From e2708cfea6be96be9a0d0c0022dc310ae5c56870 Mon Sep 17 00:00:00 2001 From: nimadez <111365948+nimadez@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:33:56 +0330 Subject: [PATCH] Update 4.5.9 --- package.json | 6 +- src/index.html | 2 +- src/libs/addons/OrbitControls.js | 50 +- src/libs/addons/TransformControls.js | 1624 ------------------------- src/libs/babylon.gui.min.js | 2 +- src/libs/babylon.inspector.bundle.js | 2 +- src/libs/babylon.js | 2 +- src/libs/babylonjs.loaders.min.js | 2 +- src/libs/babylonjs.materials.min.js | 2 +- src/libs/babylonjs.serializers.min.js | 2 +- src/libs/three.core.min.js | 6 + src/libs/three.module.min.js | 2 +- src/modules/core.js | 2 +- 13 files changed, 59 insertions(+), 1645 deletions(-) delete mode 100644 src/libs/addons/TransformControls.js create mode 100644 src/libs/three.core.min.js diff --git a/package.json b/package.json index 9cba2ad1..07aa0799 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "voxel-builder", - "version": "4.5.8", + "version": "4.5.9", "description": "Voxel-based 3D modeling application", "main": "electron.js", "scripts": { @@ -11,8 +11,8 @@ "license": "MIT", "devDependencies": { "electron": "^30.0.0", - "babylonjs": "^7.33.0", - "three": "^0.170.0", + "babylonjs": "^7.35.0", + "three": "^0.171.0", "three-mesh-bvh": "^0.8.3", "three-gpu-pathtracer": "^0.0.23", "@tweenjs/tween.js": "^25.0.0" diff --git a/src/index.html b/src/index.html index 5cf4466a..95e75591 100644 --- a/src/index.html +++ b/src/index.html @@ -276,7 +276,7 @@
  • VOXEL BUILDER -
    ↳ 4.5.8 Beta +
    ↳ 4.5.9 Beta
    GitHub
    Changelog
    Developer diff --git a/src/libs/addons/OrbitControls.js b/src/libs/addons/OrbitControls.js index 7360aab9..702bf460 100644 --- a/src/libs/addons/OrbitControls.js +++ b/src/libs/addons/OrbitControls.js @@ -784,11 +784,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( 0, this.keyPanSpeed ); + if ( this.enablePan ) { + + this._pan( 0, this.keyPanSpeed ); + + } } @@ -799,11 +807,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( 0, - this.keyPanSpeed ); + if ( this.enablePan ) { + + this._pan( 0, - this.keyPanSpeed ); + + } } @@ -814,11 +830,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( this.keyPanSpeed, 0 ); + if ( this.enablePan ) { + + this._pan( this.keyPanSpeed, 0 ); + + } } @@ -829,11 +853,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( - this.keyPanSpeed, 0 ); + if ( this.enablePan ) { + + this._pan( - this.keyPanSpeed, 0 ); + + } } @@ -1340,7 +1372,7 @@ function onMouseWheel( event ) { function onKeyDown( event ) { - if ( this.enabled === false || this.enablePan === false ) return; + if ( this.enabled === false ) return; this._handleKeyDown( event ); diff --git a/src/libs/addons/TransformControls.js b/src/libs/addons/TransformControls.js deleted file mode 100644 index 563477d0..00000000 --- a/src/libs/addons/TransformControls.js +++ /dev/null @@ -1,1624 +0,0 @@ -import { - BoxGeometry, - BufferGeometry, - Controls, - CylinderGeometry, - DoubleSide, - Euler, - Float32BufferAttribute, - Line, - LineBasicMaterial, - Matrix4, - Mesh, - MeshBasicMaterial, - Object3D, - OctahedronGeometry, - PlaneGeometry, - Quaternion, - Raycaster, - SphereGeometry, - TorusGeometry, - Vector3 -} from 'three'; - -const _raycaster = new Raycaster(); - -const _tempVector = new Vector3(); -const _tempVector2 = new Vector3(); -const _tempQuaternion = new Quaternion(); -const _unit = { - X: new Vector3( 1, 0, 0 ), - Y: new Vector3( 0, 1, 0 ), - Z: new Vector3( 0, 0, 1 ) -}; - -const _changeEvent = { type: 'change' }; -const _mouseDownEvent = { type: 'mouseDown', mode: null }; -const _mouseUpEvent = { type: 'mouseUp', mode: null }; -const _objectChangeEvent = { type: 'objectChange' }; - -class TransformControls extends Controls { - - constructor( camera, domElement = null ) { - - super( undefined, domElement ); - - const root = new TransformControlsRoot( this ); - this._root = root; - - const gizmo = new TransformControlsGizmo(); - this._gizmo = gizmo; - root.add( gizmo ); - - const plane = new TransformControlsPlane(); - this._plane = plane; - root.add( plane ); - - const scope = this; - - // Defined getter, setter and store for a property - function defineProperty( propName, defaultValue ) { - - let propValue = defaultValue; - - Object.defineProperty( scope, propName, { - - get: function () { - - return propValue !== undefined ? propValue : defaultValue; - - }, - - set: function ( value ) { - - if ( propValue !== value ) { - - propValue = value; - plane[ propName ] = value; - gizmo[ propName ] = value; - - scope.dispatchEvent( { type: propName + '-changed', value: value } ); - scope.dispatchEvent( _changeEvent ); - - } - - } - - } ); - - scope[ propName ] = defaultValue; - plane[ propName ] = defaultValue; - gizmo[ propName ] = defaultValue; - - } - - // Define properties with getters/setter - // Setting the defined property will automatically trigger change event - // Defined properties are passed down to gizmo and plane - - defineProperty( 'camera', camera ); - defineProperty( 'object', undefined ); - defineProperty( 'enabled', true ); - defineProperty( 'axis', null ); - defineProperty( 'mode', 'translate' ); - defineProperty( 'translationSnap', null ); - defineProperty( 'rotationSnap', null ); - defineProperty( 'scaleSnap', null ); - defineProperty( 'space', 'world' ); - defineProperty( 'size', 1 ); - defineProperty( 'dragging', false ); - defineProperty( 'showX', true ); - defineProperty( 'showY', true ); - defineProperty( 'showZ', true ); - defineProperty( 'minX', - Infinity ); - defineProperty( 'maxX', Infinity ); - defineProperty( 'minY', - Infinity ); - defineProperty( 'maxY', Infinity ); - defineProperty( 'minZ', - Infinity ); - defineProperty( 'maxZ', Infinity ); - - // Reusable utility variables - - const worldPosition = new Vector3(); - const worldPositionStart = new Vector3(); - const worldQuaternion = new Quaternion(); - const worldQuaternionStart = new Quaternion(); - const cameraPosition = new Vector3(); - const cameraQuaternion = new Quaternion(); - const pointStart = new Vector3(); - const pointEnd = new Vector3(); - const rotationAxis = new Vector3(); - const rotationAngle = 0; - const eye = new Vector3(); - - // TODO: remove properties unused in plane and gizmo - - defineProperty( 'worldPosition', worldPosition ); - defineProperty( 'worldPositionStart', worldPositionStart ); - defineProperty( 'worldQuaternion', worldQuaternion ); - defineProperty( 'worldQuaternionStart', worldQuaternionStart ); - defineProperty( 'cameraPosition', cameraPosition ); - defineProperty( 'cameraQuaternion', cameraQuaternion ); - defineProperty( 'pointStart', pointStart ); - defineProperty( 'pointEnd', pointEnd ); - defineProperty( 'rotationAxis', rotationAxis ); - defineProperty( 'rotationAngle', rotationAngle ); - defineProperty( 'eye', eye ); - - this._offset = new Vector3(); - this._startNorm = new Vector3(); - this._endNorm = new Vector3(); - this._cameraScale = new Vector3(); - - this._parentPosition = new Vector3(); - this._parentQuaternion = new Quaternion(); - this._parentQuaternionInv = new Quaternion(); - this._parentScale = new Vector3(); - - this._worldScaleStart = new Vector3(); - this._worldQuaternionInv = new Quaternion(); - this._worldScale = new Vector3(); - - this._positionStart = new Vector3(); - this._quaternionStart = new Quaternion(); - this._scaleStart = new Vector3(); - - this._getPointer = getPointer.bind( this ); - this._onPointerDown = onPointerDown.bind( this ); - this._onPointerHover = onPointerHover.bind( this ); - this._onPointerMove = onPointerMove.bind( this ); - this._onPointerUp = onPointerUp.bind( this ); - - if ( domElement !== null ) { - - this.connect(); - - } - - } - - connect() { - - this.domElement.addEventListener( 'pointerdown', this._onPointerDown ); - this.domElement.addEventListener( 'pointermove', this._onPointerHover ); - this.domElement.addEventListener( 'pointerup', this._onPointerUp ); - - this.domElement.style.touchAction = 'none'; // disable touch scroll - - } - - disconnect() { - - this.domElement.removeEventListener( 'pointerdown', this._onPointerDown ); - this.domElement.removeEventListener( 'pointermove', this._onPointerHover ); - this.domElement.removeEventListener( 'pointermove', this._onPointerMove ); - this.domElement.removeEventListener( 'pointerup', this._onPointerUp ); - - this.domElement.style.touchAction = 'auto'; - - } - - getHelper() { - - return this._root; - - } - - pointerHover( pointer ) { - - if ( this.object === undefined || this.dragging === true ) return; - - if ( pointer !== null ) _raycaster.setFromCamera( pointer, this.camera ); - - const intersect = intersectObjectWithRay( this._gizmo.picker[ this.mode ], _raycaster ); - - if ( intersect ) { - - this.axis = intersect.object.name; - - } else { - - this.axis = null; - - } - - } - - pointerDown( pointer ) { - - if ( this.object === undefined || this.dragging === true || ( pointer != null && pointer.button !== 0 ) ) return; - - if ( this.axis !== null ) { - - if ( pointer !== null ) _raycaster.setFromCamera( pointer, this.camera ); - - const planeIntersect = intersectObjectWithRay( this._plane, _raycaster, true ); - - if ( planeIntersect ) { - - this.object.updateMatrixWorld(); - this.object.parent.updateMatrixWorld(); - - this._positionStart.copy( this.object.position ); - this._quaternionStart.copy( this.object.quaternion ); - this._scaleStart.copy( this.object.scale ); - - this.object.matrixWorld.decompose( this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart ); - - this.pointStart.copy( planeIntersect.point ).sub( this.worldPositionStart ); - - } - - this.dragging = true; - _mouseDownEvent.mode = this.mode; - this.dispatchEvent( _mouseDownEvent ); - - } - - } - - pointerMove( pointer ) { - - const axis = this.axis; - const mode = this.mode; - const object = this.object; - let space = this.space; - - if ( mode === 'scale' ) { - - space = 'local'; - - } else if ( axis === 'E' || axis === 'XYZE' || axis === 'XYZ' ) { - - space = 'world'; - - } - - if ( object === undefined || axis === null || this.dragging === false || ( pointer !== null && pointer.button !== - 1 ) ) return; - - if ( pointer !== null ) _raycaster.setFromCamera( pointer, this.camera ); - - const planeIntersect = intersectObjectWithRay( this._plane, _raycaster, true ); - - if ( ! planeIntersect ) return; - - this.pointEnd.copy( planeIntersect.point ).sub( this.worldPositionStart ); - - if ( mode === 'translate' ) { - - // Apply translate - - this._offset.copy( this.pointEnd ).sub( this.pointStart ); - - if ( space === 'local' && axis !== 'XYZ' ) { - - this._offset.applyQuaternion( this._worldQuaternionInv ); - - } - - if ( axis.indexOf( 'X' ) === - 1 ) this._offset.x = 0; - if ( axis.indexOf( 'Y' ) === - 1 ) this._offset.y = 0; - if ( axis.indexOf( 'Z' ) === - 1 ) this._offset.z = 0; - - if ( space === 'local' && axis !== 'XYZ' ) { - - this._offset.applyQuaternion( this._quaternionStart ).divide( this._parentScale ); - - } else { - - this._offset.applyQuaternion( this._parentQuaternionInv ).divide( this._parentScale ); - - } - - object.position.copy( this._offset ).add( this._positionStart ); - - // Apply translation snap - - if ( this.translationSnap ) { - - if ( space === 'local' ) { - - object.position.applyQuaternion( _tempQuaternion.copy( this._quaternionStart ).invert() ); - - if ( axis.search( 'X' ) !== - 1 ) { - - object.position.x = Math.round( object.position.x / this.translationSnap ) * this.translationSnap; - - } - - if ( axis.search( 'Y' ) !== - 1 ) { - - object.position.y = Math.round( object.position.y / this.translationSnap ) * this.translationSnap; - - } - - if ( axis.search( 'Z' ) !== - 1 ) { - - object.position.z = Math.round( object.position.z / this.translationSnap ) * this.translationSnap; - - } - - object.position.applyQuaternion( this._quaternionStart ); - - } - - if ( space === 'world' ) { - - if ( object.parent ) { - - object.position.add( _tempVector.setFromMatrixPosition( object.parent.matrixWorld ) ); - - } - - if ( axis.search( 'X' ) !== - 1 ) { - - object.position.x = Math.round( object.position.x / this.translationSnap ) * this.translationSnap; - - } - - if ( axis.search( 'Y' ) !== - 1 ) { - - object.position.y = Math.round( object.position.y / this.translationSnap ) * this.translationSnap; - - } - - if ( axis.search( 'Z' ) !== - 1 ) { - - object.position.z = Math.round( object.position.z / this.translationSnap ) * this.translationSnap; - - } - - if ( object.parent ) { - - object.position.sub( _tempVector.setFromMatrixPosition( object.parent.matrixWorld ) ); - - } - - } - - } - - object.position.x = Math.max( this.minX, Math.min( this.maxX, object.position.x ) ); - object.position.y = Math.max( this.minY, Math.min( this.maxY, object.position.y ) ); - object.position.z = Math.max( this.minZ, Math.min( this.maxZ, object.position.z ) ); - - } else if ( mode === 'scale' ) { - - if ( axis.search( 'XYZ' ) !== - 1 ) { - - let d = this.pointEnd.length() / this.pointStart.length(); - - if ( this.pointEnd.dot( this.pointStart ) < 0 ) d *= - 1; - - _tempVector2.set( d, d, d ); - - } else { - - _tempVector.copy( this.pointStart ); - _tempVector2.copy( this.pointEnd ); - - _tempVector.applyQuaternion( this._worldQuaternionInv ); - _tempVector2.applyQuaternion( this._worldQuaternionInv ); - - _tempVector2.divide( _tempVector ); - - if ( axis.search( 'X' ) === - 1 ) { - - _tempVector2.x = 1; - - } - - if ( axis.search( 'Y' ) === - 1 ) { - - _tempVector2.y = 1; - - } - - if ( axis.search( 'Z' ) === - 1 ) { - - _tempVector2.z = 1; - - } - - } - - // Apply scale - - object.scale.copy( this._scaleStart ).multiply( _tempVector2 ); - - if ( this.scaleSnap ) { - - if ( axis.search( 'X' ) !== - 1 ) { - - object.scale.x = Math.round( object.scale.x / this.scaleSnap ) * this.scaleSnap || this.scaleSnap; - - } - - if ( axis.search( 'Y' ) !== - 1 ) { - - object.scale.y = Math.round( object.scale.y / this.scaleSnap ) * this.scaleSnap || this.scaleSnap; - - } - - if ( axis.search( 'Z' ) !== - 1 ) { - - object.scale.z = Math.round( object.scale.z / this.scaleSnap ) * this.scaleSnap || this.scaleSnap; - - } - - } - - } else if ( mode === 'rotate' ) { - - this._offset.copy( this.pointEnd ).sub( this.pointStart ); - - const ROTATION_SPEED = 20 / this.worldPosition.distanceTo( _tempVector.setFromMatrixPosition( this.camera.matrixWorld ) ); - - let _inPlaneRotation = false; - - if ( axis === 'XYZE' ) { - - this.rotationAxis.copy( this._offset ).cross( this.eye ).normalize(); - this.rotationAngle = this._offset.dot( _tempVector.copy( this.rotationAxis ).cross( this.eye ) ) * ROTATION_SPEED; - - } else if ( axis === 'X' || axis === 'Y' || axis === 'Z' ) { - - this.rotationAxis.copy( _unit[ axis ] ); - - _tempVector.copy( _unit[ axis ] ); - - if ( space === 'local' ) { - - _tempVector.applyQuaternion( this.worldQuaternion ); - - } - - _tempVector.cross( this.eye ); - - // When _tempVector is 0 after cross with this.eye the vectors are parallel and should use in-plane rotation logic. - if ( _tempVector.length() === 0 ) { - - _inPlaneRotation = true; - - } else { - - this.rotationAngle = this._offset.dot( _tempVector.normalize() ) * ROTATION_SPEED; - - } - - - } - - if ( axis === 'E' || _inPlaneRotation ) { - - this.rotationAxis.copy( this.eye ); - this.rotationAngle = this.pointEnd.angleTo( this.pointStart ); - - this._startNorm.copy( this.pointStart ).normalize(); - this._endNorm.copy( this.pointEnd ).normalize(); - - this.rotationAngle *= ( this._endNorm.cross( this._startNorm ).dot( this.eye ) < 0 ? 1 : - 1 ); - - } - - // Apply rotation snap - - if ( this.rotationSnap ) this.rotationAngle = Math.round( this.rotationAngle / this.rotationSnap ) * this.rotationSnap; - - // Apply rotate - if ( space === 'local' && axis !== 'E' && axis !== 'XYZE' ) { - - object.quaternion.copy( this._quaternionStart ); - object.quaternion.multiply( _tempQuaternion.setFromAxisAngle( this.rotationAxis, this.rotationAngle ) ).normalize(); - - } else { - - this.rotationAxis.applyQuaternion( this._parentQuaternionInv ); - object.quaternion.copy( _tempQuaternion.setFromAxisAngle( this.rotationAxis, this.rotationAngle ) ); - object.quaternion.multiply( this._quaternionStart ).normalize(); - - } - - } - - this.dispatchEvent( _changeEvent ); - this.dispatchEvent( _objectChangeEvent ); - - } - - pointerUp( pointer ) { - - if ( pointer !== null && pointer.button !== 0 ) return; - - if ( this.dragging && ( this.axis !== null ) ) { - - _mouseUpEvent.mode = this.mode; - this.dispatchEvent( _mouseUpEvent ); - - } - - this.dragging = false; - this.axis = null; - - } - - dispose() { - - this.disconnect(); - - this._root.dispose(); - - } - - // Set current object - attach( object ) { - - this.object = object; - this._root.visible = true; - - return this; - - } - - // Detach from object - detach() { - - this.object = undefined; - this.axis = null; - - this._root.visible = false; - - return this; - - } - - reset() { - - if ( ! this.enabled ) return; - - if ( this.dragging ) { - - this.object.position.copy( this._positionStart ); - this.object.quaternion.copy( this._quaternionStart ); - this.object.scale.copy( this._scaleStart ); - - this.dispatchEvent( _changeEvent ); - this.dispatchEvent( _objectChangeEvent ); - - this.pointStart.copy( this.pointEnd ); - - } - - } - - getRaycaster() { - - return _raycaster; - - } - - // TODO: deprecate - - getMode() { - - return this.mode; - - } - - setMode( mode ) { - - this.mode = mode; - - } - - setTranslationSnap( translationSnap ) { - - this.translationSnap = translationSnap; - - } - - setRotationSnap( rotationSnap ) { - - this.rotationSnap = rotationSnap; - - } - - setScaleSnap( scaleSnap ) { - - this.scaleSnap = scaleSnap; - - } - - setSize( size ) { - - this.size = size; - - } - - setSpace( space ) { - - this.space = space; - - } - -} - -// mouse / touch event handlers - -function getPointer( event ) { - - if ( this.domElement.ownerDocument.pointerLockElement ) { - - return { - x: 0, - y: 0, - button: event.button - }; - - } else { - - const rect = this.domElement.getBoundingClientRect(); - - return { - x: ( event.clientX - rect.left ) / rect.width * 2 - 1, - y: - ( event.clientY - rect.top ) / rect.height * 2 + 1, - button: event.button - }; - - } - -} - -function onPointerHover( event ) { - - if ( ! this.enabled ) return; - - switch ( event.pointerType ) { - - case 'mouse': - case 'pen': - this.pointerHover( this._getPointer( event ) ); - break; - - } - -} - -function onPointerDown( event ) { - - if ( ! this.enabled ) return; - - if ( ! document.pointerLockElement ) { - - this.domElement.setPointerCapture( event.pointerId ); - - } - - this.domElement.addEventListener( 'pointermove', this._onPointerMove ); - - this.pointerHover( this._getPointer( event ) ); - this.pointerDown( this._getPointer( event ) ); - -} - -function onPointerMove( event ) { - - if ( ! this.enabled ) return; - - this.pointerMove( this._getPointer( event ) ); - -} - -function onPointerUp( event ) { - - if ( ! this.enabled ) return; - - this.domElement.releasePointerCapture( event.pointerId ); - - this.domElement.removeEventListener( 'pointermove', this._onPointerMove ); - - this.pointerUp( this._getPointer( event ) ); - -} - -function intersectObjectWithRay( object, raycaster, includeInvisible ) { - - const allIntersections = raycaster.intersectObject( object, true ); - - for ( let i = 0; i < allIntersections.length; i ++ ) { - - if ( allIntersections[ i ].object.visible || includeInvisible ) { - - return allIntersections[ i ]; - - } - - } - - return false; - -} - -// - -// Reusable utility variables - -const _tempEuler = new Euler(); -const _alignVector = new Vector3( 0, 1, 0 ); -const _zeroVector = new Vector3( 0, 0, 0 ); -const _lookAtMatrix = new Matrix4(); -const _tempQuaternion2 = new Quaternion(); -const _identityQuaternion = new Quaternion(); -const _dirVector = new Vector3(); -const _tempMatrix = new Matrix4(); - -const _unitX = new Vector3( 1, 0, 0 ); -const _unitY = new Vector3( 0, 1, 0 ); -const _unitZ = new Vector3( 0, 0, 1 ); - -const _v1 = new Vector3(); -const _v2 = new Vector3(); -const _v3 = new Vector3(); - -class TransformControlsRoot extends Object3D { - - constructor( controls ) { - - super(); - - this.isTransformControlsRoot = true; - - this.controls = controls; - this.visible = false; - - } - - // updateMatrixWorld updates key transformation variables - updateMatrixWorld( force ) { - - const controls = this.controls; - - if ( controls.object !== undefined ) { - - controls.object.updateMatrixWorld(); - - if ( controls.object.parent === null ) { - - console.error( 'TransformControls: The attached 3D object must be a part of the scene graph.' ); - - } else { - - controls.object.parent.matrixWorld.decompose( controls._parentPosition, controls._parentQuaternion, controls._parentScale ); - - } - - controls.object.matrixWorld.decompose( controls.worldPosition, controls.worldQuaternion, controls._worldScale ); - - controls._parentQuaternionInv.copy( controls._parentQuaternion ).invert(); - controls._worldQuaternionInv.copy( controls.worldQuaternion ).invert(); - - } - - controls.camera.updateMatrixWorld(); - controls.camera.matrixWorld.decompose( controls.cameraPosition, controls.cameraQuaternion, controls._cameraScale ); - - if ( controls.camera.isOrthographicCamera ) { - - controls.camera.getWorldDirection( controls.eye ).negate(); - - } else { - - controls.eye.copy( controls.cameraPosition ).sub( controls.worldPosition ).normalize(); - - } - - super.updateMatrixWorld( force ); - - } - - dispose() { - - this.traverse( function ( child ) { - - if ( child.geometry ) child.geometry.dispose(); - if ( child.material ) child.material.dispose(); - - } ); - - } - -} - -class TransformControlsGizmo extends Object3D { - - constructor() { - - super(); - - this.isTransformControlsGizmo = true; - - this.type = 'TransformControlsGizmo'; - - // shared materials - - const gizmoMaterial = new MeshBasicMaterial( { - depthTest: false, - depthWrite: false, - fog: false, - toneMapped: false, - transparent: true - } ); - - const gizmoLineMaterial = new LineBasicMaterial( { - depthTest: false, - depthWrite: false, - fog: false, - toneMapped: false, - transparent: true - } ); - - // Make unique material for each axis/color - - const matInvisible = gizmoMaterial.clone(); - matInvisible.opacity = 0.15; - - const matHelper = gizmoLineMaterial.clone(); - matHelper.opacity = 0.5; - - const matRed = gizmoMaterial.clone(); - matRed.color.setHex( 0xff0000 ); - - const matGreen = gizmoMaterial.clone(); - matGreen.color.setHex( 0x00ff00 ); - - const matBlue = gizmoMaterial.clone(); - matBlue.color.setHex( 0x0000ff ); - - const matRedTransparent = gizmoMaterial.clone(); - matRedTransparent.color.setHex( 0xff0000 ); - matRedTransparent.opacity = 0.5; - - const matGreenTransparent = gizmoMaterial.clone(); - matGreenTransparent.color.setHex( 0x00ff00 ); - matGreenTransparent.opacity = 0.5; - - const matBlueTransparent = gizmoMaterial.clone(); - matBlueTransparent.color.setHex( 0x0000ff ); - matBlueTransparent.opacity = 0.5; - - const matWhiteTransparent = gizmoMaterial.clone(); - matWhiteTransparent.opacity = 0.25; - - const matYellowTransparent = gizmoMaterial.clone(); - matYellowTransparent.color.setHex( 0xffff00 ); - matYellowTransparent.opacity = 0.25; - - const matYellow = gizmoMaterial.clone(); - matYellow.color.setHex( 0xffff00 ); - - const matGray = gizmoMaterial.clone(); - matGray.color.setHex( 0x787878 ); - - // reusable geometry - - const arrowGeometry = new CylinderGeometry( 0, 0.04, 0.1, 12 ); - arrowGeometry.translate( 0, 0.05, 0 ); - - const scaleHandleGeometry = new BoxGeometry( 0.08, 0.08, 0.08 ); - scaleHandleGeometry.translate( 0, 0.04, 0 ); - - const lineGeometry = new BufferGeometry(); - lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 1, 0, 0 ], 3 ) ); - - const lineGeometry2 = new CylinderGeometry( 0.0075, 0.0075, 0.5, 3 ); - lineGeometry2.translate( 0, 0.25, 0 ); - - function CircleGeometry( radius, arc ) { - - const geometry = new TorusGeometry( radius, 0.0075, 3, 64, arc * Math.PI * 2 ); - geometry.rotateY( Math.PI / 2 ); - geometry.rotateX( Math.PI / 2 ); - return geometry; - - } - - // Special geometry for transform helper. If scaled with position vector it spans from [0,0,0] to position - - function TranslateHelperGeometry() { - - const geometry = new BufferGeometry(); - - geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 1, 1, 1 ], 3 ) ); - - return geometry; - - } - - // Gizmo definitions - custom hierarchy definitions for setupGizmo() function - - const gizmoTranslate = { - X: [ - [ new Mesh( arrowGeometry, matRed ), [ 0.5, 0, 0 ], [ 0, 0, - Math.PI / 2 ]], - [ new Mesh( arrowGeometry, matRed ), [ - 0.5, 0, 0 ], [ 0, 0, Math.PI / 2 ]], - [ new Mesh( lineGeometry2, matRed ), [ 0, 0, 0 ], [ 0, 0, - Math.PI / 2 ]] - ], - Y: [ - [ new Mesh( arrowGeometry, matGreen ), [ 0, 0.5, 0 ]], - [ new Mesh( arrowGeometry, matGreen ), [ 0, - 0.5, 0 ], [ Math.PI, 0, 0 ]], - [ new Mesh( lineGeometry2, matGreen ) ] - ], - Z: [ - [ new Mesh( arrowGeometry, matBlue ), [ 0, 0, 0.5 ], [ Math.PI / 2, 0, 0 ]], - [ new Mesh( arrowGeometry, matBlue ), [ 0, 0, - 0.5 ], [ - Math.PI / 2, 0, 0 ]], - [ new Mesh( lineGeometry2, matBlue ), null, [ Math.PI / 2, 0, 0 ]] - ], - XYZ: [ - [ new Mesh( new OctahedronGeometry( 0.1, 0 ), matWhiteTransparent.clone() ), [ 0, 0, 0 ]] - ], - XY: [ - [ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matBlueTransparent.clone() ), [ 0.15, 0.15, 0 ]] - ], - YZ: [ - [ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matRedTransparent.clone() ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]] - ], - XZ: [ - [ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matGreenTransparent.clone() ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]] - ] - }; - - const pickerTranslate = { - X: [ - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0.3, 0, 0 ], [ 0, 0, - Math.PI / 2 ]], - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ - 0.3, 0, 0 ], [ 0, 0, Math.PI / 2 ]] - ], - Y: [ - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, 0.3, 0 ]], - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, - 0.3, 0 ], [ 0, 0, Math.PI ]] - ], - Z: [ - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, 0, 0.3 ], [ Math.PI / 2, 0, 0 ]], - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, 0, - 0.3 ], [ - Math.PI / 2, 0, 0 ]] - ], - XYZ: [ - [ new Mesh( new OctahedronGeometry( 0.2, 0 ), matInvisible ) ] - ], - XY: [ - [ new Mesh( new BoxGeometry( 0.2, 0.2, 0.01 ), matInvisible ), [ 0.15, 0.15, 0 ]] - ], - YZ: [ - [ new Mesh( new BoxGeometry( 0.2, 0.2, 0.01 ), matInvisible ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]] - ], - XZ: [ - [ new Mesh( new BoxGeometry( 0.2, 0.2, 0.01 ), matInvisible ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]] - ] - }; - - const helperTranslate = { - START: [ - [ new Mesh( new OctahedronGeometry( 0.01, 2 ), matHelper ), null, null, null, 'helper' ] - ], - END: [ - [ new Mesh( new OctahedronGeometry( 0.01, 2 ), matHelper ), null, null, null, 'helper' ] - ], - DELTA: [ - [ new Line( TranslateHelperGeometry(), matHelper ), null, null, null, 'helper' ] - ], - X: [ - [ new Line( lineGeometry, matHelper.clone() ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] - ], - Y: [ - [ new Line( lineGeometry, matHelper.clone() ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ] - ], - Z: [ - [ new Line( lineGeometry, matHelper.clone() ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ] - ] - }; - - const gizmoRotate = { - XYZE: [ - [ new Mesh( CircleGeometry( 0.5, 1 ), matGray ), null, [ 0, Math.PI / 2, 0 ]] - ], - X: [ - [ new Mesh( CircleGeometry( 0.5, 0.5 ), matRed ) ] - ], - Y: [ - [ new Mesh( CircleGeometry( 0.5, 0.5 ), matGreen ), null, [ 0, 0, - Math.PI / 2 ]] - ], - Z: [ - [ new Mesh( CircleGeometry( 0.5, 0.5 ), matBlue ), null, [ 0, Math.PI / 2, 0 ]] - ], - E: [ - [ new Mesh( CircleGeometry( 0.75, 1 ), matYellowTransparent ), null, [ 0, Math.PI / 2, 0 ]] - ] - }; - - const helperRotate = { - AXIS: [ - [ new Line( lineGeometry, matHelper.clone() ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] - ] - }; - - const pickerRotate = { - XYZE: [ - [ new Mesh( new SphereGeometry( 0.25, 10, 8 ), matInvisible ) ] - ], - X: [ - [ new Mesh( new TorusGeometry( 0.5, 0.1, 4, 24 ), matInvisible ), [ 0, 0, 0 ], [ 0, - Math.PI / 2, - Math.PI / 2 ]], - ], - Y: [ - [ new Mesh( new TorusGeometry( 0.5, 0.1, 4, 24 ), matInvisible ), [ 0, 0, 0 ], [ Math.PI / 2, 0, 0 ]], - ], - Z: [ - [ new Mesh( new TorusGeometry( 0.5, 0.1, 4, 24 ), matInvisible ), [ 0, 0, 0 ], [ 0, 0, - Math.PI / 2 ]], - ], - E: [ - [ new Mesh( new TorusGeometry( 0.75, 0.1, 2, 24 ), matInvisible ) ] - ] - }; - - const gizmoScale = { - X: [ - [ new Mesh( scaleHandleGeometry, matRed ), [ 0.5, 0, 0 ], [ 0, 0, - Math.PI / 2 ]], - [ new Mesh( lineGeometry2, matRed ), [ 0, 0, 0 ], [ 0, 0, - Math.PI / 2 ]], - [ new Mesh( scaleHandleGeometry, matRed ), [ - 0.5, 0, 0 ], [ 0, 0, Math.PI / 2 ]], - ], - Y: [ - [ new Mesh( scaleHandleGeometry, matGreen ), [ 0, 0.5, 0 ]], - [ new Mesh( lineGeometry2, matGreen ) ], - [ new Mesh( scaleHandleGeometry, matGreen ), [ 0, - 0.5, 0 ], [ 0, 0, Math.PI ]], - ], - Z: [ - [ new Mesh( scaleHandleGeometry, matBlue ), [ 0, 0, 0.5 ], [ Math.PI / 2, 0, 0 ]], - [ new Mesh( lineGeometry2, matBlue ), [ 0, 0, 0 ], [ Math.PI / 2, 0, 0 ]], - [ new Mesh( scaleHandleGeometry, matBlue ), [ 0, 0, - 0.5 ], [ - Math.PI / 2, 0, 0 ]] - ], - XY: [ - [ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matBlueTransparent ), [ 0.15, 0.15, 0 ]] - ], - YZ: [ - [ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matRedTransparent ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]] - ], - XZ: [ - [ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matGreenTransparent ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]] - ], - XYZ: [ - [ new Mesh( new BoxGeometry( 0.1, 0.1, 0.1 ), matWhiteTransparent.clone() ) ], - ] - }; - - const pickerScale = { - X: [ - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0.3, 0, 0 ], [ 0, 0, - Math.PI / 2 ]], - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ - 0.3, 0, 0 ], [ 0, 0, Math.PI / 2 ]] - ], - Y: [ - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, 0.3, 0 ]], - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, - 0.3, 0 ], [ 0, 0, Math.PI ]] - ], - Z: [ - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, 0, 0.3 ], [ Math.PI / 2, 0, 0 ]], - [ new Mesh( new CylinderGeometry( 0.2, 0, 0.6, 4 ), matInvisible ), [ 0, 0, - 0.3 ], [ - Math.PI / 2, 0, 0 ]] - ], - XY: [ - [ new Mesh( new BoxGeometry( 0.2, 0.2, 0.01 ), matInvisible ), [ 0.15, 0.15, 0 ]], - ], - YZ: [ - [ new Mesh( new BoxGeometry( 0.2, 0.2, 0.01 ), matInvisible ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]], - ], - XZ: [ - [ new Mesh( new BoxGeometry( 0.2, 0.2, 0.01 ), matInvisible ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]], - ], - XYZ: [ - [ new Mesh( new BoxGeometry( 0.2, 0.2, 0.2 ), matInvisible ), [ 0, 0, 0 ]], - ] - }; - - const helperScale = { - X: [ - [ new Line( lineGeometry, matHelper.clone() ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] - ], - Y: [ - [ new Line( lineGeometry, matHelper.clone() ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ] - ], - Z: [ - [ new Line( lineGeometry, matHelper.clone() ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ] - ] - }; - - // Creates an Object3D with gizmos described in custom hierarchy definition. - - function setupGizmo( gizmoMap ) { - - const gizmo = new Object3D(); - - for ( const name in gizmoMap ) { - - for ( let i = gizmoMap[ name ].length; i --; ) { - - const object = gizmoMap[ name ][ i ][ 0 ].clone(); - const position = gizmoMap[ name ][ i ][ 1 ]; - const rotation = gizmoMap[ name ][ i ][ 2 ]; - const scale = gizmoMap[ name ][ i ][ 3 ]; - const tag = gizmoMap[ name ][ i ][ 4 ]; - - // name and tag properties are essential for picking and updating logic. - object.name = name; - object.tag = tag; - - if ( position ) { - - object.position.set( position[ 0 ], position[ 1 ], position[ 2 ] ); - - } - - if ( rotation ) { - - object.rotation.set( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ] ); - - } - - if ( scale ) { - - object.scale.set( scale[ 0 ], scale[ 1 ], scale[ 2 ] ); - - } - - object.updateMatrix(); - - const tempGeometry = object.geometry.clone(); - tempGeometry.applyMatrix4( object.matrix ); - object.geometry = tempGeometry; - object.renderOrder = Infinity; - - object.position.set( 0, 0, 0 ); - object.rotation.set( 0, 0, 0 ); - object.scale.set( 1, 1, 1 ); - - gizmo.add( object ); - - } - - } - - return gizmo; - - } - - // Gizmo creation - - this.gizmo = {}; - this.picker = {}; - this.helper = {}; - - this.add( this.gizmo[ 'translate' ] = setupGizmo( gizmoTranslate ) ); - this.add( this.gizmo[ 'rotate' ] = setupGizmo( gizmoRotate ) ); - this.add( this.gizmo[ 'scale' ] = setupGizmo( gizmoScale ) ); - this.add( this.picker[ 'translate' ] = setupGizmo( pickerTranslate ) ); - this.add( this.picker[ 'rotate' ] = setupGizmo( pickerRotate ) ); - this.add( this.picker[ 'scale' ] = setupGizmo( pickerScale ) ); - this.add( this.helper[ 'translate' ] = setupGizmo( helperTranslate ) ); - this.add( this.helper[ 'rotate' ] = setupGizmo( helperRotate ) ); - this.add( this.helper[ 'scale' ] = setupGizmo( helperScale ) ); - - // Pickers should be hidden always - - this.picker[ 'translate' ].visible = false; - this.picker[ 'rotate' ].visible = false; - this.picker[ 'scale' ].visible = false; - - } - - // updateMatrixWorld will update transformations and appearance of individual handles - - updateMatrixWorld( force ) { - - const space = ( this.mode === 'scale' ) ? 'local' : this.space; // scale always oriented to local rotation - - const quaternion = ( space === 'local' ) ? this.worldQuaternion : _identityQuaternion; - - // Show only gizmos for current transform mode - - this.gizmo[ 'translate' ].visible = this.mode === 'translate'; - this.gizmo[ 'rotate' ].visible = this.mode === 'rotate'; - this.gizmo[ 'scale' ].visible = this.mode === 'scale'; - - this.helper[ 'translate' ].visible = this.mode === 'translate'; - this.helper[ 'rotate' ].visible = this.mode === 'rotate'; - this.helper[ 'scale' ].visible = this.mode === 'scale'; - - - let handles = []; - handles = handles.concat( this.picker[ this.mode ].children ); - handles = handles.concat( this.gizmo[ this.mode ].children ); - handles = handles.concat( this.helper[ this.mode ].children ); - - for ( let i = 0; i < handles.length; i ++ ) { - - const handle = handles[ i ]; - - // hide aligned to camera - - handle.visible = true; - handle.rotation.set( 0, 0, 0 ); - handle.position.copy( this.worldPosition ); - - let factor; - - if ( this.camera.isOrthographicCamera ) { - - factor = ( this.camera.top - this.camera.bottom ) / this.camera.zoom; - - } else { - - factor = this.worldPosition.distanceTo( this.cameraPosition ) * Math.min( 1.9 * Math.tan( Math.PI * this.camera.fov / 360 ) / this.camera.zoom, 7 ); - - } - - handle.scale.set( 1, 1, 1 ).multiplyScalar( factor * this.size / 4 ); - - // TODO: simplify helpers and consider decoupling from gizmo - - if ( handle.tag === 'helper' ) { - - handle.visible = false; - - if ( handle.name === 'AXIS' ) { - - handle.visible = !! this.axis; - - if ( this.axis === 'X' ) { - - _tempQuaternion.setFromEuler( _tempEuler.set( 0, 0, 0 ) ); - handle.quaternion.copy( quaternion ).multiply( _tempQuaternion ); - - if ( Math.abs( _alignVector.copy( _unitX ).applyQuaternion( quaternion ).dot( this.eye ) ) > 0.9 ) { - - handle.visible = false; - - } - - } - - if ( this.axis === 'Y' ) { - - _tempQuaternion.setFromEuler( _tempEuler.set( 0, 0, Math.PI / 2 ) ); - handle.quaternion.copy( quaternion ).multiply( _tempQuaternion ); - - if ( Math.abs( _alignVector.copy( _unitY ).applyQuaternion( quaternion ).dot( this.eye ) ) > 0.9 ) { - - handle.visible = false; - - } - - } - - if ( this.axis === 'Z' ) { - - _tempQuaternion.setFromEuler( _tempEuler.set( 0, Math.PI / 2, 0 ) ); - handle.quaternion.copy( quaternion ).multiply( _tempQuaternion ); - - if ( Math.abs( _alignVector.copy( _unitZ ).applyQuaternion( quaternion ).dot( this.eye ) ) > 0.9 ) { - - handle.visible = false; - - } - - } - - if ( this.axis === 'XYZE' ) { - - _tempQuaternion.setFromEuler( _tempEuler.set( 0, Math.PI / 2, 0 ) ); - _alignVector.copy( this.rotationAxis ); - handle.quaternion.setFromRotationMatrix( _lookAtMatrix.lookAt( _zeroVector, _alignVector, _unitY ) ); - handle.quaternion.multiply( _tempQuaternion ); - handle.visible = this.dragging; - - } - - if ( this.axis === 'E' ) { - - handle.visible = false; - - } - - - } else if ( handle.name === 'START' ) { - - handle.position.copy( this.worldPositionStart ); - handle.visible = this.dragging; - - } else if ( handle.name === 'END' ) { - - handle.position.copy( this.worldPosition ); - handle.visible = this.dragging; - - } else if ( handle.name === 'DELTA' ) { - - handle.position.copy( this.worldPositionStart ); - handle.quaternion.copy( this.worldQuaternionStart ); - _tempVector.set( 1e-10, 1e-10, 1e-10 ).add( this.worldPositionStart ).sub( this.worldPosition ).multiplyScalar( - 1 ); - _tempVector.applyQuaternion( this.worldQuaternionStart.clone().invert() ); - handle.scale.copy( _tempVector ); - handle.visible = this.dragging; - - } else { - - handle.quaternion.copy( quaternion ); - - if ( this.dragging ) { - - handle.position.copy( this.worldPositionStart ); - - } else { - - handle.position.copy( this.worldPosition ); - - } - - if ( this.axis ) { - - handle.visible = this.axis.search( handle.name ) !== - 1; - - } - - } - - // If updating helper, skip rest of the loop - continue; - - } - - // Align handles to current local or world rotation - - handle.quaternion.copy( quaternion ); - - if ( this.mode === 'translate' || this.mode === 'scale' ) { - - // Hide translate and scale axis facing the camera - - const AXIS_HIDE_THRESHOLD = 0.99; - const PLANE_HIDE_THRESHOLD = 0.2; - - if ( handle.name === 'X' ) { - - if ( Math.abs( _alignVector.copy( _unitX ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_THRESHOLD ) { - - handle.scale.set( 1e-10, 1e-10, 1e-10 ); - handle.visible = false; - - } - - } - - if ( handle.name === 'Y' ) { - - if ( Math.abs( _alignVector.copy( _unitY ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_THRESHOLD ) { - - handle.scale.set( 1e-10, 1e-10, 1e-10 ); - handle.visible = false; - - } - - } - - if ( handle.name === 'Z' ) { - - if ( Math.abs( _alignVector.copy( _unitZ ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_THRESHOLD ) { - - handle.scale.set( 1e-10, 1e-10, 1e-10 ); - handle.visible = false; - - } - - } - - if ( handle.name === 'XY' ) { - - if ( Math.abs( _alignVector.copy( _unitZ ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_THRESHOLD ) { - - handle.scale.set( 1e-10, 1e-10, 1e-10 ); - handle.visible = false; - - } - - } - - if ( handle.name === 'YZ' ) { - - if ( Math.abs( _alignVector.copy( _unitX ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_THRESHOLD ) { - - handle.scale.set( 1e-10, 1e-10, 1e-10 ); - handle.visible = false; - - } - - } - - if ( handle.name === 'XZ' ) { - - if ( Math.abs( _alignVector.copy( _unitY ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_THRESHOLD ) { - - handle.scale.set( 1e-10, 1e-10, 1e-10 ); - handle.visible = false; - - } - - } - - } else if ( this.mode === 'rotate' ) { - - // Align handles to current local or world rotation - - _tempQuaternion2.copy( quaternion ); - _alignVector.copy( this.eye ).applyQuaternion( _tempQuaternion.copy( quaternion ).invert() ); - - if ( handle.name.search( 'E' ) !== - 1 ) { - - handle.quaternion.setFromRotationMatrix( _lookAtMatrix.lookAt( this.eye, _zeroVector, _unitY ) ); - - } - - if ( handle.name === 'X' ) { - - _tempQuaternion.setFromAxisAngle( _unitX, Math.atan2( - _alignVector.y, _alignVector.z ) ); - _tempQuaternion.multiplyQuaternions( _tempQuaternion2, _tempQuaternion ); - handle.quaternion.copy( _tempQuaternion ); - - } - - if ( handle.name === 'Y' ) { - - _tempQuaternion.setFromAxisAngle( _unitY, Math.atan2( _alignVector.x, _alignVector.z ) ); - _tempQuaternion.multiplyQuaternions( _tempQuaternion2, _tempQuaternion ); - handle.quaternion.copy( _tempQuaternion ); - - } - - if ( handle.name === 'Z' ) { - - _tempQuaternion.setFromAxisAngle( _unitZ, Math.atan2( _alignVector.y, _alignVector.x ) ); - _tempQuaternion.multiplyQuaternions( _tempQuaternion2, _tempQuaternion ); - handle.quaternion.copy( _tempQuaternion ); - - } - - } - - // Hide disabled axes - handle.visible = handle.visible && ( handle.name.indexOf( 'X' ) === - 1 || this.showX ); - handle.visible = handle.visible && ( handle.name.indexOf( 'Y' ) === - 1 || this.showY ); - handle.visible = handle.visible && ( handle.name.indexOf( 'Z' ) === - 1 || this.showZ ); - handle.visible = handle.visible && ( handle.name.indexOf( 'E' ) === - 1 || ( this.showX && this.showY && this.showZ ) ); - - // highlight selected axis - - handle.material._color = handle.material._color || handle.material.color.clone(); - handle.material._opacity = handle.material._opacity || handle.material.opacity; - - handle.material.color.copy( handle.material._color ); - handle.material.opacity = handle.material._opacity; - - if ( this.enabled && this.axis ) { - - if ( handle.name === this.axis ) { - - handle.material.color.setHex( 0xffff00 ); - handle.material.opacity = 1.0; - - } else if ( this.axis.split( '' ).some( function ( a ) { - - return handle.name === a; - - } ) ) { - - handle.material.color.setHex( 0xffff00 ); - handle.material.opacity = 1.0; - - } - - } - - } - - super.updateMatrixWorld( force ); - - } - -} - -// - -class TransformControlsPlane extends Mesh { - - constructor() { - - super( - new PlaneGeometry( 100000, 100000, 2, 2 ), - new MeshBasicMaterial( { visible: false, wireframe: true, side: DoubleSide, transparent: true, opacity: 0.1, toneMapped: false } ) - ); - - this.isTransformControlsPlane = true; - - this.type = 'TransformControlsPlane'; - - } - - updateMatrixWorld( force ) { - - let space = this.space; - - this.position.copy( this.worldPosition ); - - if ( this.mode === 'scale' ) space = 'local'; // scale always oriented to local rotation - - _v1.copy( _unitX ).applyQuaternion( space === 'local' ? this.worldQuaternion : _identityQuaternion ); - _v2.copy( _unitY ).applyQuaternion( space === 'local' ? this.worldQuaternion : _identityQuaternion ); - _v3.copy( _unitZ ).applyQuaternion( space === 'local' ? this.worldQuaternion : _identityQuaternion ); - - // Align the plane for current transform mode, axis and space. - - _alignVector.copy( _v2 ); - - switch ( this.mode ) { - - case 'translate': - case 'scale': - switch ( this.axis ) { - - case 'X': - _alignVector.copy( this.eye ).cross( _v1 ); - _dirVector.copy( _v1 ).cross( _alignVector ); - break; - case 'Y': - _alignVector.copy( this.eye ).cross( _v2 ); - _dirVector.copy( _v2 ).cross( _alignVector ); - break; - case 'Z': - _alignVector.copy( this.eye ).cross( _v3 ); - _dirVector.copy( _v3 ).cross( _alignVector ); - break; - case 'XY': - _dirVector.copy( _v3 ); - break; - case 'YZ': - _dirVector.copy( _v1 ); - break; - case 'XZ': - _alignVector.copy( _v3 ); - _dirVector.copy( _v2 ); - break; - case 'XYZ': - case 'E': - _dirVector.set( 0, 0, 0 ); - break; - - } - - break; - case 'rotate': - default: - // special case for rotate - _dirVector.set( 0, 0, 0 ); - - } - - if ( _dirVector.length() === 0 ) { - - // If in rotate mode, make the plane parallel to camera - this.quaternion.copy( this.cameraQuaternion ); - - } else { - - _tempMatrix.lookAt( _tempVector.set( 0, 0, 0 ), _dirVector, _alignVector ); - - this.quaternion.setFromRotationMatrix( _tempMatrix ); - - } - - super.updateMatrixWorld( force ); - - } - -} - -export { TransformControls, TransformControlsGizmo, TransformControlsPlane }; diff --git a/src/libs/babylon.gui.min.js b/src/libs/babylon.gui.min.js index 99b8b637..4dc80eac 100644 --- a/src/libs/babylon.gui.min.js +++ b/src/libs/babylon.gui.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-gui",["babylonjs"],e):"object"==typeof exports?exports["babylonjs-gui"]=e(require("babylonjs")):(t.BABYLON=t.BABYLON||{},t.BABYLON.GUI=e(t.BABYLON))}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(t=>(()=>{"use strict";var e={597:e=>{e.exports=t}},i={};function o(t){var r=i[t];if(void 0!==r)return r.exports;var n=i[t]={exports:{}};return e[t](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};o.d(r,{default:()=>fe});var n={};o.r(n),o.d(n,{AbstractButton3D:()=>yt,AdvancedDynamicTexture:()=>ct,AdvancedDynamicTextureInstrumentation:()=>ut,BaseGradient:()=>st,BaseSlider:()=>G,Button:()=>R,Button3D:()=>xt,Checkbox:()=>M,CheckboxGroup:()=>Y,ColorPicker:()=>k,Container:()=>B,Container3D:()=>Pt,Control:()=>I,Control3D:()=>mt,CornerHandle:()=>Wt,CylinderPanel:()=>Bt,DisplayGrid:()=>rt,Ellipse:()=>L,FluentBackplateMaterial:()=>wt,FluentButtonMaterial:()=>Dt,FluentMaterial:()=>Tt,FluentMaterialDefines:()=>Ct,FocusableButton:()=>N,FrameGraphGUITask:()=>dt,GUI3DManager:()=>ue,GizmoHandle:()=>Qt,Grid:()=>D,HandMenu:()=>Ot,HandleMaterial:()=>zt,HandleState:()=>At,HolographicBackplate:()=>Mt,HolographicButton:()=>Et,HolographicSlate:()=>Gt,Image:()=>O,ImageBasedSlider:()=>nt,ImageScrollBar:()=>$,InputPassword:()=>z,InputText:()=>F,InputTextArea:()=>A,KeyPropertySet:()=>it,Line:()=>Q,LinearGradient:()=>lt,MRDLBackplateMaterial:()=>te,MRDLSliderBarMaterial:()=>Zt,MRDLSliderThumbMaterial:()=>Jt,MathTools:()=>P,Matrix2D:()=>x,Measure:()=>v,MeshButton3D:()=>Ut,MultiLine:()=>W,MultiLinePoint:()=>V,NearMenu:()=>jt,NodeRenderGraphGUIBlock:()=>ft,PlanePanel:()=>Yt,RadialGradient:()=>_t,RadioButton:()=>H,RadioGroup:()=>X,Rectangle:()=>T,ScatterPanel:()=>Xt,ScrollBar:()=>J,ScrollViewer:()=>tt,SelectionPanel:()=>Z,SelectorGroup:()=>j,SideHandle:()=>Vt,SlateGizmo:()=>Ht,Slider:()=>U,Slider3D:()=>ee,SliderGroup:()=>K,SpherePanel:()=>ie,StackPanel:()=>w,StackPanel3D:()=>oe,Style:()=>ht,TextBlock:()=>S,TextWrapper:()=>E,TextWrapping:()=>C,ToggleButton:()=>et,TouchButton3D:()=>kt,TouchHolographicButton:()=>Lt,TouchHolographicButtonV3:()=>ce,TouchHolographicMenu:()=>St,TouchMeshButton3D:()=>re,ValueAndUnit:()=>f,Vector2WithInfo:()=>y,Vector3WithInfo:()=>bt,VirtualKeyboard:()=>ot,VolumeBasedPanel:()=>It,XmlLoader:()=>gt,name:()=>at});var a={};o.r(a),o.d(a,{AbstractButton3D:()=>yt,AdvancedDynamicTexture:()=>ct,AdvancedDynamicTextureInstrumentation:()=>ut,BaseGradient:()=>st,BaseSlider:()=>G,Button:()=>R,Button3D:()=>xt,Checkbox:()=>M,CheckboxGroup:()=>Y,ColorPicker:()=>k,Container:()=>B,Container3D:()=>Pt,Control:()=>I,Control3D:()=>mt,CornerHandle:()=>Wt,CylinderPanel:()=>Bt,DisplayGrid:()=>rt,Ellipse:()=>L,FluentBackplateMaterial:()=>wt,FluentButtonMaterial:()=>Dt,FluentMaterial:()=>Tt,FluentMaterialDefines:()=>Ct,FocusableButton:()=>N,FrameGraphGUITask:()=>dt,GUI3DManager:()=>ue,GizmoHandle:()=>Qt,Grid:()=>D,HandMenu:()=>Ot,HandleMaterial:()=>zt,HandleState:()=>At,HolographicBackplate:()=>Mt,HolographicButton:()=>Et,HolographicSlate:()=>Gt,Image:()=>O,ImageBasedSlider:()=>nt,ImageScrollBar:()=>$,InputPassword:()=>z,InputText:()=>F,InputTextArea:()=>A,KeyPropertySet:()=>it,Line:()=>Q,LinearGradient:()=>lt,MRDLBackplateMaterial:()=>te,MRDLSliderBarMaterial:()=>Zt,MRDLSliderThumbMaterial:()=>Jt,MathTools:()=>P,Matrix2D:()=>x,Measure:()=>v,MeshButton3D:()=>Ut,MultiLine:()=>W,MultiLinePoint:()=>V,NearMenu:()=>jt,NodeRenderGraphGUIBlock:()=>ft,PlanePanel:()=>Yt,RadialGradient:()=>_t,RadioButton:()=>H,RadioGroup:()=>X,Rectangle:()=>T,ScatterPanel:()=>Xt,ScrollBar:()=>J,ScrollViewer:()=>tt,SelectionPanel:()=>Z,SelectorGroup:()=>j,SideHandle:()=>Vt,SlateGizmo:()=>Ht,Slider:()=>U,Slider3D:()=>ee,SliderGroup:()=>K,SpherePanel:()=>ie,StackPanel:()=>w,StackPanel3D:()=>oe,Style:()=>ht,TextBlock:()=>S,TextWrapper:()=>E,TextWrapping:()=>C,ToggleButton:()=>et,TouchButton3D:()=>kt,TouchHolographicButton:()=>Lt,TouchHolographicButtonV3:()=>ce,TouchHolographicMenu:()=>St,TouchMeshButton3D:()=>re,ValueAndUnit:()=>f,Vector2WithInfo:()=>y,Vector3WithInfo:()=>bt,VirtualKeyboard:()=>ot,VolumeBasedPanel:()=>It,XmlLoader:()=>gt,name:()=>at});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},s(t,e)};function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var _=function(){return _=Object.assign||function(t){for(var e,i=1,o=arguments.length;i=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a}function c(t,e,i,o){return new(i||(i=Promise))((function(r,n){function a(t){try{l(o.next(t))}catch(t){n(t)}}function s(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function u(t,e){var i,o,r,n={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(n=0)),n;)try{if(i=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,o=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(!((r=(r=n.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){n=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]1?this.notRenderable=!0:this.notRenderable=!1}else d.Tools.Error("Cannot move a control to a vector3 if the control is not at root level")},t.prototype.getDescendantsToRef=function(t,e,i){void 0===e&&(e=!1)},t.prototype.getDescendants=function(t,e){var i=[];return this.getDescendantsToRef(i,t,e),i},t.prototype.linkWithMesh=function(e){if(!this._host||this.parent&&this.parent!==this._host._rootContainer)e&&d.Tools.Error("Cannot link a control to a mesh if the control is not at root level");else{var i=this._host._linkedControls.indexOf(this);if(-1!==i)return this._linkedMesh=e,void(e||this._host._linkedControls.splice(i,1));e&&(this.horizontalAlignment=t.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=t.VERTICAL_ALIGNMENT_TOP,this._linkedMesh=e,this._host._linkedControls.push(this))}},t.prototype.setPadding=function(t,e,i,o){var r=t,n=null!=e?e:r,a=null!=i?i:r,s=null!=o?o:n;this.paddingTop=r,this.paddingRight=n,this.paddingBottom=a,this.paddingLeft=s},t.prototype.setPaddingInPixels=function(t,e,i,o){var r=t,n=null!=e?e:r,a=null!=i?i:r,s=null!=o?o:n;this.paddingTopInPixels=r,this.paddingRightInPixels=n,this.paddingBottomInPixels=a,this.paddingLeftInPixels=s},t.prototype._moveToProjectedPosition=function(t){var e,i=this._left.getValue(this._host),o=this._top.getValue(this._host),r=null===(e=this.parent)||void 0===e?void 0:e._currentMeasure;r&&this._processMeasures(r,this._host.getContext());var n=t.x+this._linkOffsetX.getValue(this._host)-this._currentMeasure.width/2,a=t.y+this._linkOffsetY.getValue(this._host)-this._currentMeasure.height/2,s=this._left.ignoreAdaptiveScaling&&this._top.ignoreAdaptiveScaling;s&&(Math.abs(n-i)<.5&&(n=i),Math.abs(a-o)<.5&&(a=o)),(s||i!==n||o!==a)&&(this.left=n+"px",this.top=a+"px",this._left.ignoreAdaptiveScaling=!0,this._top.ignoreAdaptiveScaling=!0,this._markAsDirty())},t.prototype._offsetLeft=function(t){this._isDirty=!0,this._currentMeasure.left+=t},t.prototype._offsetTop=function(t){this._isDirty=!0,this._currentMeasure.top+=t},t.prototype._markMatrixAsDirty=function(){this._isMatrixDirty=!0,this._flagDescendantsAsMatrixDirty()},t.prototype._flagDescendantsAsMatrixDirty=function(){},t.prototype._intersectsRect=function(t,e){return this._transform(e),!(this._evaluatedMeasure.left>=t.left+t.width||this._evaluatedMeasure.top>=t.top+t.height||this._evaluatedMeasure.left+this._evaluatedMeasure.width<=t.left||this._evaluatedMeasure.top+this._evaluatedMeasure.height<=t.top)},t.prototype._computeAdditionalOffsetX=function(){return 0},t.prototype._computeAdditionalOffsetY=function(){return 0},t.prototype.invalidateRect=function(){if(this._transform(),this.host&&this.host.useInvalidateRectOptimization){this._currentMeasure.transformToRef(this._transformMatrix,this._tmpMeasureA),v.CombineToRef(this._tmpMeasureA,this._prevCurrentMeasureTransformedIntoGlobalSpace,this._tmpMeasureA);var t=this.shadowOffsetX,e=this.shadowOffsetY,i=Math.max(this._previousShadowBlur,this.shadowBlur),o=Math.min(Math.min(t,0)-2*i,0),r=Math.max(Math.max(t,0)+2*i,0),n=Math.min(Math.min(e,0)-2*i,0),a=Math.max(Math.max(e,0)+2*i,0),s=this._computeAdditionalOffsetX(),l=this._computeAdditionalOffsetY();this.host.invalidateRect(Math.floor(this._tmpMeasureA.left+o-s),Math.floor(this._tmpMeasureA.top+n-l),Math.ceil(this._tmpMeasureA.left+this._tmpMeasureA.width+r+s),Math.ceil(this._tmpMeasureA.top+this._tmpMeasureA.height+a+l))}},t.prototype._markAsDirty=function(t){void 0===t&&(t=!1),(this._isVisible||t)&&(this._isDirty=!0,this._markMatrixAsDirty(),this._host&&this._host.markAsDirty())},t.prototype._markAllAsDirty=function(){this._markAsDirty(),this._font&&this._prepareFont()},t.prototype._link=function(t){this._host=t,this._host&&(this.uniqueId=this._host.getScene().getUniqueId())},t.prototype._transform=function(t){if(this._isMatrixDirty||1!==this._scaleX||1!==this._scaleY||0!==this._rotation){var e=this._currentMeasure.width*this._transformCenterX+this._currentMeasure.left,i=this._currentMeasure.height*this._transformCenterY+this._currentMeasure.top;t&&(t.translate(e,i),t.rotate(this._rotation),t.scale(this._scaleX,this._scaleY),t.translate(-e,-i)),(this._isMatrixDirty||this._cachedOffsetX!==e||this._cachedOffsetY!==i)&&(this._cachedOffsetX=e,this._cachedOffsetY=i,this._isMatrixDirty=!1,this._flagDescendantsAsMatrixDirty(),x.ComposeToRef(-e,-i,this._rotation,this._scaleX,this._scaleY,this.parent?this.parent._transformMatrix:null,this._transformMatrix),this._transformMatrix.invertToRef(this._invertTransformMatrix),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure))}},t.prototype._renderHighlight=function(t){this.isHighlighted&&(t.save(),t.strokeStyle=this._highlightColor,t.lineWidth=this._highlightLineWidth,this._renderHighlightSpecific(t),t.restore())},t.prototype._renderHighlightSpecific=function(t){t.strokeRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)},t.prototype._getColor=function(t){return this.gradient?this.gradient.getCanvasGradient(t):this.color},t.prototype._applyStates=function(e){this._isFontSizeInPercentage&&(this._fontSet=!0),this._host&&this._host.useSmallestIdeal&&!this._font&&(this._fontSet=!0),this._fontSet&&(this._prepareFont(),this._fontSet=!1),this._font&&(e.font=this._font),(this._color||this.gradient)&&(e.fillStyle=this._getColor(e)),t.AllowAlphaInheritance?e.globalAlpha*=this._alpha:this._alphaSet&&(e.globalAlpha=this.parent&&!this.parent.renderToIntermediateTexture?this.parent.alpha*this._alpha:this._alpha)},t.prototype._layout=function(t,e){if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;if(this._isDirty||!this._cachedParentMeasure.isEqualsTo(t)){this.host._numLayoutCalls++,this._currentMeasure.addAndTransformToRef(this._transformMatrix,0|-this._paddingLeftInPixels,0|-this._paddingTopInPixels,0|this._paddingRightInPixels,0|this._paddingBottomInPixels,this._prevCurrentMeasureTransformedIntoGlobalSpace),e.save(),this._applyStates(e);var i=0;do{this._rebuildLayout=!1,this._processMeasures(t,e),i++}while(this._rebuildLayout&&i<3);i>=3&&d.Logger.Error("Layout cycle detected in GUI (Control name=".concat(this.name,", uniqueId=").concat(this.uniqueId,")")),e.restore(),this.invalidateRect(),this._evaluateClippingState(t)}return this._wasDirty=this._isDirty,this._isDirty=!1,!0},t.prototype._processMeasures=function(t,e){this._tempPaddingMeasure.copyFrom(t),this.parent&&this.parent.descendantsOnlyPadding&&(this._tempPaddingMeasure.left+=this.parent.paddingLeftInPixels,this._tempPaddingMeasure.top+=this.parent.paddingTopInPixels,this._tempPaddingMeasure.width-=this.parent.paddingLeftInPixels+this.parent.paddingRightInPixels,this._tempPaddingMeasure.height-=this.parent.paddingTopInPixels+this.parent.paddingBottomInPixels),this._currentMeasure.copyFrom(this._tempPaddingMeasure),this._preMeasure(this._tempPaddingMeasure,e),this._measure(),this._postMeasure(this._tempPaddingMeasure,e),this._computeAlignment(this._tempPaddingMeasure,e),this._currentMeasure.left=0|this._currentMeasure.left,this._currentMeasure.top=0|this._currentMeasure.top,this._currentMeasure.width=0|this._currentMeasure.width,this._currentMeasure.height=0|this._currentMeasure.height,this._additionalProcessing(this._tempPaddingMeasure,e),this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure),this.onDirtyObservable.hasObservers()&&this.onDirtyObservable.notifyObservers(this)},t.prototype._evaluateClippingState=function(t){if(this._transform(),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure),this.parent&&this.parent.clipChildren){if(t.transformToRef(this.parent._transformMatrix,this._evaluatedParentMeasure),this._evaluatedMeasure.left>this._evaluatedParentMeasure.left+this._evaluatedParentMeasure.width)return void(this._isClipped=!0);if(this._evaluatedMeasure.left+this._evaluatedMeasure.widththis._evaluatedParentMeasure.top+this._evaluatedParentMeasure.height)return void(this._isClipped=!0);if(this._evaluatedMeasure.top+this._evaluatedMeasure.heightthis._currentMeasure.left+this._currentMeasure.width||ethis._currentMeasure.top+this._currentMeasure.height||(this.isPointerBlocker&&(this._host._shouldBlockPointer=!0),0))},t.prototype._processPicking=function(t,e,i,o,r,n,a,s){return!(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this._doNotRender||!this.contains(t,e)||(this._processObservables(o,t,e,i,r,n,a,s),0))},t.prototype._onPointerMove=function(t,e,i,o){this.onPointerMoveObservable.notifyObservers(e,-1,t,this,o)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerMove(t,e,i,o)},t.prototype._onPointerEnter=function(t,e){return!(!this._isEnabled||this._enterCount>0||(-1===this._enterCount&&(this._enterCount=0),this._enterCount++,this.onPointerEnterObservable.notifyObservers(this,-1,t,this,e)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerEnter(t,e),0))},t.prototype._onPointerOut=function(t,e,i){if(void 0===i&&(i=!1),i||this._isEnabled){this._enterCount=0;var o=!0;t.isAscendant(this)||(o=this.onPointerOutObservable.notifyObservers(this,-1,t,this,e)),o&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerOut(t,e,i)}},t.prototype._onPointerDown=function(t,e,i,o,r){return this._onPointerEnter(this,r),-1!==this.tabIndex&&(this.host.focusedControl=this),0===this._downCount&&(this._downCount++,this._downPointerIds[i]=!0,this.onPointerDownObservable.notifyObservers(new y(e,o),-1,t,this,r)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerDown(t,e,i,o,r),r&&this.uniqueId!==this._host.rootContainer.uniqueId&&this._host._capturedPointerIds.add(r.event.pointerId),!0)},t.prototype._onPointerUp=function(t,e,i,o,r,n){if(this._isEnabled){this._downCount=0,delete this._downPointerIds[i];var a=r;r&&(this._enterCount>0||-1===this._enterCount)&&(this._host.usePointerTapForClickEvent||(a=this.onPointerClickObservable.notifyObservers(new y(e,o),-1,t,this,n))),this.onPointerUpObservable.notifyObservers(new y(e,o),-1,t,this,n)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerUp(t,e,i,o,a,n),n&&this.uniqueId!==this._host.rootContainer.uniqueId&&this._host._capturedPointerIds.delete(n.event.pointerId),this._host.usePointerTapForClickEvent&&this.isPointerBlocker&&(this._host._shouldBlockPointer=!1)}},t.prototype._onPointerPick=function(t,e,i,o,r,n){if(!this._host.usePointerTapForClickEvent)return!1;var a=r;return r&&(this._enterCount>0||-1===this._enterCount)&&(a=this.onPointerClickObservable.notifyObservers(new y(e,o),-1,t,this,n)),this.onPointerUpObservable.notifyObservers(new y(e,o),-1,t,this,n)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerPick(t,e,i,o,a,n),this._host.usePointerTapForClickEvent&&this.isPointerBlocker&&(this._host._shouldBlockPointer=!0),!0},t.prototype._forcePointerUp=function(t){if(void 0===t&&(t=null),null!==t)this._onPointerUp(this,d.Vector2.Zero(),t,0,!0);else for(var e in this._downPointerIds)this._onPointerUp(this,d.Vector2.Zero(),+e,0,!0)},t.prototype._onWheelScroll=function(t,e){this._isEnabled&&this.onWheelObservable.notifyObservers(new d.Vector2(t,e))&&null!=this.parent&&this.parent._onWheelScroll(t,e)},t.prototype._onCanvasBlur=function(){},t.prototype._processObservables=function(t,e,i,o,r,n,a,s){if(!this._isEnabled)return!1;if(this._dummyVector2.copyFromFloats(e,i),t===d.PointerEventTypes.POINTERMOVE){this._onPointerMove(this,this._dummyVector2,r,o);var l=this._host._lastControlOver[r];return l&&l!==this&&l._onPointerOut(this,o),l!==this&&this._onPointerEnter(this,o),this._host._lastControlOver[r]=this,!0}if(t===d.PointerEventTypes.POINTERDOWN)return this._onPointerDown(this,this._dummyVector2,r,n,o),this._host._registerLastControlDown(this,r),this._host._lastPickedControl=this,!0;if(t===d.PointerEventTypes.POINTERUP)return this._host._lastControlDown[r]&&this._host._lastControlDown[r]._onPointerUp(this,this._dummyVector2,r,n,!0,o),this._host.usePointerTapForClickEvent||delete this._host._lastControlDown[r],!0;if(t===d.PointerEventTypes.POINTERWHEEL){if(this._host._lastControlOver[r])return this._host._lastControlOver[r]._onWheelScroll(a,s),!0}else if(t===d.PointerEventTypes.POINTERTAP)return this._host._lastControlDown[r]&&this._host._lastControlDown[r]._onPointerPick(this,this._dummyVector2,r,n,!0,o),delete this._host._lastControlDown[r],!0;return!1},t.prototype._getStyleProperty=function(t,e){var i,o=null!==(i=this._style&&this._style[t])&&void 0!==i?i:this[t];return!o&&this.parent?this.parent._getStyleProperty(t,e):this.parent?o:e},t.prototype._prepareFont=function(){var e,i;(this._font||this._fontSet)&&(this._font=this._getStyleProperty("fontStyle","")+" "+this._getStyleProperty("fontWeight","")+" "+this.fontSizeInPixels+"px "+this._getStyleProperty("fontFamily","Arial"),this._fontOffset=t._GetFontOffset(this._font,null===(i=null===(e=this._host)||void 0===e?void 0:e.getScene())||void 0===i?void 0:i.getEngine()),this.getDescendants().forEach((function(t){return t._markAllAsDirty()})))},t.prototype.isDimensionFullyDefined=function(t){return this.getDimension(t).isPixel},t.prototype.getDimension=function(t){return"width"===t?this._width:this._height},t.prototype.clone=function(t){var e={};this.serialize(e,!0);var i=new(d.Tools.Instantiate("BABYLON.GUI."+e.className));return i.parse(e,t),i},t.prototype.parse=function(t,e,i){var o=this;return this._urlRewriter=i,d.SerializationHelper.Parse((function(){return o}),t,null),this.name=t.name,this._parseFromContent(t,null!=e?e:this._host),this},t.prototype.serialize=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!0),(this.isSerializable||e)&&(d.SerializationHelper.Serialize(this,t),t.name=this.name,t.className=this.getClassName(),i&&this._prepareFont(),this._fontFamily&&(t.fontFamily=this._fontFamily),this.fontSize&&(t.fontSize=this.fontSize),this.fontWeight&&(t.fontWeight=this.fontWeight),this.fontStyle&&(t.fontStyle=this.fontStyle),this._gradient&&(t.gradient={},this._gradient.serialize(t.gradient)),d.SerializationHelper.AppendSerializedAnimations(this,t))},t.prototype._parseFromContent=function(t,e,i){var o,r;if(t.fontFamily&&(this.fontFamily=t.fontFamily),t.fontSize&&(this.fontSize=t.fontSize),t.fontWeight&&(this.fontWeight=t.fontWeight),t.fontStyle&&(this.fontStyle=t.fontStyle),t.gradient){var n=d.Tools.Instantiate("BABYLON.GUI."+t.gradient.className);this._gradient=new n,null===(o=this._gradient)||void 0===o||o.parse(t.gradient)}if(t.animations){this.animations=[];for(var a=0;a-1&&this.linkWithMesh(null),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},Object.defineProperty(t,"HORIZONTAL_ALIGNMENT_LEFT",{get:function(){return t._HORIZONTAL_ALIGNMENT_LEFT},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HORIZONTAL_ALIGNMENT_RIGHT",{get:function(){return t._HORIZONTAL_ALIGNMENT_RIGHT},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HORIZONTAL_ALIGNMENT_CENTER",{get:function(){return t._HORIZONTAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),Object.defineProperty(t,"VERTICAL_ALIGNMENT_TOP",{get:function(){return t._VERTICAL_ALIGNMENT_TOP},enumerable:!1,configurable:!0}),Object.defineProperty(t,"VERTICAL_ALIGNMENT_BOTTOM",{get:function(){return t._VERTICAL_ALIGNMENT_BOTTOM},enumerable:!1,configurable:!0}),Object.defineProperty(t,"VERTICAL_ALIGNMENT_CENTER",{get:function(){return t._VERTICAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),t._GetFontOffset=function(e,i){if(t._FontHeightSizes[e])return t._FontHeightSizes[e];var o=i||d.EngineStore.LastCreatedEngine;if(!o)throw new Error("Invalid engine. Unable to create a canvas.");var r=o.getFontOffset(e);return t._FontHeightSizes[e]=r,r},t.Parse=function(t,e,i){var o=d.Tools.Instantiate("BABYLON.GUI."+t.className),r=d.SerializationHelper.Parse((function(){var t=new o;return t._urlRewriter=i,t}),t,null);return r.name=t.name,r._parseFromContent(t,e,i),r},t.drawEllipse=function(t,e,i,o,r,n){n.translate(t,e),n.scale(i,o),n.beginPath(),n.arc(0,0,1,0,2*Math.PI*r,r<0),r>=1&&n.closePath(),n.scale(1/i,1/o),n.translate(-t,-e)},t.prototype.isReady=function(){return!0},t.AllowAlphaInheritance=!1,t._ClipMeasure=new v(0,0,0,0),t._HORIZONTAL_ALIGNMENT_LEFT=0,t._HORIZONTAL_ALIGNMENT_RIGHT=1,t._HORIZONTAL_ALIGNMENT_CENTER=2,t._VERTICAL_ALIGNMENT_TOP=0,t._VERTICAL_ALIGNMENT_BOTTOM=1,t._VERTICAL_ALIGNMENT_CENTER=2,t._FontHeightSizes={},t.AddHeader=function(){},h([(0,d.serialize)()],t.prototype,"metadata",void 0),h([(0,d.serialize)()],t.prototype,"isHitTestVisible",void 0),h([(0,d.serialize)()],t.prototype,"isPointerBlocker",void 0),h([(0,d.serialize)()],t.prototype,"isFocusInvisible",void 0),h([(0,d.serialize)()],t.prototype,"clipChildren",null),h([(0,d.serialize)()],t.prototype,"clipContent",null),h([(0,d.serialize)()],t.prototype,"useBitmapCache",void 0),h([(0,d.serialize)()],t.prototype,"shadowOffsetX",null),h([(0,d.serialize)()],t.prototype,"shadowOffsetY",null),h([(0,d.serialize)()],t.prototype,"shadowBlur",null),h([(0,d.serialize)()],t.prototype,"shadowColor",null),h([(0,d.serialize)()],t.prototype,"hoverCursor",void 0),h([(0,d.serialize)()],t.prototype,"fontOffset",null),h([(0,d.serialize)()],t.prototype,"alpha",null),h([(0,d.serialize)()],t.prototype,"isSerializable",void 0),h([(0,d.serialize)()],t.prototype,"scaleX",null),h([(0,d.serialize)()],t.prototype,"scaleY",null),h([(0,d.serialize)()],t.prototype,"rotation",null),h([(0,d.serialize)()],t.prototype,"transformCenterY",null),h([(0,d.serialize)()],t.prototype,"transformCenterX",null),h([(0,d.serialize)()],t.prototype,"horizontalAlignment",null),h([(0,d.serialize)()],t.prototype,"verticalAlignment",null),h([(0,d.serialize)()],t.prototype,"fixedRatio",null),h([(0,d.serialize)()],t.prototype,"fixedRatioMasterIsWidth",null),h([(0,d.serialize)()],t.prototype,"width",null),h([(0,d.serialize)()],t.prototype,"height",null),h([(0,d.serialize)()],t.prototype,"style",null),h([(0,d.serialize)()],t.prototype,"color",null),h([(0,d.serialize)()],t.prototype,"gradient",null),h([(0,d.serialize)()],t.prototype,"zIndex",null),h([(0,d.serialize)()],t.prototype,"notRenderable",null),h([(0,d.serialize)()],t.prototype,"isVisible",null),h([(0,d.serialize)()],t.prototype,"descendantsOnlyPadding",null),h([(0,d.serialize)()],t.prototype,"paddingLeft",null),h([(0,d.serialize)()],t.prototype,"paddingRight",null),h([(0,d.serialize)()],t.prototype,"paddingTop",null),h([(0,d.serialize)()],t.prototype,"paddingBottom",null),h([(0,d.serialize)()],t.prototype,"left",null),h([(0,d.serialize)()],t.prototype,"top",null),h([(0,d.serialize)()],t.prototype,"linkOffsetX",null),h([(0,d.serialize)()],t.prototype,"linkOffsetY",null),h([(0,d.serialize)()],t.prototype,"isEnabled",null),h([(0,d.serialize)()],t.prototype,"disabledColor",null),h([(0,d.serialize)()],t.prototype,"disabledColorItem",null),h([(0,d.serialize)()],t.prototype,"overlapGroup",void 0),h([(0,d.serialize)()],t.prototype,"overlapDeltaMultiplier",void 0),t}();(0,d.RegisterClass)("BABYLON.GUI.Control",I);var B=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._children=new Array,i._measureForChildren=v.Empty(),i._background="",i._backgroundGradient=null,i._adaptWidthToChildren=!1,i._adaptHeightToChildren=!1,i._renderToIntermediateTexture=!1,i._intermediateTexture=null,i.delegatePickingToChildren=!1,i.logLayoutCycleErrors=!1,i.maxLayoutCycle=3,i.onControlAddedObservable=new d.Observable,i.onControlRemovedObservable=new d.Observable,i._inverseTransformMatrix=x.Identity(),i._inverseMeasure=new v(0,0,0,0),i}return l(e,t),Object.defineProperty(e.prototype,"renderToIntermediateTexture",{get:function(){return this._renderToIntermediateTexture},set:function(t){this._renderToIntermediateTexture!==t&&(this._renderToIntermediateTexture=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"adaptHeightToChildren",{get:function(){return this._adaptHeightToChildren},set:function(t){this._adaptHeightToChildren!==t&&(this._adaptHeightToChildren=t,t&&(this.height="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"adaptWidthToChildren",{get:function(){return this._adaptWidthToChildren},set:function(t){this._adaptWidthToChildren!==t&&(this._adaptWidthToChildren=t,t&&(this.width="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background!==t&&(this._background=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundGradient",{get:function(){return this._backgroundGradient},set:function(t){this._backgroundGradient!==t&&(this._backgroundGradient=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReadOnly",{get:function(){return this._isReadOnly},set:function(t){this._isReadOnly=t;for(var e=0,i=this._children;et.zIndex){this._children.splice(o,0,t),i=!0;break}i||this._children.push(t),t.parent=this,e&&t.linkWithMesh(e),this._markAsDirty()},e.prototype._offsetLeft=function(e){t.prototype._offsetLeft.call(this,e);for(var i=0,o=this._children;i=0&&(n+=this.paddingLeftInPixels+this.paddingRightInPixels,this.width!==n+"px"&&(null===(i=this.parent)||void 0===i||i._markAsDirty(),this.width=n+"px",this._width.ignoreAdaptiveScaling=!0,this._rebuildLayout=!0)),this.adaptHeightToChildren&&a>=0&&(a+=this.paddingTopInPixels+this.paddingBottomInPixels,this.height!==a+"px"&&(null===(o=this.parent)||void 0===o||o._markAsDirty(),this.height=a+"px",this._height.ignoreAdaptiveScaling=!0,this._rebuildLayout=!0)),this._postMeasure()}r++}while(this._rebuildLayout&&r=3&&this.logLayoutCycleErrors&&d.Logger.Error("Layout cycle detected in GUI (Container name=".concat(this.name,", uniqueId=").concat(this.uniqueId,")")),e.restore(),this._isDirty&&(this.invalidateRect(),this._isDirty=!1),!0},e.prototype._postMeasure=function(){},e.prototype._draw=function(t,e){var i=this._renderToIntermediateTexture&&this._intermediateTexture,o=i?this._intermediateTexture.getContext():t;i&&(o.save(),o.translate(-this._currentMeasure.left,-this._currentMeasure.top),e?(this._transformMatrix.invertToRef(this._inverseTransformMatrix),e.transformToRef(this._inverseTransformMatrix,this._inverseMeasure),o.clearRect(this._inverseMeasure.left,this._inverseMeasure.top,this._inverseMeasure.width,this._inverseMeasure.height)):o.clearRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._localDraw(o),t.save(),this.clipChildren&&this._clipForChildren(o);for(var r=0,n=this._children;r=0;c--)if((u=this._children[c]).isEnabled&&u.isHitTestVisible&&u.isVisible&&!u.notRenderable&&u.contains(e,i)){h=!0;break}if(!h)return!1}for(c=this._children.length-1;c>=0;c--){var u;if((u=this._children[c])._processPicking(e,i,o,r,n,a,s,l))return u.hoverCursor&&this._host._changeCursor(u.hoverCursor),!0}return!!_&&!!this.isHitTestVisible&&this._processObservables(r,e,i,o,n,a,s,l)},e.prototype._additionalProcessing=function(e,i){t.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.copyFrom(this._currentMeasure)},e.prototype._getAdaptDimTo=function(t){return"width"===t?this.adaptWidthToChildren:this.adaptHeightToChildren},e.prototype.isDimensionFullyDefined=function(e){if(this._getAdaptDimTo(e)){for(var i=0,o=this.children;i=0;i--)this.children[i].dispose();null===(e=this._intermediateTexture)||void 0===e||e.dispose()},e.prototype._parseFromContent=function(e,i,o){var r;if(t.prototype._parseFromContent.call(this,e,i,o),this._link(i),e.backgroundGradient){var n=d.Tools.Instantiate("BABYLON.GUI."+e.backgroundGradient.className);this._backgroundGradient=new n,null===(r=this._backgroundGradient)||void 0===r||r.parse(e.backgroundGradient)}if(e.children)for(var a=0,s=e.children;ar&&(r=a.width)}if(this._resizeToFit){if(0===this._textWrapping||this._forceResizeWidth){var s=Math.ceil(this._paddingLeftInPixels)+Math.ceil(this._paddingRightInPixels)+Math.ceil(r);s!==this._width.getValueInPixel(this._host,this._tempParentMeasure.width)&&(this._width.updateInPlace(s,f.UNITMODE_PIXEL),this._rebuildLayout=!0)}var l=this._paddingTopInPixels+this._paddingBottomInPixels+this._fontOffset.height*this._lines.length|0;if(this._lines.length>0&&0!==this._lineSpacing.internalValue){var _;_=this._lineSpacing.isPixel?this._lineSpacing.getValue(this._host):this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height),l+=(this._lines.length-1)*_}l!==this._height.internalValue&&(this._height.updateInPlace(l,f.UNITMODE_PIXEL),this._rebuildLayout=!0)}},e.prototype._drawText=function(t,e,i,o){var r=this._currentMeasure.width,n=0;switch(this._textHorizontalAlignment){case I.HORIZONTAL_ALIGNMENT_LEFT:n=0;break;case I.HORIZONTAL_ALIGNMENT_RIGHT:n=r-e;break;case I.HORIZONTAL_ALIGNMENT_CENTER:n=(r-e)/2}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&o.strokeText(t,this._currentMeasure.left+n,i),o.fillText(t,this._currentMeasure.left+n,i),this._underline&&this._drawLine(this._currentMeasure.left+n,i+3,this._currentMeasure.left+n+e,i+3,o),this._lineThrough&&this._drawLine(this._currentMeasure.left+n,i-this.fontSizeInPixels/3,this._currentMeasure.left+n+e,i-this.fontSizeInPixels/3,o)},e.prototype._drawLine=function(t,e,i,o,r){if(r.beginPath(),r.lineWidth=Math.round(.05*this.fontSizeInPixels),r.moveTo(t,e),r.lineTo(i,o),this.outlineWidth&&this.applyOutlineToUnderline)r.stroke(),r.fill();else{var n=r.strokeStyle;r.strokeStyle=r.fillStyle,r.stroke(),r.strokeStyle=n}r.closePath()},e.prototype._draw=function(t){t.save(),this._applyStates(t),this._renderLines(t),t.restore()},e.prototype._applyStates=function(e){t.prototype._applyStates.call(this,e),this.outlineWidth&&(e.lineWidth=this.outlineWidth,e.strokeStyle=this.outlineColor,e.lineJoin="miter",e.miterLimit=2)},e.prototype._breakLines=function(t,e,i){var o,r;this._linesTemp.length=0;var n=4===this._textWrapping?this._parseHTMLText(t,e,i):this.text.split("\n");switch(this._textWrapping){case 1:for(var a=0,s=n;ae?t-e:0,r=t/i;return Math.max(Math.floor(o/r),1)},e.prototype._parseLineEllipsis=function(t,e,i){void 0===t&&(t="");var o=this._getTextMetricsWidth(i.measureText(t)),r=this._getCharsToRemove(o,e,t.length),n=Array.from&&Array.from(t);if(n)for(;n.length&&o>e;)n.splice(n.length-r,r),t="".concat(n.join(""),"…"),o=this._getTextMetricsWidth(i.measureText(t)),r=this._getCharsToRemove(o,e,t.length);else{for(;t.length>2&&o>e;)t=t.slice(0,-r),o=this._getTextMetricsWidth(i.measureText(t+"…")),r=this._getCharsToRemove(o,e,t.length);t+="…"}return{text:t,width:o}},e.prototype._getTextMetricsWidth=function(t){return void 0!==t.actualBoundingBoxLeft?Math.abs(t.actualBoundingBoxLeft)+Math.abs(t.actualBoundingBoxRight):t.width},e.prototype._parseLineWordWrap=function(t,e,i){void 0===t&&(t="");for(var o=[],r=this.wordSplittingFunction?this.wordSplittingFunction(t):t.split(this._wordDivider),n=this._getTextMetricsWidth(i.measureText(t)),a=0;a0?t+this._wordDivider+r[a]:r[0],l=this._getTextMetricsWidth(i.measureText(s));l>e&&a>0?(o.push({text:t,width:n}),t=r[a],n=this._getTextMetricsWidth(i.measureText(t))):(n=l,t=s)}return o.push({text:t,width:n}),o},e.prototype._parseLineWordWrapEllipsis=function(t,e,i,o){void 0===t&&(t="");for(var r=this._parseLineWordWrap(t,e,o),n=1;n<=r.length;n++)if(this._computeHeightForLinesOf(n)>i&&n>1){var a=r[n-2],s=r[n-1];r[n-2]=this._parseLineEllipsis(a.text+this._wordDivider+s.text,e,o);for(var l=r.length-n+1,_=0;_0&&0!==this._lineSpacing.internalValue&&(e+=(t-1)*(this._lineSpacing.isPixel?this._lineSpacing.getValue(this._host):this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height))),e},e.prototype.isDimensionFullyDefined=function(e){return!!this.resizeToFit||t.prototype.isDimensionFullyDefined.call(this,e)},e.prototype.computeExpectedHeight=function(){var t,e;if(this.text&&this.widthInPixels){var i=null===(t=d.EngineStore.LastCreatedEngine)||void 0===t?void 0:t.createCanvas(0,0).getContext("2d");if(i){this._applyStates(i),this._fontOffset||(this._fontOffset=I._GetFontOffset(i.font,null===(e=this._host.getScene())||void 0===e?void 0:e.getEngine()));var o=this._lines?this._lines:this._breakLines(this.widthInPixels-this._paddingLeftInPixels-this._paddingRightInPixels,this.heightInPixels-this._paddingTopInPixels-this._paddingBottomInPixels,i);return this._computeHeightForLinesOf(o.length)}}return 0},e.prototype.dispose=function(){var e;t.prototype.dispose.call(this),this.onTextChangedObservable.clear(),null===(e=this._htmlElement)||void 0===e||e.remove(),this._htmlElement=null},h([(0,d.serialize)()],e.prototype,"resizeToFit",null),h([(0,d.serialize)()],e.prototype,"textWrapping",null),h([(0,d.serialize)()],e.prototype,"text",null),h([(0,d.serialize)()],e.prototype,"textHorizontalAlignment",null),h([(0,d.serialize)()],e.prototype,"textVerticalAlignment",null),h([(0,d.serialize)()],e.prototype,"lineSpacing",null),h([(0,d.serialize)()],e.prototype,"outlineWidth",null),h([(0,d.serialize)()],e.prototype,"underline",null),h([(0,d.serialize)()],e.prototype,"lineThrough",null),h([(0,d.serialize)()],e.prototype,"applyOutlineToUnderline",null),h([(0,d.serialize)()],e.prototype,"outlineColor",null),h([(0,d.serialize)()],e.prototype,"wordDivider",null),h([(0,d.serialize)()],e.prototype,"forceResizeWidth",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.TextBlock",S);var O=function(t){function e(i,o){void 0===o&&(o=null);var r=t.call(this,i)||this;return r.name=i,r._workingCanvas=null,r._loaded=!1,r._stretch=e.STRETCH_FILL,r._source=null,r._autoScale=!1,r._sourceLeft=0,r._sourceTop=0,r._sourceWidth=0,r._sourceHeight=0,r._svgAttributesComputationCompleted=!1,r._isSVG=!1,r._cellWidth=0,r._cellHeight=0,r._cellId=-1,r._populateNinePatchSlicesFromImage=!1,r._imageDataCache={data:null,key:""},r.onImageLoadedObservable=new d.Observable,r.onSVGAttributesComputedObservable=new d.Observable,r.source=o,r}return l(e,t),Object.defineProperty(e.prototype,"isLoaded",{get:function(){return this._loaded},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){return this.isLoaded},Object.defineProperty(e.prototype,"detectPointerOnOpaqueOnly",{get:function(){return this._detectPointerOnOpaqueOnly},set:function(t){this._detectPointerOnOpaqueOnly!==t&&(this._detectPointerOnOpaqueOnly=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceLeft",{get:function(){return this._sliceLeft},set:function(t){this._sliceLeft!==t&&(this._sliceLeft=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceRight",{get:function(){return this._sliceRight},set:function(t){this._sliceRight!==t&&(this._sliceRight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceTop",{get:function(){return this._sliceTop},set:function(t){this._sliceTop!==t&&(this._sliceTop=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceBottom",{get:function(){return this._sliceBottom},set:function(t){this._sliceBottom!==t&&(this._sliceBottom=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceLeft",{get:function(){return this._sourceLeft},set:function(t){this._sourceLeft!==t&&(this._sourceLeft=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceTop",{get:function(){return this._sourceTop},set:function(t){this._sourceTop!==t&&(this._sourceTop=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceWidth",{get:function(){return this._sourceWidth},set:function(t){this._sourceWidth!==t&&(this._sourceWidth=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceHeight",{get:function(){return this._sourceHeight},set:function(t){this._sourceHeight!==t&&(this._sourceHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageWidth",{get:function(){return this._imageWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageHeight",{get:function(){return this._imageHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"populateNinePatchSlicesFromImage",{get:function(){return this._populateNinePatchSlicesFromImage},set:function(t){this._populateNinePatchSlicesFromImage!==t&&(this._populateNinePatchSlicesFromImage=t,this._populateNinePatchSlicesFromImage&&this._loaded&&this._extractNinePatchSliceDataFromImage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSVG",{get:function(){return this._isSVG},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"svgAttributesComputationCompleted",{get:function(){return this._svgAttributesComputationCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoScale",{get:function(){return this._autoScale},set:function(t){this._autoScale!==t&&(this._autoScale=t,t&&this._loaded&&this.synchronizeSizeWithContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stretch",{get:function(){return this._stretch},set:function(t){this._stretch!==t&&(this._stretch=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._rotate90=function(t,i){var o,r;void 0===i&&(i=!1);var n=this._domImage.width,a=this._domImage.height,s=(null===(r=null===(o=this._host)||void 0===o?void 0:o.getScene())||void 0===r?void 0:r.getEngine())||d.EngineStore.LastCreatedEngine;if(!s)throw new Error("Invalid engine. Unable to create a canvas.");var l=s.createCanvas(a,n),_=l.getContext("2d");_.translate(l.width/2,l.height/2),_.rotate(t*Math.PI/2),_.drawImage(this._domImage,0,0,n,a,-n/2,-a/2,n,a);var h=l.toDataURL("image/jpg"),c=new e(this.name+"rotated",h);return i&&(c._stretch=this._stretch,c._autoScale=this._autoScale,c._cellId=this._cellId,c._cellWidth=t%1?this._cellHeight:this._cellWidth,c._cellHeight=t%1?this._cellWidth:this._cellHeight),this._handleRotationForSVGImage(this,c,t),this._imageDataCache.data=null,c},e.prototype._handleRotationForSVGImage=function(t,e,i){var o=this;t._isSVG&&(t._svgAttributesComputationCompleted?(this._rotate90SourceProperties(t,e,i),this._markAsDirty()):t.onSVGAttributesComputedObservable.addOnce((function(){o._rotate90SourceProperties(t,e,i),o._markAsDirty()})))},e.prototype._rotate90SourceProperties=function(t,e,i){var o,r,n=t.sourceLeft,a=t.sourceTop,s=t.domImage.width,l=t.domImage.height,_=n,h=a,c=t.sourceWidth,u=t.sourceHeight;if(0!=i){var d=i<0?-1:1;i%=4;for(var f=0;f127&&-1===this._sliceLeft)this._sliceLeft=s;else if(_<127&&this._sliceLeft>-1){this._sliceRight=s;break}this._sliceTop=-1,this._sliceBottom=-1;for(var l=0;l127&&-1===this._sliceTop)this._sliceTop=l;else if(_<127&&this._sliceTop>-1){this._sliceBottom=l;break}}},Object.defineProperty(e.prototype,"domImage",{get:function(){return this._domImage},set:function(t){var e=this;this._domImage=t,this._loaded=!1,this._imageDataCache.data=null,this._domImage.width?this._onImageLoaded():this._domImage.onload=function(){e._onImageLoaded()}},enumerable:!1,configurable:!0}),e.prototype._onImageLoaded=function(){this._imageDataCache.data=null,this._imageWidth=this._domImage.width,this._imageHeight=this._domImage.height,this._loaded=!0,this._populateNinePatchSlicesFromImage&&this._extractNinePatchSliceDataFromImage(),this._autoScale&&this.synchronizeSizeWithContent(),this.onImageLoadedObservable.notifyObservers(this),this._markAsDirty()},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},set:function(t){var i,o,r,n,a,s=this;if(this._urlRewriter&&t&&(t=this._urlRewriter(t)),this._source!==t){this._removeCacheUsage(this._source),this._loaded=!1,this._source=t,this._imageDataCache.data=null,t&&(t=this._svgCheck(t));var l=(null===(o=null===(i=this._host)||void 0===i?void 0:i.getScene())||void 0===o?void 0:o.getEngine())||d.EngineStore.LastCreatedEngine;if(!l)throw new Error("Invalid engine. Unable to create a canvas.");if(t&&e.SourceImgCache.has(t)){var _=e.SourceImgCache.get(t);return this._domImage=_.img,_.timesUsed+=1,void(_.loaded?this._onImageLoaded():_.waitingForLoadCallback.push(this._onImageLoaded.bind(this)))}this._domImage=l.createCanvasImage();var h=this._domImage,c=!1;h.style&&(null===(r=this._source)||void 0===r?void 0:r.endsWith(".svg"))&&(h.style.visibility="hidden",h.style.position="absolute",h.style.top="0",null===(a=null===(n=l.getRenderingCanvas())||void 0===n?void 0:n.parentNode)||void 0===a||a.appendChild(h),c=!0),t&&e.SourceImgCache.set(t,{img:this._domImage,timesUsed:1,loaded:!1,waitingForLoadCallback:[this._onImageLoaded.bind(this)]}),this._domImage.onload=function(){if(t){var i=e.SourceImgCache.get(t);if(i){i.loaded=!0;for(var o=0,r=i.waitingForLoadCallback;o0},e.prototype._getTypeName=function(){return"Image"},e.prototype.synchronizeSizeWithContent=function(){this._loaded&&(this.width=this._domImage.width+"px",this.height=this._domImage.height+"px")},e.prototype._processMeasures=function(i,o){if(this._loaded)switch(this._stretch){case e.STRETCH_NONE:case e.STRETCH_FILL:case e.STRETCH_UNIFORM:case e.STRETCH_NINE_PATCH:break;case e.STRETCH_EXTEND:this._autoScale&&this.synchronizeSizeWithContent(),this.parent&&this.parent.parent&&(this.parent.adaptWidthToChildren=!0,this.parent.adaptHeightToChildren=!0)}t.prototype._processMeasures.call(this,i,o)},e.prototype._prepareWorkingCanvasForOpaqueDetection=function(){var t,e;if(this._detectPointerOnOpaqueOnly){var i=this._currentMeasure.width,o=this._currentMeasure.height;if(!this._workingCanvas){var r=(null===(e=null===(t=this._host)||void 0===t?void 0:t.getScene())||void 0===e?void 0:e.getEngine())||d.EngineStore.LastCreatedEngine;if(!r)throw new Error("Invalid engine. Unable to create a canvas.");this._workingCanvas=r.createCanvas(i,o)}this._workingCanvas.getContext("2d").clearRect(0,0,i,o)}},e.prototype._drawImage=function(t,e,i,o,r,n,a,s,l){if(t.drawImage(this._domImage,e,i,o,r,n,a,s,l),this._detectPointerOnOpaqueOnly){var _=t.getTransform(),h=this._workingCanvas.getContext("2d");h.save();var c=n-this._currentMeasure.left,u=a-this._currentMeasure.top;h.setTransform(_.a,_.b,_.c,_.d,(c+s)/2,(u+l)/2),h.translate(-(c+s)/2,-(u+l)/2),h.drawImage(this._domImage,e,i,o,r,c,u,s,l),h.restore()}},e.prototype._draw=function(t){var i,o,r,n;if(t.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),-1==this.cellId)i=this._sourceLeft,o=this._sourceTop,r=this._sourceWidth?this._sourceWidth:this._imageWidth,n=this._sourceHeight?this._sourceHeight:this._imageHeight;else{var a=this._domImage.naturalWidth/this.cellWidth,s=this.cellId/a|0,l=this.cellId%a;i=this.cellWidth*l,o=this.cellHeight*s,r=this.cellWidth,n=this.cellHeight}if(this._prepareWorkingCanvasForOpaqueDetection(),this._applyStates(t),this._loaded)switch(this._stretch){case e.STRETCH_NONE:case e.STRETCH_FILL:this._drawImage(t,i,o,r,n,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case e.STRETCH_UNIFORM:var _=this._currentMeasure.width/r,h=this._currentMeasure.height/n,c=Math.min(_,h),u=(this._currentMeasure.width-r*c)/2,d=(this._currentMeasure.height-n*c)/2;this._drawImage(t,i,o,r,n,this._currentMeasure.left+u,this._currentMeasure.top+d,r*c,n*c);break;case e.STRETCH_EXTEND:this._drawImage(t,i,o,r,n,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case e.STRETCH_NINE_PATCH:this._renderNinePatch(t,i,o,r,n)}t.restore()},e.prototype._renderNinePatch=function(t,e,i,o,r){var n=this.host.idealWidth?this._width.getValue(this.host)/this.host.idealWidth:this.host.idealHeight?this._height.getValue(this.host)/this.host.idealHeight:1,a=this._sliceLeft,s=this._sliceTop,l=r-this._sliceBottom,_=o-this._sliceRight,h=this._sliceRight-this._sliceLeft,c=this._sliceBottom-this._sliceTop,u=Math.round(a*n),d=Math.round(s*n),f=Math.round(l*n),p=Math.round(_*n),g=Math.round(this._currentMeasure.width)-p-u+2,b=Math.round(this._currentMeasure.height)-f-d+2,m=Math.round(this._currentMeasure.left)+u-1,v=Math.round(this._currentMeasure.top)+d-1,y=Math.round(this._currentMeasure.left+this._currentMeasure.width)-p,x=Math.round(this._currentMeasure.top+this._currentMeasure.height)-f;this._drawImage(t,e,i,a,s,this._currentMeasure.left,this._currentMeasure.top,u,d),this._drawImage(t,e+this._sliceLeft,i,h,s,m+1,this._currentMeasure.top,g-2,d),this._drawImage(t,e+this._sliceRight,i,_,s,y,this._currentMeasure.top,p,d),this._drawImage(t,e,i+this._sliceTop,a,c,this._currentMeasure.left,v+1,u,b-2),this._drawImage(t,e+this._sliceLeft,i+this._sliceTop,h,c,m+1,v+1,g-2,b-2),this._drawImage(t,e+this._sliceRight,i+this._sliceTop,_,c,y,v+1,p,b-2),this._drawImage(t,e,i+this._sliceBottom,a,l,this._currentMeasure.left,x,u,f),this._drawImage(t,e+this.sliceLeft,i+this._sliceBottom,h,l,m+1,x,g-2,f),this._drawImage(t,e+this._sliceRight,i+this._sliceBottom,_,l,y,x,p,f)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.onImageLoadedObservable.clear(),this.onSVGAttributesComputedObservable.clear(),this._removeCacheUsage(this._source)},e.SourceImgCache=new Map,e.STRETCH_NONE=0,e.STRETCH_FILL=1,e.STRETCH_UNIFORM=2,e.STRETCH_EXTEND=3,e.STRETCH_NINE_PATCH=4,h([(0,d.serialize)()],e.prototype,"detectPointerOnOpaqueOnly",null),h([(0,d.serialize)()],e.prototype,"sliceLeft",null),h([(0,d.serialize)()],e.prototype,"sliceRight",null),h([(0,d.serialize)()],e.prototype,"sliceTop",null),h([(0,d.serialize)()],e.prototype,"sliceBottom",null),h([(0,d.serialize)()],e.prototype,"sourceLeft",null),h([(0,d.serialize)()],e.prototype,"sourceTop",null),h([(0,d.serialize)()],e.prototype,"sourceWidth",null),h([(0,d.serialize)()],e.prototype,"sourceHeight",null),h([(0,d.serialize)()],e.prototype,"populateNinePatchSlicesFromImage",null),h([(0,d.serialize)()],e.prototype,"autoScale",null),h([(0,d.serialize)()],e.prototype,"stretch",null),h([(0,d.serialize)()],e.prototype,"source",null),h([(0,d.serialize)()],e.prototype,"cellWidth",null),h([(0,d.serialize)()],e.prototype,"cellHeight",null),h([(0,d.serialize)()],e.prototype,"cellId",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.Image",O);var R=function(t){function e(e){var i=t.call(this,e)||this;i.name=e,i.thickness=1,i.isPointerBlocker=!0;var o=null;return i.pointerEnterAnimation=function(){o=i.alpha,i.alpha-=.1},i.pointerOutAnimation=function(){null!==o&&(i.alpha=o)},i.pointerDownAnimation=function(){i.scaleX-=.05,i.scaleY-=.05},i.pointerUpAnimation=function(){i.scaleX+=.05,i.scaleY+=.05},i}return l(e,t),Object.defineProperty(e.prototype,"image",{get:function(){return this._image},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textBlock",{get:function(){return this._textBlock},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"Button"},e.prototype._processPicking=function(e,i,o,r,n,a,s,l){if(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this.notRenderable)return!1;if(!t.prototype.contains.call(this,e,i))return!1;if(this.delegatePickingToChildren){for(var _=!1,h=this._children.length-1;h>=0;h--){var c=this._children[h];if(c.isEnabled&&c.isHitTestVisible&&c.isVisible&&!c.notRenderable&&c.contains(e,i)){_=!0;break}}if(!_)return!1}return this._processObservables(r,e,i,o,n,a,s,l),!0},e.prototype._onPointerEnter=function(e,i){return!!t.prototype._onPointerEnter.call(this,e,i)&&(!this.isReadOnly&&this.pointerEnterAnimation&&this.pointerEnterAnimation(),!0)},e.prototype._onPointerOut=function(e,i,o){void 0===o&&(o=!1),!this.isReadOnly&&this.pointerOutAnimation&&this.pointerOutAnimation(),t.prototype._onPointerOut.call(this,e,i,o)},e.prototype._onPointerDown=function(e,i,o,r,n){return!!t.prototype._onPointerDown.call(this,e,i,o,r,n)&&(!this.isReadOnly&&this.pointerDownAnimation&&this.pointerDownAnimation(),!0)},e.prototype._getRectangleFill=function(t){return this.isEnabled?this._getBackgroundColor(t):this._disabledColor},e.prototype._onPointerUp=function(e,i,o,r,n,a){!this.isReadOnly&&this.pointerUpAnimation&&this.pointerUpAnimation(),t.prototype._onPointerUp.call(this,e,i,o,r,n,a)},e.prototype.serialize=function(e,i){t.prototype.serialize.call(this,e,i),(this.isSerializable||i)&&(this._textBlock&&(e.textBlockName=this._textBlock.name),this._image&&(e.imageName=this._image.name))},e.prototype._parseFromContent=function(e,i){t.prototype._parseFromContent.call(this,e,i),e.textBlockName&&(this._textBlock=this.getChildByName(e.textBlockName)),e.imageName&&(this._image=this.getChildByName(e.imageName))},e.CreateImageButton=function(t,e,i){var o=new this(t),r=new S(t+"_button",e);r.textWrapping=!0,r.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,r.paddingLeft="20%",o.addControl(r);var n=new O(t+"_icon",i);return n.width="20%",n.stretch=O.STRETCH_UNIFORM,n.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o.addControl(n),o._image=n,o._textBlock=r,o},e.CreateImageOnlyButton=function(t,e){var i=new this(t),o=new O(t+"_icon",e);return o.stretch=O.STRETCH_FILL,o.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,i.addControl(o),i._image=o,i},e.CreateSimpleButton=function(t,e){var i=new this(t),o=new S(t+"_button",e);return o.textWrapping=!0,o.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,i.addControl(o),i._textBlock=o,i},e.CreateImageWithCenterTextButton=function(t,e,i){var o=new this(t),r=new O(t+"_icon",i);r.stretch=O.STRETCH_FILL,o.addControl(r);var n=new S(t+"_button",e);return n.textWrapping=!0,n.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,o.addControl(n),o._image=r,o._textBlock=n,o},e}(T);(0,d.RegisterClass)("BABYLON.GUI.Button",R);var w=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._isVertical=!0,i._manualWidth=!1,i._manualHeight=!1,i._doNotTrackManualChanges=!1,i._spacing=0,i.ignoreLayoutWarnings=!1,i}return l(e,t),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){this._spacing!==t&&(this._spacing=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(t){this._doNotTrackManualChanges||(this._manualWidth=!0),this._width.toString(this._host)!==t&&this._width.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(t){this._doNotTrackManualChanges||(this._manualHeight=!0),this._height.toString(this._host)!==t&&this._height.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"StackPanel"},e.prototype._preMeasure=function(e,i){for(var o=0,r=this._children;o=0?Math.min(t,this._characters.length):this._characters.length+Math.max(t,-this._characters.length),void 0===e?e=this._characters.length-t:(isNaN(e)||e<0)&&(e=0);for(var i=[];--e>=0;)i[e]=this._characters[t+e];return i.join("")}return this._text.substring(t,e?e+t:void 0)},t.prototype.substring=function(t,e){if(this._characters){isNaN(t)?t=0:t>this._characters.length?t=this._characters.length:t<0&&(t=0),void 0===e?e=this._characters.length:isNaN(e)?e=0:e>this._characters.length?e=this._characters.length:e<0&&(e=0);for(var i=[],o=0;t0){if(this.isTextHighlightOn)return this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this._blinkIsEven=!1,void(i&&i.preventDefault());0===this._cursorOffset?this.text=this._textWrapper.substring(0,this._textWrapper.length-1):(r=this._textWrapper.length-this._cursorOffset)>0&&(this._textWrapper.removePart(r-1,r),this._textHasChanged())}return void(i&&i.preventDefault());case 46:if(this.isTextHighlightOn)return this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,void(i&&i.preventDefault());if(this._textWrapper.text&&this._textWrapper.length>0&&this._cursorOffset>0){var r=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(r,r+1),this._textHasChanged(),this._cursorOffset--}return void(i&&i.preventDefault());case 13:return this._host.focusedControl=null,void(this.isTextHighlightOn=!1);case 35:return this._cursorOffset=0,this._blinkIsEven=!1,this.isTextHighlightOn=!1,void this._markAsDirty();case 36:return this._cursorOffset=this._textWrapper.length,this._blinkIsEven=!1,this.isTextHighlightOn=!1,void this._markAsDirty();case 37:if(this._cursorOffset++,this._cursorOffset>this._textWrapper.length&&(this._cursorOffset=this._textWrapper.length),i&&i.shiftKey){if(this._blinkIsEven=!1,i.ctrlKey||i.metaKey){if(!this.isTextHighlightOn){if(this._textWrapper.length===this._cursorOffset)return;this._endHighlightIndex=this._textWrapper.length-this._cursorOffset+1}return this._startHighlightIndex=0,this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=this._textWrapper.length,this.isTextHighlightOn=!0,void this._markAsDirty()}return this.isTextHighlightOn?-1===this._cursorIndex&&(this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=0===this._startHighlightIndex?this._textWrapper.length:this._textWrapper.length-this._startHighlightIndex+1):(this.isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset>=this._textWrapper.length?this._textWrapper.length:this._cursorOffset-1),this._cursorIndexthis._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this.isTextHighlightOn=!1,void this._markAsDirty()}return this.isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this.isTextHighlightOn=!1),i&&(i.ctrlKey||i.metaKey)&&(this._cursorOffset=this._textWrapper.length,i.preventDefault()),this._blinkIsEven=!1,this.isTextHighlightOn=!1,this._cursorIndex=-1,void this._markAsDirty();case 39:if(this._cursorOffset--,this._cursorOffset<0&&(this._cursorOffset=0),i&&i.shiftKey){if(this._blinkIsEven=!1,i.ctrlKey||i.metaKey){if(!this.isTextHighlightOn){if(0===this._cursorOffset)return;this._startHighlightIndex=this._textWrapper.length-this._cursorOffset-1}return this._endHighlightIndex=this._textWrapper.length,this.isTextHighlightOn=!0,this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=0,void this._markAsDirty()}return this.isTextHighlightOn?-1===this._cursorIndex&&(this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=this._textWrapper.length===this._endHighlightIndex?0:this._textWrapper.length-this._endHighlightIndex-1):(this.isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset<=0?0:this._cursorOffset+1),this._cursorIndexthis._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this.isTextHighlightOn=!1,void this._markAsDirty()}return this.isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._endHighlightIndex,this.isTextHighlightOn=!1),i&&(i.ctrlKey||i.metaKey)&&(this._cursorOffset=0,i.preventDefault()),this._blinkIsEven=!1,this.isTextHighlightOn=!1,this._cursorIndex=-1,void this._markAsDirty()}if(32===t&&(e=null!==(o=null==i?void 0:i.key)&&void 0!==o?o:" "),this._deadKey="Dead"===e,e&&(-1===t||32===t||34===t||39===t||t>47&&t<64||t>64&&t<91||t>159&&t<193||t>218&&t<223||t>95&&t<112)&&(this._currentKey=e,this.onBeforeKeyAddObservable.notifyObservers(this),e=this._currentKey,this._addKey&&!this._deadKey))if(this.isTextHighlightOn)this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex,e),this._textHasChanged(),this._cursorOffset=this._textWrapper.length-(this._startHighlightIndex+1),this.isTextHighlightOn=!1,this._blinkIsEven=!1,this._markAsDirty();else if(0===this._cursorOffset)this.text+=this._deadKey&&(null==i?void 0:i.key)?i.key:e;else{var n=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(n,n,e),this._textHasChanged()}}},e.prototype._updateValueFromCursorIndex=function(t){if(this._blinkIsEven=!1,-1===this._cursorIndex)this._cursorIndex=t;else if(this._cursorIndexthis._cursorOffset))return this.isTextHighlightOn=!1,void this._markAsDirty();this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex}this.isTextHighlightOn=!0,this._markAsDirty()},e.prototype._processDblClick=function(t){var e,i;this._startHighlightIndex=this._textWrapper.length-this._cursorOffset,this._endHighlightIndex=this._startHighlightIndex;do{i=this._endHighlightIndex0&&this._textWrapper.isWord(this._startHighlightIndex-1)?--this._startHighlightIndex:0}while(e||i);this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this.isTextHighlightOn=!0,this._clickedCoordinate=null,this._blinkIsEven=!0,this._cursorIndex=-1,this._markAsDirty()},e.prototype._selectAllText=function(){this._blinkIsEven=!0,this.isTextHighlightOn=!0,this._startHighlightIndex=0,this._endHighlightIndex=this._textWrapper.length,this._cursorOffset=this._textWrapper.length,this._cursorIndex=-1,this._markAsDirty()},e.prototype.processKeyboard=function(e){this.processKey(e.keyCode,e.key,e),t.prototype.processKeyboard.call(this,e)},e.prototype._onCopyText=function(t){this.isTextHighlightOn=!1;try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText},e.prototype._onCutText=function(t){if(this._highlightedText){this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex;try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText,this._highlightedText=""}},e.prototype._onPasteText=function(t){var e;e=t.clipboardData&&-1!==t.clipboardData.types.indexOf("text/plain")?t.clipboardData.getData("text/plain"):this._host.clipboardData;var i=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(i,i,e),this._textHasChanged()},e.prototype._draw=function(t){var e,i=this;t.save(),this._applyStates(t),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),this._isFocused?this._focusedBackground&&(t.fillStyle=this._isEnabled?this._focusedBackground:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)):this._background&&(t.fillStyle=this._isEnabled?this._background:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this._fontOffset&&!this._wasDirty||(this._fontOffset=I._GetFontOffset(t.font,null===(e=this._host.getScene())||void 0===e?void 0:e.getEngine()));var o=this._currentMeasure.left+this._margin.getValueInPixel(this._host,this._tempParentMeasure.width);this.color&&(t.fillStyle=this.color);var r=this._beforeRenderText(this._textWrapper);this._isFocused||this._textWrapper.text||!this._placeholderText||((r=new E).text=this._placeholderText,this._placeholderColor&&(t.fillStyle=this._placeholderColor)),this._textWidth=t.measureText(r.text).width;var n=2*this._margin.getValueInPixel(this._host,this._tempParentMeasure.width);this._autoStretchWidth&&(this.width=Math.min(this._maxWidth.getValueInPixel(this._host,this._tempParentMeasure.width),this._textWidth+n)+"px",this._autoStretchWidth=!0);var a=this._fontOffset.ascent+(this._currentMeasure.height-this._fontOffset.height)/2,s=this._width.getValueInPixel(this._host,this._tempParentMeasure.width)-n;if(t.save(),t.beginPath(),t.rect(o,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,s+2,this._currentMeasure.height),t.clip(),this._isFocused&&this._textWidth>s){var l=o-this._textWidth+s;this._scrollLeft||(this._scrollLeft=l)}else this._scrollLeft=o;if(this.outlineWidth&&t.strokeText(r.text,this._scrollLeft,this._currentMeasure.top+a),t.fillText(r.text,this._scrollLeft,this._currentMeasure.top+a),this._isFocused){if(this._clickedCoordinate){var _=this._scrollLeft+this._textWidth-this._clickedCoordinate,h=0;this._cursorOffset=0;var c=0;do{this._cursorOffset&&(c=Math.abs(_-h)),this._cursorOffset++,h=t.measureText(r.substr(r.length-this._cursorOffset,this._cursorOffset)).width}while(h<_&&r.length>=this._cursorOffset);Math.abs(_-h)>c&&this._cursorOffset--,this._blinkIsEven=!1,this._clickedCoordinate=null}if(!this._blinkIsEven){var u=r.substr(r.length-this._cursorOffset),d=t.measureText(u).width,f=this._scrollLeft+this._textWidth-d;fo+s&&(this._scrollLeft+=o+s-f,f=o+s,this._markAsDirty()),this.isTextHighlightOn||t.fillRect(f,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,2,this._fontOffset.height)}if(clearTimeout(this._blinkTimeout),this._blinkTimeout=setTimeout((function(){i._blinkIsEven=!i._blinkIsEven,i._markAsDirty()}),500),this.isTextHighlightOn){clearTimeout(this._blinkTimeout);var p=t.measureText(r.substring(this._startHighlightIndex)).width,g=this._scrollLeft+this._textWidth-p;this._highlightedText=r.substring(this._startHighlightIndex,this._endHighlightIndex);var b=t.measureText(r.substring(this._startHighlightIndex,this._endHighlightIndex)).width;g=this._rowDefinitions.length?null:this._rowDefinitions[t]},e.prototype.getColumnDefinition=function(t){return t<0||t>=this._columnDefinitions.length?null:this._columnDefinitions[t]},e.prototype.addRowDefinition=function(t,e){var i=this;return void 0===e&&(e=!1),this._rowDefinitions.push(new f(t,e?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE)),this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount-1].onChangedObservable.add((function(){return i._markAsDirty()}))),this._markAsDirty(),this},e.prototype.addColumnDefinition=function(t,e){var i=this;return void 0===e&&(e=!1),this._columnDefinitions.push(new f(t,e?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE)),this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount-1].onChangedObservable.add((function(){return i._markAsDirty()}))),this._markAsDirty(),this},e.prototype.setRowDefinition=function(t,e,i){var o=this;if(void 0===i&&(i=!1),t<0||t>=this._rowDefinitions.length)return this;var r=this._rowDefinitions[t];return r&&r.isPixel===i&&r.value===e||(this._rowDefinitions[t].onChangedObservable.remove(this._rowDefinitionObservers[t]),this._rowDefinitions[t]=new f(e,i?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE),this._rowDefinitionObservers[t]=this._rowDefinitions[t].onChangedObservable.add((function(){return o._markAsDirty()})),this._markAsDirty()),this},e.prototype.setColumnDefinition=function(t,e,i){var o=this;if(void 0===i&&(i=!1),t<0||t>=this._columnDefinitions.length)return this;var r=this._columnDefinitions[t];return r&&r.isPixel===i&&r.value===e||(this._columnDefinitions[t].onChangedObservable.remove(this._columnDefinitionObservers[t]),this._columnDefinitions[t]=new f(e,i?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE),this._columnDefinitionObservers[t]=this._columnDefinitions[t].onChangedObservable.add((function(){return o._markAsDirty()})),this._markAsDirty()),this},e.prototype.getChildrenAt=function(t,e){var i=this._cells["".concat(t,":").concat(e)];return i?i.children:null},e.prototype.getChildCellInfo=function(t){return t._tag},e.prototype._removeCell=function(e,i){if(e){t.prototype.removeControl.call(this,e);for(var o=0,r=e.children;o=this._columnDefinitions.length)return this;for(var e=0;e=this._rowDefinitions.length)return this;for(var e=0;e=1-e._Epsilon&&(this._value.r=1),this._value.g>=1-e._Epsilon&&(this._value.g=1),this._value.b>=1-e._Epsilon&&(this._value.b=1),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(t){this._width.toString(this._host)!==t&&this._width.fromString(t)&&(0===this._width.getValue(this._host)&&(t="1px",this._width.fromString(t)),this._height.fromString(t),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(t){this._height.toString(this._host)!==t&&this._height.fromString(t)&&(0===this._height.getValue(this._host)&&(t="1px",this._height.fromString(t)),this._width.fromString(t),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.width},set:function(t){this.width=t},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"ColorPicker"},e.prototype._preMeasure=function(t){t.widthl||f150?.04:-.16*(t-50)/100+.2,m=(p-_)/(t-_),a[b+3]=m1-v?255*(1-(m-(1-v))/v):255}}return r.putImageData(n,0,0),o},e.prototype._draw=function(t){t.save(),this._applyStates(t);var e=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),i=.2*e,o=this._currentMeasure.left,r=this._currentMeasure.top;this._colorWheelCanvas&&this._colorWheelCanvas.width==2*e||(this._colorWheelCanvas=this._createColorWheelCanvas(e,i)),this._updateSquareProps(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.fillRect(this._squareLeft,this._squareTop,this._squareSize,this._squareSize)),t.drawImage(this._colorWheelCanvas,o,r),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this._drawGradientSquare(this._h,this._squareLeft,this._squareTop,this._squareSize,this._squareSize,t);var n=this._squareLeft+this._squareSize*this._s,a=this._squareTop+this._squareSize*(1-this._v);this._drawCircle(n,a,.04*e,t);var s=e-.5*i;n=o+e+Math.cos((this._h-180)*Math.PI/180)*s,a=r+e+Math.sin((this._h-180)*Math.PI/180)*s,this._drawCircle(n,a,.35*i,t),t.restore()},e.prototype._updateValueFromPointer=function(t,i){if(this._pointerStartedOnWheel){var o=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),r=o+this._currentMeasure.left,n=o+this._currentMeasure.top;this._h=180*Math.atan2(i-n,t-r)/Math.PI+180}else this._pointerStartedOnSquare&&(this._updateSquareProps(),this._s=(t-this._squareLeft)/this._squareSize,this._v=1-(i-this._squareTop)/this._squareSize,this._s=Math.min(this._s,1),this._s=Math.max(this._s,e._Epsilon),this._v=Math.min(this._v,1),this._v=Math.max(this._v,e._Epsilon));d.Color3.HSVtoRGBToRef(this._h,this._s,this._v,this._tmpColor),this.value=this._tmpColor},e.prototype._isPointOnSquare=function(t,e){this._updateSquareProps();var i=this._squareLeft,o=this._squareTop,r=this._squareSize;return t>=i&&t<=i+r&&e>=o&&e<=o+r},e.prototype._isPointOnWheel=function(t,e){var i=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),o=i-.2*i,r=t-(i+this._currentMeasure.left),n=e-(i+this._currentMeasure.top),a=r*r+n*n;return a<=i*i&&a>=o*o},e.prototype._onPointerDown=function(e,i,o,r,n){if(!t.prototype._onPointerDown.call(this,e,i,o,r,n))return!1;if(this.isReadOnly)return!0;this._pointerIsDown=!0,this._pointerStartedOnSquare=!1,this._pointerStartedOnWheel=!1,this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var a=this._transformedPosition.x,s=this._transformedPosition.y;return this._isPointOnSquare(a,s)?this._pointerStartedOnSquare=!0:this._isPointOnWheel(a,s)&&(this._pointerStartedOnWheel=!0),this._updateValueFromPointer(a,s),this._host._capturingControl[o]=this,this._lastPointerDownId=o,!0},e.prototype._onPointerMove=function(e,i,o,r){if(o==this._lastPointerDownId){if(!this.isReadOnly){this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var n=this._transformedPosition.x,a=this._transformedPosition.y;this._pointerIsDown&&this._updateValueFromPointer(n,a)}t.prototype._onPointerMove.call(this,e,i,o,r)}},e.prototype._onPointerUp=function(e,i,o,r,n,a){this._pointerIsDown=!1,delete this._host._capturingControl[o],t.prototype._onPointerUp.call(this,e,i,o,r,n,a)},e.prototype._onCanvasBlur=function(){this._forcePointerUp(),t.prototype._onCanvasBlur.call(this)},e.ShowPickerDialogAsync=function(t,i){return new Promise((function(o){i.pickerWidth=i.pickerWidth||"640px",i.pickerHeight=i.pickerHeight||"400px",i.headerHeight=i.headerHeight||"35px",i.lastColor=i.lastColor||"#000000",i.swatchLimit=i.swatchLimit||20,i.numSwatchesPerLine=i.numSwatchesPerLine||10;var r,n,a,s,l,_,h,c=i.swatchLimit/i.numSwatchesPerLine,u=parseFloat(i.pickerWidth)/i.numSwatchesPerLine,f=Math.floor(.25*u),p=f*(i.numSwatchesPerLine+1),g=Math.floor((parseFloat(i.pickerWidth)-p)/i.numSwatchesPerLine),b=g*c+f*(c+1),m=(parseInt(i.pickerHeight)+b+Math.floor(.25*g)).toString()+"px",v="#c0c0c0",y="#535353",x="#414141",P="515151",B=d.Color3.FromHexString("#dddddd"),C=B.r+B.g+B.b,O=["R","G","B"],w="#454545",M="#f0f0f0",E=!1,k=new D;if(k.name="Dialog Container",k.width=i.pickerWidth,i.savedColors){k.height=m;var L=parseInt(i.pickerHeight)/parseInt(m);k.addRowDefinition(L,!1),k.addRowDefinition(1-L,!1)}else k.height=i.pickerHeight,k.addRowDefinition(1,!1);if(t.addControl(k),i.savedColors){(s=new D).name="Swatch Drawer",s.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,s.background=y,s.width=i.pickerWidth;var N,A=i.savedColors.length/i.numSwatchesPerLine;N=0==A?0:A+1,s.height=(g*A+N*f).toString()+"px",s.top=Math.floor(.25*g).toString()+"px";for(var z=0;z<2*Math.ceil(i.savedColors.length/i.numSwatchesPerLine)+1;z++)z%2!=0?s.addRowDefinition(g,!0):s.addRowDefinition(f,!0);for(z=0;z<2*i.numSwatchesPerLine+1;z++)z%2!=0?s.addColumnDefinition(g,!0):s.addColumnDefinition(f,!0);k.addControl(s,1,0)}var Q=new D;Q.name="Picker Panel",Q.height=i.pickerHeight;var V=parseInt(i.headerHeight)/parseInt(i.pickerHeight),W=[V,1-V];Q.addRowDefinition(W[0],!1),Q.addRowDefinition(W[1],!1),k.addControl(Q,0,0);var H=new T;H.name="Dialogue Header Bar",H.background="#cccccc",H.thickness=0,Q.addControl(H,0,0);var G=R.CreateSimpleButton("closeButton","a");G.fontFamily="coreglyphs";var U=d.Color3.FromHexString(H.background),j=new d.Color3(1-U.r,1-U.g,1-U.b);G.color=j.toHexString(),G.fontSize=Math.floor(.6*parseInt(i.headerHeight)),G.textBlock.textVerticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,G.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_RIGHT,G.height=G.width=i.headerHeight,G.background=H.background,G.thickness=0,G.pointerDownAnimation=function(){},G.pointerUpAnimation=function(){G.background=H.background},G.pointerEnterAnimation=function(){G.color=H.background,G.background="red"},G.pointerOutAnimation=function(){G.color=j.toHexString(),G.background=H.background},G.onPointerClickObservable.add((function(){Qt(_t.background)})),Q.addControl(G,0,0);var Y=new D;Y.name="Dialogue Body",Y.background=y;var X=[.4375,.5625];Y.addRowDefinition(1,!1),Y.addColumnDefinition(X[0],!1),Y.addColumnDefinition(X[1],!1),Q.addControl(Y,1,0);var K=new D;K.name="Picker Grid",K.addRowDefinition(.85,!1),K.addRowDefinition(.15,!1),Y.addControl(K,0,0);var Z=new e;Z.name="GUI Color Picker",i.pickerHeighti.pickerHeight?at:nt;var st=new S;st.text="new",st.name="New Color Label",st.color=v,st.fontSize=rt,et.addControl(st,1,0);var lt=new T;lt.name="New Color Swatch",lt.background=i.lastColor,lt.thickness=0,ot.addControl(lt,0,0);var _t=R.CreateSimpleButton("currentSwatch","");_t.background=i.lastColor,_t.thickness=0,_t.onPointerClickObservable.add((function(){Et(d.Color3.FromHexString(_t.background),_t.name),Lt(!1)})),_t.pointerDownAnimation=function(){},_t.pointerUpAnimation=function(){},_t.pointerEnterAnimation=function(){},_t.pointerOutAnimation=function(){},ot.addControl(_t,1,0);var ht=new T;ht.name="Swatch Outline",ht.width=.67,ht.thickness=2,ht.color="#404040",ht.isHitTestVisible=!1,et.addControl(ht,2,0);var ct=new S;ct.name="Current Color Label",ct.text="current",ct.color=v,ct.fontSize=rt,et.addControl(ct,3,0);var ut=new D;ut.name="Button Grid",ut.height=.8;var dt=1/3;ut.addRowDefinition(dt,!1),ut.addRowDefinition(dt,!1),ut.addRowDefinition(dt,!1),$.addControl(ut,0,1);var ft=Math.floor(parseInt(i.pickerWidth)*X[1]*tt[1]*.67).toString()+"px",pt=Math.floor(parseInt(i.pickerHeight)*W[1]*J[0]*(parseFloat(ut.height.toString())/100)*dt*.7).toString()+"px";r=parseFloat(ft)>parseFloat(pt)?Math.floor(.45*parseFloat(pt)):Math.floor(.11*parseFloat(ft));var gt=R.CreateSimpleButton("butOK","OK");gt.width=ft,gt.height=pt,gt.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,gt.thickness=2,gt.color=v,gt.fontSize=r,gt.background=y,gt.onPointerEnterObservable.add((function(){gt.background=x})),gt.onPointerOutObservable.add((function(){gt.background=y})),gt.pointerDownAnimation=function(){gt.background=P},gt.pointerUpAnimation=function(){gt.background=x},gt.onPointerClickObservable.add((function(){Lt(!1),Qt(lt.background)})),ut.addControl(gt,0,0);var bt=R.CreateSimpleButton("butCancel","Cancel");bt.width=ft,bt.height=pt,bt.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,bt.thickness=2,bt.color=v,bt.fontSize=r,bt.background=y,bt.onPointerEnterObservable.add((function(){bt.background=x})),bt.onPointerOutObservable.add((function(){bt.background=y})),bt.pointerDownAnimation=function(){bt.background=P},bt.pointerUpAnimation=function(){bt.background=x},bt.onPointerClickObservable.add((function(){Lt(!1),Qt(_t.background)})),ut.addControl(bt,1,0),i.savedColors&&((l=R.CreateSimpleButton("butSave","Save")).width=ft,l.height=pt,l.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,l.thickness=2,l.fontSize=r,i.savedColors.length0&&At(!0),ut.addControl(l,2,0));var mt=new D;mt.name="Dialog Lower Right",mt.addRowDefinition(.02,!1),mt.addRowDefinition(.63,!1),mt.addRowDefinition(.21,!1),mt.addRowDefinition(.14,!1),q.addControl(mt,1,0);var vt=d.Color3.FromHexString(i.lastColor),yt=new D;for(yt.name="RGB Values",yt.width=.82,yt.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,yt.addRowDefinition(1/3,!1),yt.addRowDefinition(1/3,!1),yt.addRowDefinition(1/3,!1),yt.addColumnDefinition(.1,!1),yt.addColumnDefinition(.2,!1),yt.addColumnDefinition(.7,!1),mt.addControl(yt,1,0),z=0;z255?i="255":isNaN(parseInt(i))&&(i="0")),h==t.name&&(_=i),""!=i){i=parseInt(i).toString(),t.text=i;var o=d.Color3.FromHexString(lt.background);h==t.name&&Et("r"==e?new d.Color3(parseInt(i)/255,o.g,o.b):"g"==e?new d.Color3(o.r,parseInt(i)/255,o.b):new d.Color3(o.r,o.g,parseInt(i)/255),t.name)}}function Dt(t,e){var i=t.text;if(/[^0-9.]/g.test(i))t.text=_;else{""!=i&&"."!=i&&0!=parseFloat(i)&&(parseFloat(i)<0?i="0.0":parseFloat(i)>1?i="1.0":isNaN(parseFloat(i))&&(i="0.0")),h==t.name&&(_=i),""!=i&&"."!=i&&0!=parseFloat(i)?(i=parseFloat(i).toString(),t.text=i):i="0.0";var o=d.Color3.FromHexString(lt.background);h==t.name&&Et("r"==e?new d.Color3(parseFloat(i),o.g,o.b):"g"==e?new d.Color3(o.r,parseFloat(i),o.b):new d.Color3(o.r,o.g,parseFloat(i)),t.name)}}function kt(){if(i.savedColors&&i.savedColors[a]){var t;t=E?"b":"";var e=R.CreateSimpleButton("Swatch_"+a,t);e.fontFamily="coreglyphs";var o=d.Color3.FromHexString(i.savedColors[a]),r=o.r+o.g+o.b;e.color=r>C?"#aaaaaa":"#ffffff",e.fontSize=Math.floor(.7*g),e.textBlock.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,e.height=e.width=g.toString()+"px",e.background=i.savedColors[a],e.thickness=2;var n=a;return e.pointerDownAnimation=function(){e.thickness=4},e.pointerUpAnimation=function(){e.thickness=3},e.pointerEnterAnimation=function(){e.thickness=3},e.pointerOutAnimation=function(){e.thickness=2},e.onPointerClickObservable.add((function(){var t;E?(t=n,i.savedColors&&i.savedColors.splice(t,1),i.savedColors&&0==i.savedColors.length&&(At(!1),E=!1),Nt("",l)):i.savedColors&&Et(d.Color3.FromHexString(i.savedColors[n]),e.name)})),e}return null}function Lt(t){if(void 0!==t&&(E=t),E){for(var e=0;eh*i.numSwatchesPerLine?i.numSwatchesPerLine:i.savedColors.length-(h-1)*i.numSwatchesPerLine;for(var u=Math.min(Math.max(c,0),i.numSwatchesPerLine),d=0,p=1;di.numSwatchesPerLine)){var b=kt();null!=b&&(s.addControl(b,_,p),p+=2,a++)}}i.savedColors.length>=i.swatchLimit?zt(e,!0):zt(e,!1)}}function At(t){t?((n=R.CreateSimpleButton("butEdit","Edit")).width=ft,n.height=pt,n.left=Math.floor(.1*parseInt(ft)).toString()+"px",n.top=(-1*parseFloat(n.left)).toString()+"px",n.verticalAlignment=I.VERTICAL_ALIGNMENT_BOTTOM,n.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,n.thickness=2,n.color=v,n.fontSize=r,n.background=y,n.onPointerEnterObservable.add((function(){n.background=x})),n.onPointerOutObservable.add((function(){n.background=y})),n.pointerDownAnimation=function(){n.background=P},n.pointerUpAnimation=function(){n.background=x},n.onPointerClickObservable.add((function(){E=!E,Lt()})),K.addControl(n,1,0)):K.removeControl(n)}function zt(t,e){e?(t.color="#555555",t.background="#454545"):(t.color=v,t.background=y)}function Qt(e){i.savedColors&&i.savedColors.length>0?o({savedColors:i.savedColors,pickedColor:e}):o({pickedColor:e}),t.removeControl(k)}wt.text=Mt[1],wt.color=M,wt.background=w,wt.onFocusObservable.add((function(){h=wt.name,_=wt.text,Lt(!1)})),wt.onBlurObservable.add((function(){if(3==wt.text.length){var t=wt.text.split("");wt.text=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}""==wt.text&&(wt.text="000000",Et(d.Color3.FromHexString(wt.text),"b")),h==wt.name&&(h="")})),wt.onTextChangedObservable.add((function(){var t=wt.text,e=/[^0-9A-F]/i.test(t);if((wt.text.length>6||e)&&h==wt.name)wt.text=_;else{if(wt.text.length<6)for(var i=6-wt.text.length,o=0;o0&&Nt("",l)}))},e._Epsilon=1e-6,h([(0,d.serialize)()],e.prototype,"value",null),h([(0,d.serialize)()],e.prototype,"width",null),h([(0,d.serialize)()],e.prototype,"height",null),h([(0,d.serialize)()],e.prototype,"size",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.ColorPicker",k);var L=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._thickness=1,i._arc=1,i}return l(e,t),Object.defineProperty(e.prototype,"thickness",{get:function(){return this._thickness},set:function(t){this._thickness!==t&&(this._thickness=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arc",{get:function(){return this._arc},set:function(t){this._arc!==t&&(this._arc=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"Ellipse"},e.prototype._localDraw=function(t){t.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,this._arc,t),(this._backgroundGradient||this._background)&&(t.fillStyle=this._getBackgroundColor(t),t.fill()),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this._thickness&&(this.color&&(t.strokeStyle=this.color),t.lineWidth=this._thickness,t.stroke()),t.restore()},e.prototype._additionalProcessing=function(e,i){t.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.width-=2*this._thickness,this._measureForChildren.height-=2*this._thickness,this._measureForChildren.left+=this._thickness,this._measureForChildren.top+=this._thickness},e.prototype._clipForChildren=function(t){I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2,this._currentMeasure.height/2,this._arc,t),t.clip()},e.prototype._renderHighlightSpecific=function(t){I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._highlightLineWidth/2,this._currentMeasure.height/2-this._highlightLineWidth/2,this._arc,t),t.stroke()},h([(0,d.serialize)()],e.prototype,"thickness",null),h([(0,d.serialize)()],e.prototype,"arc",null),e}(B);(0,d.RegisterClass)("BABYLON.GUI.Ellipse",L);var N=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._unfocusedColor=i.color,i}return l(e,t),e.prototype._onPointerDown=function(e,i,o,r,n){return this.isReadOnly||this.focus(),t.prototype._onPointerDown.call(this,e,i,o,r,n)},e}(R);(0,d.RegisterClass)("BABYLON.GUI.FocusableButton",N);var A=function(t){function e(e,i){void 0===i&&(i="");var o=t.call(this,e)||this;return o.name=e,o._textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._textVerticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._prevText=o.text,o._lineSpacing=new f(0),o._maxHeight=new f(1,f.UNITMODE_PERCENTAGE,!1),o.onLinesReadyObservable=new d.Observable,o.text=i,o.isPointerBlocker=!0,o.onLinesReadyObservable.add((function(){return o._updateCursorPosition()})),o._highlightCursorInfo={initialStartIndex:-1,initialRelativeStartIndex:-1,initialLineIndex:-1},o._cursorInfo={globalStartIndex:0,globalEndIndex:0,relativeEndIndex:0,relativeStartIndex:0,currentLineIndex:0},o}return l(e,t),Object.defineProperty(e.prototype,"autoStretchHeight",{get:function(){return this._autoStretchHeight},set:function(t){this._autoStretchHeight!==t&&(this._autoStretchHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{set:function(t){this.fixedRatioMasterIsWidth=!1,this._height.toString(this._host)!==t&&(this._height.fromString(t)&&this._markAsDirty(),this._autoStretchHeight=!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxHeight",{get:function(){return this._maxHeight.toString(this._host)},set:function(t){this._maxHeight.toString(this._host)!==t&&this._maxHeight.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxHeightInPixels",{get:function(){return this._maxHeight.getValueInPixel(this._host,this._cachedParentMeasure.height)},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"InputTextArea"},e.prototype.processKeyboard=function(t){this.isReadOnly||(this.alternativeProcessKey(t.code,t.key,t),this.onKeyboardEventProcessedObservable.notifyObservers(t))},e.prototype.alternativeProcessKey=function(t,e,i){if(!i||!i.ctrlKey&&!i.metaKey||"c"!==e&&"v"!==e&&"x"!==e){switch(t){case"Period":i&&i.shiftKey&&i.preventDefault();break;case"Backspace":!this._isTextHighlightOn&&this._cursorInfo.globalStartIndex>0&&(this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex--),this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,i&&i.preventDefault(),this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._textHasChanged();break;case"Delete":!this._isTextHighlightOn&&this._cursorInfo.globalEndIndexthis._highlightCursorInfo.initialStartIndex?this._cursorInfo.globalEndIndex--:this._cursorInfo.globalStartIndex--:(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex--,this._isTextHighlightOn=!0),this._blinkIsEven=!0,void i.preventDefault()):(this._isTextHighlightOn?this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex:i&&(i.ctrlKey||i.metaKey)?(this._cursorInfo.globalStartIndex-=this._cursorInfo.relativeStartIndex,i.preventDefault()):this._cursorInfo.globalStartIndex>0&&this._cursorInfo.globalStartIndex--,this._blinkIsEven=!1,void(this._isTextHighlightOn=!1));case"ArrowRight":if(this._markAsDirty(),i&&i.shiftKey){if(i.ctrlKey||i.metaKey){var o=this._lines[this._cursorInfo.currentLineIndex].text.length-this._cursorInfo.relativeEndIndex-1;this._cursorInfo.globalEndIndex+=o,this._cursorInfo.globalStartIndex=this._highlightCursorInfo.initialStartIndex}return this._isTextHighlightOn?this._cursorInfo.globalStartIndexc&&u>0&&a--,this._isTextHighlightOn?this._cursorInfo.currentLineIndex<=this._highlightCursorInfo.initialLineIndex?(this._cursorInfo.globalStartIndex=a,this._cursorInfo.globalEndIndex=this._highlightCursorInfo.initialStartIndex,this._cursorInfo.relativeEndIndex=this._highlightCursorInfo.initialRelativeStartIndex):this._cursorInfo.globalEndIndex=a:this._cursorInfo.globalStartIndex=a}return void this._markAsDirty();case"ArrowDown":if(this._blinkIsEven=!1,i&&(i.shiftKey?(this._isTextHighlightOn||(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex),this._isTextHighlightOn=!0,this._blinkIsEven=!0):this._isTextHighlightOn=!1,i.preventDefault()),this._cursorInfo.currentLineIndex===this._lines.length-1)this._cursorInfo.globalStartIndex=this.text.length;else{r=this._lines[this._cursorInfo.currentLineIndex];var d=this._lines[this._cursorInfo.currentLineIndex+1];a=0,s=0,!this._isTextHighlightOn||this._cursorInfo.currentLineIndexc&&p>0&&a--,this._isTextHighlightOn?this._cursorInfo.currentLineIndexthis._cursorInfo.globalEndIndex&&(this._cursorInfo.globalEndIndex+=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex=this._cursorInfo.globalEndIndex-this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex-=this._cursorInfo.globalStartIndex)):(this._cursorInfo.globalEndIndex=a,this._cursorInfo.globalStartIndex=this._highlightCursorInfo.initialStartIndex):this._cursorInfo.globalStartIndex=a}return void this._markAsDirty()}if("a"===e&&i&&(i.ctrlKey||i.metaKey))return this._selectAllText(),void i.preventDefault();1===(null==e?void 0:e.length)&&(null==i||i.preventDefault(),this._currentKey=e,this.onBeforeKeyAddObservable.notifyObservers(this),e=this._currentKey,this._addKey&&(this._isTextHighlightOn=!1,this._blinkIsEven=!1,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex,e),this._cursorInfo.globalStartIndex+=e.length,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._textHasChanged()))}},e.prototype._parseLineWordWrap=function(t,e,i){void 0===t&&(t="");for(var o=[],r=t.split(" "),n=0,a=function(a){var s=a>0?t+" "+r[a]:r[0],l=i.measureText(s).width;if(l>e){a>0&&(n=i.measureText(t).width,o.push({text:t,width:n,lineEnding:" "})),t=r[a];var _="";t.split("").map((function(t){i.measureText(_+t).width>e&&(o.push({text:_,width:i.measureText(_).width,lineEnding:""}),_=""),_+=t})),t=_,n=i.measureText(t).width}else n=l,t=s},s=0;se.measureText(t).width?i:t}),""),a=e.measureText(n).width;this.width=Math.min(this._maxWidth.getValueInPixel(this._host,t.width),a+r)+"px",this.autoStretchWidth=!0}if(this._availableWidth=this._width.getValueInPixel(this._host,t.width)-r,this._lines=this._breakLines(this._availableWidth,e),this._contextForBreakLines=e,this._autoStretchHeight){var s=this._lines.length*this._fontOffset.height+2*this._margin.getValueInPixel(this._host,t.height);this.height=Math.min(this._maxHeight.getValueInPixel(this._host,t.height),s)+"px",this._autoStretchHeight=!0}if(this._availableHeight=this._height.getValueInPixel(this._host,t.height)-r,this._isFocused){this._cursorInfo.currentLineIndex=0;for(var l=this._lines[this._cursorInfo.currentLineIndex].text.length+this._lines[this._cursorInfo.currentLineIndex].lineEnding.length,_=0;_+l<=this._cursorInfo.globalStartIndex;)_+=l,this._cursorInfo.currentLineIndexthis._availableWidth){var t=this._clipTextLeft-this._lines[this._cursorInfo.currentLineIndex].width+this._availableWidth;this._scrollLeft||(this._scrollLeft=t)}else this._scrollLeft=this._clipTextLeft;if(this._isFocused){var e=(this._cursorInfo.currentLineIndex+1)*this._fontOffset.height,i=this._clipTextTop-e;this._scrollTop||(this._scrollTop=i)}else this._scrollTop=this._clipTextTop},e.prototype._additionalProcessing=function(){this.highlightedText="",this.onLinesReadyObservable.notifyObservers(this)},e.prototype._drawText=function(t,e,i,o){var r=this._currentMeasure.width,n=this._scrollLeft;switch(this._textHorizontalAlignment){case I.HORIZONTAL_ALIGNMENT_LEFT:n+=0;break;case I.HORIZONTAL_ALIGNMENT_RIGHT:n+=r-e;break;case I.HORIZONTAL_ALIGNMENT_CENTER:n+=(r-e)/2}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&o.strokeText(t,this._currentMeasure.left+n,i),o.fillText(t,n,i)},e.prototype._onCopyText=function(t){this._isTextHighlightOn=!1;try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText},e.prototype._onCutText=function(t){if(this._highlightedText){try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),this._textHasChanged()}},e.prototype._onPasteText=function(e){var i;i=e.clipboardData&&-1!==e.clipboardData.types.indexOf("text/plain")?e.clipboardData.getData("text/plain"):this._host.clipboardData,this._isTextHighlightOn=!1,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex,i);var o=i.length-(this._cursorInfo.globalEndIndex-this._cursorInfo.globalStartIndex);this._cursorInfo.globalStartIndex+=o,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._clickedCoordinateX=null,this._clickedCoordinateY=null,t.prototype._textHasChanged.call(this)},e.prototype._draw=function(t){var e,i;this._computeScroll(),this._scrollLeft=null!==(e=this._scrollLeft)&&void 0!==e?e:0,this._scrollTop=null!==(i=this._scrollTop)&&void 0!==i?i:0,t.save(),this._applyStates(t),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),this._isFocused?this._focusedBackground&&(t.fillStyle=this._isEnabled?this._focusedBackground:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)):this._background&&(t.fillStyle=this._isEnabled?this._background:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this.color&&(t.fillStyle=this.color);var o=this._currentMeasure.height,r=this._currentMeasure.width,n=0;switch(this._textVerticalAlignment){case I.VERTICAL_ALIGNMENT_TOP:n=this._fontOffset.ascent;break;case I.VERTICAL_ALIGNMENT_BOTTOM:n=o-this._fontOffset.height*(this._lines.length-1)-this._fontOffset.descent;break;case I.VERTICAL_ALIGNMENT_CENTER:n=this._fontOffset.ascent+(o-this._fontOffset.height*this._lines.length)/2}t.save(),t.beginPath(),t.fillStyle=this.fontStyle,!this._textWrapper.text&&this.placeholderText&&(t.fillStyle=this._placeholderColor),t.rect(this._clipTextLeft,this._clipTextTop,this._availableWidth+2,this._availableHeight+2),t.clip(),n+=this._scrollTop;for(var a=0;athis._clipTextLeft+this._availableWidth&&(this._scrollLeft+=this._clipTextLeft+this._availableWidth-l,l=this._clipTextLeft+this._availableWidth,this._markAsDirty());var _=this._scrollTop+this._cursorInfo.currentLineIndex*this._fontOffset.height;_this._clipTextTop+this._availableHeight&&this._availableHeight>this._fontOffset.height&&(this._scrollTop+=this._clipTextTop+this._availableHeight-_-this._fontOffset.height,_=this._clipTextTop+this._availableHeight-this._fontOffset.height,this._markAsDirty()),this._isTextHighlightOn||t.fillRect(l,_,2,this._fontOffset.height)}if(this._resetBlinking(),this._isTextHighlightOn){clearTimeout(this._blinkTimeout),this._highlightedText=this.text.substring(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),t.globalAlpha=this._highligherOpacity,t.fillStyle=this._textHighlightColor;var h=Math.min(this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialLineIndex),c=Math.max(this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialLineIndex),u=this._scrollTop+h*this._fontOffset.height;for(a=h;a<=c;a++){s=this._lines[a];var d=this._scrollLeft;switch(this._textHorizontalAlignment){case I.HORIZONTAL_ALIGNMENT_LEFT:d+=0;break;case I.HORIZONTAL_ALIGNMENT_RIGHT:d+=r-s.width;break;case I.HORIZONTAL_ALIGNMENT_CENTER:d+=(r-s.width)/2}var f=a===h?this._cursorInfo.relativeStartIndex:0,p=a===c?this._cursorInfo.relativeEndIndex:s.text.length,g=t.measureText(s.text.substring(0,f)).width,b=s.text.substring(f,p),m=t.measureText(b).width;t.fillRect(d+g,u,m,this._fontOffset.height),u+=this._fontOffset.height}this._cursorInfo.globalEndIndex===this._cursorInfo.globalStartIndex&&this._resetBlinking()}}t.restore(),this._thickness&&(this._isFocused?this.focusedColor&&(t.strokeStyle=this.focusedColor):this.color&&(t.strokeStyle=this.color),t.lineWidth=this._thickness,t.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness))},e.prototype._resetBlinking=function(){var t=this;clearTimeout(this._blinkTimeout),this._blinkTimeout=setTimeout((function(){t._blinkIsEven=!t._blinkIsEven,t._markAsDirty()}),500)},e.prototype._onPointerDown=function(e,i,o,r,n){return!(!t.prototype._onPointerDown.call(this,e,i,o,r,n)||!this.isReadOnly&&(this._clickedCoordinateX=i.x,this._clickedCoordinateY=i.y,this._isTextHighlightOn=!1,this._highlightedText="",this._isPointerDown=!0,this._host._capturingControl[o]=this,this._host.focusedControl===this?(clearTimeout(this._blinkTimeout),this._markAsDirty(),0):!this._isEnabled||(this._host.focusedControl=this,0)))},e.prototype._onPointerMove=function(e,i,o,r){0===r.event.movementX&&0===r.event.movementY||(this._host.focusedControl===this&&this._isPointerDown&&!this.isReadOnly&&(this._clickedCoordinateX=i.x,this._clickedCoordinateY=i.y,this._isTextHighlightOn||(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex,this._isTextHighlightOn=!0),this._markAsDirty()),t.prototype._onPointerMove.call(this,e,i,o,r))},e.prototype._updateCursorPosition=function(){var t;if(this._isFocused)if(!this._textWrapper.text&&this.placeholderText)this._cursorInfo.currentLineIndex=0,this._cursorInfo.globalStartIndex=0,this._cursorInfo.globalEndIndex=0,this._cursorInfo.relativeStartIndex=0,this._cursorInfo.relativeEndIndex=0;else if(this._clickedCoordinateX&&this._clickedCoordinateY){this._isTextHighlightOn||(this._cursorInfo={globalStartIndex:0,globalEndIndex:0,relativeStartIndex:0,relativeEndIndex:0,currentLineIndex:0});var e=0,i=0,o=this._clickedCoordinateY-this._scrollTop,r=Math.floor(o/this._fontOffset.height);this._cursorInfo.currentLineIndex=Math.min(Math.max(r,0),this._lines.length-1);for(var n=0,a=this._clickedCoordinateX-(null!==(t=this._scrollLeft)&&void 0!==t?t:0),s=0,l=0;li;)i++,s=Math.abs(a-n),n=this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substring(0,i)).width;Math.abs(a-n)>s&&i>0&&i--,e+=i,this._isTextHighlightOn?e=this._highlightCursorInfo.initialStartIndex){for(;c+h<=this._cursorInfo.globalEndIndex;)c+=h,this._cursorInfo.currentLineIndex0&&this._textWrapper.isWord(this._cursorInfo.globalStartIndex-1)?--this._cursorInfo.globalStartIndex:0,i=this._cursorInfo.globalEndIndex1?this.notRenderable=!0:this.notRenderable=!1}else d.Tools.Error("Cannot move a control to a vector3 if the control is not at root level")},e.prototype._moveToProjectedPosition=function(t,e){void 0===e&&(e=!1);var i=t.x+this._linkOffsetX.getValue(this._host)+"px",o=t.y+this._linkOffsetY.getValue(this._host)+"px";e?(this.x2=i,this.y2=o,this._x2.ignoreAdaptiveScaling=!0,this._y2.ignoreAdaptiveScaling=!0):(this.x1=i,this.y1=o,this._x1.ignoreAdaptiveScaling=!0,this._y1.ignoreAdaptiveScaling=!0)},h([(0,d.serialize)()],e.prototype,"dash",null),h([(0,d.serialize)()],e.prototype,"x1",null),h([(0,d.serialize)()],e.prototype,"y1",null),h([(0,d.serialize)()],e.prototype,"x2",null),h([(0,d.serialize)()],e.prototype,"y2",null),h([(0,d.serialize)()],e.prototype,"lineWidth",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.Line",Q);var V=function(){function t(t){this._multiLine=t,this._x=new f(0),this._y=new f(0),this._point=new d.Vector3(0,0,0)}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x.toString(this._multiLine._host)},set:function(t){this._x.toString(this._multiLine._host)!==t&&this._x.fromString(t)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y.toString(this._multiLine._host)},set:function(t){this._y.toString(this._multiLine._host)!==t&&this._y.fromString(t)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this._control},set:function(t){this._control!==t&&(this._control&&this._controlObserver&&(this._control.onDirtyObservable.remove(this._controlObserver),this._controlObserver=null),this._control=t,this._control&&(this._controlObserver=this._control.onDirtyObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},set:function(t){this._mesh!==t&&(this._mesh&&this._meshObserver&&this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver),this._mesh=t,this._mesh&&(this._meshObserver=this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype.resetLinks=function(){this.control=null,this.mesh=null},t.prototype.translate=function(){return this._point=this._translatePoint(),this._point},t.prototype._translatePoint=function(){if(null!=this._mesh)return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center,this._mesh.getWorldMatrix());if(null!=this._control)return new d.Vector3(this._control.centerX,this._control.centerY,1-d.Epsilon);var t=this._multiLine._host,e=this._x.getValueInPixel(t,Number(t._canvas.width)),i=this._y.getValueInPixel(t,Number(t._canvas.height));return new d.Vector3(e,i,1-d.Epsilon)},t.prototype.dispose=function(){this.resetLinks()},t}(),W=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._lineWidth=1,i.onPointUpdate=function(){i._markAsDirty()},i._automaticSize=!0,i.isHitTestVisible=!1,i._horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,i._verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,i._dash=[],i._points=[],i}return l(e,t),Object.defineProperty(e.prototype,"dash",{get:function(){return this._dash},set:function(t){this._dash!==t&&(this._dash=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype.getAt=function(t){return this._points[t]||(this._points[t]=new V(this)),this._points[t]},e.prototype.add=function(){for(var t=this,e=[],i=0;i0;)this.remove(this._points.length-1)},e.prototype.resetLinks=function(){this._points.forEach((function(t){null!=t&&t.resetLinks()}))},Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(t){this._lineWidth!==t&&(this._lineWidth=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalAlignment",{set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalAlignment",{set:function(t){},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"MultiLine"},e.prototype._draw=function(t){t.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),this._applyStates(t),t.strokeStyle=this.color,t.lineWidth=this._lineWidth,t.setLineDash(this._dash),t.beginPath();var e,i=!0;this._points.forEach((function(o){o&&(i?(t.moveTo(o._point.x,o._point.y),i=!1):o._point.z<1&&e.z<1?t.lineTo(o._point.x,o._point.y):t.moveTo(o._point.x,o._point.y),e=o._point)})),t.stroke(),t.restore()},e.prototype._additionalProcessing=function(){var t=this;this._minX=null,this._minY=null,this._maxX=null,this._maxY=null,this._points.forEach((function(e){e&&(e.translate(),(null==t._minX||e._point.xt._maxX)&&(t._maxX=e._point.x),(null==t._maxY||e._point.y>t._maxY)&&(t._maxY=e._point.y))})),null==this._minX&&(this._minX=0),null==this._minY&&(this._minY=0),null==this._maxX&&(this._maxX=0),null==this._maxY&&(this._maxY=0)},e.prototype._measure=function(){null!=this._minX&&null!=this._maxX&&null!=this._minY&&null!=this._maxY&&(this._currentMeasure.width=Math.abs(this._maxX-this._minX)+this._lineWidth,this._currentMeasure.height=Math.abs(this._maxY-this._minY)+this._lineWidth)},e.prototype._computeAlignment=function(){null!=this._minX&&null!=this._minY&&(this._currentMeasure.left=this._minX-this._lineWidth/2,this._currentMeasure.top=this._minY-this._lineWidth/2)},e.prototype.dispose=function(){this.reset(),t.prototype.dispose.call(this)},h([(0,d.serialize)()],e.prototype,"dash",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.MultiLine",W);var H=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._isChecked=!1,i._background="black",i._checkSizeRatio=.8,i._thickness=1,i.group="",i.onIsCheckedChangedObservable=new d.Observable,i.isPointerBlocker=!0,i}return l(e,t),Object.defineProperty(e.prototype,"thickness",{get:function(){return this._thickness},set:function(t){this._thickness!==t&&(this._thickness=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkSizeRatio",{get:function(){return this._checkSizeRatio},set:function(t){t=Math.max(Math.min(1,t),0),this._checkSizeRatio!==t&&(this._checkSizeRatio=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background!==t&&(this._background=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isChecked",{get:function(){return this._isChecked},set:function(t){var e=this;this._isChecked!==t&&(this._isChecked=t,this._markAsDirty(),this.onIsCheckedChangedObservable.notifyObservers(t),this._isChecked&&this._host&&this._host.executeOnAllControls((function(t){if(t!==e&&void 0!==t.group){var i=t;i.group===e.group&&(i.isChecked=!1)}})))},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"RadioButton"},e.prototype._draw=function(t){t.save(),this._applyStates(t);var e=this._currentMeasure.width-this._thickness,i=this._currentMeasure.height-this._thickness;if((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,1,t),t.fillStyle=this._isEnabled?this._background:this._disabledColor,t.fill(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),t.strokeStyle=this.color,t.lineWidth=this._thickness,t.stroke(),this._isChecked){t.fillStyle=this._isEnabled?this.color:this._disabledColor;var o=e*this._checkSizeRatio,r=i*this._checkSizeRatio;I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,o/2-this._thickness/2,r/2-this._thickness/2,1,t),t.fill()}t.restore()},e.prototype._onPointerDown=function(e,i,o,r,n){return!!t.prototype._onPointerDown.call(this,e,i,o,r,n)&&(this.isReadOnly||this.isChecked||(this.isChecked=!0),!0)},e.AddRadioButtonWithHeader=function(t,i,o,r){var n=new w;n.isVertical=!1,n.height="30px";var a=new e;a.width="20px",a.height="20px",a.isChecked=o,a.color="green",a.group=i,a.onIsCheckedChangedObservable.add((function(t){return r(a,t)})),n.addControl(a);var s=new S;return s.text=t,s.width="180px",s.paddingLeft="5px",s.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,s.color="white",n.addControl(s),n},h([(0,d.serialize)()],e.prototype,"thickness",null),h([(0,d.serialize)()],e.prototype,"group",void 0),h([(0,d.serialize)()],e.prototype,"checkSizeRatio",null),h([(0,d.serialize)()],e.prototype,"background",null),h([(0,d.serialize)()],e.prototype,"isChecked",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.RadioButton",H);var G=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._thumbWidth=new f(20,f.UNITMODE_PIXEL,!1),i._minimum=0,i._maximum=100,i._value=50,i._isVertical=!1,i._barOffset=new f(5,f.UNITMODE_PIXEL,!1),i._isThumbClamped=!1,i._displayThumb=!0,i._step=0,i._lastPointerDownId=-1,i._effectiveBarOffset=0,i.onValueChangedObservable=new d.Observable,i._pointerIsDown=!1,i.isPointerBlocker=!0,i}return l(e,t),Object.defineProperty(e.prototype,"displayThumb",{get:function(){return this._displayThumb},set:function(t){this._displayThumb!==t&&(this._displayThumb=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this._step},set:function(t){this._step!==t&&(this._step=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barOffset",{get:function(){return this._barOffset.toString(this._host)},set:function(t){this._barOffset.toString(this._host)!==t&&this._barOffset.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barOffsetInPixels",{get:function(){return this._barOffset.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbWidth",{get:function(){return this._thumbWidth.toString(this._host)},set:function(t){this._thumbWidth.toString(this._host)!==t&&this._thumbWidth.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbWidthInPixels",{get:function(){return this._thumbWidth.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minimum",{get:function(){return this._minimum},set:function(t){this._minimum!==t&&(this._minimum=t,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){this._maximum!==t&&(this._maximum=t,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t=Math.max(Math.min(t,this._maximum),this._minimum),this._value!==t&&(this._value=t,this._markAsDirty(),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isThumbClamped",{get:function(){return this._isThumbClamped},set:function(t){this._isThumbClamped!==t&&(this._isThumbClamped=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"BaseSlider"},e.prototype._getThumbPosition=function(){return this.isVertical?(this.maximum-this.value)/(this.maximum-this.minimum)*this._backgroundBoxLength:(this.value-this.minimum)/(this.maximum-this.minimum)*this._backgroundBoxLength},e.prototype._getThumbThickness=function(t){var e=0;switch(t){case"circle":e=this._thumbWidth.isPixel?Math.max(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host);break;case"rectangle":e=this._thumbWidth.isPixel?Math.min(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)}return e},e.prototype._prepareRenderingData=function(t){this._effectiveBarOffset=0,this._renderLeft=this._currentMeasure.left,this._renderTop=this._currentMeasure.top,this._renderWidth=this._currentMeasure.width,this._renderHeight=this._currentMeasure.height,this._backgroundBoxLength=Math.max(this._currentMeasure.width,this._currentMeasure.height),this._backgroundBoxThickness=Math.min(this._currentMeasure.width,this._currentMeasure.height),this._effectiveThumbThickness=this._getThumbThickness(t),this.displayThumb&&(this._backgroundBoxLength-=this._effectiveThumbThickness),this.isVertical&&this._currentMeasure.height=this._selectors.length))return this._selectors[t]},t.prototype.removeSelector=function(t){t<0||t>=this._selectors.length||(this._groupPanel.removeControl(this._selectors[t]),this._selectors.splice(t,1))},t}(),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.addCheckbox=function(t,e,i){void 0===e&&(e=function(t){}),void 0===i&&(i=!1),i=i||!1;var o=new M;o.width="20px",o.height="20px",o.color="#364249",o.background="#CCCCCC",o.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o.onIsCheckedChangedObservable.add((function(t){e(t)}));var r=I.AddHeader(o,t,"200px",{isHorizontal:!0,controlFirst:!0});r.height="30px",r.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,r.left="4px",this.groupPanel.addControl(r),this.selectors.push(r),o.isChecked=i,this.groupPanel.parent&&this.groupPanel.parent.parent&&(o.color=this.groupPanel.parent.parent.buttonColor,o.background=this.groupPanel.parent.parent.buttonBackground)},e.prototype._setSelectorLabel=function(t,e){this.selectors[t].children[1].text=e},e.prototype._setSelectorLabelColor=function(t,e){this.selectors[t].children[1].color=e},e.prototype._setSelectorButtonColor=function(t,e){this.selectors[t].children[0].color=e},e.prototype._setSelectorButtonBackground=function(t,e){this.selectors[t].children[0].background=e},e}(j),X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectNb=0,e}return l(e,t),e.prototype.addRadio=function(t,e,i){void 0===e&&(e=function(t){}),void 0===i&&(i=!1);var o=this._selectNb++,r=new H;r.name=t,r.width="20px",r.height="20px",r.color="#364249",r.background="#CCCCCC",r.group=this.name,r.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,r.onIsCheckedChangedObservable.add((function(t){t&&e(o)}));var n=I.AddHeader(r,t,"200px",{isHorizontal:!0,controlFirst:!0});n.height="30px",n.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,n.left="4px",this.groupPanel.addControl(n),this.selectors.push(n),r.isChecked=i,this.groupPanel.parent&&this.groupPanel.parent.parent&&(r.color=this.groupPanel.parent.parent.buttonColor,r.background=this.groupPanel.parent.parent.buttonBackground)},e.prototype._setSelectorLabel=function(t,e){this.selectors[t].children[1].text=e},e.prototype._setSelectorLabelColor=function(t,e){this.selectors[t].children[1].color=e},e.prototype._setSelectorButtonColor=function(t,e){this.selectors[t].children[0].color=e},e.prototype._setSelectorButtonBackground=function(t,e){this.selectors[t].children[0].background=e},e}(j),K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.addSlider=function(t,e,i,o,r,n,a){void 0===e&&(e=function(t){}),void 0===i&&(i="Units"),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=function(t){return 0|t});var s=new U;s.name=i,s.value=n,s.minimum=o,s.maximum=r,s.width=.9,s.height="20px",s.color="#364249",s.background="#CCCCCC",s.borderColor="black",s.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,s.left="4px",s.paddingBottom="4px",s.onValueChangedObservable.add((function(t){s.parent.children[0].text=s.parent.children[0].name+": "+a(t)+" "+s.name,e(t)}));var l=I.AddHeader(s,t+": "+a(n)+" "+i,"30px",{isHorizontal:!1,controlFirst:!1});l.height="60px",l.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,l.left="4px",l.children[0].name=t,this.groupPanel.addControl(l),this.selectors.push(l),this.groupPanel.parent&&this.groupPanel.parent.parent&&(s.color=this.groupPanel.parent.parent.buttonColor,s.background=this.groupPanel.parent.parent.buttonBackground)},e.prototype._setSelectorLabel=function(t,e){this.selectors[t].children[0].name=e,this.selectors[t].children[0].text=e+": "+this.selectors[t].children[1].value+" "+this.selectors[t].children[1].name},e.prototype._setSelectorLabelColor=function(t,e){this.selectors[t].children[0].color=e},e.prototype._setSelectorButtonColor=function(t,e){this.selectors[t].children[1].color=e},e.prototype._setSelectorButtonBackground=function(t,e){this.selectors[t].children[1].background=e},e}(j),Z=function(t){function e(e,i){void 0===i&&(i=[]);var o=t.call(this,e)||this;if(o.name=e,o.groups=i,o._buttonColor="#364249",o._buttonBackground="#CCCCCC",o._headerColor="black",o._barColor="white",o._barHeight="2px",o._spacerHeight="20px",o._bars=new Array,o._groups=i,o.thickness=2,o._panel=new w,o._panel.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._panel.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._panel.top=5,o._panel.left=5,o._panel.width=.95,i.length>0){for(var r=0;r0&&this._addSpacer(),this._panel.addControl(t.groupPanel),this._groups.push(t),t.groupPanel.children[0].color=this._headerColor;for(var e=0;e=this._groups.length)){var e=this._groups[t];this._panel.removeControl(e.groupPanel),this._groups.splice(t,1),t=this._groups.length||(this._groups[e].groupPanel.children[0].text=t)},e.prototype.relabel=function(t,e,i){if(!(e<0||e>=this._groups.length)){var o=this._groups[e];i<0||i>=o.selectors.length||o._setSelectorLabel(i,t)}},e.prototype.removeFromGroupSelector=function(t,e){if(!(t<0||t>=this._groups.length)){var i=this._groups[t];e<0||e>=i.selectors.length||i.removeSelector(e)}},e.prototype.addToGroupCheckbox=function(t,e,i,o){void 0===i&&(i=function(){}),void 0===o&&(o=!1),t<0||t>=this._groups.length||this._groups[t].addCheckbox(e,i,o)},e.prototype.addToGroupRadio=function(t,e,i,o){void 0===i&&(i=function(){}),void 0===o&&(o=!1),t<0||t>=this._groups.length||this._groups[t].addRadio(e,i,o)},e.prototype.addToGroupSlider=function(t,e,i,o,r,n,a,s){void 0===i&&(i=function(){}),void 0===o&&(o="Units"),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===s&&(s=function(t){return 0|t}),t<0||t>=this._groups.length||this._groups[t].addSlider(e,i,o,r,n,a,s)},e}(T),q=function(t){function e(e){var i=t.call(this,e)||this;return i._freezeControls=!1,i._bucketWidth=0,i._bucketHeight=0,i._buckets={},i}return l(e,t),Object.defineProperty(e.prototype,"freezeControls",{get:function(){return this._freezeControls},set:function(t){if(this._freezeControls!==t){t||this._restoreMeasures(),this._freezeControls=!1;var e=this.host.getSize(),i=e.width,o=e.height,r=this.host.getContext(),n=new v(0,0,i,o);this.host._numLayoutCalls=0,this.host._rootContainer._layout(n,r),t&&(this._updateMeasures(),this._useBuckets()&&this._makeBuckets()),this._freezeControls=t,this.host.markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucketWidth",{get:function(){return this._bucketWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucketHeight",{get:function(){return this._bucketHeight},enumerable:!1,configurable:!0}),e.prototype.setBucketSizes=function(t,e){this._bucketWidth=t,this._bucketHeight=e,this._useBuckets()?this._freezeControls&&this._makeBuckets():this._buckets={}},e.prototype._useBuckets=function(){return this._bucketWidth>0&&this._bucketHeight>0},e.prototype._makeBuckets=function(){this._buckets={},this._bucketLen=Math.ceil(this.widthInPixels/this._bucketWidth),this._dispatchInBuckets(this._children),this._oldLeft=null,this._oldTop=null},e.prototype._dispatchInBuckets=function(t){for(var e=0;e0&&this._dispatchInBuckets(i._children)}},e.prototype._updateMeasures=function(){var t=0|this.leftInPixels,e=0|this.topInPixels;this._measureForChildren.left-=t,this._measureForChildren.top-=e,this._currentMeasure.left-=t,this._currentMeasure.top-=e,this._customData.origLeftForChildren=this._measureForChildren.left,this._customData.origTopForChildren=this._measureForChildren.top,this._customData.origLeft=this._currentMeasure.left,this._customData.origTop=this._currentMeasure.top,this._updateChildrenMeasures(this._children,t,e)},e.prototype._updateChildrenMeasures=function(t,e,i){for(var o=0;o0&&this._updateChildrenMeasures(r._children,e,i)}},e.prototype._restoreMeasures=function(){var t=0|this.leftInPixels,e=0|this.topInPixels;this._measureForChildren.left=this._customData.origLeftForChildren+t,this._measureForChildren.top=this._customData.origTopForChildren+e,this._currentMeasure.left=this._customData.origLeft+t,this._currentMeasure.top=this._customData.origTop+e},e.prototype._getTypeName=function(){return"ScrollViewerWindow"},e.prototype._additionalProcessing=function(e,i){t.prototype._additionalProcessing.call(this,e,i),this._parentMeasure=e,this._measureForChildren.left=this._currentMeasure.left,this._measureForChildren.top=this._currentMeasure.top,this._measureForChildren.width=e.width,this._measureForChildren.height=e.height},e.prototype._layout=function(e,i){return this._freezeControls?(this.invalidateRect(),!1):t.prototype._layout.call(this,e,i)},e.prototype._scrollChildren=function(t,e,i){for(var o=0;o0&&this._scrollChildren(r._children,e,i)}},e.prototype._scrollChildrenWithBuckets=function(t,e,i,o){for(var r=Math.max(0,Math.floor(-t/this._bucketWidth)),n=Math.floor((-t+this._parentMeasure.width-1)/this._bucketWidth),a=Math.floor((-e+this._parentMeasure.height-1)/this._bucketHeight),s=Math.max(0,Math.floor(-e/this._bucketHeight));s<=a;){for(var l=r;l<=n;++l){var _=s*this._bucketLen+l,h=this._buckets[_];if(h)for(var c=0;cthis._tempMeasure.left+this._tempMeasure.width||ethis._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(e-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(t-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var o;o=this.isVertical?-(e-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness):(t-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=i*o*(this.maximum-this.minimum),this._originX=t,this._originY=e},e.prototype._onPointerDown=function(e,i,o,r,n){return this._first=!0,t.prototype._onPointerDown.call(this,e,i,o,r,n)},e.prototype.serialize=function(e){t.prototype.serialize.call(this,e),this.backgroundGradient&&(e.backgroundGradient={},this.backgroundGradient.serialize(e.backgroundGradient))},e.prototype._parseFromContent=function(e,i){if(t.prototype._parseFromContent.call(this,e,i),e.backgroundGradient){var o=d.Tools.Instantiate("BABYLON.GUI."+e.backgroundGradient.className);this.backgroundGradient=new o,this.backgroundGradient.parse(e.backgroundGradient)}},h([(0,d.serialize)()],e.prototype,"borderColor",null),h([(0,d.serialize)()],e.prototype,"background",null),h([(0,d.serialize)()],e.prototype,"invertScrollDirection",null),e}(G);(0,d.RegisterClass)("BABYLON.GUI.Scrollbar",J);var $=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._thumbLength=.5,i._thumbHeight=1,i._barImageHeight=1,i._tempMeasure=new v(0,0,0,0),i._invertScrollDirection=!1,i.num90RotationInVerticalMode=1,i}return l(e,t),Object.defineProperty(e.prototype,"invertScrollDirection",{get:function(){return this._invertScrollDirection},set:function(t){this._invertScrollDirection=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundImage",{get:function(){return this._backgroundBaseImage},set:function(t){var e=this;this._backgroundBaseImage!==t&&(this._backgroundBaseImage=t,this.isVertical&&0!==this.num90RotationInVerticalMode?t.isLoaded?(this._backgroundImage=t._rotate90(this.num90RotationInVerticalMode,!0),this._markAsDirty()):t.onImageLoadedObservable.addOnce((function(){var i=t._rotate90(e.num90RotationInVerticalMode,!0);e._backgroundImage=i,i.isLoaded||i.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),e._markAsDirty()})):(this._backgroundImage=t,t&&!t.isLoaded&&t.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbImage",{get:function(){return this._thumbBaseImage},set:function(t){var e=this;this._thumbBaseImage!==t&&(this._thumbBaseImage=t,this.isVertical&&0!==this.num90RotationInVerticalMode?t.isLoaded?(this._thumbImage=t._rotate90(-this.num90RotationInVerticalMode,!0),this._markAsDirty()):t.onImageLoadedObservable.addOnce((function(){var i=t._rotate90(-e.num90RotationInVerticalMode,!0);e._thumbImage=i,i.isLoaded||i.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),e._markAsDirty()})):(this._thumbImage=t,t&&!t.isLoaded&&t.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(t){this._thumbLength!==t&&(this._thumbLength=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(t){this._thumbLength!==t&&(this._thumbHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(t){this._barImageHeight!==t&&(this._barImageHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"ImageScrollBar"},e.prototype._getThumbThickness=function(){return this._thumbWidth.isPixel?this._thumbWidth.getValue(this._host):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)},e.prototype._draw=function(t){t.save(),this._applyStates(t),this._prepareRenderingData("rectangle");var e=this._getThumbPosition(),i=this._renderLeft,o=this._renderTop,r=this._renderWidth,n=this._renderHeight;this._backgroundImage&&(this._tempMeasure.copyFromFloats(i,o,r,n),this.isVertical?(this._tempMeasure.copyFromFloats(i+r*(1-this._barImageHeight)*.5,this._currentMeasure.top,r*this._barImageHeight,n),this._tempMeasure.height+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)):(this._tempMeasure.copyFromFloats(this._currentMeasure.left,o+n*(1-this._barImageHeight)*.5,r,n*this._barImageHeight),this._tempMeasure.width+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)),this._backgroundImage._draw(t)),this.isVertical?this._tempMeasure.copyFromFloats(i-this._effectiveBarOffset+this._currentMeasure.width*(1-this._thumbHeight)*.5,this._currentMeasure.top+e,this._currentMeasure.width*this._thumbHeight,this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(this._currentMeasure.left+e,this._currentMeasure.top+this._currentMeasure.height*(1-this._thumbHeight)*.5,this._effectiveThumbThickness,this._currentMeasure.height*this._thumbHeight),this._thumbImage&&(this._thumbImage._currentMeasure.copyFrom(this._tempMeasure),this._thumbImage._draw(t)),t.restore()},e.prototype._updateValueFromPointer=function(t,e){0!=this.rotation&&(this._invertTransformMatrix.transformCoordinates(t,e,this._transformedPosition),t=this._transformedPosition.x,e=this._transformedPosition.y);var i=this._invertScrollDirection?-1:1;this._first&&(this._first=!1,this._originX=t,this._originY=e,(tthis._tempMeasure.left+this._tempMeasure.width||ethis._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(e-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(t-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var o;o=this.isVertical?-(e-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness):(t-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=i*o*(this.maximum-this.minimum),this._originX=t,this._originY=e},e.prototype._onPointerDown=function(e,i,o,r,n){return this._first=!0,t.prototype._onPointerDown.call(this,e,i,o,r,n)},h([(0,d.serialize)()],e.prototype,"num90RotationInVerticalMode",void 0),h([(0,d.serialize)()],e.prototype,"invertScrollDirection",null),e}(G),tt=function(t){function e(e,i){var o=t.call(this,e)||this;return o._barSize=20,o._pointerIsOver=!1,o._wheelPrecision=.05,o._thumbLength=.5,o._thumbHeight=1,o._barImageHeight=1,o._horizontalBarImageHeight=1,o._verticalBarImageHeight=1,o._oldWindowContentsWidth=0,o._oldWindowContentsHeight=0,o._forceHorizontalBar=!1,o._forceVerticalBar=!1,o._useImageBar=i||!1,o.onDirtyObservable.add((function(){o._horizontalBarSpace.color=o.color,o._verticalBarSpace.color=o.color,o._dragSpace.color=o.color})),o.onPointerEnterObservable.add((function(){o._pointerIsOver=!0})),o.onPointerOutObservable.add((function(){o._pointerIsOver=!1})),o._grid=new D,o._useImageBar?(o._horizontalBar=new $,o._verticalBar=new $):(o._horizontalBar=new J,o._verticalBar=new J),o._window=new q("scrollViewer_window"),o._window.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._window.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._grid.addColumnDefinition(1),o._grid.addColumnDefinition(0,!0),o._grid.addRowDefinition(1),o._grid.addRowDefinition(0,!0),t.prototype.addControl.call(o,o._grid),o._grid.addControl(o._window,0,0),o._verticalBarSpace=new T,o._verticalBarSpace.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._verticalBarSpace.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._verticalBarSpace.thickness=1,o._grid.addControl(o._verticalBarSpace,0,1),o._addBar(o._verticalBar,o._verticalBarSpace,!0,Math.PI),o._horizontalBarSpace=new T,o._horizontalBarSpace.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._horizontalBarSpace.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._horizontalBarSpace.thickness=1,o._grid.addControl(o._horizontalBarSpace,1,0),o._addBar(o._horizontalBar,o._horizontalBarSpace,!1,0),o._dragSpace=new T,o._dragSpace.thickness=1,o._grid.addControl(o._dragSpace,1,1),o._grid.clipChildren=!1,o._useImageBar||(o.barColor="grey",o.barBackground="transparent"),o}return l(e,t),Object.defineProperty(e.prototype,"horizontalBar",{get:function(){return this._horizontalBar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalBar",{get:function(){return this._verticalBar},enumerable:!1,configurable:!0}),e.prototype.addControl=function(t){return t?(this._window.addControl(t),this):this},e.prototype.removeControl=function(t){return this._window.removeControl(t),this},Object.defineProperty(e.prototype,"children",{get:function(){return this._window.children},enumerable:!1,configurable:!0}),e.prototype._flagDescendantsAsMatrixDirty=function(){for(var t=0,e=this._children;t1&&(t=1),this._wheelPrecision=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollBackground",{get:function(){return this._horizontalBarSpace.background},set:function(t){this._horizontalBarSpace.background!==t&&(this._horizontalBarSpace.background=t,this._verticalBarSpace.background=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barColor",{get:function(){return this._barColor},set:function(t){this._barColor!==t&&(this._barColor=t,this._horizontalBar.color=t,this._verticalBar.color=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbImage",{get:function(){return this._barImage},set:function(t){if(this._barImage!==t){this._barImage=t;var e=this._horizontalBar,i=this._verticalBar;e.thumbImage=t,i.thumbImage=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalThumbImage",{get:function(){return this._horizontalBarImage},set:function(t){this._horizontalBarImage!==t&&(this._horizontalBarImage=t,this._horizontalBar.thumbImage=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalThumbImage",{get:function(){return this._verticalBarImage},set:function(t){this._verticalBarImage!==t&&(this._verticalBarImage=t,this._verticalBar.thumbImage=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barSize",{get:function(){return this._barSize},set:function(t){this._barSize!==t&&(this._barSize=t,this._markAsDirty(),this._horizontalBar.isVisible&&this._grid.setRowDefinition(1,this._barSize,!0),this._verticalBar.isVisible&&this._grid.setColumnDefinition(1,this._barSize,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(t){if(this._thumbLength!==t){t<=0&&(t=.1),t>1&&(t=1),this._thumbLength=t;var e=this._horizontalBar,i=this._verticalBar;e.thumbLength=t,i.thumbLength=t,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(t){if(this._thumbHeight!==t){t<=0&&(t=.1),t>1&&(t=1),this._thumbHeight=t;var e=this._horizontalBar,i=this._verticalBar;e.thumbHeight=t,i.thumbHeight=t,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(t){if(this._barImageHeight!==t){t<=0&&(t=.1),t>1&&(t=1),this._barImageHeight=t;var e=this._horizontalBar,i=this._verticalBar;e.barImageHeight=t,i.barImageHeight=t,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalBarImageHeight",{get:function(){return this._horizontalBarImageHeight},set:function(t){this._horizontalBarImageHeight!==t&&(t<=0&&(t=.1),t>1&&(t=1),this._horizontalBarImageHeight=t,this._horizontalBar.barImageHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalBarImageHeight",{get:function(){return this._verticalBarImageHeight},set:function(t){this._verticalBarImageHeight!==t&&(t<=0&&(t=.1),t>1&&(t=1),this._verticalBarImageHeight=t,this._verticalBar.barImageHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barBackground",{get:function(){return this._barBackground},set:function(t){if(this._barBackground!==t){this._barBackground=t;var e=this._horizontalBar,i=this._verticalBar;e.background=t,i.background=t,this._dragSpace.background=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barImage",{get:function(){return this._barBackgroundImage},set:function(t){this._barBackgroundImage=t;var e=this._horizontalBar,i=this._verticalBar;e.backgroundImage=t,i.backgroundImage=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalBarImage",{get:function(){return this._horizontalBarBackgroundImage},set:function(t){this._horizontalBarBackgroundImage=t,this._horizontalBar.backgroundImage=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalBarImage",{get:function(){return this._verticalBarBackgroundImage},set:function(t){this._verticalBarBackgroundImage=t,this._verticalBar.backgroundImage=t},enumerable:!1,configurable:!0}),e.prototype._setWindowPosition=function(t){void 0===t&&(t=!0);var e=this.host.idealRatio,i=this._window._currentMeasure.width,o=this._window._currentMeasure.height;if(t||this._oldWindowContentsWidth!==i||this._oldWindowContentsHeight!==o){this._oldWindowContentsWidth=i,this._oldWindowContentsHeight=o;var r=this._clientWidth-i,n=this._clientHeight-o,a=this._horizontalBar.value/e*r+"px",s=this._verticalBar.value/e*n+"px";a!==this._window.left&&(this._window.left=a,this.freezeControls||(this._rebuildLayout=!0)),s!==this._window.top&&(this._window.top=s,this.freezeControls||(this._rebuildLayout=!0))}},e.prototype._updateScroller=function(){var t=this._window._currentMeasure.width,e=this._window._currentMeasure.height;this._horizontalBar.isVisible&&t<=this._clientWidth&&!this.forceHorizontalBar?(this._grid.setRowDefinition(1,0,!0),this._horizontalBar.isVisible=!1,this._horizontalBar.value=0,this._rebuildLayout=!0):!this._horizontalBar.isVisible&&(t>this._clientWidth||this.forceHorizontalBar)&&(this._grid.setRowDefinition(1,this._barSize,!0),this._horizontalBar.isVisible=!0,this._rebuildLayout=!0),this._verticalBar.isVisible&&e<=this._clientHeight&&!this.forceVerticalBar?(this._grid.setColumnDefinition(1,0,!0),this._verticalBar.isVisible=!1,this._verticalBar.value=0,this._rebuildLayout=!0):!this._verticalBar.isVisible&&(e>this._clientHeight||this.forceVerticalBar)&&(this._grid.setColumnDefinition(1,this._barSize,!0),this._verticalBar.isVisible=!0,this._rebuildLayout=!0),this._buildClientSizes();var i=this.host.idealRatio;this._horizontalBar.thumbWidth=.9*this._thumbLength*(this._clientWidth/i)+"px",this._verticalBar.thumbWidth=.9*this._thumbLength*(this._clientHeight/i)+"px"},e.prototype._link=function(e){t.prototype._link.call(this,e),this._attachWheel()},e.prototype._addBar=function(t,e,i,o){var r=this;t.paddingLeft=0,t.width="100%",t.height="100%",t.barOffset=0,t.value=0,t.maximum=1,t.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,t.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,t.isVertical=i,t.rotation=o,t.isVisible=!1,e.addControl(t),t.onValueChangedObservable.add((function(){r._setWindowPosition()}))},e.prototype._attachWheel=function(){var t=this;this._host&&!this._onWheelObserver&&(this._onWheelObserver=this.onWheelObservable.add((function(e){t._pointerIsOver&&!t.isReadOnly&&(1==t._verticalBar.isVisible&&(e.y<0&&t._verticalBar.value>0?t._verticalBar.value-=t._wheelPrecision:e.y>0&&t._verticalBar.value0&&t._horizontalBar.value>0&&(t._horizontalBar.value-=t._wheelPrecision)))})))},e.prototype._renderHighlightSpecific=function(e){this.isHighlighted&&(t.prototype._renderHighlightSpecific.call(this,e),this._grid._renderHighlightSpecific(e),e.restore())},e.prototype.dispose=function(){this.onWheelObservable.remove(this._onWheelObserver),this._onWheelObserver=null,t.prototype.dispose.call(this)},h([(0,d.serialize)()],e.prototype,"wheelPrecision",null),h([(0,d.serialize)()],e.prototype,"scrollBackground",null),h([(0,d.serialize)()],e.prototype,"barColor",null),h([(0,d.serialize)()],e.prototype,"barSize",null),h([(0,d.serialize)()],e.prototype,"barBackground",null),e}(T);(0,d.RegisterClass)("BABYLON.GUI.ScrollViewer",tt);var et=function(t){function e(e,i){var o=t.call(this,e)||this;o.name=e,o.onIsActiveChangedObservable=new d.Observable,o.delegatePickingToChildren=!1,o._isActive=!1,o.group=null!=i?i:"",o.thickness=0,o.isPointerBlocker=!0;var r=null;return o.toActiveAnimation=function(){o.thickness=1},o.toInactiveAnimation=function(){o.thickness=0},o.pointerEnterActiveAnimation=function(){r=o.alpha,o.alpha-=.1},o.pointerOutActiveAnimation=function(){null!==r&&(o.alpha=r)},o.pointerDownActiveAnimation=function(){o.scaleX-=.05,o.scaleY-=.05},o.pointerUpActiveAnimation=function(){o.scaleX+=.05,o.scaleY+=.05},o.pointerEnterInactiveAnimation=function(){r=o.alpha,o.alpha-=.1},o.pointerOutInactiveAnimation=function(){null!==r&&(o.alpha=r)},o.pointerDownInactiveAnimation=function(){o.scaleX-=.05,o.scaleY-=.05},o.pointerUpInactiveAnimation=function(){o.scaleX+=.05,o.scaleY+=.05},o}return l(e,t),Object.defineProperty(e.prototype,"group",{get:function(){return this._group},set:function(t){this._group!==t&&(this._group=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(t){var e,i,o=this;this._isActive!==t&&(this._isActive=t,this._isActive?null===(e=this.toActiveAnimation)||void 0===e||e.call(this):null===(i=this.toInactiveAnimation)||void 0===i||i.call(this),this._markAsDirty(),this.onIsActiveChangedObservable.notifyObservers(t),this._isActive&&this._host&&this._group&&this._host.executeOnAllControls((function(t){if("ToggleButton"===t.typeName){if(t===o)return;var e=t;e.group===o.group&&(e.isActive=!1)}})))},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"ToggleButton"},e.prototype._processPicking=function(e,i,o,r,n,a,s,l){if(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this.notRenderable)return!1;if(!t.prototype.contains.call(this,e,i))return!1;if(this.delegatePickingToChildren){for(var _=!1,h=this._children.length-1;h>=0;h--){var c=this._children[h];if(c.isEnabled&&c.isHitTestVisible&&c.isVisible&&!c.notRenderable&&c.contains(e,i)){_=!0;break}}if(!_)return!1}return this._processObservables(r,e,i,o,n,a,s,l),!0},e.prototype._onPointerEnter=function(e,i){return!!t.prototype._onPointerEnter.call(this,e,i)&&(this.isReadOnly||(this._isActive?this.pointerEnterActiveAnimation&&this.pointerEnterActiveAnimation():this.pointerEnterInactiveAnimation&&this.pointerEnterInactiveAnimation()),!0)},e.prototype._onPointerOut=function(e,i,o){void 0===o&&(o=!1),this.isReadOnly||(this._isActive?this.pointerOutActiveAnimation&&this.pointerOutActiveAnimation():this.pointerOutInactiveAnimation&&this.pointerOutInactiveAnimation()),t.prototype._onPointerOut.call(this,e,i,o)},e.prototype._onPointerDown=function(e,i,o,r,n){return!!t.prototype._onPointerDown.call(this,e,i,o,r,n)&&(this.isReadOnly||(this._isActive?this.pointerDownActiveAnimation&&this.pointerDownActiveAnimation():this.pointerDownInactiveAnimation&&this.pointerDownInactiveAnimation()),!0)},e.prototype._onPointerUp=function(e,i,o,r,n,a){this.isReadOnly||(this._isActive?this.pointerUpActiveAnimation&&this.pointerUpActiveAnimation():this.pointerUpInactiveAnimation&&this.pointerUpInactiveAnimation()),t.prototype._onPointerUp.call(this,e,i,o,r,n,a)},e}(T);(0,d.RegisterClass)("BABYLON.GUI.ToggleButton",et);var it=function(){},ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onKeyPressObservable=new d.Observable,e.defaultButtonWidth="40px",e.defaultButtonHeight="40px",e.defaultButtonPaddingLeft="2px",e.defaultButtonPaddingRight="2px",e.defaultButtonPaddingTop="2px",e.defaultButtonPaddingBottom="2px",e.defaultButtonColor="#DDD",e.defaultButtonBackground="#070707",e.shiftButtonColor="#7799FF",e.selectedShiftThickness=1,e.shiftState=0,e._currentlyConnectedInputText=null,e._connectedInputTexts=[],e._onKeyPressObserver=null,e}return l(e,t),e.prototype._getTypeName=function(){return"VirtualKeyboard"},e.prototype._createKey=function(t,e){var i=this,o=R.CreateSimpleButton(t,t);return o.width=e&&e.width?e.width:this.defaultButtonWidth,o.height=e&&e.height?e.height:this.defaultButtonHeight,o.color=e&&e.color?e.color:this.defaultButtonColor,o.background=e&&e.background?e.background:this.defaultButtonBackground,o.paddingLeft=e&&e.paddingLeft?e.paddingLeft:this.defaultButtonPaddingLeft,o.paddingRight=e&&e.paddingRight?e.paddingRight:this.defaultButtonPaddingRight,o.paddingTop=e&&e.paddingTop?e.paddingTop:this.defaultButtonPaddingTop,o.paddingBottom=e&&e.paddingBottom?e.paddingBottom:this.defaultButtonPaddingBottom,o.thickness=0,o.isFocusInvisible=!0,o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY,o.onPointerUpObservable.add((function(){i.onKeyPressObservable.notifyObservers(t)})),o},e.prototype.addKeysRow=function(t,e){var i=new w;i.isVertical=!1,i.isFocusInvisible=!0;for(var o=null,r=0;ro.heightInPixels)&&(o=a),i.addControl(a)}i.height=o?o.height:this.defaultButtonHeight,this.addControl(i)},e.prototype.applyShiftState=function(t){if(this.children)for(var e=0;e1?this.selectedShiftThickness:0),a.text=t>0?a.text.toUpperCase():a.text.toLowerCase()}}}},Object.defineProperty(e.prototype,"connectedInputText",{get:function(){return this._currentlyConnectedInputText},enumerable:!1,configurable:!0}),e.prototype.connect=function(t){var e=this;if(!this._connectedInputTexts.some((function(e){return e.input===t}))){null===this._onKeyPressObserver&&(this._onKeyPressObserver=this.onKeyPressObservable.add((function(t){if(e._currentlyConnectedInputText){switch(e._currentlyConnectedInputText._host.focusedControl=e._currentlyConnectedInputText,t){case"⇧":return e.shiftState++,e.shiftState>2&&(e.shiftState=0),void e.applyShiftState(e.shiftState);case"←":return void(e._currentlyConnectedInputText instanceof A?e._currentlyConnectedInputText.alternativeProcessKey("Backspace"):e._currentlyConnectedInputText.processKey(8));case"↵":return void(e._currentlyConnectedInputText instanceof A?e._currentlyConnectedInputText.alternativeProcessKey("Enter"):e._currentlyConnectedInputText.processKey(13))}e._currentlyConnectedInputText instanceof A?e._currentlyConnectedInputText.alternativeProcessKey("",e.shiftState?t.toUpperCase():t):e._currentlyConnectedInputText.processKey(-1,e.shiftState?t.toUpperCase():t),1===e.shiftState&&(e.shiftState=0,e.applyShiftState(e.shiftState))}}))),this.isVisible=!1,this._currentlyConnectedInputText=t,t._connectedVirtualKeyboard=this;var i=t.onFocusObservable.add((function(){e._currentlyConnectedInputText=t,t._connectedVirtualKeyboard=e,e.isVisible=!0})),o=t.onBlurObservable.add((function(){t._connectedVirtualKeyboard=null,e._currentlyConnectedInputText=null,e.isVisible=!1}));this._connectedInputTexts.push({input:t,onBlurObserver:o,onFocusObserver:i})}},e.prototype.disconnect=function(t){var e=this;if(t){var i=this._connectedInputTexts.filter((function(e){return e.input===t}));1===i.length&&(this._removeConnectedInputObservables(i[0]),this._connectedInputTexts=this._connectedInputTexts.filter((function(e){return e.input!==t})),this._currentlyConnectedInputText===t&&(this._currentlyConnectedInputText=null))}else this._connectedInputTexts.forEach((function(t){e._removeConnectedInputObservables(t)})),this._connectedInputTexts.length=0;0===this._connectedInputTexts.length&&(this._currentlyConnectedInputText=null,this.onKeyPressObservable.remove(this._onKeyPressObserver),this._onKeyPressObserver=null)},e.prototype._removeConnectedInputObservables=function(t){t.input._connectedVirtualKeyboard=null,t.input.onFocusObservable.remove(t.onFocusObserver),t.input.onBlurObservable.remove(t.onBlurObserver)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.disconnect()},e.CreateDefaultLayout=function(t){var i=new e(t);return i.addKeysRow(["1","2","3","4","5","6","7","8","9","0","←"]),i.addKeysRow(["q","w","e","r","t","y","u","i","o","p"]),i.addKeysRow(["a","s","d","f","g","h","j","k","l",";","'","↵"]),i.addKeysRow(["⇧","z","x","c","v","b","n","m",",",".","/"]),i.addKeysRow([" "],[{width:"200px"}]),i},e.prototype._parseFromContent=function(e,i){var o=this;t.prototype._parseFromContent.call(this,e,i);for(var r=0,n=this.children;r0?(h.focusedControl=null,h._focusProperties.index=0,void(h._focusProperties.total=-1)):(h._focusNextElement(e),void t.event.preventDefault())}h._focusedControl&&(t.type===d.KeyboardEventTypes.KEYDOWN&&h._focusedControl.processKeyboard(t.event),t.skipOnPointerObservable=!0)})),h._rootContainer._link(h),h.hasAlpha=!0,c&&u||(h._resizeObserver=r.getEngine().onResizeObservable.add((function(){return h._onResize()})),h._onResize()),h._texture.isReady=!0,h}return l(e,t),Object.defineProperty(e.prototype,"numLayoutCalls",{get:function(){return this._numLayoutCalls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numRenderCalls",{get:function(){return this._numRenderCalls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderScale",{get:function(){return this._renderScale},set:function(t){t!==this._renderScale&&(this._renderScale=t,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background!==t&&(this._background=t,this.markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idealWidth",{get:function(){return this._idealWidth},set:function(t){this._idealWidth!==t&&(this._idealWidth=t,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idealHeight",{get:function(){return this._idealHeight},set:function(t){this._idealHeight!==t&&(this._idealHeight=t,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useSmallestIdeal",{get:function(){return this._useSmallestIdeal},set:function(t){this._useSmallestIdeal!==t&&(this._useSmallestIdeal=t,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderAtIdealSize",{get:function(){return this._renderAtIdealSize},set:function(t){this._renderAtIdealSize!==t&&(this._renderAtIdealSize=t,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idealRatio",{get:function(){var t=0,e=0;return this._idealWidth&&(t=this.getSize().width/this._idealWidth),this._idealHeight&&(e=this.getSize().height/this._idealHeight),this._useSmallestIdeal&&this._idealWidth&&this._idealHeight?window.innerWidth0&&(a=a.add(r.normalize().scale(o/n)))}})),a.length()>0&&(a=a.normalize().scale(i*(null!==(n=t.overlapDeltaMultiplier)&&void 0!==n?n:1)),t.linkOffsetXInPixels+=a.x,t.linkOffsetYInPixels+=a.y)}))},e.prototype.dispose=function(){var e=this.getScene();e&&(this._rootElement=null,e.onBeforeCameraRenderObservable.remove(this._renderObserver),this._resizeObserver&&e.getEngine().onResizeObservable.remove(this._resizeObserver),this._prePointerObserver&&e.onPrePointerObservable.remove(this._prePointerObserver),this._sceneRenderObserver&&e.onBeforeRenderObservable.remove(this._sceneRenderObserver),this._pointerObserver&&e.onPointerObservable.remove(this._pointerObserver),this._preKeyboardObserver&&e.onPreKeyboardObservable.remove(this._preKeyboardObserver),this._canvasPointerOutObserver&&e.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver),this._canvasBlurObserver&&e.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver),this._controlAddedObserver&&this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver),this._controlRemovedObserver&&this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver),this._layerToDispose&&(this._layerToDispose.texture=null,this._layerToDispose.dispose(),this._layerToDispose=null),this._rootContainer.dispose(),this.onClipboardObservable.clear(),this.onControlPickedObservable.clear(),this.onBeginRenderObservable.clear(),this.onEndRenderObservable.clear(),this.onBeginLayoutObservable.clear(),this.onEndLayoutObservable.clear(),this.onGuiReadyObservable.clear(),t.prototype.dispose.call(this))},e.prototype._onResize=function(){var t=this.getScene();if(t){var e=t.getEngine(),i=this.getSize(),o=e.getRenderWidth()*this._renderScale,r=e.getRenderHeight()*this._renderScale;this._renderAtIdealSize&&(this._idealWidth?(r=r*this._idealWidth/o,o=this._idealWidth):this._idealHeight&&(o=o*this._idealHeight/r,r=this._idealHeight)),i.width===o&&i.height===r||(this.scaleTo(o,r),this.markAsDirty(),(this._idealWidth||this._idealHeight)&&this._rootContainer._markAllAsDirty()),this.invalidateRect(0,0,i.width-1,i.height-1)}},e.prototype._getGlobalViewport=function(){var t=this.getSize(),e=this._fullscreenViewport.toGlobal(t.width,t.height),i=Math.round(e.width*(1/this.rootContainer.scaleX)),o=Math.round(e.height*(1/this.rootContainer.scaleY));return e.x+=(e.width-i)/2,e.y+=(e.height-o)/2,e.width=i,e.height=o,e},e.prototype.getProjectedPosition=function(t,e){var i=this.getProjectedPositionWithZ(t,e);return new d.Vector2(i.x,i.y)},e.prototype.getProjectedPositionWithZ=function(t,e){var i=this.getScene();if(!i)return d.Vector3.Zero();var o=this._getGlobalViewport(),r=d.Vector3.Project(t,e,i.getTransformMatrix(),o);return new d.Vector3(r.x,r.y,r.z)},e.prototype._checkUpdate=function(t,i){if(!this._layerToDispose||!t||t.layerMask&this._layerToDispose.layerMask){if(this._isFullscreen&&this._linkedControls.length){var o=this.getScene();if(!o)return;for(var r=this._getGlobalViewport(),n=function(t){if(!t.isVisible)return"continue";var e=t._linkedMesh;if(!e||e.isDisposed())return d.Tools.SetImmediate((function(){t.linkWithMesh(null)})),"continue";var i=e.getBoundingInfo?e.getBoundingInfo().boundingSphere.center:d.Vector3.ZeroReadOnly,n=d.Vector3.Project(i,e.getWorldMatrix(),o.getTransformMatrix(),r);if(n.z<0||n.z>1)return t.notRenderable=!0,"continue";t.notRenderable=!1,a.useInvalidateRectOptimization&&t.invalidateRect(),t._moveToProjectedPosition(n)},a=this,s=0,l=this._linkedControls;sl.width||r>l.height||(t.cameraToUseForPointers=i,e.x=l.x,e.y=l.y,e.width=l.width,e.height=l.height)}))}else n.viewport.toGlobalToRef(a.getRenderWidth(),a.getRenderHeight(),e);else e.x=0,e.y=0,e.width=a.getRenderWidth(),e.height=a.getRenderHeight();var _=o/a.getHardwareScalingLevel()-e.x,h=r/a.getHardwareScalingLevel()-(a.getRenderHeight()-e.y-e.height);if(this._shouldBlockPointer=!1,i){var c=i.event.pointerId||this._defaultMousePointerId;this._doPicking(_,h,i,i.type,c,i.event.button,i.event.deltaX,i.event.deltaY),(this._shouldBlockPointer&&!(i.type&this.skipBlockEvents)||this._capturingControl[c])&&(i.skipOnPointerObservable=!0)}else this._doPicking(_,h,null,d.PointerEventTypes.POINTERMOVE,this._defaultMousePointerId,0);t.cameraToUseForPointers=s},e.prototype.attach=function(){var t=this,e=this.getScene();if(e){var i=new d.Viewport(0,0,0,0);this._prePointerObserver=e.onPrePointerObservable.add((function(o){if((!e.isPointerCaptured(o.event.pointerId)||o.type!==d.PointerEventTypes.POINTERUP||t._capturedPointerIds.has(o.event.pointerId))&&(o.type===d.PointerEventTypes.POINTERMOVE||o.type===d.PointerEventTypes.POINTERUP||o.type===d.PointerEventTypes.POINTERDOWN||o.type===d.PointerEventTypes.POINTERWHEEL||o.type===d.PointerEventTypes.POINTERTAP)){if(o.type===d.PointerEventTypes.POINTERMOVE){if(e.isPointerCaptured(o.event.pointerId))return;o.event.pointerId&&(t._defaultMousePointerId=o.event.pointerId)}t._translateToPicking(e,i,o)}})),this._attachPickingToSceneRender(e,(function(){return t._translateToPicking(e,i,null)}),!1),this._attachToOnPointerOut(e),this._attachToOnBlur(e)}},e.prototype._focusNextElement=function(t){void 0===t&&(t=!0);var e=[];if(this.executeOnAllControls((function(t){t.isFocusInvisible||!t.isVisible||t.tabIndex<0||e.push(t)})),0!==e.length){e.sort((function(t,e){return 0===t.tabIndex?1:0===e.tabIndex?-1:t.tabIndex-e.tabIndex})),this._focusProperties.total=e.length;var i=-1;this._focusedControl?(i=e.indexOf(this._focusedControl)+(t?1:-1))<0?i=e.length-1:i>=e.length&&(i=0):i=t?0:e.length-1,e[i].focus(),this._focusProperties.index=i}},e.prototype.registerClipboardEvents=function(){self.addEventListener("copy",this._onClipboardCopy,!1),self.addEventListener("cut",this._onClipboardCut,!1),self.addEventListener("paste",this._onClipboardPaste,!1)},e.prototype.unRegisterClipboardEvents=function(){self.removeEventListener("copy",this._onClipboardCopy),self.removeEventListener("cut",this._onClipboardCut),self.removeEventListener("paste",this._onClipboardPaste)},e.prototype._transformUvs=function(t){var e,i=this.getTextureMatrix();if(i.isIdentityAs3x2())e=t;else{var o=d.TmpVectors.Matrix[0];i.getRowToRef(0,d.TmpVectors.Vector4[0]),i.getRowToRef(1,d.TmpVectors.Vector4[1]),i.getRowToRef(2,d.TmpVectors.Vector4[2]);var r=d.TmpVectors.Vector4[0],n=d.TmpVectors.Vector4[1],a=d.TmpVectors.Vector4[2];o.setRowFromFloats(0,r.x,r.y,0,0),o.setRowFromFloats(1,n.x,n.y,0,0),o.setRowFromFloats(2,0,0,1,0),o.setRowFromFloats(3,a.x,a.y,0,1),e=d.TmpVectors.Vector2[0],d.Vector2.TransformToRef(t,o,e)}if((this.wrapU===d.Texture.WRAP_ADDRESSMODE||this.wrapU===d.Texture.MIRROR_ADDRESSMODE)&&e.x>1){var s=e.x-Math.trunc(e.x);this.wrapU===d.Texture.MIRROR_ADDRESSMODE&&Math.trunc(e.x)%2==1&&(s=1-s),e.x=s}if((this.wrapV===d.Texture.WRAP_ADDRESSMODE||this.wrapV===d.Texture.MIRROR_ADDRESSMODE)&&e.y>1){var l=e.y-Math.trunc(e.y);this.wrapV===d.Texture.MIRROR_ADDRESSMODE&&Math.trunc(e.x)%2==1&&(l=1-l),e.y=l}return e},e.prototype.attachToMesh=function(t,e){var i=this;void 0===e&&(e=!0);var o=this.getScene();o&&(this._pointerObserver&&o.onPointerObservable.remove(this._pointerObserver),this._pointerObserver=o.onPointerObservable.add((function(e){if(e.type===d.PointerEventTypes.POINTERMOVE||e.type===d.PointerEventTypes.POINTERUP||e.type===d.PointerEventTypes.POINTERDOWN||e.type===d.PointerEventTypes.POINTERWHEEL){e.type===d.PointerEventTypes.POINTERMOVE&&e.event.pointerId&&(i._defaultMousePointerId=e.event.pointerId);var o=e.event.pointerId||i._defaultMousePointerId;if(e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh===t){var r=e.pickInfo.getTextureCoordinates();if(r){r=i._transformUvs(r);var n=i.getSize();i._doPicking(r.x*n.width,(i.applyYInversionOnUpdate?1-r.y:r.y)*n.height,e,e.type,o,e.event.button,e.event.deltaX,e.event.deltaY)}}else if(e.type===d.PointerEventTypes.POINTERUP){if(i._lastControlDown[o]&&i._lastControlDown[o]._forcePointerUp(o),delete i._lastControlDown[o],i.focusedControl){var a=i.focusedControl.keepsFocusWith(),s=!0;if(a)for(var l=0,_=a;l<_.length;l++){var h=_[l];if(i!==h._host){var c=h._host;if(c._lastControlOver[o]&&c._lastControlOver[o].isAscendant(h)){s=!1;break}}}s&&(i.focusedControl=null)}}else e.type===d.PointerEventTypes.POINTERMOVE&&(i._lastControlOver[o]&&i._lastControlOver[o]._onPointerOut(i._lastControlOver[o],e,!0),delete i._lastControlOver[o])}})),t.enablePointerMoveEvents=e,this._attachPickingToSceneRender(o,(function(){var e=i._defaultMousePointerId,r=null==o?void 0:o.pick(o.pointerX,o.pointerY);if(r&&r.hit&&r.pickedMesh===t){var n=r.getTextureCoordinates();if(n){n=i._transformUvs(n);var a=i.getSize();i._doPicking(n.x*a.width,(i.applyYInversionOnUpdate?1-n.y:n.y)*a.height,null,d.PointerEventTypes.POINTERMOVE,e,0)}}else i._lastControlOver[e]&&i._lastControlOver[e]._onPointerOut(i._lastControlOver[e],null,!0),delete i._lastControlOver[e]}),!0),this._attachToOnPointerOut(o),this._attachToOnBlur(o))},e.prototype.moveFocusToControl=function(t){this.focusedControl=t,this._lastPickedControl=t,this._blockNextFocusCheck=!0},e.prototype._manageFocus=function(){if(this._blockNextFocusCheck)return this._blockNextFocusCheck=!1,void(this._lastPickedControl=this._focusedControl);if(this._focusedControl&&this._focusedControl!==this._lastPickedControl){if(this._lastPickedControl.isFocusInvisible)return;this.focusedControl=null}},e.prototype._attachPickingToSceneRender=function(t,e,i){var o=this;this._sceneRenderObserver=t.onBeforeRenderObservable.add((function(){o.checkPointerEveryFrame&&(o._linkedControls.length>0||i)&&e()}))},e.prototype._attachToOnPointerOut=function(t){var e=this;this._canvasPointerOutObserver=t.getEngine().onCanvasPointerOutObservable.add((function(t){e._lastControlOver[t.pointerId]&&e._lastControlOver[t.pointerId]._onPointerOut(e._lastControlOver[t.pointerId],null),delete e._lastControlOver[t.pointerId],e._lastControlDown[t.pointerId]&&e._lastControlDown[t.pointerId]!==e._capturingControl[t.pointerId]&&(e._lastControlDown[t.pointerId]._forcePointerUp(t.pointerId),delete e._lastControlDown[t.pointerId])}))},e.prototype._attachToOnBlur=function(t){var e=this;this._canvasBlurObserver=t.getEngine().onCanvasBlurObservable.add((function(){Object.entries(e._lastControlDown).forEach((function(t){t[1]._onCanvasBlur()})),e.focusedControl=null,e._lastControlDown={}}))},e.prototype.serializeContent=function(){var t=this.getSize(),e={root:{},width:t.width,height:t.height};return this._rootContainer.serialize(e.root),e},e.prototype.parseSerializedObject=function(t,e,i){if(this._rootContainer=I.Parse(t.root,this,i),e){var o=t.width,r=t.height;"number"==typeof o&&"number"==typeof r&&o>=0&&r>=0?this.scaleTo(o,r):this.scaleTo(1920,1080)}},e.prototype.clone=function(t,i){var o=this.getScene();if(!o)return this;var r,n=this.getSize(),a=this.serializeContent();return(r=this._isFullscreen?e.CreateFullscreenUI(null!=t?t:"Clone of "+this.name):i?e.CreateForMesh(i,n.width,n.height):new e(null!=t?t:"Clone of "+this.name,n.width,n.height,o,!this.noMipmap,this.samplingMode)).parseSerializedObject(a),r},e.ParseFromSnippetAsync=function(t,i,o,r){return c(this,void 0,void 0,(function(){var n,a;return u(this,(function(s){switch(s.label){case 0:return n=null!=o?o:e.CreateFullscreenUI("ADT from snippet"),"_BLANK"===t?[2,n]:[4,e._LoadURLContentAsync(e.SnippetUrl+"/"+t.replace(/#/g,"/"),!0)];case 1:return a=s.sent(),n.parseSerializedObject(a,i,r),[2,n]}}))}))},e.prototype.parseFromSnippetAsync=function(t,i,o){return e.ParseFromSnippetAsync(t,i,this,o)},e.ParseFromFileAsync=function(t,i,o,r){return c(this,void 0,void 0,(function(){var n,a;return u(this,(function(s){switch(s.label){case 0:return n=null!=o?o:e.CreateFullscreenUI("ADT from URL"),[4,e._LoadURLContentAsync(t)];case 1:return a=s.sent(),n.parseSerializedObject(a,i,r),[2,n]}}))}))},e.prototype.parseFromURLAsync=function(t,i,o){return e.ParseFromFileAsync(t,i,this,o)},e._LoadURLContentAsync=function(t,e){return void 0===e&&(e=!1),""===t?Promise.reject("No URL provided"):new Promise((function(i,o){var r=new d.WebRequest;r.addEventListener("readystatechange",(function(){if(4==r.readyState)if(200==r.status){var t=void 0;if(e){var n=JSON.parse(JSON.parse(r.responseText).jsonPayload);t=n.encodedGui?new TextDecoder("utf-8").decode((0,d.DecodeBase64ToBinary)(n.encodedGui)):n.gui}else t=r.responseText;var a=JSON.parse(t);i(a)}else o("Unable to load")})),r.open("GET",t),r.send()}))},e._Overlaps=function(t,e){return!(t.centerX>e.centerX+e.widthInPixels||t.centerX+t.widthInPixelse.centerY+e.heightInPixels)},e.CreateForMesh=function(t,i,o,r,n,a,s,l){void 0===i&&(i=1024),void 0===o&&(o=1024),void 0===r&&(r=!0),void 0===n&&(n=!1),void 0===s&&(s=this._CreateMaterial),void 0===l&&(l=d.Texture.TRILINEAR_SAMPLINGMODE);var _=(0,d.RandomGUID)(),h=new e("AdvancedDynamicTexture for ".concat(t.name," [").concat(_,"]"),i,o,t.getScene(),!0,l,a);return s(t,_,h,n),h.attachToMesh(t,r),h},e._CreateMaterial=function(t,e,i,o){var r=(0,d.GetClass)("BABYLON.StandardMaterial");if(!r)throw"StandardMaterial needs to be imported before as it contains a side-effect required by your code.";var n=new r("AdvancedDynamicTextureMaterial for ".concat(t.name," [").concat(e,"]"),t.getScene());n.backFaceCulling=!1,n.diffuseColor=d.Color3.Black(),n.specularColor=d.Color3.Black(),o?(n.diffuseTexture=i,n.emissiveTexture=i,i.hasAlpha=!0):(n.emissiveTexture=i,n.opacityTexture=i),t.material=n},e.CreateForMeshTexture=function(t,i,o,r,n,a){void 0===i&&(i=1024),void 0===o&&(o=1024),void 0===r&&(r=!0),void 0===a&&(a=d.Texture.TRILINEAR_SAMPLINGMODE);var s=new e(t.name+" AdvancedDynamicTexture",i,o,t.getScene(),!0,a,n);return s.attachToMesh(t,r),s},e.CreateFullscreenUI=function(t,i,o,r,n){void 0===i&&(i=!0),void 0===o&&(o=null),void 0===r&&(r=d.Texture.BILINEAR_SAMPLINGMODE),void 0===n&&(n=!1);var a=!o||o._isScene?new e(t,0,0,o,!1,r):new e(t,o),s=a.getScene(),l=new d.Layer(t+"_layer",null,s,!i);if(l.texture=a,a._layerToDispose=l,a._isFullscreen=!0,a.useStandalone&&(l.layerMask=0),n&&s){var _=1/s.getEngine().getHardwareScalingLevel();a._rootContainer.scaleX=_,a._rootContainer.scaleY=_}return a.attach(),a},e.prototype.scale=function(e){t.prototype.scale.call(this,e),this.markAsDirty()},e.prototype.scaleTo=function(e,i){t.prototype.scaleTo.call(this,e,i),this.markAsDirty()},e.prototype._checkGuiIsReady=function(){this.guiIsReady()&&(this.onGuiReadyObservable.notifyObservers(this),this.onGuiReadyObservable.clear())},e.prototype.guiIsReady=function(){return this._rootContainer.isReady()},e.SnippetUrl=d.Constants.SnippetUrl,e.AllowGPUOptimizations=!0,e}(d.DynamicTexture),ut=function(){function t(t){this.texture=t,this._captureRenderTime=!1,this._renderTime=new d.PerfCounter,this._captureLayoutTime=!1,this._layoutTime=new d.PerfCounter,this._onBeginRenderObserver=null,this._onEndRenderObserver=null,this._onBeginLayoutObserver=null,this._onEndLayoutObserver=null}return Object.defineProperty(t.prototype,"renderTimeCounter",{get:function(){return this._renderTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutTimeCounter",{get:function(){return this._layoutTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"captureRenderTime",{get:function(){return this._captureRenderTime},set:function(t){var e=this;t!==this._captureRenderTime&&(this._captureRenderTime=t,t?(this._onBeginRenderObserver=this.texture.onBeginRenderObservable.add((function(){e._renderTime.beginMonitoring()})),this._onEndRenderObserver=this.texture.onEndRenderObservable.add((function(){e._renderTime.endMonitoring(!0)}))):(this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"captureLayoutTime",{get:function(){return this._captureLayoutTime},set:function(t){var e=this;t!==this._captureLayoutTime&&(this._captureLayoutTime=t,t?(this._onBeginLayoutObserver=this.texture.onBeginLayoutObservable.add((function(){e._layoutTime.beginMonitoring()})),this._onEndLayoutObserver=this.texture.onEndLayoutObservable.add((function(){e._layoutTime.endMonitoring(!0)}))):(this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null))},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null,this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null,this.texture=null},t}(),dt=function(t){function e(e,i,o){var r=t.call(this,e,i)||this;if(o){if(!o.useStandalone)throw new Error('AdvancedDynamicTexture "'.concat(e,'": the texture must have been created with the useStandalone property set to true'))}else o=ct.CreateFullscreenUI(e,void 0,{useStandalone:!0});return r._adt=o,r.outputTexture=r._frameGraph.createDanglingHandle(),r}return l(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t,this._adt.disablePicking=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gui",{get:function(){return this._adt},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){return this._adt.guiIsReady()&&this._adt._layerToDispose.isReady()},e.prototype.record=function(){var t=this;if(void 0===this.destinationTexture)throw new Error("FrameGraphGUITask: destinationTexture is required");this._frameGraph.resolveDanglingHandle(this.outputTexture,this.destinationTexture);var e=this._frameGraph.addRenderPass(this.name);e.setRenderTarget(this.outputTexture),e.setExecuteFunc((function(e){t._adt._checkUpdate(null),e.render(t._adt._layerToDispose)}));var i=this._frameGraph.addRenderPass(this.name+"_disabled",!0);i.setRenderTarget(this.outputTexture),i.setExecuteFunc((function(t){}))},e.prototype.dispose=function(){this._adt.dispose(),t.prototype.dispose.call(this)},e}(d.FrameGraphTask),ft=function(t){function e(e,i,o){var r=t.call(this,e,i,o)||this;return r.registerInput("destination",d.NodeRenderGraphBlockConnectionPointTypes.Texture),r.registerOutput("output",d.NodeRenderGraphBlockConnectionPointTypes.BasedOnInput),r.destination.addAcceptedConnectionPointTypes(d.NodeRenderGraphBlockConnectionPointTypes.TextureAll),r.output._typeConnectionSource=r.destination,r._gui=ct.CreateFullscreenUI(r.name,void 0,{useStandalone:!0}),r._frameGraphTask=new dt(r.name,i,r._gui),r}return l(e,t),Object.defineProperty(e.prototype,"task",{get:function(){return this._frameGraphTask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gui",{get:function(){return this._frameGraphTask.gui},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"GUI.NodeRenderGraphGUIBlock"},Object.defineProperty(e.prototype,"destination",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),e.prototype._buildBlock=function(e){t.prototype._buildBlock.call(this,e),this._frameGraphTask.name=this.name,this.output.value=this._frameGraphTask.outputTexture;var i=this.destination.connectedPoint;i&&(this._frameGraphTask.destinationTexture=i.value)},e}(d.NodeRenderGraphBlock);(0,d.RegisterClass)("BABYLON.GUI.NodeRenderGraphGUIBlock",ft);var pt="XmlLoader Exception : XML file is malformed or corrupted.",gt=function(){function t(t){void 0===t&&(t=null),this._nodes={},this._nodeTypes={element:1,attribute:2,text:3},this._isLoaded=!1,this._objectAttributes={textHorizontalAlignment:1,textVerticalAlignment:2,horizontalAlignment:3,verticalAlignment:4,stretch:5},t&&(this._parentClass=t)}return t.prototype._getChainElement=function(t){var e=window;this._parentClass&&(e=this._parentClass);var i=t;i=i.split(".");for(var o=0;o0&&c>u)throw"XmlLoader Exception : In the Grid element, the number of columns is defined in the first row, do not add more columns in the subsequent rows.";if(0==h){if(!n[f].attributes.getNamedItem("width"))throw"XmlLoader Exception : Width must be defined for all the grid columns in the first row";o=Number(n[f].attributes.getNamedItem("width").nodeValue),_=!!n[f].attributes.getNamedItem("isPixel")&&JSON.parse(n[f].attributes.getNamedItem("isPixel").nodeValue),e.addColumnDefinition(o,_)}a=n[f].children;for(var p=0;p1||(this.onPointerEnterObservable.notifyObservers(this,-1,t,this),this.pointerEnterAnimation&&this.pointerEnterAnimation(),0))},t.prototype._onPointerOut=function(t){this._enterCount--,this._enterCount>0||(this._enterCount=0,this.onPointerOutObservable.notifyObservers(this,-1,t,this),this.pointerOutAnimation&&this.pointerOutAnimation())},t.prototype._onPointerDown=function(t,e,i,o){return this._downCount++,this._downPointerIds[i]=this._downPointerIds[i]+1||1,1===this._downCount&&(this.onPointerDownObservable.notifyObservers(new bt(e,o),-1,t,this),this.pointerDownAnimation&&this.pointerDownAnimation(),!0)},t.prototype._onPointerUp=function(t,e,i,o,r){this._downCount--,this._downPointerIds[i]--,this._downPointerIds[i]<=0&&delete this._downPointerIds[i],this._downCount<0?this._downCount=0:0==this._downCount&&(r&&(this._enterCount>0||-1===this._enterCount)&&this.onPointerClickObservable.notifyObservers(new bt(e,o),-1,t,this),this.onPointerUpObservable.notifyObservers(new bt(e,o),-1,t,this),this.pointerUpAnimation&&this.pointerUpAnimation())},t.prototype.forcePointerUp=function(t){if(void 0===t&&(t=null),null!==t)this._onPointerUp(this,d.Vector3.Zero(),t,0,!0);else{for(var e in this._downPointerIds)this._onPointerUp(this,d.Vector3.Zero(),+e,0,!0);this._downCount>0&&(this._downCount=1,this._onPointerUp(this,d.Vector3.Zero(),0,0,!0))}},t.prototype._processObservables=function(t,e,i,o,r){if(this._isTouchButton3D(this)&&i&&(t=this._generatePointerEventType(t,i,this._downCount)),t===d.PointerEventTypes.POINTERMOVE){this._onPointerMove(this,e);var n=this._host._lastControlOver[o];return n&&n!==this&&n._onPointerOut(this),n!==this&&this._onPointerEnter(this),this._host._lastControlOver[o]=this,!0}return t===d.PointerEventTypes.POINTERDOWN?(this._onPointerDown(this,e,o,r),this._host._lastControlDown[o]=this,this._host._lastPickedControl=this,!0):(t===d.PointerEventTypes.POINTERUP||t===d.PointerEventTypes.POINTERDOUBLETAP)&&(this._host._lastControlDown[o]&&this._host._lastControlDown[o]._onPointerUp(this,e,o,r,!0),delete this._host._lastControlDown[o],!0)},t.prototype._disposeNode=function(){this._node&&(this._node.dispose(),this._node=null)},t.prototype.dispose=function(){this.onPointerDownObservable.clear(),this.onPointerEnterObservable.clear(),this.onPointerMoveObservable.clear(),this.onPointerOutObservable.clear(),this.onPointerUpObservable.clear(),this.onPointerClickObservable.clear(),this._disposeNode();for(var t=0,e=this._behaviors;ti));b++);else for(b=0;bi));g++);p=0;for(var m=0,v=this._children;m0,r.BORDER=this.renderBorders,r.HOVERLIGHT=this.renderHoverLight,this._albedoTexture){if(!this._albedoTexture.isReadyOrNotBlocking())return!1;r.TEXTURE=!0}else r.TEXTURE=!1;var n=o.getEngine();if(r.isDirty){r.markAsProcessed(),o.resetCachedMaterial();var a=[d.VertexBuffer.PositionKind];a.push(d.VertexBuffer.NormalKind),a.push(d.VertexBuffer.UVKind);var s=["world","viewProjection","innerGlowColor","albedoColor","borderWidth","edgeSmoothingValue","scaleFactor","borderMinValue","hoverColor","hoverPosition","hoverRadius","textureMatrix"],l=["albedoSampler"],_=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:s,uniformBuffersNames:_,samplers:l,defines:r,maxSimultaneousLights:4});var h=r.toString();e.setEffect(o.getEngine().createEffect("fluent",{attributes:a,uniformsNames:s,uniformBuffersNames:_,samplers:l,defines:h,fallbacks:null,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),r,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(r._renderId=o.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene(),r=i.materialDefines;if(r){var n=i.effect;if(n){if(this._activeEffect=n,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._mustRebind(o,n,i)&&(this._activeEffect.setColor4("albedoColor",this.albedoColor,this.alpha),r.INNERGLOW&&this._activeEffect.setColor4("innerGlowColor",this.innerGlowColor,this.innerGlowColorIntensity),r.BORDER&&(this._activeEffect.setFloat("borderWidth",this.borderWidth),this._activeEffect.setFloat("edgeSmoothingValue",this.edgeSmoothingValue),this._activeEffect.setFloat("borderMinValue",this.borderMinValue),e.getBoundingInfo().boundingBox.extendSize.multiplyToRef(e.scaling,d.TmpVectors.Vector3[0]),this._activeEffect.setVector3("scaleFactor",d.TmpVectors.Vector3[0])),r.HOVERLIGHT&&(this._activeEffect.setDirectColor4("hoverColor",this.hoverColor),this._activeEffect.setFloat("hoverRadius",this.hoverRadius),this._activeEffect.setVector3("hoverPosition",this.hoverPosition)),r.TEXTURE&&this._albedoTexture)){this._activeEffect.setTexture("albedoSampler",this._albedoTexture);var a=this._albedoTexture.getTextureMatrix();this._activeEffect.setMatrix("textureMatrix",a)}this._afterBind(e,this._activeEffect,i)}}},e.prototype.getActiveTextures=function(){return t.prototype.getActiveTextures.call(this)},e.prototype.hasTexture=function(e){return!!t.prototype.hasTexture.call(this,e)},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.GUI.FluentMaterial",e},e.prototype.getClassName=function(){return"FluentMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},h([(0,d.serialize)(),(0,d.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"innerGlowColorIntensity",void 0),h([(0,d.serializeAsColor3)()],e.prototype,"innerGlowColor",void 0),h([(0,d.serializeAsColor3)()],e.prototype,"albedoColor",void 0),h([(0,d.serialize)(),(0,d.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"renderBorders",void 0),h([(0,d.serialize)()],e.prototype,"borderWidth",void 0),h([(0,d.serialize)()],e.prototype,"edgeSmoothingValue",void 0),h([(0,d.serialize)()],e.prototype,"borderMinValue",void 0),h([(0,d.serialize)(),(0,d.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"renderHoverLight",void 0),h([(0,d.serialize)()],e.prototype,"hoverRadius",void 0),h([(0,d.serializeAsColor4)()],e.prototype,"hoverColor",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"hoverPosition",void 0),h([(0,d.serializeAsTexture)("albedoTexture")],e.prototype,"_albedoTexture",void 0),h([(0,d.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],e.prototype,"albedoTexture",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.FluentMaterial",Tt);var St=function(t){function e(e){var i=t.call(this,e)||this;return i._backPlateMargin=1.25,i}return l(e,t),Object.defineProperty(e.prototype,"backPlateMargin",{get:function(){return this._backPlateMargin},set:function(t){var e=this;this._backPlateMargin=t,this._children.length>=1&&(this.children.forEach((function(t){e._updateCurrentMinMax(t.position)})),this._updateMargins())},enumerable:!1,configurable:!0}),e.prototype._createNode=function(t){var e=new d.Mesh("menu_".concat(this.name),t);return this._backPlate=(0,d.CreateBox)("backPlate"+this.name,{size:1},t),this._backPlate.parent=e,e},e.prototype._affectMaterial=function(t){var e=this;this._backPlateMaterial=new Tt(this.name+"backPlateMaterial",t.getScene()),this._backPlateMaterial.albedoColor=new d.Color3(.08,.15,.55),this._backPlateMaterial.renderBorders=!0,this._backPlateMaterial.renderHoverLight=!0,this._pickedPointObserver=this._host.onPickedPointChangedObservable.add((function(t){t?(e._backPlateMaterial.hoverPosition=t,e._backPlateMaterial.hoverColor.a=1):e._backPlateMaterial.hoverColor.a=0})),this._backPlate.material=this._backPlateMaterial},e.prototype._mapGridNode=function(t,e){t.mesh&&(t.position=e.clone(),this._updateCurrentMinMax(e))},e.prototype._finalProcessing=function(){this._updateMargins()},e.prototype._updateCurrentMinMax=function(t){this._currentMin||(this._currentMin=t.clone(),this._currentMax=t.clone()),this._currentMin.minimizeInPlace(t),this._currentMax.maximizeInPlace(t)},e.prototype._updateMargins=function(){if(this._children.length>0){this._currentMin.addInPlaceFromFloats(-this._cellWidth/2,-this._cellHeight/2,0),this._currentMax.addInPlaceFromFloats(this._cellWidth/2,this._cellHeight/2,0);var t=this._currentMax.subtract(this._currentMin);this._backPlate.scaling.x=t.x+this._cellWidth*this.backPlateMargin,this._backPlate.scaling.y=t.y+this._cellHeight*this.backPlateMargin,this._backPlate.scaling.z=.001;for(var e=0;e0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}\nvoid Pick_Radius_B144(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid main()\n{vec3 Nrm_World_Q128;Nrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q131;vec3 Tangent_World_N_Q131;float Tangent_Length_Q131;Tangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q131=length(Tangent_World_Q131);Tangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;vec3 Binormal_World_Q132;vec3 Binormal_World_N_Q132;float Binormal_Length_Q132;Object_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);float Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;vec3 Result_Q177;Result_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));vec3 Result_Q178;Result_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));float Result_Q144;Pick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);vec3 Dir_Q140;PickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);float Radius_Q147;float Line_Width_Q147;RelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);vec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);vec3 New_P_Q129;vec2 New_UV_Q129;float Radial_Gradient_Q129;vec3 Radial_Dir_Q129;Move_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);vec3 Pos_World_Q115;Object_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);vec4 Blob_Info_Q180;\n#if BLOB_ENABLE\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180);\n#else\nBlob_Info_Q180=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q181;\n#if BLOB_ENABLE_2\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181);\n#else\nBlob_Info_Q181=vec4(0,0,0,0);\n#endif\nfloat Gradient1_Q130;float Gradient2_Q130;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130);\n#else\nGradient1_Q130=1.0;Gradient2_Q130=1.0;\n#endif\nvec2 Rect_UV_Q139;vec4 Rect_Parms_Q139;vec2 Scale_XY_Q139;vec2 Line_UV_Q139;Round_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);vec3 Line_Vertex_Q135;Line_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);vec3 Position=Pos_World_Q115;vec3 Normal=Dir_Q140;vec2 UV=Rect_UV_Q139;vec3 Tangent=Line_Vertex_Q135;vec3 Binormal=Nrm_World_Q128;vec4 Color=Out_Color_Q145;vec4 Extra1=Rect_Parms_Q139;vec4 Extra2=Blob_Info_Q180;vec4 Extra3=Blob_Info_Q181;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var Rt=function(t){function e(){var e=t.call(this)||this;return e.BLOB_ENABLE=!0,e.BLOB_ENABLE_2=!0,e.SMOOTH_EDGES=!0,e.IRIDESCENT_MAP_ENABLE=!0,e._needNormals=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),wt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.03,r.lineWidth=.01,r.absoluteSizes=!1,r._filterWidth=1,r.baseColor=new d.Color4(.0392157,.0666667,.207843,1),r.lineColor=new d.Color4(.14902,.133333,.384314,1),r.blobIntensity=.98,r.blobFarSize=.04,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.08,r.blobNearSize=.22,r.blobPulse=0,r.blobFade=0,r.blobNearSize2=.22,r.blobPulse2=0,r.blobFade2=0,r._rate=.135,r.highlightColor=new d.Color4(.98,.98,.98,1),r.highlightWidth=.25,r._highlightTransform=new d.Vector4(1,1,0,0),r._highlight=1,r.iridescenceIntensity=0,r.iridescenceEdgeIntensity=1,r._angle=-45,r.fadeOut=1,r._reflected=!0,r._frequency=1,r._verticalOffset=0,r.globalLeftIndexTipPosition=d.Vector3.Zero(),r._globalLeftIndexTipPosition4=d.Vector4.Zero(),r.globalRightIndexTipPosition=d.Vector3.Zero(),r._globalRightIndexTipPosition4=d.Vector4.Zero(),r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._blobTexture=new d.Texture(e.BLOB_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r._iridescentMap=new d.Texture(e.IM_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new Rt);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Absolute_Sizes_","_Filter_Width_","_Base_Color_","_Line_Color_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Rate_","_Highlight_Color_","_Highlight_Width_","_Highlight_Transform_","_Highlight_","_Iridescence_Intensity_","_Iridescence_Edge_Intensity_","_Angle_","_Fade_Out_","_Reflected_","_Frequency_","_Vertical_Offset_","_Iridescent_Map_","_Use_Global_Left_Index_","_Use_Global_Right_Index_","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position"],h=["_Blob_Texture_","_Iridescent_Map_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("fluentBackplate",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o,r;if(i.materialDefines){var n=i.effect;n&&(this._activeEffect=n,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",null!==(r=null===(o=this.getScene().activeCamera)||void 0===o?void 0:o.position)&&void 0!==r?r:d.Vector3.ZeroReadOnly),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Base_Color_",this.baseColor),this._activeEffect.setDirectColor4("_Line_Color_",this.lineColor),this._activeEffect.setFloat("_Radius_Top_Left_",1),this._activeEffect.setFloat("_Radius_Top_Right_",1),this._activeEffect.setFloat("_Radius_Bottom_Left_",1),this._activeEffect.setFloat("_Radius_Bottom_Right_",1),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setFloat("_Rate_",this._rate),this._activeEffect.setDirectColor4("_Highlight_Color_",this.highlightColor),this._activeEffect.setFloat("_Highlight_Width_",this.highlightWidth),this._activeEffect.setVector4("_Highlight_Transform_",this._highlightTransform),this._activeEffect.setFloat("_Highlight_",this._highlight),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setFloat("_Iridescence_Edge_Intensity_",this.iridescenceEdgeIntensity),this._activeEffect.setFloat("_Angle_",this._angle),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._activeEffect.setFloat("_Reflected_",this._reflected?1:0),this._activeEffect.setFloat("_Frequency_",this._frequency),this._activeEffect.setFloat("_Vertical_Offset_",this._verticalOffset),this._activeEffect.setTexture("_Iridescent_Map_",this._iridescentMap),this._activeEffect.setFloat("_Use_Global_Left_Index_",1),this._activeEffect.setFloat("_Use_Global_Right_Index_",1),this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x,this.globalLeftIndexTipPosition.y,this.globalLeftIndexTipPosition.z,1),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this._globalLeftIndexTipPosition4),this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x,this.globalRightIndexTipPosition.y,this.globalRightIndexTipPosition.z,1),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this._globalRightIndexTipPosition4),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),this._blobTexture.dispose(),this._iridescentMap.dispose()},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.FluentBackplateMaterial",e},e.prototype.getClassName=function(){return"FluentBackplateMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLOB_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png",e.IM_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"absoluteSizes",void 0),h([(0,d.serialize)()],e.prototype,"baseColor",void 0),h([(0,d.serialize)()],e.prototype,"lineColor",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"highlightColor",void 0),h([(0,d.serialize)()],e.prototype,"highlightWidth",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceEdgeIntensity",void 0),h([(0,d.serialize)()],e.prototype,"fadeOut",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalLeftIndexTipPosition",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalRightIndexTipPosition",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.FluentBackplateMaterial",wt);var Mt=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o._shareMaterials=i,o}return l(e,t),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._model.renderingGroupId},set:function(t){this._model.renderingGroupId=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"HolographicBackplate"},e.prototype._createNode=function(t){var i,o=this,r=(0,d.CreateBox)((null!==(i=this.name)&&void 0!==i?i:"HolographicBackplate")+"_CollisionMesh",{width:1,height:1,depth:1},t);return r.isPickable=!0,r.visibility=0,d.SceneLoader.ImportMeshAsync(void 0,e.MODEL_BASE_URL,e.MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.name="".concat(o.name,"_frontPlate"),e.isPickable=!1,e.parent=r,o._material&&(e.material=o._material),o._model=e})),r},e.prototype._createMaterial=function(t){this._material=new wt(this.name+" Material",t.getScene())},e.prototype._affectMaterial=function(t){this._shareMaterials?this._host._touchSharedMaterials.fluentBackplateMaterial?this._material=this._host._touchSharedMaterials.fluentBackplateMaterial:(this._createMaterial(t),this._host._touchSharedMaterials.fluentBackplateMaterial=this._material):this._createMaterial(t)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.shareMaterials||this._material.dispose(),this._model.dispose()},e.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.MODEL_FILENAME="mrtk-fluent-backplate.glb",e}(mt),Et=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o._shareMaterials=!0,o._shareMaterials=i,o.pointerEnterAnimation=function(){o.mesh&&o._frontPlate.setEnabled(!0)},o.pointerOutAnimation=function(){o.mesh&&o._frontPlate.setEnabled(!1)},o}return l(e,t),e.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(t){this._backPlate.renderingGroupId=t,this._textPlate.renderingGroupId=t,this._frontPlate.renderingGroupId=t,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tooltipText",{get:function(){return this._tooltipTextBlock?this._tooltipTextBlock.text:null},set:function(t){var e=this;if(t){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,d.CreatePlane)("",{size:1},this._backPlate._scene);var o=(0,d.CreatePlane)("",{size:1,sideOrientation:d.Mesh.DOUBLESIDE},this._backPlate._scene),r=new d.StandardMaterial("",this._backPlate._scene);r.diffuseColor=d.Color3.FromHexString("#212121"),o.material=r,o.isPickable=!1,this._tooltipMesh.addChild(o),o.position=d.Vector3.Forward(i).scale(.05),this._tooltipMesh.scaling.y=1/3,this._tooltipMesh.position=d.Vector3.Up().scale(.7).add(d.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._backPlate,this._tooltipTexture=ct.CreateForMesh(this._tooltipMesh),this._tooltipTextBlock=new S,this._tooltipTextBlock.scaleY=3,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=130,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new d.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=t)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this._text!==t&&(this._text=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(t){this._imageUrl!==t&&(this._imageUrl=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"HolographicButton"},e.prototype._rebuildContent=function(){this._disposeFacadeTexture();var t=new w;if(t.isVertical=!0,(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var e=new O;e.source=this._imageUrl,e.paddingTop="40px",e.height="180px",e.width="100px",e.paddingBottom="40px",t.addControl(e)}if(this._text){var i=new S;i.text=this._text,i.color="white",i.height="30px",i.fontSize=24,t.addControl(i)}this._frontPlate&&(this.content=t)},e.prototype._createNode=function(e){return this._backPlate=(0,d.CreateBox)(this.name+"BackMesh",{width:1,height:1,depth:.08},e),this._frontPlate=(0,d.CreateBox)(this.name+"FrontMesh",{width:1,height:1,depth:.08},e),this._frontPlate.parent=this._backPlate,this._frontPlate.position=d.Vector3.Forward(e.useRightHandedSystem).scale(-.08),this._frontPlate.isPickable=!1,this._frontPlate.setEnabled(!1),this._textPlate=t.prototype._createNode.call(this,e),this._textPlate.parent=this._backPlate,this._textPlate.position=d.Vector3.Forward(e.useRightHandedSystem).scale(-.08),this._textPlate.isPickable=!1,this._backPlate},e.prototype._applyFacade=function(t){this._plateMaterial.emissiveTexture=t,this._plateMaterial.opacityTexture=t},e.prototype._createBackMaterial=function(t){var e=this;this._backMaterial=new Tt(this.name+"Back Material",t.getScene()),this._backMaterial.renderHoverLight=!0,this._pickedPointObserver=this._host.onPickedPointChangedObservable.add((function(t){t?(e._backMaterial.hoverPosition=t,e._backMaterial.hoverColor.a=1):e._backMaterial.hoverColor.a=0}))},e.prototype._createFrontMaterial=function(t){this._frontMaterial=new Tt(this.name+"Front Material",t.getScene()),this._frontMaterial.innerGlowColorIntensity=0,this._frontMaterial.alpha=.5,this._frontMaterial.renderBorders=!0},e.prototype._createPlateMaterial=function(t){this._plateMaterial=new d.StandardMaterial(this.name+"Plate Material",t.getScene()),this._plateMaterial.specularColor=d.Color3.Black()},e.prototype._affectMaterial=function(t){this._shareMaterials?(this._host._sharedMaterials.backFluentMaterial?this._backMaterial=this._host._sharedMaterials.backFluentMaterial:(this._createBackMaterial(t),this._host._sharedMaterials.backFluentMaterial=this._backMaterial),this._host._sharedMaterials.frontFluentMaterial?this._frontMaterial=this._host._sharedMaterials.frontFluentMaterial:(this._createFrontMaterial(t),this._host._sharedMaterials.frontFluentMaterial=this._frontMaterial)):(this._createBackMaterial(t),this._createFrontMaterial(t)),this._createPlateMaterial(t),this._backPlate.material=this._backMaterial,this._frontPlate.material=this._frontMaterial,this._textPlate.material=this._plateMaterial,this._rebuildContent()},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._disposeTooltip(),this.shareMaterials||(this._backMaterial.dispose(),this._frontMaterial.dispose(),this._plateMaterial.dispose(),this._pickedPointObserver&&(this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._pickedPointObserver=null))},e}(xt);d.ShaderStore.ShadersStore.fluentButtonPixelShader="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform bool _Relative_Width_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool Enable_Fade;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool _Use_Blob_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Holo_Edge_Fragment_B35(\nvec4 Edges,\nfloat Edge_Width,\nout float NotEdge)\n{vec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));vec2 df=fwidth(c)*Edge_Width;vec2 g=clamp(c/df,0.0,1.0);NotEdge=g.x*g.y;}\nvoid Blob_Fragment_B39(\nvec2 UV,\nvec3 Blob_Info,\nsampler2D Blob_Texture,\nout vec4 Blob_Color)\n{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}\nvec2 FilterStep(vec2 Edge,vec2 X)\n{vec2 dX=max(fwidth(X),vec2(0.00001,0.00001));return clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);}\nvoid Wireframe_Fragment_B59(\nvec3 Widths,\nvec2 UV,\nfloat Proximity,\nvec4 Edge_Color,\nout vec4 Wireframe)\n{vec2 c=min(UV,vec2(1.0,1.0)-UV);vec2 g=FilterStep(Widths.xy*0.5,c); \nWireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;}\nvoid Proximity_B53(\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Proximity_Max_Intensity,\nfloat Proximity_Near_Radius,\nvec3 Position,\nvec3 Show_Selection,\nvec4 Extra1,\nfloat Dist_To_Face,\nfloat Intensity,\nout float Proximity)\n{vec2 delta1=Extra1.xy;vec2 delta2=Extra1.zw;float d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);Proximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;}\nvoid To_XYZ_B46(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid main()\n{float NotEdge_Q35;\n#if ENABLE_FADE\nHolo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35);\n#else\nNotEdge_Q35=1.0;\n#endif\nvec4 Blob_Color_Q39;float k=dot(vUV,vUV);vec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);vec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));Blob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));float Is_Quad_Q24;Is_Quad_Q24=vNormal.z;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));float X_Q46;float Y_Q46;float Z_Q46;To_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);float Proximity_Q53;Proximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);vec4 Wireframe_Q59;Wireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);vec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);vec4 Result_Q22;Result_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));vec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;vec4 Out_Color=Final_Color_Q37;float Clip_Threshold=0.0;bool To_sRGB=false;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.fluentButtonVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool _Enable_Fade_;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;void Blob_Vertex_B47(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nvec4 Vx_Color,\nvec2 UV,\nvec3 Face_Center,\nvec2 Face_Size,\nvec2 In_UV,\nfloat Blob_Fade_Length,\nfloat Selection_Fade,\nfloat Selection_Fade_Size,\nfloat Inner_Fade,\nvec3 Active_Face_Center,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nfloat Blob_Enabled,\nout vec3 Out_Position,\nout vec2 Out_UV,\nout vec3 Blob_Info)\n{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal);Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; \nvec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);}\nvec2 ProjectProximity(\nvec3 blobPosition,\nvec3 position,\nvec3 center,\nvec3 dir,\nvec3 xdir,\nvec3 ydir,\nout float vdistance\n)\n{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}\nvoid Proximity_Vertex_B66(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nvec3 Position,\nfloat Proximity_Far_Distance,\nfloat Relative_Scale,\nfloat Proximity_Anisotropy,\nvec3 Up,\nout vec4 Extra1,\nout float Distance_To_Face,\nout float Intensity)\n{vec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));vec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);float distz1,distz2;Extra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;Extra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;Distance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);Intensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);}\nvoid Holo_Edge_Vertex_B44(\nvec3 Incident,\nvec3 Normal,\nvec2 UV,\nvec3 Tangent,\nvec3 Bitangent,\nbool Smooth_Active_Face,\nfloat Active,\nout vec4 Holo_Edges)\n{float NdotI=dot(Incident,Normal);vec2 flip=(UV-vec2(0.5,0.5));float udot=dot(Incident,Tangent)*flip.x*NdotI;float uval=1.0-float(udot>0.0);float vdot=-dot(Incident,Bitangent)*flip.y*NdotI;float vval=1.0-float(vdot>0.0);float Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));uval=mix(uval,max(1.0,uval),Smooth_And_Active); \nvval=mix(vval,max(1.0,vval),Smooth_And_Active);Holo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));}\nvoid Object_To_World_Pos_B13(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Choose_Blob_B38(\nvec4 Vx_Color,\nvec3 Position1,\nvec3 Position2,\nbool Blob_Enable_1,\nbool Blob_Enable_2,\nfloat Near_Size_1,\nfloat Near_Size_2,\nfloat Blob_Inner_Fade_1,\nfloat Blob_Inner_Fade_2,\nfloat Blob_Pulse_1,\nfloat Blob_Pulse_2,\nfloat Blob_Fade_1,\nfloat Blob_Fade_2,\nout vec3 Position,\nout float Near_Size,\nout float Inner_Fade,\nout float Blob_Enable,\nout float Fade,\nout float Pulse)\n{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=float(Blob_Enable_1);float b2=float(Blob_Enable_2);Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}\nvoid Wireframe_Vertex_B51(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Edge_Width,\nvec2 Face_Size,\nout vec3 Wire_Vx_Pos,\nout vec2 UV,\nout vec2 Widths)\n{Widths.xy=Edge_Width/Face_Size;float x=dot(Position,Tangent);float y=dot(Position,Bitangent);float dx=0.5-abs(x);float newx=(0.5-dx*Widths.x*2.0)*sign(x);float dy=0.5-abs(y);float newy=(0.5-dy*Widths.y*2.0)*sign(y);Wire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;UV.x=dot(Wire_Vx_Pos,Tangent)+0.5;UV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;}\nvec2 ramp2(vec2 start,vec2 end,vec2 x)\n{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}\nfloat computeSelection(\nvec3 blobPosition,\nvec3 normal,\nvec3 tangent,\nvec3 bitangent,\nvec3 faceCenter,\nvec2 faceSize,\nfloat selectionFuzz,\nfloat farDistance,\nfloat fadeLength\n)\n{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}\nvoid Selection_Vertex_B48(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec2 Face_Size,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Selection_Fuzz,\nfloat Selected,\nfloat Far_Distance,\nfloat Fade_Length,\nvec3 Active_Face_Dir,\nout float Show_Selection)\n{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float Active=max(0.0,dot(Active_Face_Dir,Normal));Show_Selection=mix(max(select1,select2),1.0,Selected)*Active;}\nvoid Proximity_Visibility_B54(\nfloat Selection,\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Input_Width,\nfloat Proximity_Far_Distance,\nfloat Proximity_Radius,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nout float Width)\n{vec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;float boxMaxSize=length(boxEdges);float d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);vec3 blob1=Proximity_Center-d1*Active_Face_Dir;float d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);vec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;vec3 delta1=blob1-Active_Face_Center;vec3 delta2=blob2-Active_Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));}\nvoid Object_To_World_Dir_B67(\nvec3 Dir_Object,\nout vec3 Dir_World)\n{Dir_World=(world*vec4(Dir_Object,0.0)).xyz;}\nvoid main()\n{vec3 Active_Face_Center_Q49;Active_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));vec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);float Relative_Scale_Q57;\n#if RELATIVE_WIDTH\nRelative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz);\n#else\nRelative_Scale_Q57=1.0;\n#endif\nvec3 Tangent_World_Q30;Tangent_World_Q30=(world*vec4(tangent,0.0)).xyz;vec3 Binormal_World_Q31;Binormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;vec3 Normal_World_Q60;Normal_World_Q60=(world*vec4(normal,0.0)).xyz;vec3 Result_Q18=0.5*normal;vec3 Dir_World_Q67;Object_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);float Product_Q56=_Edge_Width_*Relative_Scale_Q57;vec3 Normal_World_N_Q29=normalize(Normal_World_Q60);vec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);vec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);vec3 Position_Q38;float Near_Size_Q38;float Inner_Fade_Q38;float Blob_Enable_Q38;float Fade_Q38;float Pulse_Q38;Choose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);vec3 Face_Center_Q33;Face_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;vec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));float Show_Selection_Q48;Selection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);vec3 Normalized_Q72=normalize(Dir_World_Q67);float Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));float Width_Q54;Proximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);vec3 Wire_Vx_Pos_Q51;vec2 UV_Q51;vec2 Widths_Q51;Wireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);vec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);vec3 Pos_World_Q13;Object_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);vec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);vec3 Out_Position_Q47;vec2 Out_UV_Q47;vec3 Blob_Info_Q47;Blob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);vec4 Extra1_Q66;float Distance_To_Face_Q66;float Intensity_Q66;Proximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);vec4 Holo_Edges_Q44;Holo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);vec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);vec3 Position=Out_Position_Q47;vec2 UV=Out_UV_Q47;vec3 Tangent=Blob_Info_Q47;vec3 Binormal=Vec3_Q19;vec3 Normal=Vec3_Q27;vec4 Extra1=Extra1_Q66;vec4 Color=Holo_Edges_Q44;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;}";var Ft=function(t){function e(){var e=t.call(this)||this;return e.RELATIVE_WIDTH=!0,e.ENABLE_FADE=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),Dt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.edgeWidth=.04,r.edgeColor=new d.Color4(.592157,.592157,.592157,1),r.proximityMaxIntensity=.45,r.proximityFarDistance=.16,r.proximityNearRadius=1.5,r.proximityAnisotropy=1,r.selectionFuzz=.5,r.selected=0,r.selectionFade=0,r.selectionFadeSize=.3,r.selectedDistance=.08,r.selectedFadeLength=.08,r.blobIntensity=.5,r.blobFarSize=.05,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.08,r.leftBlobEnable=!0,r.leftBlobNearSize=.025,r.leftBlobPulse=0,r.leftBlobFade=1,r.leftBlobInnerFade=.01,r.rightBlobEnable=!0,r.rightBlobNearSize=.025,r.rightBlobPulse=0,r.rightBlobFade=1,r.rightBlobInnerFade=.01,r.activeFaceDir=new d.Vector3(0,0,-1),r.activeFaceUp=new d.Vector3(0,1,0),r.enableFade=!0,r.fadeWidth=1.5,r.smoothActiveFace=!0,r.showFrame=!1,r.useBlobTexture=!0,r.globalLeftIndexTipPosition=d.Vector3.Zero(),r.globalRightIndexTipPosition=d.Vector3.Zero(),r.alphaMode=d.Constants.ALPHA_ADD,r.disableDepthWrite=!0,r.backFaceCulling=!1,r._blobTexture=new d.Texture(e.BLOB_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!0},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new Ft);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!0,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Edge_Width_","_Edge_Color_","_Relative_Width_","_Proximity_Max_Intensity_","_Proximity_Far_Distance_","_Proximity_Near_Radius_","_Proximity_Anisotropy_","_Selection_Fuzz_","_Selected_","_Selection_Fade_","_Selection_Fade_Size_","_Selected_Distance_","_Selected_Fade_Length_","_Blob_Enable_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Inner_Fade_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Enable_2_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Inner_Fade_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Active_Face_Dir_","_Active_Face_Up_","_Enable_Fade_","_Fade_Width_","_Smooth_Active_Face_","_Show_Frame_","_Use_Blob_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],h=["_Blob_Texture_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("fluentButton",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Edge_Width_",this.edgeWidth),this._activeEffect.setColor4("_Edge_Color_",new d.Color3(this.edgeColor.r,this.edgeColor.g,this.edgeColor.b),this.edgeColor.a),this._activeEffect.setFloat("_Proximity_Max_Intensity_",this.proximityMaxIntensity),this._activeEffect.setFloat("_Proximity_Far_Distance_",this.proximityFarDistance),this._activeEffect.setFloat("_Proximity_Near_Radius_",this.proximityNearRadius),this._activeEffect.setFloat("_Proximity_Anisotropy_",this.proximityAnisotropy),this._activeEffect.setFloat("_Selection_Fuzz_",this.selectionFuzz),this._activeEffect.setFloat("_Selected_",this.selected),this._activeEffect.setFloat("_Selection_Fade_",this.selectionFade),this._activeEffect.setFloat("_Selection_Fade_Size_",this.selectionFadeSize),this._activeEffect.setFloat("_Selected_Distance_",this.selectedDistance),this._activeEffect.setFloat("_Selected_Fade_Length_",this.selectedFadeLength),this._activeEffect.setFloat("_Blob_Enable_",this.leftBlobEnable?1:0),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.leftBlobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Inner_Fade_",this.leftBlobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_",this.leftBlobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.leftBlobFade),this._activeEffect.setFloat("_Blob_Enable_2_",this.rightBlobEnable?1:0),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.rightBlobNearSize),this._activeEffect.setFloat("_Blob_Inner_Fade_2_",this.rightBlobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_2_",this.rightBlobPulse),this._activeEffect.setFloat("_Blob_Fade_2_",this.rightBlobFade),this._activeEffect.setVector3("_Active_Face_Dir_",this.activeFaceDir),this._activeEffect.setVector3("_Active_Face_Up_",this.activeFaceUp),this._activeEffect.setFloat("_Fade_Width_",this.fadeWidth),this._activeEffect.setFloat("_Smooth_Active_Face_",this.smoothActiveFace?1:0),this._activeEffect.setFloat("_Show_Frame_",this.showFrame?1:0),this._activeEffect.setFloat("_Use_Blob_Texture_",this.useBlobTexture?1:0),this._activeEffect.setFloat("Use_Global_Left_Index",1),this._activeEffect.setFloat("Use_Global_Right_Index",1),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",new d.Vector4(this.globalLeftIndexTipPosition.x,this.globalLeftIndexTipPosition.y,this.globalLeftIndexTipPosition.z,1)),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",new d.Vector4(this.globalRightIndexTipPosition.x,this.globalRightIndexTipPosition.y,this.globalRightIndexTipPosition.z,1)),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.FluentButtonMaterial",e},e.prototype.getClassName=function(){return"FluentButtonMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLOB_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png",h([(0,d.serialize)()],e.prototype,"edgeWidth",void 0),h([(0,d.serializeAsColor4)()],e.prototype,"edgeColor",void 0),h([(0,d.serialize)()],e.prototype,"proximityMaxIntensity",void 0),h([(0,d.serialize)()],e.prototype,"proximityFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"proximityNearRadius",void 0),h([(0,d.serialize)()],e.prototype,"proximityAnisotropy",void 0),h([(0,d.serialize)()],e.prototype,"selectionFuzz",void 0),h([(0,d.serialize)()],e.prototype,"selected",void 0),h([(0,d.serialize)()],e.prototype,"selectionFade",void 0),h([(0,d.serialize)()],e.prototype,"selectionFadeSize",void 0),h([(0,d.serialize)()],e.prototype,"selectedDistance",void 0),h([(0,d.serialize)()],e.prototype,"selectedFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobEnable",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobPulse",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobFade",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobInnerFade",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobEnable",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobPulse",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobFade",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobInnerFade",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"activeFaceDir",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"activeFaceUp",void 0),h([(0,d.serialize)()],e.prototype,"enableFade",void 0),h([(0,d.serialize)()],e.prototype,"fadeWidth",void 0),h([(0,d.serialize)()],e.prototype,"smoothActiveFace",void 0),h([(0,d.serialize)()],e.prototype,"showFrame",void 0),h([(0,d.serialize)()],e.prototype,"useBlobTexture",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalLeftIndexTipPosition",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalRightIndexTipPosition",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.FluentButtonMaterial",Dt);var kt=function(t){function e(e,i){var o=t.call(this,e)||this;return o._isNearPressed=!1,o._interactionSurfaceHeight=0,o._isToggleButton=!1,o._toggleState=!1,o._toggleButtonCallback=function(){o._onToggle(!o._toggleState)},o.onToggleObservable=new d.Observable,o.collidableFrontDirection=d.Vector3.Zero(),i&&(o.collisionMesh=i),o}return l(e,t),Object.defineProperty(e.prototype,"isActiveNearInteraction",{get:function(){return this._isNearPressed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collidableFrontDirection",{get:function(){if(this._collisionMesh){var t=d.TmpVectors.Vector3[0];return d.Vector3.TransformNormalToRef(this._collidableFrontDirection,this._collisionMesh.getWorldMatrix(),t),t.normalize()}return this._collidableFrontDirection},set:function(t){if(this._collidableFrontDirection=t.normalize(),this._collisionMesh){var e=d.TmpVectors.Matrix[0];e.copyFrom(this._collisionMesh.getWorldMatrix()),e.invert(),d.Vector3.TransformNormalToRef(this._collidableFrontDirection,e,this._collidableFrontDirection),this._collidableFrontDirection.normalize()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collisionMesh",{set:function(t){var e,i=this;this._collisionMesh&&(this._collisionMesh.isNearPickable=!1,(null===(e=this._collisionMesh.reservedDataStore)||void 0===e?void 0:e.GUI3D)&&(this._collisionMesh.reservedDataStore.GUI3D={}),this._collisionMesh.getChildMeshes().forEach((function(t){var e;t.isNearPickable=!1,(null===(e=t.reservedDataStore)||void 0===e?void 0:e.GUI3D)&&(t.reservedDataStore.GUI3D={})}))),this._collisionMesh=t,this._injectGUI3DReservedDataStore(this._collisionMesh).control=this,this._collisionMesh.isNearPickable=!0,this._collisionMesh.getChildMeshes().forEach((function(t){i._injectGUI3DReservedDataStore(t).control=i,t.isNearPickable=!0})),this.collidableFrontDirection=t.forward},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isToggleButton",{get:function(){return this._isToggleButton},set:function(t){t!==this._isToggleButton&&(this._isToggleButton=t,t?this.onPointerUpObservable.add(this._toggleButtonCallback):(this.onPointerUpObservable.removeCallback(this._toggleButtonCallback),this._toggleState&&this._onToggle(!1)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isToggled",{get:function(){return this._toggleState},set:function(t){this._isToggleButton&&this._toggleState!==t&&this._onToggle(t)},enumerable:!1,configurable:!0}),e.prototype._onToggle=function(t){this._toggleState=t,this.onToggleObservable.notifyObservers(t)},e.prototype._isInteractionInFrontOfButton=function(t){return this._getInteractionHeight(t,this._collisionMesh.getAbsolutePosition())>0},e.prototype.getPressDepth=function(t){if(!this._isNearPressed)return 0;var e=this._getInteractionHeight(t,this._collisionMesh.getAbsolutePosition());return this._interactionSurfaceHeight-e},e.prototype._getInteractionHeight=function(t,e){var i=this.collidableFrontDirection;if(0===i.length())return d.Vector3.Distance(t,e);var o=d.Vector3.Dot(e,i);return d.Vector3.Dot(t,i)-o},e.prototype._generatePointerEventType=function(t,e,i){if(t===d.PointerEventTypes.POINTERDOWN||t===d.PointerEventTypes.POINTERMOVE){if(!this._isInteractionInFrontOfButton(e))return d.PointerEventTypes.POINTERMOVE;this._isNearPressed=!0,this._interactionSurfaceHeight=this._getInteractionHeight(e,this._collisionMesh.getAbsolutePosition())}if(t===d.PointerEventTypes.POINTERUP){if(0==i)return d.PointerEventTypes.POINTERMOVE;this._isNearPressed=!1}return t},e.prototype._getTypeName=function(){return"TouchButton3D"},e.prototype._createNode=function(e){return t.prototype._createNode.call(this,e)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.onPointerUpObservable.removeCallback(this._toggleButtonCallback),this.onToggleObservable.clear(),this._collisionMesh&&this._collisionMesh.dispose()},e}(xt),Lt=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o._shareMaterials=!0,o._isBackplateVisible=!0,o._frontPlateDepth=.5,o._backPlateDepth=.04,o._backplateColor=new d.Color3(.08,.15,.55),o._backplateToggledColor=new d.Color3(.25,.4,.95),o._shareMaterials=i,o.pointerEnterAnimation=function(){o._frontMaterial.leftBlobEnable=!0,o._frontMaterial.rightBlobEnable=!0},o.pointerOutAnimation=function(){o._frontMaterial.leftBlobEnable=!1,o._frontMaterial.rightBlobEnable=!1},o.pointerDownAnimation=function(){o._frontPlate&&!o.isActiveNearInteraction&&(o._frontPlate.scaling.z=.2*o._frontPlateDepth,o._frontPlate.position=d.Vector3.Forward(o._frontPlate._scene.useRightHandedSystem).scale((o._frontPlateDepth-.2*o._frontPlateDepth)/2),o._textPlate.position=d.Vector3.Forward(o._textPlate._scene.useRightHandedSystem).scale(-(o._backPlateDepth+.2*o._frontPlateDepth)/2))},o.pointerUpAnimation=function(){o._frontPlate&&(o._frontPlate.scaling.z=o._frontPlateDepth,o._frontPlate.position=d.Vector3.Forward(o._frontPlate._scene.useRightHandedSystem).scale((o._frontPlateDepth-o._frontPlateDepth)/2),o._textPlate.position=d.Vector3.Forward(o._textPlate._scene.useRightHandedSystem).scale(-(o._backPlateDepth+o._frontPlateDepth)/2))},o.onPointerMoveObservable.add((function(t){if(o._frontPlate&&o.isActiveNearInteraction){var e=d.Vector3.Zero();if(o._backPlate.getWorldMatrix().decompose(e,void 0,void 0)){var i=o._getInteractionHeight(t,o._backPlate.getAbsolutePosition())/e.z;i=d.Scalar.Clamp(i-o._backPlateDepth/2,.2*o._frontPlateDepth,o._frontPlateDepth),o._frontPlate.scaling.z=i,o._frontPlate.position=d.Vector3.Forward(o._frontPlate._scene.useRightHandedSystem).scale((o._frontPlateDepth-i)/2),o._textPlate.position=d.Vector3.Forward(o._textPlate._scene.useRightHandedSystem).scale(-(o._backPlateDepth+i)/2)}}})),o._pointerHoverObserver=o.onPointerMoveObservable.add((function(t){o._frontMaterial.globalLeftIndexTipPosition=t})),o}return l(e,t),e.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(t){this._backPlate.renderingGroupId=t,this._textPlate.renderingGroupId=t,this._frontPlate.renderingGroupId=t,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._backPlate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tooltipText",{get:function(){return this._tooltipTextBlock?this._tooltipTextBlock.text:null},set:function(t){var e=this;if(t){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,d.CreatePlane)("",{size:1},this._backPlate._scene);var o=(0,d.CreatePlane)("",{size:1,sideOrientation:d.Mesh.DOUBLESIDE},this._backPlate._scene),r=new d.StandardMaterial("",this._backPlate._scene);r.diffuseColor=d.Color3.FromHexString("#212121"),o.material=r,o.isPickable=!1,this._tooltipMesh.addChild(o),o.position=d.Vector3.Forward(i).scale(.05),this._tooltipMesh.scaling.y=1/3,this._tooltipMesh.position=d.Vector3.Up().scale(.7).add(d.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._backPlate,this._tooltipTexture=ct.CreateForMesh(this._tooltipMesh),this._tooltipTextBlock=new S,this._tooltipTextBlock.scaleY=3,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=130,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new d.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=t)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this._text!==t&&(this._text=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(t){this._imageUrl!==t&&(this._imageUrl=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBackplateVisible",{set:function(t){this.mesh&&this._backMaterial&&(t&&!this._isBackplateVisible?this._backPlate.visibility=1:!t&&this._isBackplateVisible&&(this._backPlate.visibility=0)),this._isBackplateVisible=t},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"TouchHolographicButton"},e.prototype._rebuildContent=function(){this._disposeFacadeTexture();var t=new w;if(t.isVertical=!0,(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var e=new O;e.source=this._imageUrl,e.paddingTop="40px",e.height="180px",e.width="100px",e.paddingBottom="40px",t.addControl(e)}if(this._text){var i=new S;i.text=this._text,i.color="white",i.height="30px",i.fontSize=24,t.addControl(i)}this.content=t},e.prototype._createNode=function(i){var o,r=this;this.name=null!==(o=this.name)&&void 0!==o?o:"TouchHolographicButton";var n=(0,d.CreateBox)("".concat(this.name,"_collisionMesh"),{width:1,height:1,depth:this._frontPlateDepth},i);n.isPickable=!0,n.isNearPickable=!0,n.visibility=0,n.position=d.Vector3.Forward(i.useRightHandedSystem).scale(-this._frontPlateDepth/2),d.SceneLoader.ImportMeshAsync(void 0,e.MODEL_BASE_URL,e.MODEL_FILENAME,i).then((function(t){var e=(0,d.CreateBox)("${this.name}_alphaMesh",{width:1,height:1,depth:1},i);e.isPickable=!1,e.material=new d.StandardMaterial("${this.name}_alphaMesh_material",i),e.material.alpha=.15;var o=t.meshes[1];o.name="".concat(r.name,"_frontPlate"),o.isPickable=!1,o.scaling.z=r._frontPlateDepth,e.parent=o,o.parent=n,r._frontMaterial&&(o.material=r._frontMaterial),r._frontPlate=o})),this._backPlate=(0,d.CreateBox)("".concat(this.name,"_backPlate"),{width:1,height:1,depth:this._backPlateDepth},i),this._backPlate.position=d.Vector3.Forward(i.useRightHandedSystem).scale(this._backPlateDepth/2),this._backPlate.isPickable=!1,this._textPlate=t.prototype._createNode.call(this,i),this._textPlate.name="".concat(this.name,"_textPlate"),this._textPlate.isPickable=!1,this._textPlate.position=d.Vector3.Forward(i.useRightHandedSystem).scale(-this._frontPlateDepth/2),this._backPlate.addChild(n),this._backPlate.addChild(this._textPlate);var a=new d.TransformNode("{this.name}_root",i);return this._backPlate.setParent(a),this.collisionMesh=n,this.collidableFrontDirection=this._backPlate.forward.negate(),a},e.prototype._applyFacade=function(t){this._plateMaterial.emissiveTexture=t,this._plateMaterial.opacityTexture=t,this._plateMaterial.diffuseColor=new d.Color3(.4,.4,.4)},e.prototype._createBackMaterial=function(t){this._backMaterial=new Tt(this.name+"backPlateMaterial",t.getScene()),this._backMaterial.albedoColor=this._backplateColor,this._backMaterial.renderBorders=!0,this._backMaterial.renderHoverLight=!1},e.prototype._createFrontMaterial=function(t){this._frontMaterial=new Dt(this.name+"Front Material",t.getScene())},e.prototype._createPlateMaterial=function(t){this._plateMaterial=new d.StandardMaterial(this.name+"Plate Material",t.getScene()),this._plateMaterial.specularColor=d.Color3.Black()},e.prototype._onToggle=function(e){this._backMaterial&&(this._backMaterial.albedoColor=e?this._backplateToggledColor:this._backplateColor),t.prototype._onToggle.call(this,e)},e.prototype._affectMaterial=function(t){this._shareMaterials?(this._host._touchSharedMaterials.backFluentMaterial?this._backMaterial=this._host._touchSharedMaterials.backFluentMaterial:(this._createBackMaterial(t),this._host._touchSharedMaterials.backFluentMaterial=this._backMaterial),this._host._touchSharedMaterials.frontFluentMaterial?this._frontMaterial=this._host._touchSharedMaterials.frontFluentMaterial:(this._createFrontMaterial(t),this._host._touchSharedMaterials.frontFluentMaterial=this._frontMaterial)):(this._createBackMaterial(t),this._createFrontMaterial(t)),this._createPlateMaterial(t),this._backPlate.material=this._backMaterial,this._textPlate.material=this._plateMaterial,this._isBackplateVisible||(this._backPlate.visibility=0),this._frontPlate&&(this._frontPlate.material=this._frontMaterial),this._rebuildContent()},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._disposeTooltip(),this.onPointerMoveObservable.remove(this._pointerHoverObserver),this.shareMaterials||(this._backMaterial.dispose(),this._frontMaterial.dispose(),this._plateMaterial.dispose(),this._pickedPointObserver&&(this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._pickedPointObserver=null))},e.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.MODEL_FILENAME="mrtk-fluent-button.glb",e}(kt),Nt=function(){function t(){this.followBehaviorEnabled=!1,this.sixDofDragBehaviorEnabled=!0,this.surfaceMagnetismBehaviorEnabled=!0,this._followBehavior=new d.FollowBehavior,this._sixDofDragBehavior=new d.SixDofDragBehavior,this._surfaceMagnetismBehavior=new d.SurfaceMagnetismBehavior}return Object.defineProperty(t.prototype,"name",{get:function(){return"Default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"followBehavior",{get:function(){return this._followBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sixDofDragBehavior",{get:function(){return this._sixDofDragBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surfaceMagnetismBehavior",{get:function(){return this._surfaceMagnetismBehavior},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.attach=function(t,e,i){this._scene=t.getScene(),this.attachedNode=t,this._addObservables(),this._followBehavior.attach(t),this._sixDofDragBehavior.attach(t),this._sixDofDragBehavior.draggableMeshes=e||null,this._sixDofDragBehavior.faceCameraOnDragStart=!0,this._surfaceMagnetismBehavior.attach(t,this._scene),i&&(this._surfaceMagnetismBehavior.meshes=i),this._surfaceMagnetismBehavior.enabled=!1},t.prototype.detach=function(){this.attachedNode=null,this._removeObservables(),this._followBehavior.detach(),this._sixDofDragBehavior.detach(),this._surfaceMagnetismBehavior.detach()},t.prototype._addObservables=function(){var t=this;this._onBeforeRenderObserver=this._scene.onBeforeRenderObservable.add((function(){t._followBehavior._enabled=!t._sixDofDragBehavior.isMoving&&t.followBehaviorEnabled})),this._onDragObserver=this._sixDofDragBehavior.onDragObservable.add((function(e){t._sixDofDragBehavior.disableMovement=t._surfaceMagnetismBehavior.findAndUpdateTarget(e.pickInfo)}))},t.prototype._removeObservables=function(){this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._sixDofDragBehavior.onDragObservable.remove(this._onDragObserver)},t}();d.ShaderStore.ShadersStore.handleVertexShader="precision highp float;attribute vec3 position;uniform vec3 positionOffset;uniform mat4 worldViewProjection;uniform float scale;void main(void) {vec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);gl_Position=worldViewProjection*vPos;}";d.ShaderStore.ShadersStore.handlePixelShader="uniform vec3 color;void main(void) {gl_FragColor=vec4(color,1.0);}";var At,zt=function(t){function e(e,i){var o=t.call(this,e,i,"handle",{attributes:["position"],uniforms:["worldViewProjection","color","scale","positionOffset"],needAlphaBlending:!1,needAlphaTesting:!1})||this;return o._hover=!1,o._drag=!1,o._color=new d.Color3,o._scale=1,o._lastTick=-1,o.animationLength=100,o.hoverColor=new d.Color3(0,.467,.84),o.baseColor=new d.Color3(1,1,1),o.hoverScale=.75,o.baseScale=.35,o.dragScale=.55,o._positionOffset=d.Vector3.Zero(),o._updateInterpolationTarget(),o._lastTick=Date.now(),o._onBeforeRender=o.getScene().onBeforeRenderObservable.add((function(){var t=Date.now(),e=t-o._lastTick,i=o._targetScale-o._scale,r=d.TmpColors.Color3[0].copyFrom(o._targetColor).subtractToRef(o._color,d.TmpColors.Color3[0]);o._scale=o._scale+i*e/o.animationLength,r.scaleToRef(e/o.animationLength,r),o._color.addToRef(r,o._color),o.setColor3("color",o._color),o.setFloat("scale",o._scale),o.setVector3("positionOffset",o._positionOffset),o._lastTick=t})),o}return l(e,t),Object.defineProperty(e.prototype,"hover",{get:function(){return this._hover},set:function(t){this._hover=t,this._updateInterpolationTarget()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drag",{get:function(){return this._drag},set:function(t){this._drag=t,this._updateInterpolationTarget()},enumerable:!1,configurable:!0}),e.prototype._updateInterpolationTarget=function(){this.drag?(this._targetColor=this.hoverColor,this._targetScale=this.dragScale):this.hover?(this._targetColor=this.hoverColor,this._targetScale=this.hoverScale):(this._targetColor=this.baseColor,this._targetScale=this.baseScale)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.getScene().onBeforeRenderObservable.remove(this._onBeforeRender)},e}(d.ShaderMaterial);!function(t){t[t.IDLE=0]="IDLE",t[t.HOVER=1]="HOVER",t[t.DRAG=2]="DRAG"}(At||(At={}));var Qt=function(){function t(t,e){this._state=0,this._materials=[],this._scene=e,this._gizmo=t,this.node=this.createNode(),this.node.reservedDataStore={handle:this}}return Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gizmo",{get:function(){return this._gizmo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hover",{set:function(t){t?this._state|=1:this._state&=-2,this._updateMaterial()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drag",{set:function(t){t?this._state|=2:this._state&=-3,this._updateMaterial()},enumerable:!1,configurable:!0}),t.prototype._createMaterial=function(t){var e=new zt("handle",this._scene);return t&&(e._positionOffset=t),e},t.prototype._updateMaterial=function(){for(var t=this._state,e=0,i=this._materials;ei?this.minDimensions.x/t.x:this.minDimensions.y/t.y}this._dimensions.copyFrom(t).scaleInPlace(e),this._updatePivot(),this._positionElements()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"titleBarHeight",{get:function(){return this._titleBarHeight},set:function(t){this._titleBarHeight=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._titleBar.renderingGroupId},set:function(t){this._titleBar.renderingGroupId=t,this._titleBarTitle.renderingGroupId=t,this._contentPlate.renderingGroupId=t,this._backPlate.renderingGroupId=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this._titleText},set:function(t){this._titleText=t,this._titleTextComponent&&(this._titleTextComponent.text=t)},enumerable:!1,configurable:!0}),e.prototype._applyFacade=function(t){this._contentMaterial.albedoTexture=t,this._resetContentPositionAndZoom(),this._applyContentViewport(),t.attachToMesh(this._contentPlate,!0)},e.prototype._addControl=function(t){t._host=this._host,this._host.utilityLayer&&t._prepareNode(this._host.utilityLayer.utilityLayerScene)},e.prototype._getTypeName=function(){return"HolographicSlate"},e.prototype._positionElements=function(){var t=this._followButton,i=this._closeButton,o=this._titleBar,r=this._titleBarTitle,n=this._contentPlate,a=this._backPlate;if(t&&i&&o){i.scaling.setAll(this.titleBarHeight),t.scaling.setAll(this.titleBarHeight),i.position.copyFromFloats(this.dimensions.x-this.titleBarHeight/2,-this.titleBarHeight/2,0).addInPlace(this.origin),t.position.copyFromFloats(this.dimensions.x-3*this.titleBarHeight/2,-this.titleBarHeight/2,0).addInPlace(this.origin);var s=this.dimensions.y-this.titleBarHeight-this.titleBarMargin,l=n.getScene().useRightHandedSystem;o.scaling.set(this.dimensions.x,this.titleBarHeight,d.Epsilon),r.scaling.set(this.dimensions.x-2*this.titleBarHeight,this.titleBarHeight,d.Epsilon),n.scaling.copyFromFloats(this.dimensions.x,s,d.Epsilon),a.scaling.copyFromFloats(this.dimensions.x,s,d.Epsilon),o.position.copyFromFloats(this.dimensions.x/2,-this.titleBarHeight/2,0).addInPlace(this.origin),r.position.copyFromFloats(this.dimensions.x/2-this.titleBarHeight,-this.titleBarHeight/2,l?d.Epsilon:-d.Epsilon).addInPlace(this.origin),n.position.copyFromFloats(this.dimensions.x/2,-(this.titleBarHeight+this.titleBarMargin+s/2),0).addInPlace(this.origin),a.position.copyFromFloats(this.dimensions.x/2,-(this.titleBarHeight+this.titleBarMargin+s/2),l?-d.Epsilon:d.Epsilon).addInPlace(this.origin),this._titleTextComponent.host.scaleTo(e._DEFAULT_TEXT_RESOLUTION_Y*r.scaling.x/r.scaling.y,e._DEFAULT_TEXT_RESOLUTION_Y);var _=this.dimensions.x/s;this._contentViewport.width=this._contentScaleRatio,this._contentViewport.height=this._contentScaleRatio/_,this._applyContentViewport(),this._gizmo&&this._gizmo.updateBoundingBox()}},e.prototype._applyContentViewport=function(){var t;if((null===(t=this._contentPlate)||void 0===t?void 0:t.material)&&this._contentPlate.material.albedoTexture){var e=this._contentPlate.material.albedoTexture;e.uScale=this._contentScaleRatio,e.vScale=this.fitContentToDimensions?this._contentScaleRatio:this._contentScaleRatio/this._contentViewport.width*this._contentViewport.height,e.uOffset=this._contentViewport.x,e.vOffset=this._contentViewport.y}},e.prototype._resetContentPositionAndZoom=function(){this._contentViewport.x=0,this._contentViewport.y=0,this._contentScaleRatio=1},e.prototype._updatePivot=function(){if(this.mesh){var t=new d.Vector3(.5*this.dimensions.x,.5*-this.dimensions.y,d.Epsilon);t.addInPlace(this.origin),t.z=0;var e=new d.Vector3(0,0,0);d.Vector3.TransformCoordinatesToRef(e,this.mesh.computeWorldMatrix(!0),e),this.mesh.setPivotPoint(t);var i=new d.Vector3(0,0,0);d.Vector3.TransformCoordinatesToRef(i,this.mesh.computeWorldMatrix(!0),i),this.mesh.position.addInPlace(e).subtractInPlace(i)}},e.prototype._createNode=function(t){var i=this,o=new d.Mesh("slate_"+this.name,t);this._titleBar=(0,d.CreateBox)("titleBar_"+this.name,{size:1},t),this._titleBarTitle=(0,d.CreatePlane)("titleText_"+this.name,{size:1},t),this._titleBarTitle.parent=o,this._titleBarTitle.isPickable=!1;var r=ct.CreateForMesh(this._titleBarTitle);if(this._titleTextComponent=new S("titleText_"+this.name,this._titleText),this._titleTextComponent.textWrapping=2,this._titleTextComponent.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,this._titleTextComponent.color="white",this._titleTextComponent.fontSize=e._DEFAULT_TEXT_RESOLUTION_Y/2,this._titleTextComponent.paddingLeft=e._DEFAULT_TEXT_RESOLUTION_Y/4,r.addControl(this._titleTextComponent),t.useRightHandedSystem){var n=new d.Vector4(0,0,1,1);this._contentPlate=(0,d.CreatePlane)("contentPlate_"+this.name,{size:1,sideOrientation:d.VertexData.BACKSIDE,frontUVs:n},t),this._backPlate=(0,d.CreatePlane)("backPlate_"+this.name,{size:1,sideOrientation:d.VertexData.FRONTSIDE},t)}else n=new d.Vector4(0,0,1,1),this._contentPlate=(0,d.CreatePlane)("contentPlate_"+this.name,{size:1,sideOrientation:d.VertexData.FRONTSIDE,frontUVs:n},t),this._backPlate=(0,d.CreatePlane)("backPlate_"+this.name,{size:1,sideOrientation:d.VertexData.BACKSIDE},t);this._titleBar.parent=o,this._titleBar.isNearGrabbable=!0,this._contentPlate.parent=o,this._backPlate.parent=o,this._attachContentPlateBehavior(),this._addControl(this._followButton),this._addControl(this._closeButton);var a=this._followButton,s=this._closeButton;return a.node.parent=o,s.node.parent=o,this._positionElements(),this._followButton.imageUrl=e.ASSETS_BASE_URL+e.FOLLOW_ICON_FILENAME,this._closeButton.imageUrl=e.ASSETS_BASE_URL+e.CLOSE_ICON_FILENAME,this._followButton.isBackplateVisible=!1,this._closeButton.isBackplateVisible=!1,this._followButton.onToggleObservable.add((function(t){i._defaultBehavior.followBehaviorEnabled=t,i._defaultBehavior.followBehaviorEnabled&&i._defaultBehavior.followBehavior.recenter()})),this._closeButton.onPointerClickObservable.add((function(){i.dispose()})),o.rotationQuaternion=d.Quaternion.Identity(),o.isVisible=!1,o},e.prototype._attachContentPlateBehavior=function(){var t=this;this._contentDragBehavior.attach(this._contentPlate),this._contentDragBehavior.moveAttached=!1,this._contentDragBehavior.useObjectOrientationForDragging=!0,this._contentDragBehavior.updateDragPlane=!1;var e,i,o=new d.Vector3,r=new d.Vector3,n=new d.Vector3,a=new d.Vector3,s=new d.Vector2;this._contentDragBehavior.onDragStartObservable.add((function(s){t.node&&(e=t._contentViewport.clone(),i=t.node.computeWorldMatrix(!0),o.copyFrom(s.dragPlanePoint),r.set(t.dimensions.x,t.dimensions.y,d.Epsilon),r.y-=t.titleBarHeight+t.titleBarMargin,d.Vector3.TransformNormalToRef(r,i,r),n.copyFromFloats(0,1,0),d.Vector3.TransformNormalToRef(n,i,n),a.copyFromFloats(1,0,0),d.Vector3.TransformNormalToRef(a,i,a),n.normalize(),n.scaleInPlace(1/d.Vector3.Dot(n,r)),a.normalize(),a.scaleInPlace(1/d.Vector3.Dot(a,r)))}));var l=new d.Vector3;this._contentDragBehavior.onDragObservable.add((function(i){t.fitContentToDimensions||(l.copyFrom(i.dragPlanePoint),l.subtractInPlace(o),s.copyFromFloats(d.Vector3.Dot(l,a),d.Vector3.Dot(l,n)),t._contentViewport.x=d.Scalar.Clamp(e.x-l.x,0,1-t._contentViewport.width*t._contentScaleRatio),t._contentViewport.y=d.Scalar.Clamp(e.y-l.y,0,1-t._contentViewport.height*t._contentScaleRatio),t._applyContentViewport())}))},e.prototype._affectMaterial=function(t){this._titleBarMaterial=new wt("".concat(this.name," plateMaterial"),t.getScene()),this._contentMaterial=new Tt("".concat(this.name," contentMaterial"),t.getScene()),this._contentMaterial.renderBorders=!0,this._backMaterial=new wt("".concat(this.name," backPlate"),t.getScene()),this._backMaterial.lineWidth=d.Epsilon,this._backMaterial.radius=.005,this._backMaterial.backFaceCulling=!0,this._titleBar.material=this._titleBarMaterial,this._contentPlate.material=this._contentMaterial,this._backPlate.material=this._backMaterial,this._resetContent(),this._applyContentViewport()},e.prototype._prepareNode=function(e){var i=this;t.prototype._prepareNode.call(this,e),this._gizmo=new Ht(this._host.utilityLayer),this._gizmo.attachedSlate=this,this._defaultBehavior=new Nt,this._defaultBehavior.attach(this.node,[this._titleBar]),this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add((function(){i._followButton.isToggled=!1})),this._positionChangedObserver=this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add((function(){i._gizmo.updateBoundingBox()})),this._updatePivot(),this.resetDefaultAspectAndPose(!1)},e.prototype.resetDefaultAspectAndPose=function(t){if(void 0===t&&(t=!0),this._host&&this._host.utilityLayer&&this.node){var e=this._host.utilityLayer.utilityLayerScene,i=e.activeCamera;if(i){var o=i.getWorldMatrix(),r=d.Vector3.TransformNormal(d.Vector3.Backward(e.useRightHandedSystem),o);this.origin.setAll(0),this._gizmo.updateBoundingBox();var n=this.node.getAbsolutePivotPoint();this.node.position.equalsToFloats(0,0,0)&&this.node.position.copyFrom(i.position).subtractInPlace(r).subtractInPlace(n),this.node.rotationQuaternion=d.Quaternion.FromLookDirectionLH(r,new d.Vector3(0,1,0)),t&&(this.dimensions=this.defaultDimensions)}}},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._titleBarMaterial.dispose(),this._contentMaterial.dispose(),this._titleBar.dispose(),this._titleBarTitle.dispose(),this._contentPlate.dispose(),this._backPlate.dispose(),this._followButton.dispose(),this._closeButton.dispose(),this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.remove(this._positionChangedObserver),this._defaultBehavior.detach(),this._gizmo.dispose(),this._contentDragBehavior.detach()},e.ASSETS_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.CLOSE_ICON_FILENAME="IconClose.png",e.FOLLOW_ICON_FILENAME="IconFollowMe.png",e._DEFAULT_TEXT_RESOLUTION_Y=102.4,e}(vt),Ut=function(t){function e(e,i){var o=t.call(this,i)||this;return o._currentMesh=e,o.pointerEnterAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1.1)},o.pointerOutAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/1.1)},o.pointerDownAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(.95)},o.pointerUpAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/.95)},o}return l(e,t),e.prototype._getTypeName=function(){return"MeshButton3D"},e.prototype._createNode=function(t){var e=this;return this._currentMesh.getChildMeshes().forEach((function(t){e._injectGUI3DReservedDataStore(t).control=e})),this._currentMesh},e.prototype._affectMaterial=function(t){},e}(xt),jt=function(t){function e(e){var i=t.call(this,e)||this;return i._isPinned=!1,i._defaultBehavior=new Nt,i._dragObserver=i._defaultBehavior.sixDofDragBehavior.onDragObservable.add((function(){i.isPinned=!0})),i.backPlateMargin=1,i}return l(e,t),Object.defineProperty(e.prototype,"defaultBehavior",{get:function(){return this._defaultBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPinned",{get:function(){return this._isPinned},set:function(t){this._pinButton.isToggled===t?(this._isPinned=t,this._defaultBehavior.followBehaviorEnabled=!t):this._pinButton.isToggled=t},enumerable:!1,configurable:!0}),e.prototype._createPinButton=function(t){var i=this,o=new Lt("pin"+this.name,!1);return o.imageUrl=e._ASSETS_BASE_URL+e._PIN_ICON_FILENAME,o.parent=this,o._host=this._host,o.isToggleButton=!0,o.onToggleObservable.add((function(t){i.isPinned=t})),this._host.utilityLayer&&(o._prepareNode(this._host.utilityLayer.utilityLayerScene),o.scaling.scaleInPlace(St.MENU_BUTTON_SCALE),o.node&&(o.node.parent=t)),o},e.prototype._createNode=function(e){var i=t.prototype._createNode.call(this,e);return this._pinButton=this._createPinButton(i),this.isPinned=!1,this._defaultBehavior.attach(i,[this._backPlate]),this._defaultBehavior.followBehavior.ignoreCameraPitchAndRoll=!0,this._defaultBehavior.followBehavior.pitchOffset=-15,this._defaultBehavior.followBehavior.minimumDistance=.3,this._defaultBehavior.followBehavior.defaultDistance=.4,this._defaultBehavior.followBehavior.maximumDistance=.6,this._backPlate.isNearGrabbable=!0,i.isVisible=!1,i},e.prototype._finalProcessing=function(){t.prototype._finalProcessing.call(this),this._pinButton.position.copyFromFloats((this._backPlate.scaling.x+St.MENU_BUTTON_SCALE)/2,this._backPlate.scaling.y/2,0)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._defaultBehavior.sixDofDragBehavior.onDragObservable.remove(this._dragObserver),this._defaultBehavior.detach()},e._ASSETS_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e._PIN_ICON_FILENAME="IconPin.png",e}(St),Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype._mapGridNode=function(t,e){var i=t.mesh;if(i){t.position=e.clone();var o=d.TmpVectors.Vector3[0];switch(o.copyFrom(e),this.orientation){case Pt.FACEORIGIN_ORIENTATION:case Pt.FACEFORWARD_ORIENTATION:o.addInPlace(new d.Vector3(0,0,1)),i.lookAt(o);break;case Pt.FACEFORWARDREVERSED_ORIENTATION:case Pt.FACEORIGINREVERSED_ORIENTATION:o.addInPlace(new d.Vector3(0,0,-1)),i.lookAt(o)}}},e}(It),Xt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._iteration=100,e}return l(e,t),Object.defineProperty(e.prototype,"iteration",{get:function(){return this._iteration},set:function(t){var e=this;this._iteration!==t&&(this._iteration=t,d.Tools.SetImmediate((function(){e._arrangeChildren()})))},enumerable:!1,configurable:!0}),e.prototype._mapGridNode=function(t,e){var i=t.mesh,o=this._scatterMapping(e);if(i){switch(this.orientation){case Pt.FACEORIGIN_ORIENTATION:case Pt.FACEFORWARD_ORIENTATION:i.lookAt(new d.Vector3(0,0,1));break;case Pt.FACEFORWARDREVERSED_ORIENTATION:case Pt.FACEORIGINREVERSED_ORIENTATION:i.lookAt(new d.Vector3(0,0,-1))}t.position=o}},e.prototype._scatterMapping=function(t){return t.x=(1-2*Math.random())*this._cellWidth,t.y=(1-2*Math.random())*this._cellHeight,t},e.prototype._finalProcessing=function(){for(var t=[],e=0,i=this._children;eo?-1:0}));for(var n=Math.pow(this.margin,2),a=Math.max(this._cellWidth,this._cellHeight),s=d.TmpVectors.Vector2[0],l=d.TmpVectors.Vector3[0],_=0;_0.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }\nreturn C;}\nvoid Sky_Environment_B50(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{Reflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}\nvoid Min_Segment_Distance_B65(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}\nif (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}\nvoid To_XYZ_B74(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Finger_Positions_B64(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}\nvoid VaryHSV_B108(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}\nvoid Remap_Range_B114(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid To_HSV_B75(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Conditional_Float_B36(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Greater_Than_B37(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}\nvoid Remap_Range_B105(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid main()\n{vec2 XY_Q85;XY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q27;vec3 Tangent_World_N_Q27;float Tangent_Length_Q27;Tangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q27=length(Tangent_World_Q27);Tangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;vec3 Normal_World_Q60;vec3 Normal_World_N_Q60;float Normal_Length_Q60;Object_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);float X_Q78;float Y_Q78;float Z_Q78;To_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);vec3 Nrm_World_Q26;Nrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q28;vec3 Binormal_World_N_Q28;float Binormal_Length_Q28;Object_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);float Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;float Result_Q69;Pick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);float Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;bool Not_Greater_Than_Q37;bool Greater_Than_Q37;Greater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);vec4 Linear_Q101;Linear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q101.a=_Left_Color_.a;vec4 Linear_Q102;Linear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q102.a=_Right_Color_.a;vec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;vec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);float Result_Q36;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);float Result_Q94;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);vec3 New_P_Q130;vec2 New_UV_Q130;float Radial_Gradient_Q130;vec3 Radial_Dir_Q130;vec3 New_Normal_Q130;Move_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);float X_Q98;float Y_Q98;X_Q98=New_UV_Q130.x;Y_Q98=New_UV_Q130.y;vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);vec3 Nrm_World_Q32;Object_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);vec4 Blob_Info_Q23;\n#if BLOB_ENABLE\nBlob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23);\n#else\nBlob_Info_Q23=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q24;\n#if BLOB_ENABLE_2\nBlob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24);\n#else\nBlob_Info_Q24=vec4(0,0,0,0);\n#endif\nfloat Out_Q105;Remap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);float X_Q86;float Y_Q86;float Z_Q86;To_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);vec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);float Minus_F_Q87=-Z_Q86;float R_Q99;float G_Q99;float B_Q99;float A_Q99;R_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;float ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);float Result_Q93;Conditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);vec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);vec3 Position=Pos_World_Q12;vec3 Normal=Nrm_World_Q32;vec2 UV=XY_Q85;vec3 Tangent=Tangent_World_N_Q27;vec3 Binormal=Difference_Q61;vec4 Color=Out_Color_Q34;vec4 Extra1=Vec4_Q89;vec4 Extra2=Blob_Info_Q23;vec4 Extra3=Blob_Info_Q24;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var Kt=function(t){function e(){var e=t.call(this)||this;return e.SKY_ENABLED=!0,e.BLOB_ENABLE_2=!0,e.IRIDESCENCE_ENABLED=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),Zt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.6,r.bevelFront=.6,r.bevelFrontStretch=.077,r.bevelBack=0,r.bevelBackStretch=0,r.radiusTopLeft=1,r.radiusTopRight=1,r.radiusBottomLeft=1,r.radiusBottomRight=1,r.bulgeEnabled=!1,r.bulgeHeight=-.323,r.bulgeRadius=.73,r.sunIntensity=1.102,r.sunTheta=.76,r.sunPhi=.526,r.indirectDiffuse=.658,r.albedo=new d.Color4(.0117647,.505882,.996078,1),r.specular=0,r.shininess=10,r.sharpness=0,r.subsurface=0,r.leftGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.rightGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.reflection=.749,r.frontReflect=0,r.edgeReflect=.09,r.power=8.13,r.skyColor=new d.Color4(.0117647,.964706,.996078,1),r.horizonColor=new d.Color4(.0117647,.333333,.996078,1),r.groundColor=new d.Color4(0,.254902,.996078,1),r.horizonPower=1,r.width=.02,r.fuzz=.5,r.minFuzz=.001,r.clipFade=.01,r.hueShift=0,r.saturationShift=0,r.valueShift=0,r.blobPosition=new d.Vector3(0,0,.1),r.blobIntensity=.5,r.blobNearSize=.01,r.blobFarSize=.03,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.576,r.blobPulse=0,r.blobFade=1,r.blobPosition2=new d.Vector3(.2,0,.1),r.blobNearSize2=.01,r.blobPulse2=0,r.blobFade2=1,r.blobTexture=new d.Texture("",r.getScene()),r.leftIndexPosition=new d.Vector3(0,0,1),r.rightIndexPosition=new d.Vector3(-1,-1,-1),r.leftIndexMiddlePosition=new d.Vector3(0,0,0),r.rightIndexMiddlePosition=new d.Vector3(0,0,0),r.decalScaleXY=new d.Vector2(1.5,1.5),r.decalFrontOnly=!0,r.rimIntensity=.287,r.rimHueShift=0,r.rimSaturationShift=0,r.rimValueShift=-1,r.iridescenceIntensity=0,r.useGlobalLeftIndex=1,r.useGlobalRightIndex=1,r.globalLeftIndexTipProximity=0,r.globalRightIndexTipProximity=0,r.globalLeftIndexTipPosition=new d.Vector4(.5,0,-.55,1),r.globaRightIndexTipPosition=new d.Vector4(0,0,0,1),r.globalLeftThumbTipPosition=new d.Vector4(.5,0,-.55,1),r.globalRightThumbTipPosition=new d.Vector4(0,0,0,1),r.globalLeftIndexMiddlePosition=new d.Vector4(.5,0,-.55,1),r.globalRightIndexMiddlePosition=new d.Vector4(0,0,0,1),r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._blueGradientTexture=new d.Texture(e.BLUE_GRADIENT_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r._decalTexture=new d.Texture("",r.getScene()),r._reflectionMapTexture=new d.Texture("",r.getScene()),r._indirectEnvTexture=new d.Texture("",r.getScene()),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new Kt);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Bevel_Front_","_Bevel_Front_Stretch_","_Bevel_Back_","_Bevel_Back_Stretch_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Bulge_Enabled_","_Bulge_Height_","_Bulge_Radius_","_Sun_Intensity_","_Sun_Theta_","_Sun_Phi_","_Indirect_Diffuse_","_Albedo_","_Specular_","_Shininess_","_Sharpness_","_Subsurface_","_Left_Color_","_Right_Color_","_Reflection_","_Front_Reflect_","_Edge_Reflect_","_Power_","_Sky_Color_","_Horizon_Color_","_Ground_Color_","_Horizon_Power_","_Reflection_Map_","_Indirect_Environment_","_Width_","_Fuzz_","_Min_Fuzz_","_Clip_Fade_","_Hue_Shift_","_Saturation_Shift_","_Value_Shift_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Left_Index_Pos_","_Right_Index_Pos_","_Left_Index_Middle_Pos_","_Right_Index_Middle_Pos_","_Decal_","_Decal_Scale_XY_","_Decal_Front_Only_","_Rim_Intensity_","_Rim_Texture_","_Rim_Hue_Shift_","_Rim_Saturation_Shift_","_Rim_Value_Shift_","_Iridescence_Intensity_","_Iridescence_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Middle_Position;","Global_Right_Index_Middle_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],h=["_Rim_Texture_","_Iridescence_Texture_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlSliderBar",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){if(i.materialDefines){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Bevel_Front_",this.bevelFront),this._activeEffect.setFloat("_Bevel_Front_Stretch_",this.bevelFrontStretch),this._activeEffect.setFloat("_Bevel_Back_",this.bevelBack),this._activeEffect.setFloat("_Bevel_Back_Stretch_",this.bevelBackStretch),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Bulge_Enabled_",this.bulgeEnabled?1:0),this._activeEffect.setFloat("_Bulge_Height_",this.bulgeHeight),this._activeEffect.setFloat("_Bulge_Radius_",this.bulgeRadius),this._activeEffect.setFloat("_Sun_Intensity_",this.sunIntensity),this._activeEffect.setFloat("_Sun_Theta_",this.sunTheta),this._activeEffect.setFloat("_Sun_Phi_",this.sunPhi),this._activeEffect.setFloat("_Indirect_Diffuse_",this.indirectDiffuse),this._activeEffect.setDirectColor4("_Albedo_",this.albedo),this._activeEffect.setFloat("_Specular_",this.specular),this._activeEffect.setFloat("_Shininess_",this.shininess),this._activeEffect.setFloat("_Sharpness_",this.sharpness),this._activeEffect.setFloat("_Subsurface_",this.subsurface),this._activeEffect.setDirectColor4("_Left_Color_",this.leftGradientColor),this._activeEffect.setDirectColor4("_Right_Color_",this.rightGradientColor),this._activeEffect.setFloat("_Reflection_",this.reflection),this._activeEffect.setFloat("_Front_Reflect_",this.frontReflect),this._activeEffect.setFloat("_Edge_Reflect_",this.edgeReflect),this._activeEffect.setFloat("_Power_",this.power),this._activeEffect.setDirectColor4("_Sky_Color_",this.skyColor),this._activeEffect.setDirectColor4("_Horizon_Color_",this.horizonColor),this._activeEffect.setDirectColor4("_Ground_Color_",this.groundColor),this._activeEffect.setFloat("_Horizon_Power_",this.horizonPower),this._activeEffect.setTexture("_Reflection_Map_",this._reflectionMapTexture),this._activeEffect.setTexture("_Indirect_Environment_",this._indirectEnvTexture),this._activeEffect.setFloat("_Width_",this.width),this._activeEffect.setFloat("_Fuzz_",this.fuzz),this._activeEffect.setFloat("_Min_Fuzz_",this.minFuzz),this._activeEffect.setFloat("_Clip_Fade_",this.clipFade),this._activeEffect.setFloat("_Hue_Shift_",this.hueShift),this._activeEffect.setFloat("_Saturation_Shift_",this.saturationShift),this._activeEffect.setFloat("_Value_Shift_",this.valueShift),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this.blobTexture),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setVector3("_Left_Index_Pos_",this.leftIndexPosition),this._activeEffect.setVector3("_Right_Index_Pos_",this.rightIndexPosition),this._activeEffect.setVector3("_Left_Index_Middle_Pos_",this.leftIndexMiddlePosition),this._activeEffect.setVector3("_Right_Index_Middle_Pos_",this.rightIndexMiddlePosition),this._activeEffect.setTexture("_Decal_",this._decalTexture),this._activeEffect.setVector2("_Decal_Scale_XY_",this.decalScaleXY),this._activeEffect.setFloat("_Decal_Front_Only_",this.decalFrontOnly?1:0),this._activeEffect.setFloat("_Rim_Intensity_",this.rimIntensity),this._activeEffect.setTexture("_Rim_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("_Rim_Hue_Shift_",this.rimHueShift),this._activeEffect.setFloat("_Rim_Saturation_Shift_",this.rimSaturationShift),this._activeEffect.setFloat("_Rim_Value_Shift_",this.rimValueShift),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setTexture("_Iridescence_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("Use_Global_Left_Index",this.useGlobalLeftIndex),this._activeEffect.setFloat("Use_Global_Right_Index",this.useGlobalRightIndex),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this.globalLeftIndexTipPosition),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this.globaRightIndexTipPosition),this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position",this.globalLeftThumbTipPosition),this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position",this.globalRightThumbTipPosition),this._activeEffect.setVector4("Global_Left_Index_Middle_Position",this.globalLeftIndexMiddlePosition),this._activeEffect.setVector4("Global_Right_Index_Middle_Position",this.globalRightIndexMiddlePosition),this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity",this.globalLeftIndexTipProximity),this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity",this.globalRightIndexTipProximity),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),this._reflectionMapTexture.dispose(),this._indirectEnvTexture.dispose(),this._blueGradientTexture.dispose(),this._decalTexture.dispose()},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.MRDLSliderBarMaterial",e},e.prototype.getClassName=function(){return"MRDLSliderBarMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLUE_GRADIENT_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"bevelFront",void 0),h([(0,d.serialize)()],e.prototype,"bevelFrontStretch",void 0),h([(0,d.serialize)()],e.prototype,"bevelBack",void 0),h([(0,d.serialize)()],e.prototype,"bevelBackStretch",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopRight",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomRight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeEnabled",void 0),h([(0,d.serialize)()],e.prototype,"bulgeHeight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeRadius",void 0),h([(0,d.serialize)()],e.prototype,"sunIntensity",void 0),h([(0,d.serialize)()],e.prototype,"sunTheta",void 0),h([(0,d.serialize)()],e.prototype,"sunPhi",void 0),h([(0,d.serialize)()],e.prototype,"indirectDiffuse",void 0),h([(0,d.serialize)()],e.prototype,"albedo",void 0),h([(0,d.serialize)()],e.prototype,"specular",void 0),h([(0,d.serialize)()],e.prototype,"shininess",void 0),h([(0,d.serialize)()],e.prototype,"sharpness",void 0),h([(0,d.serialize)()],e.prototype,"subsurface",void 0),h([(0,d.serialize)()],e.prototype,"leftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"rightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"reflection",void 0),h([(0,d.serialize)()],e.prototype,"frontReflect",void 0),h([(0,d.serialize)()],e.prototype,"edgeReflect",void 0),h([(0,d.serialize)()],e.prototype,"power",void 0),h([(0,d.serialize)()],e.prototype,"skyColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonColor",void 0),h([(0,d.serialize)()],e.prototype,"groundColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonPower",void 0),h([(0,d.serialize)()],e.prototype,"width",void 0),h([(0,d.serialize)()],e.prototype,"fuzz",void 0),h([(0,d.serialize)()],e.prototype,"minFuzz",void 0),h([(0,d.serialize)()],e.prototype,"clipFade",void 0),h([(0,d.serialize)()],e.prototype,"hueShift",void 0),h([(0,d.serialize)()],e.prototype,"saturationShift",void 0),h([(0,d.serialize)()],e.prototype,"valueShift",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition2",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"blobTexture",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"decalScaleXY",void 0),h([(0,d.serialize)()],e.prototype,"decalFrontOnly",void 0),h([(0,d.serialize)()],e.prototype,"rimIntensity",void 0),h([(0,d.serialize)()],e.prototype,"rimHueShift",void 0),h([(0,d.serialize)()],e.prototype,"rimSaturationShift",void 0),h([(0,d.serialize)()],e.prototype,"rimValueShift",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLSliderBarMaterial",Zt);d.ShaderStore.ShadersStore.mrdlSliderThumbPixelShader="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B180(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }\nreturn C;}\nvoid Sky_Environment_B200(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{Reflected_Color=SampleEnv_Bid200(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}\nvoid Min_Segment_Distance_B215(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}\nif (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}\nvoid To_XYZ_B224(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Finger_Positions_B214(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}\nvoid VaryHSV_B258(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}\nvoid Remap_Range_B264(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid To_HSV_B225(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Conditional_Float_B186(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Greater_Than_B187(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}\nvoid Remap_Range_B255(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid main()\n{vec2 XY_Q235;XY_Q235=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q177;vec3 Tangent_World_N_Q177;float Tangent_Length_Q177;Tangent_World_Q177=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q177=length(Tangent_World_Q177);Tangent_World_N_Q177=Tangent_World_Q177/Tangent_Length_Q177;vec3 Normal_World_Q210;vec3 Normal_World_N_Q210;float Normal_Length_Q210;Object_To_World_Dir_B210(vec3(0,0,1),Normal_World_Q210,Normal_World_N_Q210,Normal_Length_Q210);float X_Q228;float Y_Q228;float Z_Q228;To_XYZ_B228(position,X_Q228,Y_Q228,Z_Q228);vec3 Nrm_World_Q176;Nrm_World_Q176=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q178;vec3 Binormal_World_N_Q178;float Binormal_Length_Q178;Object_To_World_Dir_B178(vec3(0,1,0),Binormal_World_Q178,Binormal_World_N_Q178,Binormal_Length_Q178);float Anisotropy_Q179=Tangent_Length_Q177/Binormal_Length_Q178;float Result_Q219;Pick_Radius_B219(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q219);float Anisotropy_Q203=Binormal_Length_Q178/Normal_Length_Q210;bool Not_Greater_Than_Q187;bool Greater_Than_Q187;Greater_Than_B187(Z_Q228,0.0,Not_Greater_Than_Q187,Greater_Than_Q187);vec4 Linear_Q251;Linear_Q251.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q251.a=_Left_Color_.a;vec4 Linear_Q252;Linear_Q252.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q252.a=_Right_Color_.a;vec3 Difference_Q211=vec3(0,0,0)-Normal_World_N_Q210;vec4 Out_Color_Q184=vec4(X_Q228,Y_Q228,Z_Q228,1);float Result_Q186;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_,_Bevel_Front_,Result_Q186);float Result_Q244;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q244);vec3 New_P_Q280;vec2 New_UV_Q280;float Radial_Gradient_Q280;vec3 Radial_Dir_Q280;vec3 New_Normal_Q280;Move_Verts_B280(Anisotropy_Q179,position,Result_Q219,Result_Q186,normal,Anisotropy_Q203,Result_Q244,New_P_Q280,New_UV_Q280,Radial_Gradient_Q280,Radial_Dir_Q280,New_Normal_Q280);float X_Q248;float Y_Q248;X_Q248=New_UV_Q280.x;Y_Q248=New_UV_Q280.y;vec3 Pos_World_Q162;Object_To_World_Pos_B162(New_P_Q280,Pos_World_Q162);vec3 Nrm_World_Q182;Object_To_World_Normal_B182(New_Normal_Q280,Nrm_World_Q182);vec4 Blob_Info_Q173;\n#if BLOB_ENABLE\nBlob_Vertex_B173(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q173);\n#else\nBlob_Info_Q173=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q174;\n#if BLOB_ENABLE_2\nBlob_Vertex_B174(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q174);\n#else\nBlob_Info_Q174=vec4(0,0,0,0);\n#endif\nfloat Out_Q255;Remap_Range_B255(0.0,1.0,0.0,1.0,X_Q248,Out_Q255);float X_Q236;float Y_Q236;float Z_Q236;To_XYZ_B228(Nrm_World_Q182,X_Q236,Y_Q236,Z_Q236);vec4 Color_At_T_Q247=mix(Linear_Q251,Linear_Q252,Out_Q255);float Minus_F_Q237=-Z_Q236;float R_Q249;float G_Q249;float B_Q249;float A_Q249;R_Q249=Color_At_T_Q247.r; G_Q249=Color_At_T_Q247.g; B_Q249=Color_At_T_Q247.b; A_Q249=Color_At_T_Q247.a;float ClampF_Q238=clamp(0.0,Minus_F_Q237,1.0);float Result_Q243;Conditional_Float_B243(_Decal_Front_Only_,ClampF_Q238,1.0,Result_Q243);vec4 Vec4_Q239=vec4(Result_Q243,Radial_Gradient_Q280,G_Q249,B_Q249);vec3 Position=Pos_World_Q162;vec3 Normal=Nrm_World_Q182;vec2 UV=XY_Q235;vec3 Tangent=Tangent_World_N_Q177;vec3 Binormal=Difference_Q211;vec4 Color=Out_Color_Q184;vec4 Extra1=Vec4_Q239;vec4 Extra2=Blob_Info_Q173;vec4 Extra3=Blob_Info_Q174;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var qt=function(t){function e(){var e=t.call(this)||this;return e.SKY_ENABLED=!0,e.BLOB_ENABLE_2=!0,e.IRIDESCENCE_ENABLED=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),Jt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.157,r.bevelFront=.065,r.bevelFrontStretch=.077,r.bevelBack=.031,r.bevelBackStretch=0,r.radiusTopLeft=1,r.radiusTopRight=1,r.radiusBottomLeft=1,r.radiusBottomRight=1,r.bulgeEnabled=!1,r.bulgeHeight=-.323,r.bulgeRadius=.73,r.sunIntensity=2,r.sunTheta=.937,r.sunPhi=.555,r.indirectDiffuse=1,r.albedo=new d.Color4(.0117647,.505882,.996078,1),r.specular=0,r.shininess=10,r.sharpness=0,r.subsurface=.31,r.leftGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.rightGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.reflection=.749,r.frontReflect=0,r.edgeReflect=.09,r.power=8.1,r.skyColor=new d.Color4(.0117647,.960784,.996078,1),r.horizonColor=new d.Color4(.0117647,.333333,.996078,1),r.groundColor=new d.Color4(0,.254902,.996078,1),r.horizonPower=1,r.width=.02,r.fuzz=.5,r.minFuzz=.001,r.clipFade=.01,r.hueShift=0,r.saturationShift=0,r.valueShift=0,r.blobPosition=new d.Vector3(0,0,.1),r.blobIntensity=.5,r.blobNearSize=.01,r.blobFarSize=.03,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.576,r.blobPulse=0,r.blobFade=1,r.blobPosition2=new d.Vector3(.2,0,.1),r.blobNearSize2=.01,r.blobPulse2=0,r.blobFade2=1,r.blobTexture=new d.Texture("",r.getScene()),r.leftIndexPosition=new d.Vector3(0,0,1),r.rightIndexPosition=new d.Vector3(-1,-1,-1),r.leftIndexMiddlePosition=new d.Vector3(0,0,0),r.rightIndexMiddlePosition=new d.Vector3(0,0,0),r.decalScaleXY=new d.Vector2(1.5,1.5),r.decalFrontOnly=!0,r.rimIntensity=.287,r.rimHueShift=0,r.rimSaturationShift=0,r.rimValueShift=-1,r.iridescenceIntensity=0,r.useGlobalLeftIndex=1,r.useGlobalRightIndex=1,r.globalLeftIndexTipProximity=0,r.globalRightIndexTipProximity=0,r.globalLeftIndexTipPosition=new d.Vector4(.5,0,-.55,1),r.globaRightIndexTipPosition=new d.Vector4(0,0,0,1),r.globalLeftThumbTipPosition=new d.Vector4(.5,0,-.55,1),r.globalRightThumbTipPosition=new d.Vector4(0,0,0,1),r.globalLeftIndexMiddlePosition=new d.Vector4(.5,0,-.55,1),r.globalRightIndexMiddlePosition=new d.Vector4(0,0,0,1),r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._blueGradientTexture=new d.Texture(e.BLUE_GRADIENT_TEXTURE_URL,o,!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r._decalTexture=new d.Texture("",r.getScene()),r._reflectionMapTexture=new d.Texture("",r.getScene()),r._indirectEnvTexture=new d.Texture("",r.getScene()),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new qt);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Bevel_Front_","_Bevel_Front_Stretch_","_Bevel_Back_","_Bevel_Back_Stretch_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Bulge_Enabled_","_Bulge_Height_","_Bulge_Radius_","_Sun_Intensity_","_Sun_Theta_","_Sun_Phi_","_Indirect_Diffuse_","_Albedo_","_Specular_","_Shininess_","_Sharpness_","_Subsurface_","_Left_Color_","_Right_Color_","_Reflection_","_Front_Reflect_","_Edge_Reflect_","_Power_","_Sky_Color_","_Horizon_Color_","_Ground_Color_","_Horizon_Power_","_Reflection_Map_","_Indirect_Environment_","_Width_","_Fuzz_","_Min_Fuzz_","_Clip_Fade_","_Hue_Shift_","_Saturation_Shift_","_Value_Shift_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Left_Index_Pos_","_Right_Index_Pos_","_Left_Index_Middle_Pos_","_Right_Index_Middle_Pos_","_Decal_","_Decal_Scale_XY_","_Decal_Front_Only_","_Rim_Intensity_","_Rim_Texture_","_Rim_Hue_Shift_","_Rim_Saturation_Shift_","_Rim_Value_Shift_","_Iridescence_Intensity_","_Iridescence_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Middle_Position;","Global_Right_Index_Middle_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],h=["_Rim_Texture_","_Iridescence_Texture_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlSliderThumb",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){if(i.materialDefines){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Bevel_Front_",this.bevelFront),this._activeEffect.setFloat("_Bevel_Front_Stretch_",this.bevelFrontStretch),this._activeEffect.setFloat("_Bevel_Back_",this.bevelBack),this._activeEffect.setFloat("_Bevel_Back_Stretch_",this.bevelBackStretch),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Bulge_Enabled_",this.bulgeEnabled?1:0),this._activeEffect.setFloat("_Bulge_Height_",this.bulgeHeight),this._activeEffect.setFloat("_Bulge_Radius_",this.bulgeRadius),this._activeEffect.setFloat("_Sun_Intensity_",this.sunIntensity),this._activeEffect.setFloat("_Sun_Theta_",this.sunTheta),this._activeEffect.setFloat("_Sun_Phi_",this.sunPhi),this._activeEffect.setFloat("_Indirect_Diffuse_",this.indirectDiffuse),this._activeEffect.setDirectColor4("_Albedo_",this.albedo),this._activeEffect.setFloat("_Specular_",this.specular),this._activeEffect.setFloat("_Shininess_",this.shininess),this._activeEffect.setFloat("_Sharpness_",this.sharpness),this._activeEffect.setFloat("_Subsurface_",this.subsurface),this._activeEffect.setDirectColor4("_Left_Color_",this.leftGradientColor),this._activeEffect.setDirectColor4("_Right_Color_",this.rightGradientColor),this._activeEffect.setFloat("_Reflection_",this.reflection),this._activeEffect.setFloat("_Front_Reflect_",this.frontReflect),this._activeEffect.setFloat("_Edge_Reflect_",this.edgeReflect),this._activeEffect.setFloat("_Power_",this.power),this._activeEffect.setDirectColor4("_Sky_Color_",this.skyColor),this._activeEffect.setDirectColor4("_Horizon_Color_",this.horizonColor),this._activeEffect.setDirectColor4("_Ground_Color_",this.groundColor),this._activeEffect.setFloat("_Horizon_Power_",this.horizonPower),this._activeEffect.setTexture("_Reflection_Map_",this._reflectionMapTexture),this._activeEffect.setTexture("_Indirect_Environment_",this._indirectEnvTexture),this._activeEffect.setFloat("_Width_",this.width),this._activeEffect.setFloat("_Fuzz_",this.fuzz),this._activeEffect.setFloat("_Min_Fuzz_",this.minFuzz),this._activeEffect.setFloat("_Clip_Fade_",this.clipFade),this._activeEffect.setFloat("_Hue_Shift_",this.hueShift),this._activeEffect.setFloat("_Saturation_Shift_",this.saturationShift),this._activeEffect.setFloat("_Value_Shift_",this.valueShift),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this.blobTexture),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setVector3("_Left_Index_Pos_",this.leftIndexPosition),this._activeEffect.setVector3("_Right_Index_Pos_",this.rightIndexPosition),this._activeEffect.setVector3("_Left_Index_Middle_Pos_",this.leftIndexMiddlePosition),this._activeEffect.setVector3("_Right_Index_Middle_Pos_",this.rightIndexMiddlePosition),this._activeEffect.setTexture("_Decal_",this._decalTexture),this._activeEffect.setVector2("_Decal_Scale_XY_",this.decalScaleXY),this._activeEffect.setFloat("_Decal_Front_Only_",this.decalFrontOnly?1:0),this._activeEffect.setFloat("_Rim_Intensity_",this.rimIntensity),this._activeEffect.setTexture("_Rim_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("_Rim_Hue_Shift_",this.rimHueShift),this._activeEffect.setFloat("_Rim_Saturation_Shift_",this.rimSaturationShift),this._activeEffect.setFloat("_Rim_Value_Shift_",this.rimValueShift),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setTexture("_Iridescence_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("Use_Global_Left_Index",this.useGlobalLeftIndex),this._activeEffect.setFloat("Use_Global_Right_Index",this.useGlobalRightIndex),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this.globalLeftIndexTipPosition),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this.globaRightIndexTipPosition),this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position",this.globalLeftThumbTipPosition),this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position",this.globalRightThumbTipPosition),this._activeEffect.setVector4("Global_Left_Index_Middle_Position",this.globalLeftIndexMiddlePosition),this._activeEffect.setVector4("Global_Right_Index_Middle_Position",this.globalRightIndexMiddlePosition),this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity",this.globalLeftIndexTipProximity),this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity",this.globalRightIndexTipProximity),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),this._reflectionMapTexture.dispose(),this._indirectEnvTexture.dispose(),this._blueGradientTexture.dispose(),this._decalTexture.dispose()},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.MRDLSliderThumbMaterial",e},e.prototype.getClassName=function(){return"MRDLSliderThumbMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLUE_GRADIENT_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"bevelFront",void 0),h([(0,d.serialize)()],e.prototype,"bevelFrontStretch",void 0),h([(0,d.serialize)()],e.prototype,"bevelBack",void 0),h([(0,d.serialize)()],e.prototype,"bevelBackStretch",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopRight",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomRight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeEnabled",void 0),h([(0,d.serialize)()],e.prototype,"bulgeHeight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeRadius",void 0),h([(0,d.serialize)()],e.prototype,"sunIntensity",void 0),h([(0,d.serialize)()],e.prototype,"sunTheta",void 0),h([(0,d.serialize)()],e.prototype,"sunPhi",void 0),h([(0,d.serialize)()],e.prototype,"indirectDiffuse",void 0),h([(0,d.serialize)()],e.prototype,"albedo",void 0),h([(0,d.serialize)()],e.prototype,"specular",void 0),h([(0,d.serialize)()],e.prototype,"shininess",void 0),h([(0,d.serialize)()],e.prototype,"sharpness",void 0),h([(0,d.serialize)()],e.prototype,"subsurface",void 0),h([(0,d.serialize)()],e.prototype,"leftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"rightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"reflection",void 0),h([(0,d.serialize)()],e.prototype,"frontReflect",void 0),h([(0,d.serialize)()],e.prototype,"edgeReflect",void 0),h([(0,d.serialize)()],e.prototype,"power",void 0),h([(0,d.serialize)()],e.prototype,"skyColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonColor",void 0),h([(0,d.serialize)()],e.prototype,"groundColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonPower",void 0),h([(0,d.serialize)()],e.prototype,"width",void 0),h([(0,d.serialize)()],e.prototype,"fuzz",void 0),h([(0,d.serialize)()],e.prototype,"minFuzz",void 0),h([(0,d.serialize)()],e.prototype,"clipFade",void 0),h([(0,d.serialize)()],e.prototype,"hueShift",void 0),h([(0,d.serialize)()],e.prototype,"saturationShift",void 0),h([(0,d.serialize)()],e.prototype,"valueShift",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition2",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"blobTexture",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"decalScaleXY",void 0),h([(0,d.serialize)()],e.prototype,"decalFrontOnly",void 0),h([(0,d.serialize)()],e.prototype,"rimIntensity",void 0),h([(0,d.serialize)()],e.prototype,"rimHueShift",void 0),h([(0,d.serialize)()],e.prototype,"rimSaturationShift",void 0),h([(0,d.serialize)()],e.prototype,"rimValueShift",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLSliderThumbMaterial",Jt);d.ShaderStore.ShadersStore.mrdlBackplatePixelShader="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;void FastLinearTosRGB_B353(\nvec4 Linear,\nout vec4 sRGB)\n{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}\nvoid Round_Rect_Fragment_B332(\nfloat Radius,\nfloat Line_Width,\nvec4 Line_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Line_Visibility,\nvec4 Rect_Parms,\nvec4 Fill_Color,\nout vec4 Color)\n{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;}\nvoid Iridescence_B343(\nvec3 Position,\nvec3 Normal,\nvec2 UV,\nvec3 Axis,\nvec3 Eye,\nvec4 Tint,\nsampler2D Texture,\nbool Reflected,\nfloat Frequency,\nfloat Vertical_Offset,\nout vec4 Color)\n{vec3 i=normalize(Position-Eye);vec3 r=reflect(i,Normal);float idota=dot(i,Axis);float idotr=dot(i,r);float x=Reflected ? idotr : idota;vec2 xy;xy.x=fract((x*Frequency+1.0)*0.5+UV.y*Vertical_Offset);xy.y=0.5;Color=texture(Texture,xy);Color.rgb*=Tint.rgb;}\nvoid Scale_RGB_B346(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Scale_RGB_B344(\nfloat Scalar,\nvec4 Color,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Line_Fragment_B362(\nvec4 Base_Color,\nvec4 Highlight_Color,\nfloat Highlight_Width,\nvec3 Line_Vertex,\nfloat Highlight,\nout vec4 Line_Color)\n{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);}\nvoid Edge_B356(\nvec4 RectParms,\nfloat Radius,\nfloat Line_Width,\nvec2 UV,\nfloat Edge_Width,\nfloat Edge_Power,\nout float Result)\n{float d=length(max(abs(UV)-RectParms.xy,0.0));float edge=1.0-clamp((1.0-d/(Radius-Line_Width))/Edge_Width,0.0,1.0);Result=pow(edge,Edge_Power);}\nvoid Gradient_B355(\nvec4 Gradient_Color,\nvec4 Top_Left,\nvec4 Top_Right,\nvec4 Bottom_Left,\nvec4 Bottom_Right,\nvec2 UV,\nout vec4 Result)\n{vec3 top=Top_Left.rgb+(Top_Right.rgb-Top_Left.rgb)*UV.x;vec3 bottom=Bottom_Left.rgb+(Bottom_Right.rgb-Bottom_Left.rgb)*UV.x;Result.rgb=Gradient_Color.rgb*(bottom+(top-bottom)*UV.y);Result.a=1.0;}\nvoid main()\n{float X_Q338;float Y_Q338;float Z_Q338;float W_Q338;X_Q338=vExtra2.x;Y_Q338=vExtra2.y;Z_Q338=vExtra2.z;W_Q338=vExtra2.w;vec4 Color_Q343;\n#if IRIDESCENCE_ENABLE\nIridescence_B343(vPosition,vNormal,vUV,vBinormal,cameraPosition,_Iridescence_Tint_,_Iridescent_Map_,_Reflected_,_Frequency_,_Vertical_Offset_,Color_Q343);\n#else\nColor_Q343=vec4(0,0,0,0);\n#endif\nvec4 Result_Q344;Scale_RGB_B344(_Iridescence_Intensity_,Color_Q343,Result_Q344);vec4 Line_Color_Q362;Line_Fragment_B362(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q362);float Result_Q356;\n#if EDGE_ONLY\nEdge_B356(vExtra1,Z_Q338,W_Q338,vUV,_Edge_Width_,_Edge_Power_,Result_Q356);\n#else\nResult_Q356=1.0;\n#endif\nvec2 Vec2_Q339=vec2(X_Q338,Y_Q338);vec4 Result_Q355;Gradient_B355(_Gradient_Color_,_Top_Left_,_Top_Right_,_Bottom_Left_,_Bottom_Right_,Vec2_Q339,Result_Q355);vec4 Linear_Q348;Linear_Q348.rgb=clamp(Result_Q355.rgb*Result_Q355.rgb,0.0,1.0);Linear_Q348.a=Result_Q355.a;vec4 Result_Q346;Scale_RGB_B346(Linear_Q348,Result_Q356,Result_Q346);vec4 Sum_Q345=Result_Q346+Result_Q344;vec4 Color_At_T_Q347=mix(Line_Color_Q362,Result_Q346,_Line_Gradient_Blend_);vec4 Base_And_Iridescent_Q350;Base_And_Iridescent_Q350=_Base_Color_+vec4(Sum_Q345.rgb,0.0);vec4 Sum_Q349=Color_At_T_Q347+_Iridescence_Edge_Intensity_*Color_Q343;vec4 Result_Q351=Sum_Q349; Result_Q351.a=1.0;vec4 Color_Q332;Round_Rect_Fragment_B332(Z_Q338,W_Q338,Result_Q351,_Filter_Width_,vUV,1.0,vExtra1,Base_And_Iridescent_Q350,Color_Q332);vec4 Result_Q354=_Fade_Out_*Color_Q332;vec4 sRGB_Q353;FastLinearTosRGB_B353(Result_Q354,sRGB_Q353);vec4 Out_Color=sRGB_Q353;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.mrdlBackplateVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec3 tangent;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;void Object_To_World_Pos_B314(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Round_Rect_Vertex_B357(\nvec2 UV,\nfloat Radius,\nfloat Margin,\nfloat Anisotropy,\nfloat Gradient1,\nfloat Gradient2,\nvec3 Normal,\nvec4 Color_Scale_Translate,\nout vec2 Rect_UV,\nout vec4 Rect_Parms,\nout vec2 Scale_XY,\nout vec2 Line_UV,\nout vec2 Color_UV_Info)\n{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; \nRect_Parms.w=Gradient2;Color_UV_Info=(Line_UV+vec2(0.5,0.5))*Color_Scale_Translate.xy+Color_Scale_Translate.zw;}\nvoid Line_Vertex_B333(\nvec2 Scale_XY,\nvec2 UV,\nfloat Time,\nfloat Rate,\nvec4 Highlight_Transform,\nout vec3 Line_Vertex)\n{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; }\nvoid PickDir_B334(\nfloat Degrees,\nvec3 DirX,\nvec3 DirY,\nout vec3 Dir)\n{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;}\nvoid Move_Verts_B327(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir)\n{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);}\nvoid Pick_Radius_B336(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Edge_AA_Vertex_B328(\nvec3 Position_World,\nvec3 Position_Object,\nvec3 Normal_Object,\nvec3 Eye,\nfloat Radial_Gradient,\nvec3 Radial_Dir,\nvec3 Tangent,\nout float Gradient1,\nout float Gradient2)\n{vec3 I=(Eye-Position_World);vec3 T=(vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { \nGradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}\nvoid Object_To_World_Dir_B330(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}\nvoid RelativeOrAbsoluteDetail_B341(\nfloat Nominal_Radius,\nfloat Nominal_LineWidth,\nbool Absolute_Measurements,\nfloat Height,\nout float Radius,\nout float Line_Width)\n{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;}\nvoid main()\n{vec3 Nrm_World_Q326;Nrm_World_Q326=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q329;vec3 Tangent_World_N_Q329;float Tangent_Length_Q329;Tangent_World_Q329=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q329=length(Tangent_World_Q329);Tangent_World_N_Q329=Tangent_World_Q329/Tangent_Length_Q329;vec3 Binormal_World_Q330;vec3 Binormal_World_N_Q330;float Binormal_Length_Q330;Object_To_World_Dir_B330(vec3(0,1,0),Binormal_World_Q330,Binormal_World_N_Q330,Binormal_Length_Q330);float Radius_Q341;float Line_Width_Q341;RelativeOrAbsoluteDetail_B341(_Radius_,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q330,Radius_Q341,Line_Width_Q341);vec3 Dir_Q334;PickDir_B334(_Angle_,Tangent_World_N_Q329,Binormal_World_N_Q330,Dir_Q334);float Result_Q336;Pick_Radius_B336(Radius_Q341,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q336);float Anisotropy_Q331=Tangent_Length_Q329/Binormal_Length_Q330;vec4 Out_Color_Q337=vec4(Result_Q336,Line_Width_Q341,0,1);vec3 New_P_Q327;vec2 New_UV_Q327;float Radial_Gradient_Q327;vec3 Radial_Dir_Q327;Move_Verts_B327(Anisotropy_Q331,position,Result_Q336,New_P_Q327,New_UV_Q327,Radial_Gradient_Q327,Radial_Dir_Q327);vec3 Pos_World_Q314;Object_To_World_Pos_B314(New_P_Q327,Pos_World_Q314);float Gradient1_Q328;float Gradient2_Q328;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B328(Pos_World_Q314,position,normal,cameraPosition,Radial_Gradient_Q327,Radial_Dir_Q327,tangent,Gradient1_Q328,Gradient2_Q328);\n#else\nGradient1_Q328=1.0;Gradient2_Q328=1.0;\n#endif\nvec2 Rect_UV_Q357;vec4 Rect_Parms_Q357;vec2 Scale_XY_Q357;vec2 Line_UV_Q357;vec2 Color_UV_Info_Q357;Round_Rect_Vertex_B357(New_UV_Q327,Result_Q336,0.0,Anisotropy_Q331,Gradient1_Q328,Gradient2_Q328,normal,vec4(1,1,0,0),Rect_UV_Q357,Rect_Parms_Q357,Scale_XY_Q357,Line_UV_Q357,Color_UV_Info_Q357);vec3 Line_Vertex_Q333;Line_Vertex_B333(Scale_XY_Q357,Line_UV_Q357,(20.0),_Rate_,_Highlight_Transform_,Line_Vertex_Q333);float X_Q359;float Y_Q359;X_Q359=Color_UV_Info_Q357.x;Y_Q359=Color_UV_Info_Q357.y;vec4 Vec4_Q358=vec4(X_Q359,Y_Q359,Result_Q336,Line_Width_Q341);vec3 Position=Pos_World_Q314;vec3 Normal=Nrm_World_Q326;vec2 UV=Rect_UV_Q357;vec3 Tangent=Line_Vertex_Q333;vec3 Binormal=Dir_Q334;vec4 Color=Out_Color_Q337;vec4 Extra1=Rect_Parms_Q357;vec4 Extra2=Vec4_Q358;vec4 Extra3=vec4(0,0,0,0);gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vExtra1=Extra1;vExtra2=Extra2;}";var $t=function(t){function e(){var e=t.call(this)||this;return e.IRIDESCENCE_ENABLE=!0,e.SMOOTH_EDGES=!0,e._needNormals=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),te=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.3,r.lineWidth=.003,r.absoluteSizes=!1,r._filterWidth=1,r.baseColor=new d.Color4(0,0,0,1),r.lineColor=new d.Color4(.2,.262745,.4,1),r.radiusTopLeft=1,r.radiusTopRight=1,r.radiusBottomLeft=1,r.radiusBottomRight=1,r._rate=0,r.highlightColor=new d.Color4(.239216,.435294,.827451,1),r.highlightWidth=0,r._highlightTransform=new d.Vector4(1,1,0,0),r._highlight=1,r.iridescenceIntensity=.45,r.iridescenceEdgeIntensity=1,r.iridescenceTint=new d.Color4(1,1,1,1),r._angle=-45,r.fadeOut=1,r._reflected=!0,r._frequency=1,r._verticalOffset=0,r.gradientColor=new d.Color4(.74902,.74902,.74902,1),r.topLeftGradientColor=new d.Color4(.00784314,.294118,.580392,1),r.topRightGradientColor=new d.Color4(.305882,0,1,1),r.bottomLeftGradientColor=new d.Color4(.133333,.258824,.992157,1),r.bottomRightGradientColor=new d.Color4(.176471,.176471,.619608,1),r.edgeWidth=.5,r.edgePower=1,r.edgeLineGradientBlend=.5,r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._iridescentMapTexture=new d.Texture(e.IRIDESCENT_MAP_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new $t);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Absolute_Sizes_","_Filter_Width_","_Base_Color_","_Line_Color_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Rate_","_Highlight_Color_","_Highlight_Width_","_Highlight_Transform_","_Highlight_","_Iridescence_Intensity_","_Iridescence_Edge_Intensity_","_Iridescence_Tint_","_Iridescent_Map_","_Angle_","_Reflected_","_Frequency_","_Vertical_Offset_","_Gradient_Color_","_Top_Left_","_Top_Right_","_Bottom_Left_","_Bottom_Right_","_Edge_Width_","_Edge_Power_","_Line_Gradient_Blend_","_Fade_Out_"],h=["_Iridescent_Map_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlBackplate",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){if(i.materialDefines){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Base_Color_",this.baseColor),this._activeEffect.setDirectColor4("_Line_Color_",this.lineColor),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Rate_",this._rate),this._activeEffect.setDirectColor4("_Highlight_Color_",this.highlightColor),this._activeEffect.setFloat("_Highlight_Width_",this.highlightWidth),this._activeEffect.setVector4("_Highlight_Transform_",this._highlightTransform),this._activeEffect.setFloat("_Highlight_",this._highlight),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setFloat("_Iridescence_Edge_Intensity_",this.iridescenceEdgeIntensity),this._activeEffect.setDirectColor4("_Iridescence_Tint_",this.iridescenceTint),this._activeEffect.setTexture("_Iridescent_Map_",this._iridescentMapTexture),this._activeEffect.setFloat("_Angle_",this._angle),this._activeEffect.setFloat("_Reflected_",this._reflected?1:0),this._activeEffect.setFloat("_Frequency_",this._frequency),this._activeEffect.setFloat("_Vertical_Offset_",this._verticalOffset),this._activeEffect.setDirectColor4("_Gradient_Color_",this.gradientColor),this._activeEffect.setDirectColor4("_Top_Left_",this.topLeftGradientColor),this._activeEffect.setDirectColor4("_Top_Right_",this.topRightGradientColor),this._activeEffect.setDirectColor4("_Bottom_Left_",this.bottomLeftGradientColor),this._activeEffect.setDirectColor4("_Bottom_Right_",this.bottomRightGradientColor),this._activeEffect.setFloat("_Edge_Width_",this.edgeWidth),this._activeEffect.setFloat("_Edge_Power_",this.edgePower),this._activeEffect.setFloat("_Line_Gradient_Blend_",this.edgeLineGradientBlend),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.MRDLBackplateMaterial",e},e.prototype.getClassName=function(){return"MRDLBackplateMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.IRIDESCENT_MAP_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"absoluteSizes",void 0),h([(0,d.serialize)()],e.prototype,"baseColor",void 0),h([(0,d.serialize)()],e.prototype,"lineColor",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopRight",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomRight",void 0),h([(0,d.serialize)()],e.prototype,"highlightColor",void 0),h([(0,d.serialize)()],e.prototype,"highlightWidth",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceEdgeIntensity",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceTint",void 0),h([(0,d.serialize)()],e.prototype,"fadeOut",void 0),h([(0,d.serialize)()],e.prototype,"gradientColor",void 0),h([(0,d.serialize)()],e.prototype,"topLeftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"topRightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"bottomLeftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"bottomRightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"edgeWidth",void 0),h([(0,d.serialize)()],e.prototype,"edgePower",void 0),h([(0,d.serialize)()],e.prototype,"edgeLineGradientBlend",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLBackplateMaterial",te);var ee=function(t){function e(e,i){var o=t.call(this,e)||this;return o.onValueChangedObservable=new d.Observable,o._sliderBackplateVisible=i||!1,o._minimum=0,o._maximum=100,o._step=0,o._value=50,o}return l(e,t),Object.defineProperty(e.prototype,"mesh",{get:function(){return this.node?this._sliderThumb:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minimum",{get:function(){return this._minimum},set:function(t){this._minimum!==t&&(this._minimum=Math.max(t,0),this._value=Math.max(Math.min(this._value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){this._maximum!==t&&(this._maximum=Math.max(t,this._minimum),this._value=Math.max(Math.min(this._value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this._step},set:function(t){this._step!==t&&(this._step=Math.max(Math.min(t,this._maximum-this._minimum),0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){this._value!==t&&(this._value=Math.max(Math.min(t,this._maximum),this._minimum),this._sliderThumb&&(this._sliderThumb.position.x=this._convertToPosition(this.value)),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.node?this._sliderBar.position.x-this._sliderBar.scaling.x/2:-.5},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.node?this._sliderBar.position.x+this._sliderBar.scaling.x/2:.5},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBarMaterial",{get:function(){return this._sliderBarMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderThumbMaterial",{get:function(){return this._sliderThumbMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBackplateMaterial",{get:function(){return this._sliderBackplateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBar",{get:function(){return this._sliderBar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderThumb",{get:function(){return this._sliderThumb},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBackplate",{get:function(){return this._sliderBackplate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{set:function(t){var e;this._isVisible!==t&&(this._isVisible=t,null===(e=this.node)||void 0===e||e.setEnabled(t))},enumerable:!1,configurable:!0}),e.prototype._createNode=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_sliderbackplate"),{width:1,height:1,depth:1},t);return o.isPickable=!1,o.visibility=0,o.scaling=new d.Vector3(1,.5,.8),d.SceneLoader.ImportMeshAsync(void 0,e.MODEL_BASE_URL,e.MODEL_FILENAME,t).then((function(t){t.meshes.forEach((function(t){t.isPickable=!1}));var e=t.meshes[1],r=t.meshes[1].clone("".concat(i.name,"_sliderbar"),o),n=t.meshes[1].clone("".concat(i.name,"_sliderthumb"),o);e.visibility=0,i._sliderBackplateVisible&&(e.visibility=1,e.name="".concat(i.name,"_sliderbackplate"),e.scaling.x=1,e.scaling.z=.2,e.parent=o,i._sliderBackplateMaterial&&(e.material=i._sliderBackplateMaterial),i._sliderBackplate=e),r&&(r.parent=o,r.position.z=-.1,r.scaling=new d.Vector3(.8,.04,.3),i._sliderBarMaterial&&(r.material=i._sliderBarMaterial),i._sliderBar=r),n&&(n.parent=o,n.isPickable=!0,n.position.z=-.115,n.scaling=new d.Vector3(.025,.3,.6),n.position.x=i._convertToPosition(i.value),n.addBehavior(i._createBehavior()),i._sliderThumbMaterial&&(n.material=i._sliderThumbMaterial),i._sliderThumb=n),i._injectGUI3DReservedDataStore(o).control=i,o.getChildMeshes().forEach((function(t){i._injectGUI3DReservedDataStore(t).control=i}))})),this._affectMaterial(o),o},e.prototype._affectMaterial=function(t){var e,i,o;this._sliderBackplateMaterial=null!==(e=this._sliderBackplateMaterial)&&void 0!==e?e:new te("".concat(this.name,"_sliderbackplate_material"),t.getScene()),this._sliderBarMaterial=null!==(i=this._sliderBarMaterial)&&void 0!==i?i:new Zt("".concat(this.name,"_sliderbar_material"),t.getScene()),this._sliderThumbMaterial=null!==(o=this._sliderThumbMaterial)&&void 0!==o?o:new Jt("".concat(this.name,"_sliderthumb_material"),t.getScene())},e.prototype._createBehavior=function(){var t=this,e=new d.PointerDragBehavior({dragAxis:d.Vector3.Right()});return e.moveAttached=!1,e.onDragStartObservable.add((function(){t._draggedPosition=t._sliderThumb.position.x})),e.onDragObservable.add((function(e){t._draggedPosition+=e.dragDistance/t.scaling.x,t.value=t._convertToValue(t._draggedPosition)})),e},e.prototype._convertToPosition=function(t){var e=(t-this.minimum)/(this.maximum-this.minimum)*(this.end-this.start)+this.start;return Math.min(Math.max(e,this.start),this.end)},e.prototype._convertToValue=function(t){var e=(t-this.start)/(this.end-this.start)*(this.maximum-this.minimum);return e=this.step?Math.round(e/this.step)*this.step:e,Math.max(Math.min(this.minimum+e,this._maximum),this._minimum)},e.prototype.dispose=function(){var e,i,o,r,n,a;t.prototype.dispose.call(this),null===(e=this._sliderBar)||void 0===e||e.dispose(),null===(i=this._sliderThumb)||void 0===i||i.dispose(),null===(o=this._sliderBarMaterial)||void 0===o||o.dispose(),null===(r=this._sliderThumbMaterial)||void 0===r||r.dispose(),null===(n=this._sliderBackplate)||void 0===n||n.dispose(),null===(a=this._sliderBackplateMaterial)||void 0===a||a.dispose()},e.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.MODEL_FILENAME="mrtk-fluent-backplate.glb",e}(mt),ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._radius=5,e}return l(e,t),Object.defineProperty(e.prototype,"radius",{get:function(){return this._radius},set:function(t){var e=this;this._radius!==t&&(this._radius=t,d.Tools.SetImmediate((function(){e._arrangeChildren()})))},enumerable:!1,configurable:!0}),e.prototype._mapGridNode=function(t,e){var i=t.mesh;if(i){var o=this._sphericalMapping(e);switch(t.position=o,this.orientation){case Pt.FACEORIGIN_ORIENTATION:i.lookAt(new d.Vector3(2*o.x,2*o.y,2*o.z));break;case Pt.FACEORIGINREVERSED_ORIENTATION:i.lookAt(new d.Vector3(-o.x,-o.y,-o.z));break;case Pt.FACEFORWARD_ORIENTATION:break;case Pt.FACEFORWARDREVERSED_ORIENTATION:i.rotate(d.Axis.Y,Math.PI,0)}}},e.prototype._sphericalMapping=function(t){var e=new d.Vector3(0,0,this._radius),i=t.y/this._radius,o=-t.x/this._radius;return d.Matrix.RotationYawPitchRollToRef(o,i,0,d.TmpVectors.Matrix[0]),d.Vector3.TransformNormal(e,d.TmpVectors.Matrix[0])},e}(It),oe=function(t){function e(e){void 0===e&&(e=!1);var i=t.call(this)||this;return i._isVertical=!1,i.margin=.1,i._isVertical=e,i}return l(e,t),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){var e=this;this._isVertical!==t&&(this._isVertical=t,d.Tools.SetImmediate((function(){e._arrangeChildren()})))},enumerable:!1,configurable:!0}),e.prototype._arrangeChildren=function(){for(var t,e=0,i=0,o=0,r=[],n=d.Matrix.Invert(this.node.computeWorldMatrix(!0)),a=0,s=this._children;a0?this.margin:0)}},e}(Pt),re=function(t){function e(e,i){var o=t.call(this,i,e)||this;return o._currentMesh=e,o.pointerEnterAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1.1)},o.pointerOutAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/1.1)},o.pointerDownAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(.95)},o.pointerUpAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/.95)},o}return l(e,t),e.prototype._getTypeName=function(){return"TouchMeshButton3D"},e.prototype._createNode=function(){var t=this;return this._currentMesh.getChildMeshes().forEach((function(e){t._injectGUI3DReservedDataStore(e).control=t})),this._currentMesh},e.prototype._affectMaterial=function(t){},e}(kt);d.ShaderStore.ShadersStore.mrdlBackglowPixelShader="uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;float BiasFunc(float b,float v) {return pow(v,log(clamp(b,0.001,0.999))/log(0.5));}\nvoid Fuzzy_Round_Rect_B33(\nfloat Size_X,\nfloat Size_Y,\nfloat Radius_X,\nfloat Radius_Y,\nfloat Line_Width,\nvec2 UV,\nfloat Outer_Fuzz,\nfloat Max_Outer_Fuzz,\nout float Rect_Distance,\nout float Inner_Distance)\n{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius_X,Radius_Y),halfSize),vec2(0.001,0.001));float radius=min(r.x,r.y)-Max_Outer_Fuzz;vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);float d=distance(nearestp,v);Inner_Distance=clamp(1.0-(radius-d)/Line_Width,0.0,1.0);Rect_Distance=clamp(1.0-(d-radius)/Outer_Fuzz,0.0,1.0)*Inner_Distance;}\nvoid main()\n{float X_Q42;float Y_Q42;X_Q42=vNormal.x;Y_Q42=vNormal.y;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Sqrt_F_Q27=sqrt(MaxAB_Q24);float Power_Q43=pow(MaxAB_Q24,_Intensity_Fade_In_Exponent_);float Value_At_T_Q26=mix(_Outer_Fuzz_Start_,_Outer_Fuzz_End_,Sqrt_F_Q27);float Product_Q23=_Max_Intensity_*Power_Q43;float Rect_Distance_Q33;float Inner_Distance_Q33;Fuzzy_Round_Rect_B33(X_Q42,Y_Q42,_Bevel_Radius_,_Bevel_Radius_,_Line_Width_,vUV,Value_At_T_Q26,_Outer_Fuzz_Start_,Rect_Distance_Q33,Inner_Distance_Q33);float Power_Q44=pow(Inner_Distance_Q33,_Blend_Exponent_);float Result_Q45=pow(BiasFunc(_Bias_,Rect_Distance_Q33),_Falloff_);vec4 Color_At_T_Q25=mix(_Inner_Color_,_Color_,Power_Q44);float Product_Q22=Result_Q45*Product_Q23;vec4 Result_Q28=Product_Q22*Color_At_T_Q25;vec4 Out_Color=Result_Q28;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.mrdlBackglowVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;varying vec3 vNormal;varying vec2 vUV;void main()\n{vec3 Dir_World_Q41=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q40=(world*vec4((cross(normal,tangent)),0.0)).xyz;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Length_Q16=length(Dir_World_Q41);float Length_Q17=length(Dir_World_Q40);bool Greater_Than_Q37=MaxAB_Q24>0.0;vec3 Sizes_Q35;vec2 XY_Q35;Sizes_Q35=(_Absolute_Sizes_ ? vec3(Length_Q16,Length_Q17,0) : vec3(Length_Q16/Length_Q17,1,0));XY_Q35=(uv-vec2(0.5,0.5))*Sizes_Q35.xy;vec3 Result_Q38=Greater_Than_Q37 ? position : vec3(0,0,0);vec3 Pos_World_Q39=(world*vec4(Result_Q38,1.0)).xyz;vec3 Position=Pos_World_Q39;vec3 Normal=Sizes_Q35;vec2 UV=XY_Q35;vec3 Tangent=vec3(0,0,0);vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;}";var ne=function(t){function e(){var e=t.call(this)||this;return e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),ae=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o.bevelRadius=.16,o.lineWidth=.16,o.absoluteSizes=!1,o.tuningMotion=0,o.motion=1,o.maxIntensity=.7,o.intensityFadeInExponent=2,o.outerFuzzStart=.04,o.outerFuzzEnd=.04,o.color=new d.Color4(.682353,.698039,1,1),o.innerColor=new d.Color4(.356863,.392157,.796078,1),o.blendExponent=1.5,o.falloff=2,o.bias=.5,o.alphaMode=d.Constants.ALPHA_ADD,o.disableDepthWrite=!0,o.backFaceCulling=!1,o}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new ne);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Bevel_Radius_","_Line_Width_","_Absolute_Sizes_","_Tuning_Motion_","_Motion_","_Max_Intensity_","_Intensity_Fade_In_Exponent_","_Outer_Fuzz_Start_","_Outer_Fuzz_End_","_Color_","_Inner_Color_","_Blend_Exponent_","_Falloff_","_Bias_"],h=[],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlBackglow",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setFloat("_Bevel_Radius_",this.bevelRadius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Tuning_Motion_",this.tuningMotion),this._activeEffect.setFloat("_Motion_",this.motion),this._activeEffect.setFloat("_Max_Intensity_",this.maxIntensity),this._activeEffect.setFloat("_Intensity_Fade_In_Exponent_",this.intensityFadeInExponent),this._activeEffect.setFloat("_Outer_Fuzz_Start_",this.outerFuzzStart),this._activeEffect.setFloat("_Outer_Fuzz_End_",this.outerFuzzEnd),this._activeEffect.setDirectColor4("_Color_",this.color),this._activeEffect.setDirectColor4("_Inner_Color_",this.innerColor),this._activeEffect.setFloat("_Blend_Exponent_",this.blendExponent),this._activeEffect.setFloat("_Falloff_",this.falloff),this._activeEffect.setFloat("_Bias_",this.bias),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var t=d.SerializationHelper.Serialize(this);return t.customType="BABYLON.MRDLBackglowMaterial",t},e.prototype.getClassName=function(){return"MRDLBackglowMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},h([(0,d.serialize)()],e.prototype,"bevelRadius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"absoluteSizes",void 0),h([(0,d.serialize)()],e.prototype,"tuningMotion",void 0),h([(0,d.serialize)()],e.prototype,"motion",void 0),h([(0,d.serialize)()],e.prototype,"maxIntensity",void 0),h([(0,d.serialize)()],e.prototype,"intensityFadeInExponent",void 0),h([(0,d.serialize)()],e.prototype,"outerFuzzStart",void 0),h([(0,d.serialize)()],e.prototype,"outerFuzzEnd",void 0),h([(0,d.serialize)()],e.prototype,"color",void 0),h([(0,d.serialize)()],e.prototype,"innerColor",void 0),h([(0,d.serialize)()],e.prototype,"blendExponent",void 0),h([(0,d.serialize)()],e.prototype,"falloff",void 0),h([(0,d.serialize)()],e.prototype,"bias",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLBackglowMaterial",ae);d.ShaderStore.ShadersStore.mrdlFrontplatePixelShader="uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Scale_Color_B54(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=Scalar*Color;}\nvoid Scale_RGB_B50(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Proximity_Fragment_B51(\nfloat Proximity_Max_Intensity,\nfloat Proximity_Near_Radius,\nvec4 Deltas,\nfloat Show_Selection,\nfloat Distance_Fade1,\nfloat Distance_Fade2,\nfloat Strength,\nout float Proximity)\n{float proximity1=(1.0-clamp(length(Deltas.xy)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade1;float proximity2=(1.0-clamp(length(Deltas.zw)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade2;Proximity=Strength*(Proximity_Max_Intensity*max(proximity1,proximity2) *(1.0-Show_Selection)+Show_Selection);}\nvoid Blob_Fragment_B56(\nvec2 UV,\nvec3 Blob_Info,\nsampler2D Blob_Texture,\nout vec4 Blob_Color)\n{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}\nvoid Round_Rect_Fragment_B61(\nfloat Radius,\nvec4 Line_Color,\nfloat Filter_Width,\nfloat Line_Visibility,\nvec4 Fill_Color,\nbool Smooth_Edges,\nvec4 Rect_Parms,\nout float Inside_Rect)\n{float d=length(max(abs(Rect_Parms.zw)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);Inside_Rect=Smooth_Edges ? clamp((Radius-d)/dx,0.0,1.0) : 1.0-step(Radius,d);}\nvoid main()\n{float Is_Quad_Q53;Is_Quad_Q53=vNormal.z;vec4 Blob_Color_Q56;Blob_Fragment_B56(vUV,vTangent,_Blob_Texture_,Blob_Color_Q56);float X_Q52;float Y_Q52;float Z_Q52;float W_Q52;X_Q52=vExtra3.x;Y_Q52=vExtra3.y;Z_Q52=vExtra3.z;W_Q52=vExtra3.w;float Proximity_Q51;Proximity_Fragment_B51(_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vExtra2,X_Q52,Y_Q52,Z_Q52,1.0,Proximity_Q51);float Inside_Rect_Q61;Round_Rect_Fragment_B61(W_Q52,vec4(1,1,1,1),_Filter_Width_,1.0,vec4(0,0,0,0),_Smooth_Edges_,vExtra1,Inside_Rect_Q61);vec4 Result_Q50;Scale_RGB_B50(_Edge_Color_,Proximity_Q51,Result_Q50);vec4 Result_Q47=Inside_Rect_Q61*Blob_Color_Q56;vec4 Color_At_T_Q48=mix(Result_Q50,Result_Q47,Is_Quad_Q53);vec4 Result_Q54;Scale_Color_B54(Color_At_T_Q48,_Fade_Out_,Result_Q54);vec4 Out_Color=Result_Q54;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.mrdlFrontplateVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Blob_Vertex_B40(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nvec4 Vx_Color,\nvec2 UV,\nvec3 Face_Center,\nvec2 Face_Size,\nvec2 In_UV,\nfloat Blob_Fade_Length,\nfloat Selection_Fade,\nfloat Selection_Fade_Size,\nfloat Inner_Fade,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nfloat Blob_Enabled,\nfloat DistanceOffset,\nout vec3 Out_Position,\nout vec2 Out_UV,\nout vec3 Blob_Info,\nout vec2 Blob_Relative_UV)\n{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal)+DistanceOffset*Blob_Far_Distance;Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; \nvec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);Blob_Relative_UV=blobClipped/Face_Size.y;}\nvoid Round_Rect_Vertex_B36(\nvec2 UV,\nvec3 Tangent,\nvec3 Binormal,\nfloat Radius,\nfloat Anisotropy,\nvec2 Blob_Center_UV,\nout vec2 Rect_UV,\nout vec2 Scale_XY,\nout vec4 Rect_Parms)\n{Scale_XY=vec2(Anisotropy,1.0);Rect_UV=(UV-vec2(0.5,0.5))*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius);Rect_Parms.zw=Blob_Center_UV;}\nvec2 ProjectProximity(\nvec3 blobPosition,\nvec3 position,\nvec3 center,\nvec3 dir,\nvec3 xdir,\nvec3 ydir,\nout float vdistance\n)\n{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}\nvoid Proximity_Vertex_B33(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec3 Position,\nfloat Proximity_Far_Distance,\nfloat Relative_Scale,\nfloat Proximity_Anisotropy,\nvec3 Normal,\nvec3 Tangent,\nvec3 Binormal,\nout vec4 Extra,\nout float Distance_To_Face,\nout float Distance_Fade1,\nout float Distance_Fade2)\n{float distz1,distz2;Extra.xy=ProjectProximity(Blob_Position,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz1)/Relative_Scale;Extra.zw=ProjectProximity(Blob_Position_2,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz2)/Relative_Scale;Distance_To_Face=dot(Normal,Position-Face_Center);Distance_Fade1=1.0-clamp(distz1/Proximity_Far_Distance,0.0,1.0);Distance_Fade2=1.0-clamp(distz2/Proximity_Far_Distance,0.0,1.0);}\nvoid Object_To_World_Pos_B12(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Choose_Blob_B27(\nvec4 Vx_Color,\nvec3 Position1,\nvec3 Position2,\nbool Blob_Enable_1,\nbool Blob_Enable_2,\nfloat Near_Size_1,\nfloat Near_Size_2,\nfloat Blob_Inner_Fade_1,\nfloat Blob_Inner_Fade_2,\nfloat Blob_Pulse_1,\nfloat Blob_Pulse_2,\nfloat Blob_Fade_1,\nfloat Blob_Fade_2,\nout vec3 Position,\nout float Near_Size,\nout float Inner_Fade,\nout float Blob_Enable,\nout float Fade,\nout float Pulse)\n{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=Blob_Enable_1 ? 1.0 : 0.0;float b2=Blob_Enable_2 ? 1.0 : 0.0;Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}\nvoid Move_Verts_B32(\nvec2 UV,\nfloat Radius,\nfloat Anisotropy,\nfloat Line_Width,\nfloat Visible,\nout vec3 New_P,\nout vec2 New_UV)\n{vec2 xy=2.0*UV-vec2(0.5,0.5);vec2 center=clamp(xy,0.0,1.0);vec2 delta=2.0*(xy-center);float deltaLength=length(delta);vec2 aniso=vec2(1.0/Anisotropy,1.0);center=(center-vec2(0.5,0.5))*(1.0-2.0*Radius*aniso);New_UV=vec2((2.0-2.0*deltaLength)*Visible,0.0);float deltaRadius= (Radius-Line_Width*New_UV.x);New_P.xy=(center+deltaRadius/deltaLength *aniso*delta);New_P.z=0.0;}\nvoid Object_To_World_Dir_B14(\nvec3 Dir_Object,\nout vec3 Binormal_World)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;}\nvoid Proximity_Visibility_B55(\nfloat Selection,\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Proximity_Far_Distance,\nfloat Proximity_Radius,\nvec3 Face_Center,\nvec3 Normal,\nvec2 Face_Size,\nfloat Gaze,\nout float Width)\n{float boxMaxSize=length(Face_Size)*0.5;float d1=dot(Proximity_Center-Face_Center,Normal);vec3 blob1=Proximity_Center-d1*Normal;float d2=dot(Proximity_Center_2-Face_Center,Normal);vec3 blob2=Proximity_Center_2-d2*Normal;vec3 delta1=blob1-Face_Center;vec3 delta2=blob2-Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));Width=max(Gaze,Width);}\nvec2 ramp2(vec2 start,vec2 end,vec2 x)\n{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}\nfloat computeSelection(\nvec3 blobPosition,\nvec3 normal,\nvec3 tangent,\nvec3 bitangent,\nvec3 faceCenter,\nvec2 faceSize,\nfloat selectionFuzz,\nfloat farDistance,\nfloat fadeLength\n)\n{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}\nvoid Selection_Vertex_B31(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec2 Face_Size,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Selection_Fuzz,\nfloat Selected,\nfloat Far_Distance,\nfloat Fade_Length,\nvec3 Active_Face_Dir,\nout float Show_Selection)\n{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);Show_Selection=mix(max(select1,select2),1.0,Selected);}\nvoid main()\n{vec3 Vec3_Q29=vec3(vec2(0,0).x,vec2(0,0).y,color.r);vec3 Nrm_World_Q24;Nrm_World_Q24=normalize((world*vec4(normal,0.0)).xyz);vec3 Face_Center_Q30;Face_Center_Q30=(world*vec4(vec3(0,0,0),1.0)).xyz;vec3 Tangent_World_Q13;Tangent_World_Q13=(world*vec4(tangent,0.0)).xyz;vec3 Result_Q42;Result_Q42=_Use_Global_Left_Index_ ? Global_Left_Index_Tip_Position.xyz : _Blob_Position_;vec3 Result_Q43;Result_Q43=_Use_Global_Right_Index_ ? Global_Right_Index_Tip_Position.xyz : _Blob_Position_2_;float Value_At_T_Q58=mix(_Blob_Near_Size_,_Blob_Pulse_Max_Size_,_Blob_Pulse_);float Value_At_T_Q59=mix(_Blob_Near_Size_2_,_Blob_Pulse_Max_Size_,_Blob_Pulse_2_);vec3 Cross_Q70=cross(normal,tangent);float Product_Q45=_Gaze_Intensity_*_Gaze_Focus_;float Step_Q46=step(0.0001,Product_Q45);vec3 Tangent_World_N_Q15=normalize(Tangent_World_Q13);vec3 Position_Q27;float Near_Size_Q27;float Inner_Fade_Q27;float Blob_Enable_Q27;float Fade_Q27;float Pulse_Q27;Choose_Blob_B27(color,Result_Q42,Result_Q43,_Blob_Enable_,_Blob_Enable_2_,Value_At_T_Q58,Value_At_T_Q59,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q27,Near_Size_Q27,Inner_Fade_Q27,Blob_Enable_Q27,Fade_Q27,Pulse_Q27);vec3 Binormal_World_Q14;Object_To_World_Dir_B14(Cross_Q70,Binormal_World_Q14);float Anisotropy_Q21=length(Tangent_World_Q13)/length(Binormal_World_Q14);vec3 Binormal_World_N_Q16=normalize(Binormal_World_Q14);vec2 Face_Size_Q35;float ScaleY_Q35;Face_Size_Q35=vec2(length(Tangent_World_Q13),length(Binormal_World_Q14));ScaleY_Q35=Face_Size_Q35.y;float Out_Radius_Q38;float Out_Line_Width_Q38;Out_Radius_Q38=_Relative_To_Height_ ? _Radius_ : _Radius_/ScaleY_Q35;Out_Line_Width_Q38=_Relative_To_Height_ ? _Line_Width_ : _Line_Width_/ScaleY_Q35;float Show_Selection_Q31;Selection_Vertex_B31(Result_Q42,Result_Q43,Face_Center_Q30,Face_Size_Q35,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,vec3(0,0,-1),Show_Selection_Q31);float MaxAB_Q41=max(Show_Selection_Q31,Product_Q45);float Width_Q55;Proximity_Visibility_B55(Show_Selection_Q31,Result_Q42,Result_Q43,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Face_Center_Q30,Nrm_World_Q24,Face_Size_Q35,Step_Q46,Width_Q55);vec3 New_P_Q32;vec2 New_UV_Q32;Move_Verts_B32(uv,Out_Radius_Q38,Anisotropy_Q21,Out_Line_Width_Q38,Width_Q55,New_P_Q32,New_UV_Q32);vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q32,Pos_World_Q12);vec3 Out_Position_Q40;vec2 Out_UV_Q40;vec3 Blob_Info_Q40;vec2 Blob_Relative_UV_Q40;Blob_Vertex_B40(Pos_World_Q12,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Position_Q27,_Blob_Intensity_,Near_Size_Q27,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q30,Face_Size_Q35,New_UV_Q32,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q27,Pulse_Q27,Fade_Q27,Blob_Enable_Q27,0.0,Out_Position_Q40,Out_UV_Q40,Blob_Info_Q40,Blob_Relative_UV_Q40);vec2 Rect_UV_Q36;vec2 Scale_XY_Q36;vec4 Rect_Parms_Q36;Round_Rect_Vertex_B36(New_UV_Q32,Tangent_World_Q13,Binormal_World_Q14,Out_Radius_Q38,Anisotropy_Q21,Blob_Relative_UV_Q40,Rect_UV_Q36,Scale_XY_Q36,Rect_Parms_Q36);vec4 Extra_Q33;float Distance_To_Face_Q33;float Distance_Fade1_Q33;float Distance_Fade2_Q33;Proximity_Vertex_B33(Result_Q42,Result_Q43,Face_Center_Q30,Pos_World_Q12,_Proximity_Far_Distance_,1.0,_Proximity_Anisotropy_,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Extra_Q33,Distance_To_Face_Q33,Distance_Fade1_Q33,Distance_Fade2_Q33);vec4 Vec4_Q37=vec4(MaxAB_Q41,Distance_Fade1_Q33,Distance_Fade2_Q33,Out_Radius_Q38);vec3 Position=Out_Position_Q40;vec3 Normal=Vec3_Q29;vec2 UV=Out_UV_Q40;vec3 Tangent=Blob_Info_Q40;vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);vec4 Extra1=Rect_Parms_Q36;vec4 Extra2=Extra_Q33;vec4 Extra3=Vec4_Q37;gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;vTangent=Tangent;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var se=function(t){function e(){var e=t.call(this)||this;return e.SMOOTH_EDGES=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),le=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.12,r.lineWidth=.01,r.relativeToHeight=!1,r._filterWidth=1,r.edgeColor=new d.Color4(.53,.53,.53,1),r.blobEnable=!0,r.blobPosition=new d.Vector3(100,100,100),r.blobIntensity=.5,r.blobNearSize=.032,r.blobFarSize=.048,r.blobNearDistance=.008,r.blobFarDistance=.064,r.blobFadeLength=.04,r.blobInnerFade=.01,r.blobPulse=0,r.blobFade=1,r.blobPulseMaxSize=.05,r.blobEnable2=!0,r.blobPosition2=new d.Vector3(10,10.1,-.6),r.blobNearSize2=.008,r.blobInnerFade2=.1,r.blobPulse2=0,r.blobFade2=1,r.gazeIntensity=.8,r.gazeFocus=0,r.selectionFuzz=.5,r.selected=1,r.selectionFade=.2,r.selectionFadeSize=0,r.selectedDistance=.08,r.selectedFadeLength=.08,r.proximityMaxIntensity=.45,r.proximityFarDistance=.16,r.proximityNearRadius=.016,r.proximityAnisotropy=1,r.useGlobalLeftIndex=!0,r.useGlobalRightIndex=!0,r.fadeOut=1,r.alphaMode=d.Constants.ALPHA_ADD,r.disableDepthWrite=!0,r.backFaceCulling=!1,r._blobTexture=new d.Texture(e.BLOB_TEXTURE_URL,o,!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new se);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Relative_To_Height_","_Filter_Width_","_Edge_Color_","_Fade_Out_","_Smooth_Edges_","_Blob_Enable_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Inner_Fade_","_Blob_Pulse_","_Blob_Fade_","_Blob_Pulse_Max_Size_","_Blob_Enable_2_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Inner_Fade_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Gaze_Intensity_","_Gaze_Focus_","_Blob_Texture_","_Selection_Fuzz_","_Selected_","_Selection_Fade_","_Selection_Fade_Size_","_Selected_Distance_","_Selected_Fade_Length_","_Proximity_Max_Intensity_","_Proximity_Far_Distance_","_Proximity_Near_Radius_","_Proximity_Anisotropy_","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","_Use_Global_Left_Index_","_Use_Global_Right_Index_"],h=[],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlFrontplate",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Relative_To_Height_",this.relativeToHeight?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Edge_Color_",this.edgeColor),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._activeEffect.setFloat("_Blob_Enable_",this.blobEnable?1:0),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Inner_Fade_",this.blobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setFloat("_Blob_Pulse_Max_Size_",this.blobPulseMaxSize),this._activeEffect.setFloat("_Blob_Enable_2_",this.blobEnable2?1:0),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Inner_Fade_2_",this.blobInnerFade2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setFloat("_Gaze_Intensity_",this.gazeIntensity),this._activeEffect.setFloat("_Gaze_Focus_",this.gazeFocus),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Selection_Fuzz_",this.selectionFuzz),this._activeEffect.setFloat("_Selected_",this.selected),this._activeEffect.setFloat("_Selection_Fade_",this.selectionFade),this._activeEffect.setFloat("_Selection_Fade_Size_",this.selectionFadeSize),this._activeEffect.setFloat("_Selected_Distance_",this.selectedDistance),this._activeEffect.setFloat("_Selected_Fade_Length_",this.selectedFadeLength),this._activeEffect.setFloat("_Proximity_Max_Intensity_",this.proximityMaxIntensity),this._activeEffect.setFloat("_Proximity_Far_Distance_",this.proximityFarDistance),this._activeEffect.setFloat("_Proximity_Near_Radius_",this.proximityNearRadius),this._activeEffect.setFloat("_Proximity_Anisotropy_",this.proximityAnisotropy),this._activeEffect.setFloat("_Use_Global_Left_Index_",this.useGlobalLeftIndex?1:0),this._activeEffect.setFloat("_Use_Global_Right_Index_",this.useGlobalRightIndex?1:0),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var t=d.SerializationHelper.Serialize(this);return t.customType="BABYLON.MRDLFrontplateMaterial",t},e.prototype.getClassName=function(){return"MRDLFrontplateMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLOB_TEXTURE_URL="",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"relativeToHeight",void 0),h([(0,d.serialize)()],e.prototype,"edgeColor",void 0),h([(0,d.serialize)()],e.prototype,"blobEnable",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobInnerFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPulseMaxSize",void 0),h([(0,d.serialize)()],e.prototype,"blobEnable2",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition2",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobInnerFade2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"gazeIntensity",void 0),h([(0,d.serialize)()],e.prototype,"gazeFocus",void 0),h([(0,d.serialize)()],e.prototype,"selectionFuzz",void 0),h([(0,d.serialize)()],e.prototype,"selected",void 0),h([(0,d.serialize)()],e.prototype,"selectionFade",void 0),h([(0,d.serialize)()],e.prototype,"selectionFadeSize",void 0),h([(0,d.serialize)()],e.prototype,"selectedDistance",void 0),h([(0,d.serialize)()],e.prototype,"selectedFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"proximityMaxIntensity",void 0),h([(0,d.serialize)()],e.prototype,"proximityFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"proximityNearRadius",void 0),h([(0,d.serialize)()],e.prototype,"proximityAnisotropy",void 0),h([(0,d.serialize)()],e.prototype,"useGlobalLeftIndex",void 0),h([(0,d.serialize)()],e.prototype,"useGlobalRightIndex",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLFrontplateMaterial",le);d.ShaderStore.ShadersStore.mrdlInnerquadPixelShader="uniform vec3 cameraPosition;varying vec2 vUV;varying vec3 vTangent;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;float FilterStep_Bid194(float edge,float x,float filterWidth)\n{float dx=max(1.0E-5,fwidth(x)*filterWidth);return max((x+dx*0.5-max(edge,x-dx*0.5))/dx,0.0);}\nvoid Round_Rect_B194(\nfloat Size_X,\nfloat Size_Y,\nfloat Radius,\nvec4 Rect_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Glow_Fraction,\nfloat Glow_Max,\nfloat Glow_Falloff,\nout vec4 Color)\n{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius,Radius),halfSize),vec2(0.01,0.01));vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);vec2 delta=(v-nearestp)/max(vec2(0.01,0.01),r);float Distance=length(delta);float insideRect=1.0-FilterStep_Bid194(1.0-Glow_Fraction,Distance,Filter_Width);float glow=clamp((1.0-Distance)/Glow_Fraction,0.0,1.0);glow=pow(glow,Glow_Falloff);Color=Rect_Color*max(insideRect,glow*Glow_Max);}\nvoid main()\n{float X_Q192;float Y_Q192;float Z_Q192;X_Q192=vTangent.x;Y_Q192=vTangent.y;Z_Q192=vTangent.z;vec4 Color_Q194;Round_Rect_B194(X_Q192,1.0,Y_Q192,_Color_,_Filter_Width_,vUV,_Glow_Fraction_,_Glow_Max_,_Glow_Falloff_,Color_Q194);vec4 Out_Color=Color_Q194;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}\n";d.ShaderStore.ShadersStore.mrdlInnerquadVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;varying vec2 vUV;varying vec3 vTangent;void main()\n{vec3 Pos_World_Q189;Pos_World_Q189=(world*vec4(position,1.0)).xyz;vec3 Dir_World_Q190;Dir_World_Q190=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q191;Dir_World_Q191=(world*vec4((cross(normal,tangent)),0.0)).xyz;float Length_Q180=length(Dir_World_Q190);float Length_Q181=length(Dir_World_Q191);float Quotient_Q184=Length_Q180/Length_Q181;float Quotient_Q195=_Radius_/Length_Q181;vec2 Result_Q193;Result_Q193=vec2((uv.x-0.5)*Length_Q180/Length_Q181,(uv.y-0.5));float Result_Q198=_Fixed_Radius_ ? Quotient_Q195 : _Radius_;vec3 Vec3_Q183=vec3(Quotient_Q184,Result_Q198,0);vec3 Position=Pos_World_Q189;vec3 Normal=vec3(0,0,0);vec2 UV=Result_Q193;vec3 Tangent=Vec3_Q183;vec3 Binormal=vec3(0,0,0);vec4 Color=color;gl_Position=viewProjection*vec4(Position,1);vUV=UV;vTangent=Tangent;}\n";var _e=function(t){function e(){var e=t.call(this)||this;return e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),he=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o.color=new d.Color4(1,1,1,.05),o.radius=.12,o.fixedRadius=!0,o._filterWidth=1,o.glowFraction=0,o.glowMax=.5,o.glowFalloff=2,o.alphaMode=d.Constants.ALPHA_COMBINE,o.backFaceCulling=!1,o}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new _e);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!0,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Color_","_Radius_","_Fixed_Radius_","_Filter_Width_","_Glow_Fraction_","_Glow_Max_","_Glow_Falloff_"],h=[],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlInnerquad",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setDirectColor4("_Color_",this.color),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Fixed_Radius_",this.fixedRadius?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setFloat("_Glow_Fraction_",this.glowFraction),this._activeEffect.setFloat("_Glow_Max_",this.glowMax),this._activeEffect.setFloat("_Glow_Falloff_",this.glowFalloff),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var t=d.SerializationHelper.Serialize(this);return t.customType="BABYLON.MRDLInnerquadMaterial",t},e.prototype.getClassName=function(){return"MRDLInnerquadMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},h([(0,d.serialize)()],e.prototype,"color",void 0),h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"fixedRadius",void 0),h([(0,d.serialize)()],e.prototype,"glowFraction",void 0),h([(0,d.serialize)()],e.prototype,"glowMax",void 0),h([(0,d.serialize)()],e.prototype,"glowFalloff",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLInnerquadMaterial",he);var ce=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o.width=1,o.height=1,o.radius=.14,o.textSizeInPixels=18,o.imageSizeInPixels=40,o.plateMaterialColor=new d.Color3(.4,.4,.4),o.frontPlateDepth=.2,o.backPlateDepth=.04,o.backGlowOffset=.1,o.flatPlaneDepth=.001,o.innerQuadRadius=o.radius-.04,o.innerQuadColor=new d.Color4(0,0,0,0),o.innerQuadToggledColor=new d.Color4(.5197843,.6485234,.9607843,.6),o.innerQuadHoverColor=new d.Color4(1,1,1,.05),o.innerQuadToggledHoverColor=new d.Color4(.5197843,.6485234,.9607843,1),o._isBackplateVisible=!0,o._shareMaterials=!0,o._shareMaterials=i,o.pointerEnterAnimation=function(){o._frontPlate&&o._textPlate&&!o.isToggleButton&&o._performEnterExitAnimation(1),o.isToggleButton&&o._innerQuadMaterial&&(o.isToggled?o._innerQuadMaterial.color=o.innerQuadToggledHoverColor:o._innerQuadMaterial.color=o.innerQuadHoverColor)},o.pointerOutAnimation=function(){o._frontPlate&&o._textPlate&&!o.isToggleButton&&o._performEnterExitAnimation(-.8),o.isToggleButton&&o._innerQuadMaterial&&o._onToggle(o.isToggled)},o.pointerDownAnimation=function(){},o.pointerUpAnimation=function(){},o._pointerClickObserver=o.onPointerClickObservable.add((function(){o._frontPlate&&o._backGlow&&!o.isActiveNearInteraction&&o._performClickAnimation(),o.isToggleButton&&o._innerQuadMaterial&&o._onToggle(o.isToggled)})),o._pointerEnterObserver=o.onPointerEnterObservable.add((function(){o.pointerEnterAnimation()})),o._pointerOutObserver=o.onPointerOutObservable.add((function(){o.pointerOutAnimation()})),o._toggleObserver=o.onToggleObservable.add((function(t){o._innerQuadMaterial.color=t?o.innerQuadToggledColor:o.innerQuadColor})),o}return l(e,t),e.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(t){this._backPlate.renderingGroupId=t,this._textPlate.renderingGroupId=t,this._frontPlate.renderingGroupId=t,this._backGlow.renderingGroupId=t,this._innerQuad.renderingGroupId=t,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._backPlate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tooltipText",{get:function(){var t;return(null===(t=this._tooltipTextBlock)||void 0===t?void 0:t.text)||null},set:function(t){var e=this;if(t){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,d.CreatePlane)("",{size:1},this._backPlate._scene),this._tooltipMesh.position=d.Vector3.Down().scale(.7).add(d.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._frontPlateCollisionMesh,this._tooltipTexture=ct.CreateForMesh(this._tooltipMesh);var o=new T;o.height=.25,o.width=.8,o.cornerRadius=25,o.color="#ffffff",o.thickness=20,o.background="#060668",this._tooltipTexture.addControl(o),this._tooltipTextBlock=new S,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=100,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new d.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=t)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this._text!==t&&(this._text=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subtext",{get:function(){return this._subtext},set:function(t){this._subtext!==t&&(this._subtext=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(t){this._imageUrl!==t&&(this._imageUrl=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backGlowMaterial",{get:function(){return this._backGlowMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"innerQuadMaterial",{get:function(){return this._innerQuadMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBackplateVisible",{set:function(t){this.mesh&&this._backMaterial&&(t&&!this._isBackplateVisible?this._backPlate.visibility=1:!t&&this._isBackplateVisible&&(this._backPlate.visibility=0)),this._isBackplateVisible=t},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"TouchHolographicButton"},e.prototype._rebuildContent=function(){var t;t=this._getAspectRatio()<=1?this._alignContentVertically():this._alignContentHorizontally(),this.content=t},e.prototype._getAspectRatio=function(){return this.width/this.height},e.prototype._alignContentVertically=function(){var t=new w;if(t.isVertical=!0,(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var e=new O;e.source=this._imageUrl,e.heightInPixels=180,e.widthInPixels=100,e.paddingTopInPixels=40,e.paddingBottomInPixels=40,t.addControl(e)}if(this._text){var i=new S;i.text=this._text,i.color="white",i.heightInPixels=30,i.fontSize=24,t.addControl(i)}return t},e.prototype._alignContentHorizontally=function(){var t=240,e=15,i=new T;i.widthInPixels=t,i.heightInPixels=t,i.color="transparent",i.setPaddingInPixels(e,e,e,e),t-=30;var o=new w;if(o.isVertical=!1,o.scaleY=this._getAspectRatio(),(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var r=new T("".concat(this.name,"_image"));r.widthInPixels=this.imageSizeInPixels,r.heightInPixels=this.imageSizeInPixels,r.color="transparent",t-=this.imageSizeInPixels;var n=new O;n.source=this._imageUrl,r.addControl(n),o.addControl(r)}if(this._text){var a=new S("".concat(this.name,"_text"));if(a.text=this._text,a.color="white",a.fontSize=this.textSizeInPixels,a.widthInPixels=t,this._imageUrl&&(a.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,a.paddingLeftInPixels=e),this._subtext){var s=new D;s.addColumnDefinition(1),s.addRowDefinition(.5),s.addRowDefinition(.5),s.widthInPixels=t,s.heightInPixels=45;var l=new S("".concat(this.name,"_subtext"));l.text=this._subtext,l.color="#EEEEEEAB",l.fontSize=.75*this.textSizeInPixels,l.fontWeight="600",this._imageUrl&&(l.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,l.paddingLeftInPixels=e),s.addControl(a,0),s.addControl(l,1),o.addControl(s)}else o.addControl(a)}return i.addControl(o),i},e.prototype._createNode=function(e){var i;this.name=null!==(i=this.name)&&void 0!==i?i:"TouchHolographicButton";var o=this._createBackPlate(e),r=this._createFrontPlate(e),n=this._createInnerQuad(e),a=this._createBackGlow(e);this._frontPlateCollisionMesh=r,this._textPlate=t.prototype._createNode.call(this,e),this._textPlate.name="".concat(this.name,"_textPlate"),this._textPlate.isPickable=!1,this._textPlate.scaling.x=this.width,this._textPlate.parent=r,this._backPlate=o,this._backPlate.position=d.Vector3.Forward(e.useRightHandedSystem).scale(this.backPlateDepth/2),this._backPlate.isPickable=!1,this._backPlate.addChild(r),this._backPlate.addChild(n),a&&this._backPlate.addChild(a);var s=new d.TransformNode("".concat(this.name,"_root"),e);return this._backPlate.setParent(s),this.collisionMesh=r,this.collidableFrontDirection=this._backPlate.forward.negate(),s},e.prototype._createBackPlate=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_backPlate"),{},t);return o.isPickable=!1,o.visibility=0,o.scaling.z=.2,d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.BACKPLATE_MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.visibility=0,i._isBackplateVisible&&(e.visibility=1,e.name="".concat(i.name,"_backPlate"),e.isPickable=!1,e.scaling.x=i.width,e.scaling.y=i.height,e.parent=o),i._backMaterial&&(e.material=i._backMaterial),i._backPlate=e})),o},e.prototype._createFrontPlate=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_frontPlate"),{width:this.width,height:this.height,depth:this.frontPlateDepth},t);return o.isPickable=!0,o.isNearPickable=!0,o.visibility=0,o.position=d.Vector3.Forward(t.useRightHandedSystem).scale((this.backPlateDepth-this.frontPlateDepth)/2),d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.FRONTPLATE_MODEL_FILENAME,t).then((function(e){var r=(0,d.CreateBox)("".concat(i.name,"_collisionPlate"),{width:i.width,height:i.height},t);r.isPickable=!1,r.scaling.z=i.frontPlateDepth,r.visibility=0,r.parent=o,i._collisionPlate=r;var n=e.meshes[1];n.name="".concat(i.name,"_frontPlate"),n.isPickable=!1,n.scaling.x=i.width-i.backGlowOffset,n.scaling.y=i.height-i.backGlowOffset,n.position=d.Vector3.Forward(t.useRightHandedSystem).scale(-.5),n.parent=r,i.isToggleButton&&(n.visibility=0),i._frontMaterial&&(n.material=i._frontMaterial),i._textPlate.scaling.x=1,i._textPlate.parent=n,i._frontPlate=n})),o},e.prototype._createInnerQuad=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_innerQuad"),{},t);return o.isPickable=!1,o.visibility=0,o.scaling.z=this.flatPlaneDepth,o.position.z+=this.backPlateDepth/2-this.flatPlaneDepth,d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.INNERQUAD_MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.name="".concat(i.name,"_innerQuad"),e.isPickable=!1,e.scaling.x=i.width-i.backGlowOffset,e.scaling.y=i.height-i.backGlowOffset,e.parent=o,i._innerQuadMaterial&&(e.material=i._innerQuadMaterial),i._innerQuad=e})),o},e.prototype._createBackGlow=function(t){var i=this;if(!this.isToggleButton){var o=(0,d.CreateBox)("".concat(this.name,"_backGlow"),{},t);return o.isPickable=!1,o.visibility=0,o.scaling.z=this.flatPlaneDepth,o.position.z+=this.backPlateDepth/2-2*this.flatPlaneDepth,d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.BACKGLOW_MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.name="".concat(i.name,"_backGlow"),e.isPickable=!1,e.scaling.x=i.width-i.backGlowOffset,e.scaling.y=i.height-i.backGlowOffset,e.parent=o,i._backGlowMaterial&&(e.material=i._backGlowMaterial),i._backGlow=e})),o}},e.prototype._applyFacade=function(t){this._plateMaterial.emissiveTexture=t,this._plateMaterial.opacityTexture=t,this._plateMaterial.diffuseColor=this.plateMaterialColor},e.prototype._performClickAnimation=function(){for(var t=new d.AnimationGroup("Click Animation Group"),e=0,i=[{name:"backGlowMotion",mesh:this._backGlow,property:"material.motion",keys:[{frame:0,values:[0,0,0]},{frame:20,values:[1,.0144,.0144]},{frame:40,values:[.0027713229489760476,0,0]},{frame:45,values:[.0027713229489760476]}]},{name:"_collisionPlateZSlide",mesh:this._collisionPlate,property:"position.z",keys:[{frame:0,values:[0,0,0]},{frame:20,values:[d.Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth/2).z,0,0]},{frame:40,values:[0,.005403332496794331]},{frame:45,values:[0]}]},{name:"_collisionPlateZScale",mesh:this._collisionPlate,property:"scaling.z",keys:[{frame:0,values:[this.frontPlateDepth,0,0]},{frame:20,values:[this.backPlateDepth,0,0]},{frame:40,values:[this.frontPlateDepth,.0054]},{frame:45,values:[this.frontPlateDepth]}]}];e0){var e=t/this._customControlScaling;this._customControlScaling=t,this._rootContainer.children.forEach((function(i){i.scaling.scaleInPlace(e),1!==t&&(i._isScaledByManager=!0)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useRealisticScaling",{get:function(){return this.controlScaling===t.MRTK_REALISTIC_SCALING},set:function(e){this.controlScaling=e?t.MRTK_REALISTIC_SCALING:1},enumerable:!1,configurable:!0}),t.prototype._handlePointerOut=function(t,e){var i=this._lastControlOver[t];i&&(i._onPointerOut(i),delete this._lastControlOver[t]),e&&this._lastControlDown[t]&&(this._lastControlDown[t].forcePointerUp(),delete this._lastControlDown[t]),this.onPickedPointChangedObservable.notifyObservers(null)},t.prototype._doPicking=function(t){var e,i,o;if(!this._utilityLayer||!this._utilityLayer.shouldRender||!this._utilityLayer.utilityLayerScene.activeCamera)return!1;var r=t.event,n=r.pointerId||0,a=r.button,s=t.pickInfo;if(s&&this.onPickingObservable.notifyObservers(s.pickedMesh),!s||!s.hit)return this._handlePointerOut(n,t.type===d.PointerEventTypes.POINTERUP),!1;s.pickedPoint&&this.onPickedPointChangedObservable.notifyObservers(s.pickedPoint);var l=null===(i=null===(e=s.pickedMesh.reservedDataStore)||void 0===e?void 0:e.GUI3D)||void 0===i?void 0:i.control;return l&&!l._processObservables(t.type,s.pickedPoint,(null===(o=s.originMesh)||void 0===o?void 0:o.position)||null,n,a)&&t.type===d.PointerEventTypes.POINTERMOVE&&(this._lastControlOver[n]&&this._lastControlOver[n]._onPointerOut(this._lastControlOver[n]),delete this._lastControlOver[n]),t.type===d.PointerEventTypes.POINTERUP&&(this._lastControlDown[r.pointerId]&&(this._lastControlDown[r.pointerId].forcePointerUp(),delete this._lastControlDown[r.pointerId]),("touch"===r.pointerType||"xr"===r.pointerType&&this._scene.getEngine().hostInformation.isMobile)&&this._handlePointerOut(n,!1)),!0},Object.defineProperty(t.prototype,"rootContainer",{get:function(){return this._rootContainer},enumerable:!1,configurable:!0}),t.prototype.containsControl=function(t){return this._rootContainer.containsControl(t)},t.prototype.addControl=function(t){return this._rootContainer.addControl(t),1!==this._customControlScaling&&(t.scaling.scaleInPlace(this._customControlScaling),t._isScaledByManager=!0),this},t.prototype.removeControl=function(t){return this._rootContainer.removeControl(t),t._isScaledByManager&&(t.scaling.scaleInPlace(1/this._customControlScaling),t._isScaledByManager=!1),this},t.prototype.dispose=function(){for(var t in this._rootContainer.dispose(),this._sharedMaterials)Object.prototype.hasOwnProperty.call(this._sharedMaterials,t)&&this._sharedMaterials[t].dispose();for(var t in this._sharedMaterials={},this._touchSharedMaterials)Object.prototype.hasOwnProperty.call(this._touchSharedMaterials,t)&&this._touchSharedMaterials[t].dispose();this._touchSharedMaterials={},this._pointerOutObserver&&this._utilityLayer&&(this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver),this._pointerOutObserver=null),this.onPickedPointChangedObservable.clear(),this.onPickingObservable.clear();var e=this._utilityLayer?this._utilityLayer.utilityLayerScene:null;e&&this._pointerObserver&&(e.onPointerObservable.remove(this._pointerObserver),this._pointerObserver=null),this._scene&&this._sceneDisposeObserver&&(this._scene.onDisposeObservable.remove(this._sceneDisposeObserver),this._sceneDisposeObserver=null),this._utilityLayer&&this._utilityLayer.dispose()},t.MRTK_REALISTIC_SCALING=.032,t}(),de=void 0!==o.g?o.g:"undefined"!=typeof window?window:void 0;void 0!==de&&(de.BABYLON=de.BABYLON||{},de.BABYLON.GUI||(de.BABYLON.GUI=n));const fe=a;return r.default})())); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-gui",["babylonjs"],e):"object"==typeof exports?exports["babylonjs-gui"]=e(require("babylonjs")):(t.BABYLON=t.BABYLON||{},t.BABYLON.GUI=e(t.BABYLON))}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(t=>(()=>{"use strict";var e={597:e=>{e.exports=t}},i={};function o(t){var r=i[t];if(void 0!==r)return r.exports;var n=i[t]={exports:{}};return e[t](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};o.d(r,{default:()=>fe});var n={};o.r(n),o.d(n,{AbstractButton3D:()=>yt,AdvancedDynamicTexture:()=>ct,AdvancedDynamicTextureInstrumentation:()=>ut,BaseGradient:()=>st,BaseSlider:()=>G,Button:()=>R,Button3D:()=>xt,Checkbox:()=>M,CheckboxGroup:()=>Y,ColorPicker:()=>k,Container:()=>B,Container3D:()=>Pt,Control:()=>I,Control3D:()=>mt,CornerHandle:()=>Wt,CylinderPanel:()=>Bt,DisplayGrid:()=>rt,Ellipse:()=>L,FluentBackplateMaterial:()=>wt,FluentButtonMaterial:()=>Dt,FluentMaterial:()=>Tt,FluentMaterialDefines:()=>Ct,FocusableButton:()=>N,FrameGraphGUITask:()=>dt,GUI3DManager:()=>ue,GizmoHandle:()=>Qt,Grid:()=>D,HandMenu:()=>Ot,HandleMaterial:()=>zt,HandleState:()=>At,HolographicBackplate:()=>Mt,HolographicButton:()=>Et,HolographicSlate:()=>Gt,Image:()=>O,ImageBasedSlider:()=>nt,ImageScrollBar:()=>$,InputPassword:()=>z,InputText:()=>F,InputTextArea:()=>A,KeyPropertySet:()=>it,Line:()=>Q,LinearGradient:()=>lt,MRDLBackplateMaterial:()=>te,MRDLSliderBarMaterial:()=>Zt,MRDLSliderThumbMaterial:()=>Jt,MathTools:()=>P,Matrix2D:()=>x,Measure:()=>v,MeshButton3D:()=>Ut,MultiLine:()=>W,MultiLinePoint:()=>V,NearMenu:()=>jt,NodeRenderGraphGUIBlock:()=>ft,PlanePanel:()=>Yt,RadialGradient:()=>_t,RadioButton:()=>H,RadioGroup:()=>X,Rectangle:()=>T,ScatterPanel:()=>Xt,ScrollBar:()=>J,ScrollViewer:()=>tt,SelectionPanel:()=>Z,SelectorGroup:()=>j,SideHandle:()=>Vt,SlateGizmo:()=>Ht,Slider:()=>U,Slider3D:()=>ee,SliderGroup:()=>K,SpherePanel:()=>ie,StackPanel:()=>w,StackPanel3D:()=>oe,Style:()=>ht,TextBlock:()=>S,TextWrapper:()=>E,TextWrapping:()=>C,ToggleButton:()=>et,TouchButton3D:()=>kt,TouchHolographicButton:()=>Lt,TouchHolographicButtonV3:()=>ce,TouchHolographicMenu:()=>St,TouchMeshButton3D:()=>re,ValueAndUnit:()=>f,Vector2WithInfo:()=>y,Vector3WithInfo:()=>bt,VirtualKeyboard:()=>ot,VolumeBasedPanel:()=>It,XmlLoader:()=>gt,name:()=>at});var a={};o.r(a),o.d(a,{AbstractButton3D:()=>yt,AdvancedDynamicTexture:()=>ct,AdvancedDynamicTextureInstrumentation:()=>ut,BaseGradient:()=>st,BaseSlider:()=>G,Button:()=>R,Button3D:()=>xt,Checkbox:()=>M,CheckboxGroup:()=>Y,ColorPicker:()=>k,Container:()=>B,Container3D:()=>Pt,Control:()=>I,Control3D:()=>mt,CornerHandle:()=>Wt,CylinderPanel:()=>Bt,DisplayGrid:()=>rt,Ellipse:()=>L,FluentBackplateMaterial:()=>wt,FluentButtonMaterial:()=>Dt,FluentMaterial:()=>Tt,FluentMaterialDefines:()=>Ct,FocusableButton:()=>N,FrameGraphGUITask:()=>dt,GUI3DManager:()=>ue,GizmoHandle:()=>Qt,Grid:()=>D,HandMenu:()=>Ot,HandleMaterial:()=>zt,HandleState:()=>At,HolographicBackplate:()=>Mt,HolographicButton:()=>Et,HolographicSlate:()=>Gt,Image:()=>O,ImageBasedSlider:()=>nt,ImageScrollBar:()=>$,InputPassword:()=>z,InputText:()=>F,InputTextArea:()=>A,KeyPropertySet:()=>it,Line:()=>Q,LinearGradient:()=>lt,MRDLBackplateMaterial:()=>te,MRDLSliderBarMaterial:()=>Zt,MRDLSliderThumbMaterial:()=>Jt,MathTools:()=>P,Matrix2D:()=>x,Measure:()=>v,MeshButton3D:()=>Ut,MultiLine:()=>W,MultiLinePoint:()=>V,NearMenu:()=>jt,NodeRenderGraphGUIBlock:()=>ft,PlanePanel:()=>Yt,RadialGradient:()=>_t,RadioButton:()=>H,RadioGroup:()=>X,Rectangle:()=>T,ScatterPanel:()=>Xt,ScrollBar:()=>J,ScrollViewer:()=>tt,SelectionPanel:()=>Z,SelectorGroup:()=>j,SideHandle:()=>Vt,SlateGizmo:()=>Ht,Slider:()=>U,Slider3D:()=>ee,SliderGroup:()=>K,SpherePanel:()=>ie,StackPanel:()=>w,StackPanel3D:()=>oe,Style:()=>ht,TextBlock:()=>S,TextWrapper:()=>E,TextWrapping:()=>C,ToggleButton:()=>et,TouchButton3D:()=>kt,TouchHolographicButton:()=>Lt,TouchHolographicButtonV3:()=>ce,TouchHolographicMenu:()=>St,TouchMeshButton3D:()=>re,ValueAndUnit:()=>f,Vector2WithInfo:()=>y,Vector3WithInfo:()=>bt,VirtualKeyboard:()=>ot,VolumeBasedPanel:()=>It,XmlLoader:()=>gt,name:()=>at});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},s(t,e)};function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var _=function(){return _=Object.assign||function(t){for(var e,i=1,o=arguments.length;i=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a}function c(t,e,i,o){return new(i||(i=Promise))((function(r,n){function a(t){try{l(o.next(t))}catch(t){n(t)}}function s(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function u(t,e){var i,o,r,n={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(n=0)),n;)try{if(i=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,o=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(!((r=(r=n.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){n=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]1?this.notRenderable=!0:this.notRenderable=!1}else d.Tools.Error("Cannot move a control to a vector3 if the control is not at root level")},t.prototype.getDescendantsToRef=function(t,e,i){void 0===e&&(e=!1)},t.prototype.getDescendants=function(t,e){var i=[];return this.getDescendantsToRef(i,t,e),i},t.prototype.linkWithMesh=function(e){if(!this._host||this.parent&&this.parent!==this._host._rootContainer)e&&d.Tools.Error("Cannot link a control to a mesh if the control is not at root level");else{var i=this._host._linkedControls.indexOf(this);if(-1!==i)return this._linkedMesh=e,void(e||this._host._linkedControls.splice(i,1));e&&(this.horizontalAlignment=t.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=t.VERTICAL_ALIGNMENT_TOP,this._linkedMesh=e,this._host._linkedControls.push(this))}},t.prototype.setPadding=function(t,e,i,o){var r=t,n=null!=e?e:r,a=null!=i?i:r,s=null!=o?o:n;this.paddingTop=r,this.paddingRight=n,this.paddingBottom=a,this.paddingLeft=s},t.prototype.setPaddingInPixels=function(t,e,i,o){var r=t,n=null!=e?e:r,a=null!=i?i:r,s=null!=o?o:n;this.paddingTopInPixels=r,this.paddingRightInPixels=n,this.paddingBottomInPixels=a,this.paddingLeftInPixels=s},t.prototype._moveToProjectedPosition=function(t){var e,i=this._left.getValue(this._host),o=this._top.getValue(this._host),r=null===(e=this.parent)||void 0===e?void 0:e._currentMeasure;r&&this._processMeasures(r,this._host.getContext());var n=t.x+this._linkOffsetX.getValue(this._host)-this._currentMeasure.width/2,a=t.y+this._linkOffsetY.getValue(this._host)-this._currentMeasure.height/2,s=this._left.ignoreAdaptiveScaling&&this._top.ignoreAdaptiveScaling;s&&(Math.abs(n-i)<.5&&(n=i),Math.abs(a-o)<.5&&(a=o)),(s||i!==n||o!==a)&&(this.left=n+"px",this.top=a+"px",this._left.ignoreAdaptiveScaling=!0,this._top.ignoreAdaptiveScaling=!0,this._markAsDirty())},t.prototype._offsetLeft=function(t){this._isDirty=!0,this._currentMeasure.left+=t},t.prototype._offsetTop=function(t){this._isDirty=!0,this._currentMeasure.top+=t},t.prototype._markMatrixAsDirty=function(){this._isMatrixDirty=!0,this._flagDescendantsAsMatrixDirty()},t.prototype._flagDescendantsAsMatrixDirty=function(){},t.prototype._intersectsRect=function(t,e){return this._transform(e),!(this._evaluatedMeasure.left>=t.left+t.width||this._evaluatedMeasure.top>=t.top+t.height||this._evaluatedMeasure.left+this._evaluatedMeasure.width<=t.left||this._evaluatedMeasure.top+this._evaluatedMeasure.height<=t.top)},t.prototype._computeAdditionalOffsetX=function(){return 0},t.prototype._computeAdditionalOffsetY=function(){return 0},t.prototype.invalidateRect=function(){if(this._transform(),this.host&&this.host.useInvalidateRectOptimization){this._currentMeasure.transformToRef(this._transformMatrix,this._tmpMeasureA),v.CombineToRef(this._tmpMeasureA,this._prevCurrentMeasureTransformedIntoGlobalSpace,this._tmpMeasureA);var t=this.shadowOffsetX,e=this.shadowOffsetY,i=Math.max(this._previousShadowBlur,this.shadowBlur),o=Math.min(Math.min(t,0)-2*i,0),r=Math.max(Math.max(t,0)+2*i,0),n=Math.min(Math.min(e,0)-2*i,0),a=Math.max(Math.max(e,0)+2*i,0),s=this._computeAdditionalOffsetX(),l=this._computeAdditionalOffsetY();this.host.invalidateRect(Math.floor(this._tmpMeasureA.left+o-s),Math.floor(this._tmpMeasureA.top+n-l),Math.ceil(this._tmpMeasureA.left+this._tmpMeasureA.width+r+s),Math.ceil(this._tmpMeasureA.top+this._tmpMeasureA.height+a+l))}},t.prototype._markAsDirty=function(t){void 0===t&&(t=!1),(this._isVisible||t)&&(this._isDirty=!0,this._markMatrixAsDirty(),this._host&&this._host.markAsDirty())},t.prototype._markAllAsDirty=function(){this._markAsDirty(),this._font&&this._prepareFont()},t.prototype._link=function(t){this._host=t,this._host&&(this.uniqueId=this._host.getScene().getUniqueId())},t.prototype._transform=function(t){if(this._isMatrixDirty||1!==this._scaleX||1!==this._scaleY||0!==this._rotation){var e=this._currentMeasure.width*this._transformCenterX+this._currentMeasure.left,i=this._currentMeasure.height*this._transformCenterY+this._currentMeasure.top;t&&(t.translate(e,i),t.rotate(this._rotation),t.scale(this._scaleX,this._scaleY),t.translate(-e,-i)),(this._isMatrixDirty||this._cachedOffsetX!==e||this._cachedOffsetY!==i)&&(this._cachedOffsetX=e,this._cachedOffsetY=i,this._isMatrixDirty=!1,this._flagDescendantsAsMatrixDirty(),x.ComposeToRef(-e,-i,this._rotation,this._scaleX,this._scaleY,this.parent?this.parent._transformMatrix:null,this._transformMatrix),this._transformMatrix.invertToRef(this._invertTransformMatrix),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure))}},t.prototype._renderHighlight=function(t){this.isHighlighted&&(t.save(),t.strokeStyle=this._highlightColor,t.lineWidth=this._highlightLineWidth,this._renderHighlightSpecific(t),t.restore())},t.prototype._renderHighlightSpecific=function(t){t.strokeRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)},t.prototype._getColor=function(t){return this.gradient?this.gradient.getCanvasGradient(t):this.color},t.prototype._applyStates=function(e){this._isFontSizeInPercentage&&(this._fontSet=!0),this._host&&this._host.useSmallestIdeal&&!this._font&&(this._fontSet=!0),this._fontSet&&(this._prepareFont(),this._fontSet=!1),this._font&&(e.font=this._font),(this._color||this.gradient)&&(e.fillStyle=this._getColor(e)),t.AllowAlphaInheritance?e.globalAlpha*=this._alpha:this._alphaSet&&(e.globalAlpha=this.parent&&!this.parent.renderToIntermediateTexture?this.parent.alpha*this._alpha:this._alpha)},t.prototype._layout=function(t,e){if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;if(this._isDirty||!this._cachedParentMeasure.isEqualsTo(t)){this.host._numLayoutCalls++,this._currentMeasure.addAndTransformToRef(this._transformMatrix,0|-this._paddingLeftInPixels,0|-this._paddingTopInPixels,0|this._paddingRightInPixels,0|this._paddingBottomInPixels,this._prevCurrentMeasureTransformedIntoGlobalSpace),e.save(),this._applyStates(e);var i=0;do{this._rebuildLayout=!1,this._processMeasures(t,e),i++}while(this._rebuildLayout&&i<3);i>=3&&d.Logger.Error("Layout cycle detected in GUI (Control name=".concat(this.name,", uniqueId=").concat(this.uniqueId,")")),e.restore(),this.invalidateRect(),this._evaluateClippingState(t)}return this._wasDirty=this._isDirty,this._isDirty=!1,!0},t.prototype._processMeasures=function(t,e){this._tempPaddingMeasure.copyFrom(t),this.parent&&this.parent.descendantsOnlyPadding&&(this._tempPaddingMeasure.left+=this.parent.paddingLeftInPixels,this._tempPaddingMeasure.top+=this.parent.paddingTopInPixels,this._tempPaddingMeasure.width-=this.parent.paddingLeftInPixels+this.parent.paddingRightInPixels,this._tempPaddingMeasure.height-=this.parent.paddingTopInPixels+this.parent.paddingBottomInPixels),this._currentMeasure.copyFrom(this._tempPaddingMeasure),this._preMeasure(this._tempPaddingMeasure,e),this._measure(),this._postMeasure(this._tempPaddingMeasure,e),this._computeAlignment(this._tempPaddingMeasure,e),this._currentMeasure.left=0|this._currentMeasure.left,this._currentMeasure.top=0|this._currentMeasure.top,this._currentMeasure.width=0|this._currentMeasure.width,this._currentMeasure.height=0|this._currentMeasure.height,this._additionalProcessing(this._tempPaddingMeasure,e),this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure),this.onDirtyObservable.hasObservers()&&this.onDirtyObservable.notifyObservers(this)},t.prototype._evaluateClippingState=function(t){if(this._transform(),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure),this.parent&&this.parent.clipChildren){if(t.transformToRef(this.parent._transformMatrix,this._evaluatedParentMeasure),this._evaluatedMeasure.left>this._evaluatedParentMeasure.left+this._evaluatedParentMeasure.width)return void(this._isClipped=!0);if(this._evaluatedMeasure.left+this._evaluatedMeasure.widththis._evaluatedParentMeasure.top+this._evaluatedParentMeasure.height)return void(this._isClipped=!0);if(this._evaluatedMeasure.top+this._evaluatedMeasure.heightthis._currentMeasure.left+this._currentMeasure.width||ethis._currentMeasure.top+this._currentMeasure.height||(this.isPointerBlocker&&(this._host._shouldBlockPointer=!0),0))},t.prototype._processPicking=function(t,e,i,o,r,n,a,s){return!(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this._doNotRender||!this.contains(t,e)||(this._processObservables(o,t,e,i,r,n,a,s),0))},t.prototype._onPointerMove=function(t,e,i,o){this.onPointerMoveObservable.notifyObservers(e,-1,t,this,o)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerMove(t,e,i,o)},t.prototype._onPointerEnter=function(t,e){return!(!this._isEnabled||this._enterCount>0||(-1===this._enterCount&&(this._enterCount=0),this._enterCount++,this.onPointerEnterObservable.notifyObservers(this,-1,t,this,e)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerEnter(t,e),0))},t.prototype._onPointerOut=function(t,e,i){if(void 0===i&&(i=!1),i||this._isEnabled){this._enterCount=0;var o=!0;t.isAscendant(this)||(o=this.onPointerOutObservable.notifyObservers(this,-1,t,this,e)),o&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerOut(t,e,i)}},t.prototype._onPointerDown=function(t,e,i,o,r){return this._onPointerEnter(this,r),-1!==this.tabIndex&&(this.host.focusedControl=this),0===this._downCount&&(this._downCount++,this._downPointerIds[i]=!0,this.onPointerDownObservable.notifyObservers(new y(e,o),-1,t,this,r)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerDown(t,e,i,o,r),r&&this.uniqueId!==this._host.rootContainer.uniqueId&&this._host._capturedPointerIds.add(r.event.pointerId),!0)},t.prototype._onPointerUp=function(t,e,i,o,r,n){if(this._isEnabled){this._downCount=0,delete this._downPointerIds[i];var a=r;r&&(this._enterCount>0||-1===this._enterCount)&&(this._host.usePointerTapForClickEvent||(a=this.onPointerClickObservable.notifyObservers(new y(e,o),-1,t,this,n))),this.onPointerUpObservable.notifyObservers(new y(e,o),-1,t,this,n)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerUp(t,e,i,o,a,n),n&&this.uniqueId!==this._host.rootContainer.uniqueId&&this._host._capturedPointerIds.delete(n.event.pointerId),this._host.usePointerTapForClickEvent&&this.isPointerBlocker&&(this._host._shouldBlockPointer=!1)}},t.prototype._onPointerPick=function(t,e,i,o,r,n){if(!this._host.usePointerTapForClickEvent)return!1;var a=r;return r&&(this._enterCount>0||-1===this._enterCount)&&(a=this.onPointerClickObservable.notifyObservers(new y(e,o),-1,t,this,n)),this.onPointerUpObservable.notifyObservers(new y(e,o),-1,t,this,n)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerPick(t,e,i,o,a,n),this._host.usePointerTapForClickEvent&&this.isPointerBlocker&&(this._host._shouldBlockPointer=!0),!0},t.prototype._forcePointerUp=function(t){if(void 0===t&&(t=null),null!==t)this._onPointerUp(this,d.Vector2.Zero(),t,0,!0);else for(var e in this._downPointerIds)this._onPointerUp(this,d.Vector2.Zero(),+e,0,!0)},t.prototype._onWheelScroll=function(t,e){this._isEnabled&&this.onWheelObservable.notifyObservers(new d.Vector2(t,e))&&null!=this.parent&&this.parent._onWheelScroll(t,e)},t.prototype._onCanvasBlur=function(){},t.prototype._processObservables=function(t,e,i,o,r,n,a,s){if(!this._isEnabled)return!1;if(this._dummyVector2.copyFromFloats(e,i),t===d.PointerEventTypes.POINTERMOVE){this._onPointerMove(this,this._dummyVector2,r,o);var l=this._host._lastControlOver[r];return l&&l!==this&&l._onPointerOut(this,o),l!==this&&this._onPointerEnter(this,o),this._host._lastControlOver[r]=this,!0}if(t===d.PointerEventTypes.POINTERDOWN)return this._onPointerDown(this,this._dummyVector2,r,n,o),this._host._registerLastControlDown(this,r),this._host._lastPickedControl=this,!0;if(t===d.PointerEventTypes.POINTERUP)return this._host._lastControlDown[r]&&this._host._lastControlDown[r]._onPointerUp(this,this._dummyVector2,r,n,!0,o),this._host.usePointerTapForClickEvent||delete this._host._lastControlDown[r],!0;if(t===d.PointerEventTypes.POINTERWHEEL){if(this._host._lastControlOver[r])return this._host._lastControlOver[r]._onWheelScroll(a,s),!0}else if(t===d.PointerEventTypes.POINTERTAP)return this._host._lastControlDown[r]&&this._host._lastControlDown[r]._onPointerPick(this,this._dummyVector2,r,n,!0,o),delete this._host._lastControlDown[r],!0;return!1},t.prototype._getStyleProperty=function(t,e){var i,o=null!==(i=this._style&&this._style[t])&&void 0!==i?i:this[t];return!o&&this.parent?this.parent._getStyleProperty(t,e):this.parent?o:e},t.prototype._prepareFont=function(){var e,i;(this._font||this._fontSet)&&(this._font=this._getStyleProperty("fontStyle","")+" "+this._getStyleProperty("fontWeight","")+" "+this.fontSizeInPixels+"px "+this._getStyleProperty("fontFamily","Arial"),this._fontOffset=t._GetFontOffset(this._font,null===(i=null===(e=this._host)||void 0===e?void 0:e.getScene())||void 0===i?void 0:i.getEngine()),this.getDescendants().forEach((function(t){return t._markAllAsDirty()})))},t.prototype.isDimensionFullyDefined=function(t){return this.getDimension(t).isPixel},t.prototype.getDimension=function(t){return"width"===t?this._width:this._height},t.prototype.clone=function(t){var e={};this.serialize(e,!0);var i=new(d.Tools.Instantiate("BABYLON.GUI."+e.className));return i.parse(e,t),i},t.prototype.parse=function(t,e,i){var o=this;return this._urlRewriter=i,d.SerializationHelper.Parse((function(){return o}),t,null),this.name=t.name,this._parseFromContent(t,null!=e?e:this._host),this},t.prototype.serialize=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!0),(this.isSerializable||e)&&(d.SerializationHelper.Serialize(this,t),t.name=this.name,t.className=this.getClassName(),i&&this._prepareFont(),this._fontFamily&&(t.fontFamily=this._fontFamily),this.fontSize&&(t.fontSize=this.fontSize),this.fontWeight&&(t.fontWeight=this.fontWeight),this.fontStyle&&(t.fontStyle=this.fontStyle),this._gradient&&(t.gradient={},this._gradient.serialize(t.gradient)),d.SerializationHelper.AppendSerializedAnimations(this,t))},t.prototype._parseFromContent=function(t,e,i){var o,r;if(t.fontFamily&&(this.fontFamily=t.fontFamily),t.fontSize&&(this.fontSize=t.fontSize),t.fontWeight&&(this.fontWeight=t.fontWeight),t.fontStyle&&(this.fontStyle=t.fontStyle),t.gradient){var n=d.Tools.Instantiate("BABYLON.GUI."+t.gradient.className);this._gradient=new n,null===(o=this._gradient)||void 0===o||o.parse(t.gradient)}if(t.animations){this.animations=[];for(var a=0;a-1&&this.linkWithMesh(null),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},Object.defineProperty(t,"HORIZONTAL_ALIGNMENT_LEFT",{get:function(){return t._HORIZONTAL_ALIGNMENT_LEFT},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HORIZONTAL_ALIGNMENT_RIGHT",{get:function(){return t._HORIZONTAL_ALIGNMENT_RIGHT},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HORIZONTAL_ALIGNMENT_CENTER",{get:function(){return t._HORIZONTAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),Object.defineProperty(t,"VERTICAL_ALIGNMENT_TOP",{get:function(){return t._VERTICAL_ALIGNMENT_TOP},enumerable:!1,configurable:!0}),Object.defineProperty(t,"VERTICAL_ALIGNMENT_BOTTOM",{get:function(){return t._VERTICAL_ALIGNMENT_BOTTOM},enumerable:!1,configurable:!0}),Object.defineProperty(t,"VERTICAL_ALIGNMENT_CENTER",{get:function(){return t._VERTICAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),t._GetFontOffset=function(e,i){if(t._FontHeightSizes[e])return t._FontHeightSizes[e];var o=i||d.EngineStore.LastCreatedEngine;if(!o)throw new Error("Invalid engine. Unable to create a canvas.");var r=o.getFontOffset(e);return t._FontHeightSizes[e]=r,r},t.Parse=function(t,e,i){var o=d.Tools.Instantiate("BABYLON.GUI."+t.className),r=d.SerializationHelper.Parse((function(){var t=new o;return t._urlRewriter=i,t}),t,null);return r.name=t.name,r._parseFromContent(t,e,i),r},t.drawEllipse=function(t,e,i,o,r,n){n.translate(t,e),n.scale(i,o),n.beginPath(),n.arc(0,0,1,0,2*Math.PI*r,r<0),r>=1&&n.closePath(),n.scale(1/i,1/o),n.translate(-t,-e)},t.prototype.isReady=function(){return!0},t.AllowAlphaInheritance=!1,t._ClipMeasure=new v(0,0,0,0),t._HORIZONTAL_ALIGNMENT_LEFT=0,t._HORIZONTAL_ALIGNMENT_RIGHT=1,t._HORIZONTAL_ALIGNMENT_CENTER=2,t._VERTICAL_ALIGNMENT_TOP=0,t._VERTICAL_ALIGNMENT_BOTTOM=1,t._VERTICAL_ALIGNMENT_CENTER=2,t._FontHeightSizes={},t.AddHeader=function(){},h([(0,d.serialize)()],t.prototype,"metadata",void 0),h([(0,d.serialize)()],t.prototype,"isHitTestVisible",void 0),h([(0,d.serialize)()],t.prototype,"isPointerBlocker",void 0),h([(0,d.serialize)()],t.prototype,"isFocusInvisible",void 0),h([(0,d.serialize)()],t.prototype,"clipChildren",null),h([(0,d.serialize)()],t.prototype,"clipContent",null),h([(0,d.serialize)()],t.prototype,"useBitmapCache",void 0),h([(0,d.serialize)()],t.prototype,"shadowOffsetX",null),h([(0,d.serialize)()],t.prototype,"shadowOffsetY",null),h([(0,d.serialize)()],t.prototype,"shadowBlur",null),h([(0,d.serialize)()],t.prototype,"shadowColor",null),h([(0,d.serialize)()],t.prototype,"hoverCursor",void 0),h([(0,d.serialize)()],t.prototype,"fontOffset",null),h([(0,d.serialize)()],t.prototype,"alpha",null),h([(0,d.serialize)()],t.prototype,"isSerializable",void 0),h([(0,d.serialize)()],t.prototype,"scaleX",null),h([(0,d.serialize)()],t.prototype,"scaleY",null),h([(0,d.serialize)()],t.prototype,"rotation",null),h([(0,d.serialize)()],t.prototype,"transformCenterY",null),h([(0,d.serialize)()],t.prototype,"transformCenterX",null),h([(0,d.serialize)()],t.prototype,"horizontalAlignment",null),h([(0,d.serialize)()],t.prototype,"verticalAlignment",null),h([(0,d.serialize)()],t.prototype,"fixedRatio",null),h([(0,d.serialize)()],t.prototype,"fixedRatioMasterIsWidth",null),h([(0,d.serialize)()],t.prototype,"width",null),h([(0,d.serialize)()],t.prototype,"height",null),h([(0,d.serialize)()],t.prototype,"style",null),h([(0,d.serialize)()],t.prototype,"color",null),h([(0,d.serialize)()],t.prototype,"gradient",null),h([(0,d.serialize)()],t.prototype,"zIndex",null),h([(0,d.serialize)()],t.prototype,"notRenderable",null),h([(0,d.serialize)()],t.prototype,"isVisible",null),h([(0,d.serialize)()],t.prototype,"descendantsOnlyPadding",null),h([(0,d.serialize)()],t.prototype,"paddingLeft",null),h([(0,d.serialize)()],t.prototype,"paddingRight",null),h([(0,d.serialize)()],t.prototype,"paddingTop",null),h([(0,d.serialize)()],t.prototype,"paddingBottom",null),h([(0,d.serialize)()],t.prototype,"left",null),h([(0,d.serialize)()],t.prototype,"top",null),h([(0,d.serialize)()],t.prototype,"linkOffsetX",null),h([(0,d.serialize)()],t.prototype,"linkOffsetY",null),h([(0,d.serialize)()],t.prototype,"isEnabled",null),h([(0,d.serialize)()],t.prototype,"disabledColor",null),h([(0,d.serialize)()],t.prototype,"disabledColorItem",null),h([(0,d.serialize)()],t.prototype,"overlapGroup",void 0),h([(0,d.serialize)()],t.prototype,"overlapDeltaMultiplier",void 0),t}();(0,d.RegisterClass)("BABYLON.GUI.Control",I);var B=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._children=new Array,i._measureForChildren=v.Empty(),i._background="",i._backgroundGradient=null,i._adaptWidthToChildren=!1,i._adaptHeightToChildren=!1,i._renderToIntermediateTexture=!1,i._intermediateTexture=null,i.delegatePickingToChildren=!1,i.logLayoutCycleErrors=!1,i.maxLayoutCycle=3,i.onControlAddedObservable=new d.Observable,i.onControlRemovedObservable=new d.Observable,i._inverseTransformMatrix=x.Identity(),i._inverseMeasure=new v(0,0,0,0),i}return l(e,t),Object.defineProperty(e.prototype,"renderToIntermediateTexture",{get:function(){return this._renderToIntermediateTexture},set:function(t){this._renderToIntermediateTexture!==t&&(this._renderToIntermediateTexture=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"adaptHeightToChildren",{get:function(){return this._adaptHeightToChildren},set:function(t){this._adaptHeightToChildren!==t&&(this._adaptHeightToChildren=t,t&&(this.height="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"adaptWidthToChildren",{get:function(){return this._adaptWidthToChildren},set:function(t){this._adaptWidthToChildren!==t&&(this._adaptWidthToChildren=t,t&&(this.width="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background!==t&&(this._background=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundGradient",{get:function(){return this._backgroundGradient},set:function(t){this._backgroundGradient!==t&&(this._backgroundGradient=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReadOnly",{get:function(){return this._isReadOnly},set:function(t){this._isReadOnly=t;for(var e=0,i=this._children;et.zIndex){this._children.splice(o,0,t),i=!0;break}i||this._children.push(t),t.parent=this,e&&t.linkWithMesh(e),this._markAsDirty()},e.prototype._offsetLeft=function(e){t.prototype._offsetLeft.call(this,e);for(var i=0,o=this._children;i=0&&(n+=this.paddingLeftInPixels+this.paddingRightInPixels,this.width!==n+"px"&&(null===(i=this.parent)||void 0===i||i._markAsDirty(),this.width=n+"px",this._width.ignoreAdaptiveScaling=!0,this._rebuildLayout=!0)),this.adaptHeightToChildren&&a>=0&&(a+=this.paddingTopInPixels+this.paddingBottomInPixels,this.height!==a+"px"&&(null===(o=this.parent)||void 0===o||o._markAsDirty(),this.height=a+"px",this._height.ignoreAdaptiveScaling=!0,this._rebuildLayout=!0)),this._postMeasure()}r++}while(this._rebuildLayout&&r=3&&this.logLayoutCycleErrors&&d.Logger.Error("Layout cycle detected in GUI (Container name=".concat(this.name,", uniqueId=").concat(this.uniqueId,")")),e.restore(),this._isDirty&&(this.invalidateRect(),this._isDirty=!1),!0},e.prototype._postMeasure=function(){},e.prototype._draw=function(t,e){var i=this._renderToIntermediateTexture&&this._intermediateTexture,o=i?this._intermediateTexture.getContext():t;i&&(o.save(),o.translate(-this._currentMeasure.left,-this._currentMeasure.top),e?(this._transformMatrix.invertToRef(this._inverseTransformMatrix),e.transformToRef(this._inverseTransformMatrix,this._inverseMeasure),o.clearRect(this._inverseMeasure.left,this._inverseMeasure.top,this._inverseMeasure.width,this._inverseMeasure.height)):o.clearRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._localDraw(o),t.save(),this.clipChildren&&this._clipForChildren(o);for(var r=0,n=this._children;r=0;c--)if((u=this._children[c]).isEnabled&&u.isHitTestVisible&&u.isVisible&&!u.notRenderable&&u.contains(e,i)){h=!0;break}if(!h)return!1}for(c=this._children.length-1;c>=0;c--){var u;if((u=this._children[c])._processPicking(e,i,o,r,n,a,s,l))return u.hoverCursor&&this._host._changeCursor(u.hoverCursor),!0}return!!_&&!!this.isHitTestVisible&&this._processObservables(r,e,i,o,n,a,s,l)},e.prototype._additionalProcessing=function(e,i){t.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.copyFrom(this._currentMeasure)},e.prototype._getAdaptDimTo=function(t){return"width"===t?this.adaptWidthToChildren:this.adaptHeightToChildren},e.prototype.isDimensionFullyDefined=function(e){if(this._getAdaptDimTo(e)){for(var i=0,o=this.children;i=0;i--)this.children[i].dispose();null===(e=this._intermediateTexture)||void 0===e||e.dispose()},e.prototype._parseFromContent=function(e,i,o){var r;if(t.prototype._parseFromContent.call(this,e,i,o),this._link(i),e.backgroundGradient){var n=d.Tools.Instantiate("BABYLON.GUI."+e.backgroundGradient.className);this._backgroundGradient=new n,null===(r=this._backgroundGradient)||void 0===r||r.parse(e.backgroundGradient)}if(e.children)for(var a=0,s=e.children;ar&&(r=a.width)}if(this._resizeToFit){if(0===this._textWrapping||this._forceResizeWidth){var s=Math.ceil(this._paddingLeftInPixels)+Math.ceil(this._paddingRightInPixels)+Math.ceil(r);s!==this._width.getValueInPixel(this._host,this._tempParentMeasure.width)&&(this._width.updateInPlace(s,f.UNITMODE_PIXEL),this._rebuildLayout=!0)}var l=this._paddingTopInPixels+this._paddingBottomInPixels+this._fontOffset.height*this._lines.length|0;if(this._lines.length>0&&0!==this._lineSpacing.internalValue){var _;_=this._lineSpacing.isPixel?this._lineSpacing.getValue(this._host):this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height),l+=(this._lines.length-1)*_}l!==this._height.internalValue&&(this._height.updateInPlace(l,f.UNITMODE_PIXEL),this._rebuildLayout=!0)}},e.prototype._drawText=function(t,e,i,o){var r=this._currentMeasure.width,n=0;switch(this._textHorizontalAlignment){case I.HORIZONTAL_ALIGNMENT_LEFT:n=0;break;case I.HORIZONTAL_ALIGNMENT_RIGHT:n=r-e;break;case I.HORIZONTAL_ALIGNMENT_CENTER:n=(r-e)/2}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&o.strokeText(t,this._currentMeasure.left+n,i),o.fillText(t,this._currentMeasure.left+n,i),this._underline&&this._drawLine(this._currentMeasure.left+n,i+3,this._currentMeasure.left+n+e,i+3,o),this._lineThrough&&this._drawLine(this._currentMeasure.left+n,i-this.fontSizeInPixels/3,this._currentMeasure.left+n+e,i-this.fontSizeInPixels/3,o)},e.prototype._drawLine=function(t,e,i,o,r){if(r.beginPath(),r.lineWidth=Math.round(.05*this.fontSizeInPixels),r.moveTo(t,e),r.lineTo(i,o),this.outlineWidth&&this.applyOutlineToUnderline)r.stroke(),r.fill();else{var n=r.strokeStyle;r.strokeStyle=r.fillStyle,r.stroke(),r.strokeStyle=n}r.closePath()},e.prototype._draw=function(t){t.save(),this._applyStates(t),this._renderLines(t),t.restore()},e.prototype._applyStates=function(e){t.prototype._applyStates.call(this,e),this.outlineWidth&&(e.lineWidth=this.outlineWidth,e.strokeStyle=this.outlineColor,e.lineJoin="miter",e.miterLimit=2)},e.prototype._breakLines=function(t,e,i){var o,r;this._linesTemp.length=0;var n=4===this._textWrapping?this._parseHTMLText(t,e,i):this.text.split("\n");switch(this._textWrapping){case 1:for(var a=0,s=n;ae?t-e:0,r=t/i;return Math.max(Math.floor(o/r),1)},e.prototype._parseLineEllipsis=function(t,e,i){void 0===t&&(t="");var o=this._getTextMetricsWidth(i.measureText(t)),r=this._getCharsToRemove(o,e,t.length),n=Array.from&&Array.from(t);if(n)for(;n.length&&o>e;)n.splice(n.length-r,r),t="".concat(n.join(""),"…"),o=this._getTextMetricsWidth(i.measureText(t)),r=this._getCharsToRemove(o,e,t.length);else{for(;t.length>2&&o>e;)t=t.slice(0,-r),o=this._getTextMetricsWidth(i.measureText(t+"…")),r=this._getCharsToRemove(o,e,t.length);t+="…"}return{text:t,width:o}},e.prototype._getTextMetricsWidth=function(t){return void 0!==t.actualBoundingBoxLeft?Math.abs(t.actualBoundingBoxLeft)+Math.abs(t.actualBoundingBoxRight):t.width},e.prototype._parseLineWordWrap=function(t,e,i){void 0===t&&(t="");for(var o=[],r=this.wordSplittingFunction?this.wordSplittingFunction(t):t.split(this._wordDivider),n=this._getTextMetricsWidth(i.measureText(t)),a=0;a0?t+this._wordDivider+r[a]:r[0],l=this._getTextMetricsWidth(i.measureText(s));l>e&&a>0?(o.push({text:t,width:n}),t=r[a],n=this._getTextMetricsWidth(i.measureText(t))):(n=l,t=s)}return o.push({text:t,width:n}),o},e.prototype._parseLineWordWrapEllipsis=function(t,e,i,o){void 0===t&&(t="");for(var r=this._parseLineWordWrap(t,e,o),n=1;n<=r.length;n++)if(this._computeHeightForLinesOf(n)>i&&n>1){var a=r[n-2],s=r[n-1];r[n-2]=this._parseLineEllipsis(a.text+this._wordDivider+s.text,e,o);for(var l=r.length-n+1,_=0;_0&&0!==this._lineSpacing.internalValue&&(e+=(t-1)*(this._lineSpacing.isPixel?this._lineSpacing.getValue(this._host):this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height))),e},e.prototype.isDimensionFullyDefined=function(e){return!!this.resizeToFit||t.prototype.isDimensionFullyDefined.call(this,e)},e.prototype.computeExpectedHeight=function(){var t,e;if(this.text&&this.widthInPixels){var i=null===(t=d.EngineStore.LastCreatedEngine)||void 0===t?void 0:t.createCanvas(0,0).getContext("2d");if(i){this._applyStates(i),this._fontOffset||(this._fontOffset=I._GetFontOffset(i.font,null===(e=this._host.getScene())||void 0===e?void 0:e.getEngine()));var o=this._lines?this._lines:this._breakLines(this.widthInPixels-this._paddingLeftInPixels-this._paddingRightInPixels,this.heightInPixels-this._paddingTopInPixels-this._paddingBottomInPixels,i);return this._computeHeightForLinesOf(o.length)}}return 0},e.prototype.dispose=function(){var e;t.prototype.dispose.call(this),this.onTextChangedObservable.clear(),null===(e=this._htmlElement)||void 0===e||e.remove(),this._htmlElement=null},h([(0,d.serialize)()],e.prototype,"resizeToFit",null),h([(0,d.serialize)()],e.prototype,"textWrapping",null),h([(0,d.serialize)()],e.prototype,"text",null),h([(0,d.serialize)()],e.prototype,"textHorizontalAlignment",null),h([(0,d.serialize)()],e.prototype,"textVerticalAlignment",null),h([(0,d.serialize)()],e.prototype,"lineSpacing",null),h([(0,d.serialize)()],e.prototype,"outlineWidth",null),h([(0,d.serialize)()],e.prototype,"underline",null),h([(0,d.serialize)()],e.prototype,"lineThrough",null),h([(0,d.serialize)()],e.prototype,"applyOutlineToUnderline",null),h([(0,d.serialize)()],e.prototype,"outlineColor",null),h([(0,d.serialize)()],e.prototype,"wordDivider",null),h([(0,d.serialize)()],e.prototype,"forceResizeWidth",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.TextBlock",S);var O=function(t){function e(i,o){void 0===o&&(o=null);var r=t.call(this,i)||this;return r.name=i,r._workingCanvas=null,r._loaded=!1,r._stretch=e.STRETCH_FILL,r._source=null,r._autoScale=!1,r._sourceLeft=0,r._sourceTop=0,r._sourceWidth=0,r._sourceHeight=0,r._svgAttributesComputationCompleted=!1,r._isSVG=!1,r._cellWidth=0,r._cellHeight=0,r._cellId=-1,r._populateNinePatchSlicesFromImage=!1,r._imageDataCache={data:null,key:""},r.onImageLoadedObservable=new d.Observable,r.onSVGAttributesComputedObservable=new d.Observable,r.source=o,r}return l(e,t),Object.defineProperty(e.prototype,"isLoaded",{get:function(){return this._loaded},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){return this.isLoaded},Object.defineProperty(e.prototype,"detectPointerOnOpaqueOnly",{get:function(){return this._detectPointerOnOpaqueOnly},set:function(t){this._detectPointerOnOpaqueOnly!==t&&(this._detectPointerOnOpaqueOnly=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceLeft",{get:function(){return this._sliceLeft},set:function(t){this._sliceLeft!==t&&(this._sliceLeft=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceRight",{get:function(){return this._sliceRight},set:function(t){this._sliceRight!==t&&(this._sliceRight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceTop",{get:function(){return this._sliceTop},set:function(t){this._sliceTop!==t&&(this._sliceTop=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliceBottom",{get:function(){return this._sliceBottom},set:function(t){this._sliceBottom!==t&&(this._sliceBottom=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceLeft",{get:function(){return this._sourceLeft},set:function(t){this._sourceLeft!==t&&(this._sourceLeft=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceTop",{get:function(){return this._sourceTop},set:function(t){this._sourceTop!==t&&(this._sourceTop=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceWidth",{get:function(){return this._sourceWidth},set:function(t){this._sourceWidth!==t&&(this._sourceWidth=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceHeight",{get:function(){return this._sourceHeight},set:function(t){this._sourceHeight!==t&&(this._sourceHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageWidth",{get:function(){return this._imageWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageHeight",{get:function(){return this._imageHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"populateNinePatchSlicesFromImage",{get:function(){return this._populateNinePatchSlicesFromImage},set:function(t){this._populateNinePatchSlicesFromImage!==t&&(this._populateNinePatchSlicesFromImage=t,this._populateNinePatchSlicesFromImage&&this._loaded&&this._extractNinePatchSliceDataFromImage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSVG",{get:function(){return this._isSVG},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"svgAttributesComputationCompleted",{get:function(){return this._svgAttributesComputationCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoScale",{get:function(){return this._autoScale},set:function(t){this._autoScale!==t&&(this._autoScale=t,t&&this._loaded&&this.synchronizeSizeWithContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stretch",{get:function(){return this._stretch},set:function(t){this._stretch!==t&&(this._stretch=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._rotate90=function(t,i){var o,r;void 0===i&&(i=!1);var n=this._domImage.width,a=this._domImage.height,s=(null===(r=null===(o=this._host)||void 0===o?void 0:o.getScene())||void 0===r?void 0:r.getEngine())||d.EngineStore.LastCreatedEngine;if(!s)throw new Error("Invalid engine. Unable to create a canvas.");var l=s.createCanvas(a,n),_=l.getContext("2d");_.translate(l.width/2,l.height/2),_.rotate(t*Math.PI/2),_.drawImage(this._domImage,0,0,n,a,-n/2,-a/2,n,a);var h=l.toDataURL("image/jpg"),c=new e(this.name+"rotated",h);return i&&(c._stretch=this._stretch,c._autoScale=this._autoScale,c._cellId=this._cellId,c._cellWidth=t%1?this._cellHeight:this._cellWidth,c._cellHeight=t%1?this._cellWidth:this._cellHeight),this._handleRotationForSVGImage(this,c,t),this._imageDataCache.data=null,c},e.prototype._handleRotationForSVGImage=function(t,e,i){var o=this;t._isSVG&&(t._svgAttributesComputationCompleted?(this._rotate90SourceProperties(t,e,i),this._markAsDirty()):t.onSVGAttributesComputedObservable.addOnce((function(){o._rotate90SourceProperties(t,e,i),o._markAsDirty()})))},e.prototype._rotate90SourceProperties=function(t,e,i){var o,r,n=t.sourceLeft,a=t.sourceTop,s=t.domImage.width,l=t.domImage.height,_=n,h=a,c=t.sourceWidth,u=t.sourceHeight;if(0!=i){var d=i<0?-1:1;i%=4;for(var f=0;f127&&-1===this._sliceLeft)this._sliceLeft=s;else if(_<127&&this._sliceLeft>-1){this._sliceRight=s;break}this._sliceTop=-1,this._sliceBottom=-1;for(var l=0;l127&&-1===this._sliceTop)this._sliceTop=l;else if(_<127&&this._sliceTop>-1){this._sliceBottom=l;break}}},Object.defineProperty(e.prototype,"domImage",{get:function(){return this._domImage},set:function(t){var e=this;this._domImage=t,this._loaded=!1,this._imageDataCache.data=null,this._domImage.width?this._onImageLoaded():this._domImage.onload=function(){e._onImageLoaded()}},enumerable:!1,configurable:!0}),e.prototype._onImageLoaded=function(){this._imageDataCache.data=null,this._imageWidth=this._domImage.width,this._imageHeight=this._domImage.height,this._loaded=!0,this._populateNinePatchSlicesFromImage&&this._extractNinePatchSliceDataFromImage(),this._autoScale&&this.synchronizeSizeWithContent(),this.onImageLoadedObservable.notifyObservers(this),this._markAsDirty()},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},set:function(t){var i,o,r,n,a,s=this;if(this._urlRewriter&&t&&(t=this._urlRewriter(t)),this._source!==t){this._removeCacheUsage(this._source),this._loaded=!1,this._source=t,this._imageDataCache.data=null,t&&(t=this._svgCheck(t));var l=(null===(o=null===(i=this._host)||void 0===i?void 0:i.getScene())||void 0===o?void 0:o.getEngine())||d.EngineStore.LastCreatedEngine;if(!l)throw new Error("Invalid engine. Unable to create a canvas.");if(t&&e.SourceImgCache.has(t)){var _=e.SourceImgCache.get(t);return this._domImage=_.img,_.timesUsed+=1,void(_.loaded?this._onImageLoaded():_.waitingForLoadCallback.push(this._onImageLoaded.bind(this)))}this._domImage=l.createCanvasImage();var h=this._domImage,c=!1;h.style&&(null===(r=this._source)||void 0===r?void 0:r.endsWith(".svg"))&&(h.style.visibility="hidden",h.style.position="absolute",h.style.top="0",null===(a=null===(n=l.getRenderingCanvas())||void 0===n?void 0:n.parentNode)||void 0===a||a.appendChild(h),c=!0),t&&e.SourceImgCache.set(t,{img:this._domImage,timesUsed:1,loaded:!1,waitingForLoadCallback:[this._onImageLoaded.bind(this)]}),this._domImage.onload=function(){if(t){var i=e.SourceImgCache.get(t);if(i){i.loaded=!0;for(var o=0,r=i.waitingForLoadCallback;o0},e.prototype._getTypeName=function(){return"Image"},e.prototype.synchronizeSizeWithContent=function(){this._loaded&&(this.width=this._domImage.width+"px",this.height=this._domImage.height+"px")},e.prototype._processMeasures=function(i,o){if(this._loaded)switch(this._stretch){case e.STRETCH_NONE:case e.STRETCH_FILL:case e.STRETCH_UNIFORM:case e.STRETCH_NINE_PATCH:break;case e.STRETCH_EXTEND:this._autoScale&&this.synchronizeSizeWithContent(),this.parent&&this.parent.parent&&(this.parent.adaptWidthToChildren=!0,this.parent.adaptHeightToChildren=!0)}t.prototype._processMeasures.call(this,i,o)},e.prototype._prepareWorkingCanvasForOpaqueDetection=function(){var t,e;if(this._detectPointerOnOpaqueOnly){var i=this._currentMeasure.width,o=this._currentMeasure.height;if(!this._workingCanvas){var r=(null===(e=null===(t=this._host)||void 0===t?void 0:t.getScene())||void 0===e?void 0:e.getEngine())||d.EngineStore.LastCreatedEngine;if(!r)throw new Error("Invalid engine. Unable to create a canvas.");this._workingCanvas=r.createCanvas(i,o)}this._workingCanvas.getContext("2d").clearRect(0,0,i,o)}},e.prototype._drawImage=function(t,e,i,o,r,n,a,s,l){if(t.drawImage(this._domImage,e,i,o,r,n,a,s,l),this._detectPointerOnOpaqueOnly){var _=t.getTransform(),h=this._workingCanvas.getContext("2d");h.save();var c=n-this._currentMeasure.left,u=a-this._currentMeasure.top;h.setTransform(_.a,_.b,_.c,_.d,(c+s)/2,(u+l)/2),h.translate(-(c+s)/2,-(u+l)/2),h.drawImage(this._domImage,e,i,o,r,c,u,s,l),h.restore()}},e.prototype._draw=function(t){var i,o,r,n;if(t.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),-1==this.cellId)i=this._sourceLeft,o=this._sourceTop,r=this._sourceWidth?this._sourceWidth:this._imageWidth,n=this._sourceHeight?this._sourceHeight:this._imageHeight;else{var a=this._domImage.naturalWidth/this.cellWidth,s=this.cellId/a|0,l=this.cellId%a;i=this.cellWidth*l,o=this.cellHeight*s,r=this.cellWidth,n=this.cellHeight}if(this._prepareWorkingCanvasForOpaqueDetection(),this._applyStates(t),this._loaded)switch(this._stretch){case e.STRETCH_NONE:case e.STRETCH_FILL:this._drawImage(t,i,o,r,n,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case e.STRETCH_UNIFORM:var _=this._currentMeasure.width/r,h=this._currentMeasure.height/n,c=Math.min(_,h),u=(this._currentMeasure.width-r*c)/2,d=(this._currentMeasure.height-n*c)/2;this._drawImage(t,i,o,r,n,this._currentMeasure.left+u,this._currentMeasure.top+d,r*c,n*c);break;case e.STRETCH_EXTEND:this._drawImage(t,i,o,r,n,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case e.STRETCH_NINE_PATCH:this._renderNinePatch(t,i,o,r,n)}t.restore()},e.prototype._renderNinePatch=function(t,e,i,o,r){var n=this.host.idealWidth?this._width.getValue(this.host)/this.host.idealWidth:this.host.idealHeight?this._height.getValue(this.host)/this.host.idealHeight:1,a=this._sliceLeft,s=this._sliceTop,l=r-this._sliceBottom,_=o-this._sliceRight,h=this._sliceRight-this._sliceLeft,c=this._sliceBottom-this._sliceTop,u=Math.round(a*n),d=Math.round(s*n),f=Math.round(l*n),p=Math.round(_*n),g=Math.round(this._currentMeasure.width)-p-u+2,b=Math.round(this._currentMeasure.height)-f-d+2,m=Math.round(this._currentMeasure.left)+u-1,v=Math.round(this._currentMeasure.top)+d-1,y=Math.round(this._currentMeasure.left+this._currentMeasure.width)-p,x=Math.round(this._currentMeasure.top+this._currentMeasure.height)-f;this._drawImage(t,e,i,a,s,this._currentMeasure.left,this._currentMeasure.top,u,d),this._drawImage(t,e+this._sliceLeft,i,h,s,m+1,this._currentMeasure.top,g-2,d),this._drawImage(t,e+this._sliceRight,i,_,s,y,this._currentMeasure.top,p,d),this._drawImage(t,e,i+this._sliceTop,a,c,this._currentMeasure.left,v+1,u,b-2),this._drawImage(t,e+this._sliceLeft,i+this._sliceTop,h,c,m+1,v+1,g-2,b-2),this._drawImage(t,e+this._sliceRight,i+this._sliceTop,_,c,y,v+1,p,b-2),this._drawImage(t,e,i+this._sliceBottom,a,l,this._currentMeasure.left,x,u,f),this._drawImage(t,e+this.sliceLeft,i+this._sliceBottom,h,l,m+1,x,g-2,f),this._drawImage(t,e+this._sliceRight,i+this._sliceBottom,_,l,y,x,p,f)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.onImageLoadedObservable.clear(),this.onSVGAttributesComputedObservable.clear(),this._removeCacheUsage(this._source)},e.SourceImgCache=new Map,e.STRETCH_NONE=0,e.STRETCH_FILL=1,e.STRETCH_UNIFORM=2,e.STRETCH_EXTEND=3,e.STRETCH_NINE_PATCH=4,h([(0,d.serialize)()],e.prototype,"detectPointerOnOpaqueOnly",null),h([(0,d.serialize)()],e.prototype,"sliceLeft",null),h([(0,d.serialize)()],e.prototype,"sliceRight",null),h([(0,d.serialize)()],e.prototype,"sliceTop",null),h([(0,d.serialize)()],e.prototype,"sliceBottom",null),h([(0,d.serialize)()],e.prototype,"sourceLeft",null),h([(0,d.serialize)()],e.prototype,"sourceTop",null),h([(0,d.serialize)()],e.prototype,"sourceWidth",null),h([(0,d.serialize)()],e.prototype,"sourceHeight",null),h([(0,d.serialize)()],e.prototype,"populateNinePatchSlicesFromImage",null),h([(0,d.serialize)()],e.prototype,"autoScale",null),h([(0,d.serialize)()],e.prototype,"stretch",null),h([(0,d.serialize)()],e.prototype,"source",null),h([(0,d.serialize)()],e.prototype,"cellWidth",null),h([(0,d.serialize)()],e.prototype,"cellHeight",null),h([(0,d.serialize)()],e.prototype,"cellId",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.Image",O);var R=function(t){function e(e){var i=t.call(this,e)||this;i.name=e,i.thickness=1,i.isPointerBlocker=!0;var o=null;return i.pointerEnterAnimation=function(){o=i.alpha,i.alpha-=.1},i.pointerOutAnimation=function(){null!==o&&(i.alpha=o)},i.pointerDownAnimation=function(){i.scaleX-=.05,i.scaleY-=.05},i.pointerUpAnimation=function(){i.scaleX+=.05,i.scaleY+=.05},i}return l(e,t),Object.defineProperty(e.prototype,"image",{get:function(){return this._image},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textBlock",{get:function(){return this._textBlock},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"Button"},e.prototype._processPicking=function(e,i,o,r,n,a,s,l){if(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this.notRenderable)return!1;if(!t.prototype.contains.call(this,e,i))return!1;if(this.delegatePickingToChildren){for(var _=!1,h=this._children.length-1;h>=0;h--){var c=this._children[h];if(c.isEnabled&&c.isHitTestVisible&&c.isVisible&&!c.notRenderable&&c.contains(e,i)){_=!0;break}}if(!_)return!1}return this._processObservables(r,e,i,o,n,a,s,l),!0},e.prototype._onPointerEnter=function(e,i){return!!t.prototype._onPointerEnter.call(this,e,i)&&(!this.isReadOnly&&this.pointerEnterAnimation&&this.pointerEnterAnimation(),!0)},e.prototype._onPointerOut=function(e,i,o){void 0===o&&(o=!1),!this.isReadOnly&&this.pointerOutAnimation&&this.pointerOutAnimation(),t.prototype._onPointerOut.call(this,e,i,o)},e.prototype._onPointerDown=function(e,i,o,r,n){return!!t.prototype._onPointerDown.call(this,e,i,o,r,n)&&(!this.isReadOnly&&this.pointerDownAnimation&&this.pointerDownAnimation(),!0)},e.prototype._getRectangleFill=function(t){return this.isEnabled?this._getBackgroundColor(t):this._disabledColor},e.prototype._onPointerUp=function(e,i,o,r,n,a){!this.isReadOnly&&this.pointerUpAnimation&&this.pointerUpAnimation(),t.prototype._onPointerUp.call(this,e,i,o,r,n,a)},e.prototype.serialize=function(e,i){t.prototype.serialize.call(this,e,i),(this.isSerializable||i)&&(this._textBlock&&(e.textBlockName=this._textBlock.name),this._image&&(e.imageName=this._image.name))},e.prototype._parseFromContent=function(e,i){t.prototype._parseFromContent.call(this,e,i),e.textBlockName&&(this._textBlock=this.getChildByName(e.textBlockName)),e.imageName&&(this._image=this.getChildByName(e.imageName))},e.CreateImageButton=function(t,e,i){var o=new this(t),r=new S(t+"_button",e);r.textWrapping=!0,r.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,r.paddingLeft="20%",o.addControl(r);var n=new O(t+"_icon",i);return n.width="20%",n.stretch=O.STRETCH_UNIFORM,n.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o.addControl(n),o._image=n,o._textBlock=r,o},e.CreateImageOnlyButton=function(t,e){var i=new this(t),o=new O(t+"_icon",e);return o.stretch=O.STRETCH_FILL,o.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,i.addControl(o),i._image=o,i},e.CreateSimpleButton=function(t,e){var i=new this(t),o=new S(t+"_button",e);return o.textWrapping=!0,o.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,i.addControl(o),i._textBlock=o,i},e.CreateImageWithCenterTextButton=function(t,e,i){var o=new this(t),r=new O(t+"_icon",i);r.stretch=O.STRETCH_FILL,o.addControl(r);var n=new S(t+"_button",e);return n.textWrapping=!0,n.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,o.addControl(n),o._image=r,o._textBlock=n,o},e}(T);(0,d.RegisterClass)("BABYLON.GUI.Button",R);var w=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._isVertical=!0,i._manualWidth=!1,i._manualHeight=!1,i._doNotTrackManualChanges=!1,i._spacing=0,i.ignoreLayoutWarnings=!1,i}return l(e,t),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){this._spacing!==t&&(this._spacing=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(t){this._doNotTrackManualChanges||(this._manualWidth=!0),this._width.toString(this._host)!==t&&this._width.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(t){this._doNotTrackManualChanges||(this._manualHeight=!0),this._height.toString(this._host)!==t&&this._height.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"StackPanel"},e.prototype._preMeasure=function(e,i){for(var o=0,r=this._children;o=0?Math.min(t,this._characters.length):this._characters.length+Math.max(t,-this._characters.length),void 0===e?e=this._characters.length-t:(isNaN(e)||e<0)&&(e=0);for(var i=[];--e>=0;)i[e]=this._characters[t+e];return i.join("")}return this._text.substring(t,e?e+t:void 0)},t.prototype.substring=function(t,e){if(this._characters){isNaN(t)?t=0:t>this._characters.length?t=this._characters.length:t<0&&(t=0),void 0===e?e=this._characters.length:isNaN(e)?e=0:e>this._characters.length?e=this._characters.length:e<0&&(e=0);for(var i=[],o=0;t0){if(this.isTextHighlightOn)return this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this._blinkIsEven=!1,void(i&&i.preventDefault());0===this._cursorOffset?this.text=this._textWrapper.substring(0,this._textWrapper.length-1):(r=this._textWrapper.length-this._cursorOffset)>0&&(this._textWrapper.removePart(r-1,r),this._textHasChanged())}return void(i&&i.preventDefault());case 46:if(this.isTextHighlightOn)return this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,void(i&&i.preventDefault());if(this._textWrapper.text&&this._textWrapper.length>0&&this._cursorOffset>0){var r=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(r,r+1),this._textHasChanged(),this._cursorOffset--}return void(i&&i.preventDefault());case 13:return this._host.focusedControl=null,void(this.isTextHighlightOn=!1);case 35:return this._cursorOffset=0,this._blinkIsEven=!1,this.isTextHighlightOn=!1,void this._markAsDirty();case 36:return this._cursorOffset=this._textWrapper.length,this._blinkIsEven=!1,this.isTextHighlightOn=!1,void this._markAsDirty();case 37:if(this._cursorOffset++,this._cursorOffset>this._textWrapper.length&&(this._cursorOffset=this._textWrapper.length),i&&i.shiftKey){if(this._blinkIsEven=!1,i.ctrlKey||i.metaKey){if(!this.isTextHighlightOn){if(this._textWrapper.length===this._cursorOffset)return;this._endHighlightIndex=this._textWrapper.length-this._cursorOffset+1}return this._startHighlightIndex=0,this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=this._textWrapper.length,this.isTextHighlightOn=!0,void this._markAsDirty()}return this.isTextHighlightOn?-1===this._cursorIndex&&(this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=0===this._startHighlightIndex?this._textWrapper.length:this._textWrapper.length-this._startHighlightIndex+1):(this.isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset>=this._textWrapper.length?this._textWrapper.length:this._cursorOffset-1),this._cursorIndexthis._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this.isTextHighlightOn=!1,void this._markAsDirty()}return this.isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this.isTextHighlightOn=!1),i&&(i.ctrlKey||i.metaKey)&&(this._cursorOffset=this._textWrapper.length,i.preventDefault()),this._blinkIsEven=!1,this.isTextHighlightOn=!1,this._cursorIndex=-1,void this._markAsDirty();case 39:if(this._cursorOffset--,this._cursorOffset<0&&(this._cursorOffset=0),i&&i.shiftKey){if(this._blinkIsEven=!1,i.ctrlKey||i.metaKey){if(!this.isTextHighlightOn){if(0===this._cursorOffset)return;this._startHighlightIndex=this._textWrapper.length-this._cursorOffset-1}return this._endHighlightIndex=this._textWrapper.length,this.isTextHighlightOn=!0,this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=0,void this._markAsDirty()}return this.isTextHighlightOn?-1===this._cursorIndex&&(this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=this._textWrapper.length===this._endHighlightIndex?0:this._textWrapper.length-this._endHighlightIndex-1):(this.isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset<=0?0:this._cursorOffset+1),this._cursorIndexthis._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this.isTextHighlightOn=!1,void this._markAsDirty()}return this.isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._endHighlightIndex,this.isTextHighlightOn=!1),i&&(i.ctrlKey||i.metaKey)&&(this._cursorOffset=0,i.preventDefault()),this._blinkIsEven=!1,this.isTextHighlightOn=!1,this._cursorIndex=-1,void this._markAsDirty()}if(32===t&&(e=null!==(o=null==i?void 0:i.key)&&void 0!==o?o:" "),this._deadKey="Dead"===e,e&&(-1===t||32===t||34===t||39===t||t>47&&t<64||t>64&&t<91||t>159&&t<193||t>218&&t<223||t>95&&t<112)&&(this._currentKey=e,this.onBeforeKeyAddObservable.notifyObservers(this),e=this._currentKey,this._addKey&&!this._deadKey))if(this.isTextHighlightOn)this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex,e),this._textHasChanged(),this._cursorOffset=this._textWrapper.length-(this._startHighlightIndex+1),this.isTextHighlightOn=!1,this._blinkIsEven=!1,this._markAsDirty();else if(0===this._cursorOffset)this.text+=this._deadKey&&(null==i?void 0:i.key)?i.key:e;else{var n=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(n,n,e),this._textHasChanged()}}},e.prototype._updateValueFromCursorIndex=function(t){if(this._blinkIsEven=!1,-1===this._cursorIndex)this._cursorIndex=t;else if(this._cursorIndexthis._cursorOffset))return this.isTextHighlightOn=!1,void this._markAsDirty();this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex}this.isTextHighlightOn=!0,this._markAsDirty()},e.prototype._processDblClick=function(t){var e,i;this._startHighlightIndex=this._textWrapper.length-this._cursorOffset,this._endHighlightIndex=this._startHighlightIndex;do{i=this._endHighlightIndex0&&this._textWrapper.isWord(this._startHighlightIndex-1)?--this._startHighlightIndex:0}while(e||i);this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this.isTextHighlightOn=!0,this._clickedCoordinate=null,this._blinkIsEven=!0,this._cursorIndex=-1,this._markAsDirty()},e.prototype.selectAllText=function(){this._blinkIsEven=!0,this.isTextHighlightOn=!0,this._startHighlightIndex=0,this._endHighlightIndex=this._textWrapper.length,this._cursorOffset=this._textWrapper.length,this._cursorIndex=-1,this._markAsDirty()},e.prototype.processKeyboard=function(e){this.processKey(e.keyCode,e.key,e),t.prototype.processKeyboard.call(this,e)},e.prototype._onCopyText=function(t){this.isTextHighlightOn=!1;try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText},e.prototype._onCutText=function(t){if(this._highlightedText){this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex;try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText,this._highlightedText=""}},e.prototype._onPasteText=function(t){var e;e=t.clipboardData&&-1!==t.clipboardData.types.indexOf("text/plain")?t.clipboardData.getData("text/plain"):this._host.clipboardData;var i=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(i,i,e),this._textHasChanged()},e.prototype._draw=function(t){var e,i=this;t.save(),this._applyStates(t),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),this._isFocused?this._focusedBackground&&(t.fillStyle=this._isEnabled?this._focusedBackground:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)):this._background&&(t.fillStyle=this._isEnabled?this._background:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this._fontOffset&&!this._wasDirty||(this._fontOffset=I._GetFontOffset(t.font,null===(e=this._host.getScene())||void 0===e?void 0:e.getEngine()));var o=this._currentMeasure.left+this._margin.getValueInPixel(this._host,this._tempParentMeasure.width);this.color&&(t.fillStyle=this.color);var r=this._beforeRenderText(this._textWrapper);this._isFocused||this._textWrapper.text||!this._placeholderText||((r=new E).text=this._placeholderText,this._placeholderColor&&(t.fillStyle=this._placeholderColor)),this._textWidth=t.measureText(r.text).width;var n=2*this._margin.getValueInPixel(this._host,this._tempParentMeasure.width);this._autoStretchWidth&&(this.width=Math.min(this._maxWidth.getValueInPixel(this._host,this._tempParentMeasure.width),this._textWidth+n)+"px",this._autoStretchWidth=!0);var a=this._fontOffset.ascent+(this._currentMeasure.height-this._fontOffset.height)/2,s=this._width.getValueInPixel(this._host,this._tempParentMeasure.width)-n;if(t.save(),t.beginPath(),t.rect(o,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,s+2,this._currentMeasure.height),t.clip(),this._isFocused&&this._textWidth>s){var l=o-this._textWidth+s;this._scrollLeft||(this._scrollLeft=l)}else this._scrollLeft=o;if(this.outlineWidth&&t.strokeText(r.text,this._scrollLeft,this._currentMeasure.top+a),t.fillText(r.text,this._scrollLeft,this._currentMeasure.top+a),this._isFocused){if(this._clickedCoordinate){var _=this._scrollLeft+this._textWidth-this._clickedCoordinate,h=0;this._cursorOffset=0;var c=0;do{this._cursorOffset&&(c=Math.abs(_-h)),this._cursorOffset++,h=t.measureText(r.substr(r.length-this._cursorOffset,this._cursorOffset)).width}while(h<_&&r.length>=this._cursorOffset);Math.abs(_-h)>c&&this._cursorOffset--,this._blinkIsEven=!1,this._clickedCoordinate=null}if(!this._blinkIsEven){var u=r.substr(r.length-this._cursorOffset),d=t.measureText(u).width,f=this._scrollLeft+this._textWidth-d;fo+s&&(this._scrollLeft+=o+s-f,f=o+s,this._markAsDirty()),this.isTextHighlightOn||t.fillRect(f,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,2,this._fontOffset.height)}if(clearTimeout(this._blinkTimeout),this._blinkTimeout=setTimeout((function(){i._blinkIsEven=!i._blinkIsEven,i._markAsDirty()}),500),this.isTextHighlightOn){clearTimeout(this._blinkTimeout);var p=t.measureText(r.substring(this._startHighlightIndex)).width,g=this._scrollLeft+this._textWidth-p;this._highlightedText=r.substring(this._startHighlightIndex,this._endHighlightIndex);var b=t.measureText(r.substring(this._startHighlightIndex,this._endHighlightIndex)).width;g=this._rowDefinitions.length?null:this._rowDefinitions[t]},e.prototype.getColumnDefinition=function(t){return t<0||t>=this._columnDefinitions.length?null:this._columnDefinitions[t]},e.prototype.addRowDefinition=function(t,e){var i=this;return void 0===e&&(e=!1),this._rowDefinitions.push(new f(t,e?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE)),this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount-1].onChangedObservable.add((function(){return i._markAsDirty()}))),this._markAsDirty(),this},e.prototype.addColumnDefinition=function(t,e){var i=this;return void 0===e&&(e=!1),this._columnDefinitions.push(new f(t,e?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE)),this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount-1].onChangedObservable.add((function(){return i._markAsDirty()}))),this._markAsDirty(),this},e.prototype.setRowDefinition=function(t,e,i){var o=this;if(void 0===i&&(i=!1),t<0||t>=this._rowDefinitions.length)return this;var r=this._rowDefinitions[t];return r&&r.isPixel===i&&r.value===e||(this._rowDefinitions[t].onChangedObservable.remove(this._rowDefinitionObservers[t]),this._rowDefinitions[t]=new f(e,i?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE),this._rowDefinitionObservers[t]=this._rowDefinitions[t].onChangedObservable.add((function(){return o._markAsDirty()})),this._markAsDirty()),this},e.prototype.setColumnDefinition=function(t,e,i){var o=this;if(void 0===i&&(i=!1),t<0||t>=this._columnDefinitions.length)return this;var r=this._columnDefinitions[t];return r&&r.isPixel===i&&r.value===e||(this._columnDefinitions[t].onChangedObservable.remove(this._columnDefinitionObservers[t]),this._columnDefinitions[t]=new f(e,i?f.UNITMODE_PIXEL:f.UNITMODE_PERCENTAGE),this._columnDefinitionObservers[t]=this._columnDefinitions[t].onChangedObservable.add((function(){return o._markAsDirty()})),this._markAsDirty()),this},e.prototype.getChildrenAt=function(t,e){var i=this._cells["".concat(t,":").concat(e)];return i?i.children:null},e.prototype.getChildCellInfo=function(t){return t._tag},e.prototype._removeCell=function(e,i){if(e){t.prototype.removeControl.call(this,e);for(var o=0,r=e.children;o=this._columnDefinitions.length)return this;for(var e=0;e=this._rowDefinitions.length)return this;for(var e=0;e=1-e._Epsilon&&(this._value.r=1),this._value.g>=1-e._Epsilon&&(this._value.g=1),this._value.b>=1-e._Epsilon&&(this._value.b=1),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(t){this._width.toString(this._host)!==t&&this._width.fromString(t)&&(0===this._width.getValue(this._host)&&(t="1px",this._width.fromString(t)),this._height.fromString(t),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(t){this._height.toString(this._host)!==t&&this._height.fromString(t)&&(0===this._height.getValue(this._host)&&(t="1px",this._height.fromString(t)),this._width.fromString(t),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.width},set:function(t){this.width=t},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"ColorPicker"},e.prototype._preMeasure=function(t){t.widthl||f150?.04:-.16*(t-50)/100+.2,m=(p-_)/(t-_),a[b+3]=m1-v?255*(1-(m-(1-v))/v):255}}return r.putImageData(n,0,0),o},e.prototype._draw=function(t){t.save(),this._applyStates(t);var e=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),i=.2*e,o=this._currentMeasure.left,r=this._currentMeasure.top;this._colorWheelCanvas&&this._colorWheelCanvas.width==2*e||(this._colorWheelCanvas=this._createColorWheelCanvas(e,i)),this._updateSquareProps(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.fillRect(this._squareLeft,this._squareTop,this._squareSize,this._squareSize)),t.drawImage(this._colorWheelCanvas,o,r),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this._drawGradientSquare(this._h,this._squareLeft,this._squareTop,this._squareSize,this._squareSize,t);var n=this._squareLeft+this._squareSize*this._s,a=this._squareTop+this._squareSize*(1-this._v);this._drawCircle(n,a,.04*e,t);var s=e-.5*i;n=o+e+Math.cos((this._h-180)*Math.PI/180)*s,a=r+e+Math.sin((this._h-180)*Math.PI/180)*s,this._drawCircle(n,a,.35*i,t),t.restore()},e.prototype._updateValueFromPointer=function(t,i){if(this._pointerStartedOnWheel){var o=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),r=o+this._currentMeasure.left,n=o+this._currentMeasure.top;this._h=180*Math.atan2(i-n,t-r)/Math.PI+180}else this._pointerStartedOnSquare&&(this._updateSquareProps(),this._s=(t-this._squareLeft)/this._squareSize,this._v=1-(i-this._squareTop)/this._squareSize,this._s=Math.min(this._s,1),this._s=Math.max(this._s,e._Epsilon),this._v=Math.min(this._v,1),this._v=Math.max(this._v,e._Epsilon));d.Color3.HSVtoRGBToRef(this._h,this._s,this._v,this._tmpColor),this.value=this._tmpColor},e.prototype._isPointOnSquare=function(t,e){this._updateSquareProps();var i=this._squareLeft,o=this._squareTop,r=this._squareSize;return t>=i&&t<=i+r&&e>=o&&e<=o+r},e.prototype._isPointOnWheel=function(t,e){var i=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),o=i-.2*i,r=t-(i+this._currentMeasure.left),n=e-(i+this._currentMeasure.top),a=r*r+n*n;return a<=i*i&&a>=o*o},e.prototype._onPointerDown=function(e,i,o,r,n){if(!t.prototype._onPointerDown.call(this,e,i,o,r,n))return!1;if(this.isReadOnly)return!0;this._pointerIsDown=!0,this._pointerStartedOnSquare=!1,this._pointerStartedOnWheel=!1,this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var a=this._transformedPosition.x,s=this._transformedPosition.y;return this._isPointOnSquare(a,s)?this._pointerStartedOnSquare=!0:this._isPointOnWheel(a,s)&&(this._pointerStartedOnWheel=!0),this._updateValueFromPointer(a,s),this._host._capturingControl[o]=this,this._lastPointerDownId=o,!0},e.prototype._onPointerMove=function(e,i,o,r){if(o==this._lastPointerDownId){if(!this.isReadOnly){this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var n=this._transformedPosition.x,a=this._transformedPosition.y;this._pointerIsDown&&this._updateValueFromPointer(n,a)}t.prototype._onPointerMove.call(this,e,i,o,r)}},e.prototype._onPointerUp=function(e,i,o,r,n,a){this._pointerIsDown=!1,delete this._host._capturingControl[o],t.prototype._onPointerUp.call(this,e,i,o,r,n,a)},e.prototype._onCanvasBlur=function(){this._forcePointerUp(),t.prototype._onCanvasBlur.call(this)},e.ShowPickerDialogAsync=function(t,i){return new Promise((function(o){i.pickerWidth=i.pickerWidth||"640px",i.pickerHeight=i.pickerHeight||"400px",i.headerHeight=i.headerHeight||"35px",i.lastColor=i.lastColor||"#000000",i.swatchLimit=i.swatchLimit||20,i.numSwatchesPerLine=i.numSwatchesPerLine||10;var r,n,a,s,l,_,h,c=i.swatchLimit/i.numSwatchesPerLine,u=parseFloat(i.pickerWidth)/i.numSwatchesPerLine,f=Math.floor(.25*u),p=f*(i.numSwatchesPerLine+1),g=Math.floor((parseFloat(i.pickerWidth)-p)/i.numSwatchesPerLine),b=g*c+f*(c+1),m=(parseInt(i.pickerHeight)+b+Math.floor(.25*g)).toString()+"px",v="#c0c0c0",y="#535353",x="#414141",P="515151",B=d.Color3.FromHexString("#dddddd"),C=B.r+B.g+B.b,O=["R","G","B"],w="#454545",M="#f0f0f0",E=!1,k=new D;if(k.name="Dialog Container",k.width=i.pickerWidth,i.savedColors){k.height=m;var L=parseInt(i.pickerHeight)/parseInt(m);k.addRowDefinition(L,!1),k.addRowDefinition(1-L,!1)}else k.height=i.pickerHeight,k.addRowDefinition(1,!1);if(t.addControl(k),i.savedColors){(s=new D).name="Swatch Drawer",s.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,s.background=y,s.width=i.pickerWidth;var N,A=i.savedColors.length/i.numSwatchesPerLine;N=0==A?0:A+1,s.height=(g*A+N*f).toString()+"px",s.top=Math.floor(.25*g).toString()+"px";for(var z=0;z<2*Math.ceil(i.savedColors.length/i.numSwatchesPerLine)+1;z++)z%2!=0?s.addRowDefinition(g,!0):s.addRowDefinition(f,!0);for(z=0;z<2*i.numSwatchesPerLine+1;z++)z%2!=0?s.addColumnDefinition(g,!0):s.addColumnDefinition(f,!0);k.addControl(s,1,0)}var Q=new D;Q.name="Picker Panel",Q.height=i.pickerHeight;var V=parseInt(i.headerHeight)/parseInt(i.pickerHeight),W=[V,1-V];Q.addRowDefinition(W[0],!1),Q.addRowDefinition(W[1],!1),k.addControl(Q,0,0);var H=new T;H.name="Dialogue Header Bar",H.background="#cccccc",H.thickness=0,Q.addControl(H,0,0);var G=R.CreateSimpleButton("closeButton","a");G.fontFamily="coreglyphs";var U=d.Color3.FromHexString(H.background),j=new d.Color3(1-U.r,1-U.g,1-U.b);G.color=j.toHexString(),G.fontSize=Math.floor(.6*parseInt(i.headerHeight)),G.textBlock.textVerticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,G.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_RIGHT,G.height=G.width=i.headerHeight,G.background=H.background,G.thickness=0,G.pointerDownAnimation=function(){},G.pointerUpAnimation=function(){G.background=H.background},G.pointerEnterAnimation=function(){G.color=H.background,G.background="red"},G.pointerOutAnimation=function(){G.color=j.toHexString(),G.background=H.background},G.onPointerClickObservable.add((function(){Qt(_t.background)})),Q.addControl(G,0,0);var Y=new D;Y.name="Dialogue Body",Y.background=y;var X=[.4375,.5625];Y.addRowDefinition(1,!1),Y.addColumnDefinition(X[0],!1),Y.addColumnDefinition(X[1],!1),Q.addControl(Y,1,0);var K=new D;K.name="Picker Grid",K.addRowDefinition(.85,!1),K.addRowDefinition(.15,!1),Y.addControl(K,0,0);var Z=new e;Z.name="GUI Color Picker",i.pickerHeighti.pickerHeight?at:nt;var st=new S;st.text="new",st.name="New Color Label",st.color=v,st.fontSize=rt,et.addControl(st,1,0);var lt=new T;lt.name="New Color Swatch",lt.background=i.lastColor,lt.thickness=0,ot.addControl(lt,0,0);var _t=R.CreateSimpleButton("currentSwatch","");_t.background=i.lastColor,_t.thickness=0,_t.onPointerClickObservable.add((function(){Et(d.Color3.FromHexString(_t.background),_t.name),Lt(!1)})),_t.pointerDownAnimation=function(){},_t.pointerUpAnimation=function(){},_t.pointerEnterAnimation=function(){},_t.pointerOutAnimation=function(){},ot.addControl(_t,1,0);var ht=new T;ht.name="Swatch Outline",ht.width=.67,ht.thickness=2,ht.color="#404040",ht.isHitTestVisible=!1,et.addControl(ht,2,0);var ct=new S;ct.name="Current Color Label",ct.text="current",ct.color=v,ct.fontSize=rt,et.addControl(ct,3,0);var ut=new D;ut.name="Button Grid",ut.height=.8;var dt=1/3;ut.addRowDefinition(dt,!1),ut.addRowDefinition(dt,!1),ut.addRowDefinition(dt,!1),$.addControl(ut,0,1);var ft=Math.floor(parseInt(i.pickerWidth)*X[1]*tt[1]*.67).toString()+"px",pt=Math.floor(parseInt(i.pickerHeight)*W[1]*J[0]*(parseFloat(ut.height.toString())/100)*dt*.7).toString()+"px";r=parseFloat(ft)>parseFloat(pt)?Math.floor(.45*parseFloat(pt)):Math.floor(.11*parseFloat(ft));var gt=R.CreateSimpleButton("butOK","OK");gt.width=ft,gt.height=pt,gt.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,gt.thickness=2,gt.color=v,gt.fontSize=r,gt.background=y,gt.onPointerEnterObservable.add((function(){gt.background=x})),gt.onPointerOutObservable.add((function(){gt.background=y})),gt.pointerDownAnimation=function(){gt.background=P},gt.pointerUpAnimation=function(){gt.background=x},gt.onPointerClickObservable.add((function(){Lt(!1),Qt(lt.background)})),ut.addControl(gt,0,0);var bt=R.CreateSimpleButton("butCancel","Cancel");bt.width=ft,bt.height=pt,bt.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,bt.thickness=2,bt.color=v,bt.fontSize=r,bt.background=y,bt.onPointerEnterObservable.add((function(){bt.background=x})),bt.onPointerOutObservable.add((function(){bt.background=y})),bt.pointerDownAnimation=function(){bt.background=P},bt.pointerUpAnimation=function(){bt.background=x},bt.onPointerClickObservable.add((function(){Lt(!1),Qt(_t.background)})),ut.addControl(bt,1,0),i.savedColors&&((l=R.CreateSimpleButton("butSave","Save")).width=ft,l.height=pt,l.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,l.thickness=2,l.fontSize=r,i.savedColors.length0&&At(!0),ut.addControl(l,2,0));var mt=new D;mt.name="Dialog Lower Right",mt.addRowDefinition(.02,!1),mt.addRowDefinition(.63,!1),mt.addRowDefinition(.21,!1),mt.addRowDefinition(.14,!1),q.addControl(mt,1,0);var vt=d.Color3.FromHexString(i.lastColor),yt=new D;for(yt.name="RGB Values",yt.width=.82,yt.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,yt.addRowDefinition(1/3,!1),yt.addRowDefinition(1/3,!1),yt.addRowDefinition(1/3,!1),yt.addColumnDefinition(.1,!1),yt.addColumnDefinition(.2,!1),yt.addColumnDefinition(.7,!1),mt.addControl(yt,1,0),z=0;z255?i="255":isNaN(parseInt(i))&&(i="0")),h==t.name&&(_=i),""!=i){i=parseInt(i).toString(),t.text=i;var o=d.Color3.FromHexString(lt.background);h==t.name&&Et("r"==e?new d.Color3(parseInt(i)/255,o.g,o.b):"g"==e?new d.Color3(o.r,parseInt(i)/255,o.b):new d.Color3(o.r,o.g,parseInt(i)/255),t.name)}}function Dt(t,e){var i=t.text;if(/[^0-9.]/g.test(i))t.text=_;else{""!=i&&"."!=i&&0!=parseFloat(i)&&(parseFloat(i)<0?i="0.0":parseFloat(i)>1?i="1.0":isNaN(parseFloat(i))&&(i="0.0")),h==t.name&&(_=i),""!=i&&"."!=i&&0!=parseFloat(i)?(i=parseFloat(i).toString(),t.text=i):i="0.0";var o=d.Color3.FromHexString(lt.background);h==t.name&&Et("r"==e?new d.Color3(parseFloat(i),o.g,o.b):"g"==e?new d.Color3(o.r,parseFloat(i),o.b):new d.Color3(o.r,o.g,parseFloat(i)),t.name)}}function kt(){if(i.savedColors&&i.savedColors[a]){var t;t=E?"b":"";var e=R.CreateSimpleButton("Swatch_"+a,t);e.fontFamily="coreglyphs";var o=d.Color3.FromHexString(i.savedColors[a]),r=o.r+o.g+o.b;e.color=r>C?"#aaaaaa":"#ffffff",e.fontSize=Math.floor(.7*g),e.textBlock.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,e.height=e.width=g.toString()+"px",e.background=i.savedColors[a],e.thickness=2;var n=a;return e.pointerDownAnimation=function(){e.thickness=4},e.pointerUpAnimation=function(){e.thickness=3},e.pointerEnterAnimation=function(){e.thickness=3},e.pointerOutAnimation=function(){e.thickness=2},e.onPointerClickObservable.add((function(){var t;E?(t=n,i.savedColors&&i.savedColors.splice(t,1),i.savedColors&&0==i.savedColors.length&&(At(!1),E=!1),Nt("",l)):i.savedColors&&Et(d.Color3.FromHexString(i.savedColors[n]),e.name)})),e}return null}function Lt(t){if(void 0!==t&&(E=t),E){for(var e=0;eh*i.numSwatchesPerLine?i.numSwatchesPerLine:i.savedColors.length-(h-1)*i.numSwatchesPerLine;for(var u=Math.min(Math.max(c,0),i.numSwatchesPerLine),d=0,p=1;di.numSwatchesPerLine)){var b=kt();null!=b&&(s.addControl(b,_,p),p+=2,a++)}}i.savedColors.length>=i.swatchLimit?zt(e,!0):zt(e,!1)}}function At(t){t?((n=R.CreateSimpleButton("butEdit","Edit")).width=ft,n.height=pt,n.left=Math.floor(.1*parseInt(ft)).toString()+"px",n.top=(-1*parseFloat(n.left)).toString()+"px",n.verticalAlignment=I.VERTICAL_ALIGNMENT_BOTTOM,n.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,n.thickness=2,n.color=v,n.fontSize=r,n.background=y,n.onPointerEnterObservable.add((function(){n.background=x})),n.onPointerOutObservable.add((function(){n.background=y})),n.pointerDownAnimation=function(){n.background=P},n.pointerUpAnimation=function(){n.background=x},n.onPointerClickObservable.add((function(){E=!E,Lt()})),K.addControl(n,1,0)):K.removeControl(n)}function zt(t,e){e?(t.color="#555555",t.background="#454545"):(t.color=v,t.background=y)}function Qt(e){i.savedColors&&i.savedColors.length>0?o({savedColors:i.savedColors,pickedColor:e}):o({pickedColor:e}),t.removeControl(k)}wt.text=Mt[1],wt.color=M,wt.background=w,wt.onFocusObservable.add((function(){h=wt.name,_=wt.text,Lt(!1)})),wt.onBlurObservable.add((function(){if(3==wt.text.length){var t=wt.text.split("");wt.text=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}""==wt.text&&(wt.text="000000",Et(d.Color3.FromHexString(wt.text),"b")),h==wt.name&&(h="")})),wt.onTextChangedObservable.add((function(){var t=wt.text,e=/[^0-9A-F]/i.test(t);if((wt.text.length>6||e)&&h==wt.name)wt.text=_;else{if(wt.text.length<6)for(var i=6-wt.text.length,o=0;o0&&Nt("",l)}))},e._Epsilon=1e-6,h([(0,d.serialize)()],e.prototype,"value",null),h([(0,d.serialize)()],e.prototype,"width",null),h([(0,d.serialize)()],e.prototype,"height",null),h([(0,d.serialize)()],e.prototype,"size",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.ColorPicker",k);var L=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._thickness=1,i._arc=1,i}return l(e,t),Object.defineProperty(e.prototype,"thickness",{get:function(){return this._thickness},set:function(t){this._thickness!==t&&(this._thickness=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arc",{get:function(){return this._arc},set:function(t){this._arc!==t&&(this._arc=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"Ellipse"},e.prototype._localDraw=function(t){t.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,this._arc,t),(this._backgroundGradient||this._background)&&(t.fillStyle=this._getBackgroundColor(t),t.fill()),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this._thickness&&(this.color&&(t.strokeStyle=this.color),t.lineWidth=this._thickness,t.stroke()),t.restore()},e.prototype._additionalProcessing=function(e,i){t.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.width-=2*this._thickness,this._measureForChildren.height-=2*this._thickness,this._measureForChildren.left+=this._thickness,this._measureForChildren.top+=this._thickness},e.prototype._clipForChildren=function(t){I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2,this._currentMeasure.height/2,this._arc,t),t.clip()},e.prototype._renderHighlightSpecific=function(t){I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._highlightLineWidth/2,this._currentMeasure.height/2-this._highlightLineWidth/2,this._arc,t),t.stroke()},h([(0,d.serialize)()],e.prototype,"thickness",null),h([(0,d.serialize)()],e.prototype,"arc",null),e}(B);(0,d.RegisterClass)("BABYLON.GUI.Ellipse",L);var N=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._unfocusedColor=i.color,i}return l(e,t),e.prototype._onPointerDown=function(e,i,o,r,n){return this.isReadOnly||this.focus(),t.prototype._onPointerDown.call(this,e,i,o,r,n)},e}(R);(0,d.RegisterClass)("BABYLON.GUI.FocusableButton",N);var A=function(t){function e(e,i){void 0===i&&(i="");var o=t.call(this,e)||this;return o.name=e,o._textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._textVerticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._prevText=o.text,o._lineSpacing=new f(0),o._maxHeight=new f(1,f.UNITMODE_PERCENTAGE,!1),o.onLinesReadyObservable=new d.Observable,o.text=i,o.isPointerBlocker=!0,o.onLinesReadyObservable.add((function(){return o._updateCursorPosition()})),o._highlightCursorInfo={initialStartIndex:-1,initialRelativeStartIndex:-1,initialLineIndex:-1},o._cursorInfo={globalStartIndex:0,globalEndIndex:0,relativeEndIndex:0,relativeStartIndex:0,currentLineIndex:0},o}return l(e,t),Object.defineProperty(e.prototype,"autoStretchHeight",{get:function(){return this._autoStretchHeight},set:function(t){this._autoStretchHeight!==t&&(this._autoStretchHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{set:function(t){this.fixedRatioMasterIsWidth=!1,this._height.toString(this._host)!==t&&(this._height.fromString(t)&&this._markAsDirty(),this._autoStretchHeight=!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxHeight",{get:function(){return this._maxHeight.toString(this._host)},set:function(t){this._maxHeight.toString(this._host)!==t&&this._maxHeight.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxHeightInPixels",{get:function(){return this._maxHeight.getValueInPixel(this._host,this._cachedParentMeasure.height)},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"InputTextArea"},e.prototype.processKeyboard=function(t){this.isReadOnly||(this.alternativeProcessKey(t.code,t.key,t),this.onKeyboardEventProcessedObservable.notifyObservers(t))},e.prototype.alternativeProcessKey=function(t,e,i){if(!i||!i.ctrlKey&&!i.metaKey||"c"!==e&&"v"!==e&&"x"!==e){switch(t){case"Period":i&&i.shiftKey&&i.preventDefault();break;case"Backspace":!this._isTextHighlightOn&&this._cursorInfo.globalStartIndex>0&&(this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex--),this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,i&&i.preventDefault(),this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._textHasChanged();break;case"Delete":!this._isTextHighlightOn&&this._cursorInfo.globalEndIndexthis._highlightCursorInfo.initialStartIndex?this._cursorInfo.globalEndIndex--:this._cursorInfo.globalStartIndex--:(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex--,this._isTextHighlightOn=!0),this._blinkIsEven=!0,void i.preventDefault()):(this._isTextHighlightOn?this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex:i&&(i.ctrlKey||i.metaKey)?(this._cursorInfo.globalStartIndex-=this._cursorInfo.relativeStartIndex,i.preventDefault()):this._cursorInfo.globalStartIndex>0&&this._cursorInfo.globalStartIndex--,this._blinkIsEven=!1,void(this._isTextHighlightOn=!1));case"ArrowRight":if(this._markAsDirty(),i&&i.shiftKey){if(i.ctrlKey||i.metaKey){var o=this._lines[this._cursorInfo.currentLineIndex].text.length-this._cursorInfo.relativeEndIndex-1;this._cursorInfo.globalEndIndex+=o,this._cursorInfo.globalStartIndex=this._highlightCursorInfo.initialStartIndex}return this._isTextHighlightOn?this._cursorInfo.globalStartIndexc&&u>0&&a--,this._isTextHighlightOn?this._cursorInfo.currentLineIndex<=this._highlightCursorInfo.initialLineIndex?(this._cursorInfo.globalStartIndex=a,this._cursorInfo.globalEndIndex=this._highlightCursorInfo.initialStartIndex,this._cursorInfo.relativeEndIndex=this._highlightCursorInfo.initialRelativeStartIndex):this._cursorInfo.globalEndIndex=a:this._cursorInfo.globalStartIndex=a}return void this._markAsDirty();case"ArrowDown":if(this._blinkIsEven=!1,i&&(i.shiftKey?(this._isTextHighlightOn||(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex),this._isTextHighlightOn=!0,this._blinkIsEven=!0):this._isTextHighlightOn=!1,i.preventDefault()),this._cursorInfo.currentLineIndex===this._lines.length-1)this._cursorInfo.globalStartIndex=this.text.length;else{r=this._lines[this._cursorInfo.currentLineIndex];var d=this._lines[this._cursorInfo.currentLineIndex+1];a=0,s=0,!this._isTextHighlightOn||this._cursorInfo.currentLineIndexc&&p>0&&a--,this._isTextHighlightOn?this._cursorInfo.currentLineIndexthis._cursorInfo.globalEndIndex&&(this._cursorInfo.globalEndIndex+=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex=this._cursorInfo.globalEndIndex-this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex-=this._cursorInfo.globalStartIndex)):(this._cursorInfo.globalEndIndex=a,this._cursorInfo.globalStartIndex=this._highlightCursorInfo.initialStartIndex):this._cursorInfo.globalStartIndex=a}return void this._markAsDirty()}if("a"===e&&i&&(i.ctrlKey||i.metaKey))return this.selectAllText(),void i.preventDefault();1===(null==e?void 0:e.length)&&(null==i||i.preventDefault(),this._currentKey=e,this.onBeforeKeyAddObservable.notifyObservers(this),e=this._currentKey,this._addKey&&(this._isTextHighlightOn=!1,this._blinkIsEven=!1,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex,e),this._cursorInfo.globalStartIndex+=e.length,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._textHasChanged()))}},e.prototype._parseLineWordWrap=function(t,e,i){void 0===t&&(t="");for(var o=[],r=t.split(" "),n=0,a=function(a){var s=a>0?t+" "+r[a]:r[0],l=i.measureText(s).width;if(l>e){a>0&&(n=i.measureText(t).width,o.push({text:t,width:n,lineEnding:" "})),t=r[a];var _="";t.split("").map((function(t){i.measureText(_+t).width>e&&(o.push({text:_,width:i.measureText(_).width,lineEnding:""}),_=""),_+=t})),t=_,n=i.measureText(t).width}else n=l,t=s},s=0;se.measureText(t).width?i:t}),""),a=e.measureText(n).width;this.width=Math.min(this._maxWidth.getValueInPixel(this._host,t.width),a+r)+"px",this.autoStretchWidth=!0}if(this._availableWidth=this._width.getValueInPixel(this._host,t.width)-r,this._lines=this._breakLines(this._availableWidth,e),this._contextForBreakLines=e,this._autoStretchHeight){var s=this._lines.length*this._fontOffset.height+2*this._margin.getValueInPixel(this._host,t.height);this.height=Math.min(this._maxHeight.getValueInPixel(this._host,t.height),s)+"px",this._autoStretchHeight=!0}if(this._availableHeight=this._height.getValueInPixel(this._host,t.height)-r,this._isFocused){this._cursorInfo.currentLineIndex=0;for(var l=this._lines[this._cursorInfo.currentLineIndex].text.length+this._lines[this._cursorInfo.currentLineIndex].lineEnding.length,_=0;_+l<=this._cursorInfo.globalStartIndex;)_+=l,this._cursorInfo.currentLineIndexthis._availableWidth){var t=this._clipTextLeft-this._lines[this._cursorInfo.currentLineIndex].width+this._availableWidth;this._scrollLeft||(this._scrollLeft=t)}else this._scrollLeft=this._clipTextLeft;if(this._isFocused){var e=(this._cursorInfo.currentLineIndex+1)*this._fontOffset.height,i=this._clipTextTop-e;this._scrollTop||(this._scrollTop=i)}else this._scrollTop=this._clipTextTop},e.prototype._additionalProcessing=function(){this.highlightedText="",this.onLinesReadyObservable.notifyObservers(this)},e.prototype._drawText=function(t,e,i,o){var r=this._currentMeasure.width,n=this._scrollLeft;switch(this._textHorizontalAlignment){case I.HORIZONTAL_ALIGNMENT_LEFT:n+=0;break;case I.HORIZONTAL_ALIGNMENT_RIGHT:n+=r-e;break;case I.HORIZONTAL_ALIGNMENT_CENTER:n+=(r-e)/2}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&o.strokeText(t,this._currentMeasure.left+n,i),o.fillText(t,n,i)},e.prototype._onCopyText=function(t){this._isTextHighlightOn=!1;try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText},e.prototype._onCutText=function(t){if(this._highlightedText){try{t.clipboardData&&t.clipboardData.setData("text/plain",this._highlightedText)}catch(t){}this._host.clipboardData=this._highlightedText,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),this._textHasChanged()}},e.prototype._onPasteText=function(e){var i;i=e.clipboardData&&-1!==e.clipboardData.types.indexOf("text/plain")?e.clipboardData.getData("text/plain"):this._host.clipboardData,this._isTextHighlightOn=!1,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex,i);var o=i.length-(this._cursorInfo.globalEndIndex-this._cursorInfo.globalStartIndex);this._cursorInfo.globalStartIndex+=o,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._clickedCoordinateX=null,this._clickedCoordinateY=null,t.prototype._textHasChanged.call(this)},e.prototype._draw=function(t){var e,i;this._computeScroll(),this._scrollLeft=null!==(e=this._scrollLeft)&&void 0!==e?e:0,this._scrollTop=null!==(i=this._scrollTop)&&void 0!==i?i:0,t.save(),this._applyStates(t),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),this._isFocused?this._focusedBackground&&(t.fillStyle=this._isEnabled?this._focusedBackground:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)):this._background&&(t.fillStyle=this._isEnabled?this._background:this._disabledColor,t.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),this.color&&(t.fillStyle=this.color);var o=this._currentMeasure.height,r=this._currentMeasure.width,n=0;switch(this._textVerticalAlignment){case I.VERTICAL_ALIGNMENT_TOP:n=this._fontOffset.ascent;break;case I.VERTICAL_ALIGNMENT_BOTTOM:n=o-this._fontOffset.height*(this._lines.length-1)-this._fontOffset.descent;break;case I.VERTICAL_ALIGNMENT_CENTER:n=this._fontOffset.ascent+(o-this._fontOffset.height*this._lines.length)/2}t.save(),t.beginPath(),t.fillStyle=this.fontStyle,!this._textWrapper.text&&this.placeholderText&&(t.fillStyle=this._placeholderColor),t.rect(this._clipTextLeft,this._clipTextTop,this._availableWidth+2,this._availableHeight+2),t.clip(),n+=this._scrollTop;for(var a=0;athis._clipTextLeft+this._availableWidth&&(this._scrollLeft+=this._clipTextLeft+this._availableWidth-l,l=this._clipTextLeft+this._availableWidth,this._markAsDirty());var _=this._scrollTop+this._cursorInfo.currentLineIndex*this._fontOffset.height;_this._clipTextTop+this._availableHeight&&this._availableHeight>this._fontOffset.height&&(this._scrollTop+=this._clipTextTop+this._availableHeight-_-this._fontOffset.height,_=this._clipTextTop+this._availableHeight-this._fontOffset.height,this._markAsDirty()),this._isTextHighlightOn||t.fillRect(l,_,2,this._fontOffset.height)}if(this._resetBlinking(),this._isTextHighlightOn){clearTimeout(this._blinkTimeout),this._highlightedText=this.text.substring(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),t.globalAlpha=this._highligherOpacity,t.fillStyle=this._textHighlightColor;var h=Math.min(this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialLineIndex),c=Math.max(this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialLineIndex),u=this._scrollTop+h*this._fontOffset.height;for(a=h;a<=c;a++){s=this._lines[a];var d=this._scrollLeft;switch(this._textHorizontalAlignment){case I.HORIZONTAL_ALIGNMENT_LEFT:d+=0;break;case I.HORIZONTAL_ALIGNMENT_RIGHT:d+=r-s.width;break;case I.HORIZONTAL_ALIGNMENT_CENTER:d+=(r-s.width)/2}var f=a===h?this._cursorInfo.relativeStartIndex:0,p=a===c?this._cursorInfo.relativeEndIndex:s.text.length,g=t.measureText(s.text.substring(0,f)).width,b=s.text.substring(f,p),m=t.measureText(b).width;t.fillRect(d+g,u,m,this._fontOffset.height),u+=this._fontOffset.height}this._cursorInfo.globalEndIndex===this._cursorInfo.globalStartIndex&&this._resetBlinking()}}t.restore(),this._thickness&&(this._isFocused?this.focusedColor&&(t.strokeStyle=this.focusedColor):this.color&&(t.strokeStyle=this.color),t.lineWidth=this._thickness,t.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness))},e.prototype._resetBlinking=function(){var t=this;clearTimeout(this._blinkTimeout),this._blinkTimeout=setTimeout((function(){t._blinkIsEven=!t._blinkIsEven,t._markAsDirty()}),500)},e.prototype._onPointerDown=function(e,i,o,r,n){return!(!t.prototype._onPointerDown.call(this,e,i,o,r,n)||!this.isReadOnly&&(this._clickedCoordinateX=i.x,this._clickedCoordinateY=i.y,this._isTextHighlightOn=!1,this._highlightedText="",this._isPointerDown=!0,this._host._capturingControl[o]=this,this._host.focusedControl===this?(clearTimeout(this._blinkTimeout),this._markAsDirty(),0):!this._isEnabled||(this._host.focusedControl=this,0)))},e.prototype._onPointerMove=function(e,i,o,r){0===r.event.movementX&&0===r.event.movementY||(this._host.focusedControl===this&&this._isPointerDown&&!this.isReadOnly&&(this._clickedCoordinateX=i.x,this._clickedCoordinateY=i.y,this._isTextHighlightOn||(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex,this._isTextHighlightOn=!0),this._markAsDirty()),t.prototype._onPointerMove.call(this,e,i,o,r))},e.prototype._updateCursorPosition=function(){var t;if(this._isFocused)if(!this._textWrapper.text&&this.placeholderText)this._cursorInfo.currentLineIndex=0,this._cursorInfo.globalStartIndex=0,this._cursorInfo.globalEndIndex=0,this._cursorInfo.relativeStartIndex=0,this._cursorInfo.relativeEndIndex=0;else if(this._clickedCoordinateX&&this._clickedCoordinateY){this._isTextHighlightOn||(this._cursorInfo={globalStartIndex:0,globalEndIndex:0,relativeStartIndex:0,relativeEndIndex:0,currentLineIndex:0});var e=0,i=0,o=this._clickedCoordinateY-this._scrollTop,r=Math.floor(o/this._fontOffset.height);this._cursorInfo.currentLineIndex=Math.min(Math.max(r,0),this._lines.length-1);for(var n=0,a=this._clickedCoordinateX-(null!==(t=this._scrollLeft)&&void 0!==t?t:0),s=0,l=0;li;)i++,s=Math.abs(a-n),n=this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substring(0,i)).width;Math.abs(a-n)>s&&i>0&&i--,e+=i,this._isTextHighlightOn?e=this._highlightCursorInfo.initialStartIndex){for(;c+h<=this._cursorInfo.globalEndIndex;)c+=h,this._cursorInfo.currentLineIndex0&&this._textWrapper.isWord(this._cursorInfo.globalStartIndex-1)?--this._cursorInfo.globalStartIndex:0,i=this._cursorInfo.globalEndIndex1?this.notRenderable=!0:this.notRenderable=!1}else d.Tools.Error("Cannot move a control to a vector3 if the control is not at root level")},e.prototype._moveToProjectedPosition=function(t,e){void 0===e&&(e=!1);var i=t.x+this._linkOffsetX.getValue(this._host)+"px",o=t.y+this._linkOffsetY.getValue(this._host)+"px";e?(this.x2=i,this.y2=o,this._x2.ignoreAdaptiveScaling=!0,this._y2.ignoreAdaptiveScaling=!0):(this.x1=i,this.y1=o,this._x1.ignoreAdaptiveScaling=!0,this._y1.ignoreAdaptiveScaling=!0)},h([(0,d.serialize)()],e.prototype,"dash",null),h([(0,d.serialize)()],e.prototype,"x1",null),h([(0,d.serialize)()],e.prototype,"y1",null),h([(0,d.serialize)()],e.prototype,"x2",null),h([(0,d.serialize)()],e.prototype,"y2",null),h([(0,d.serialize)()],e.prototype,"lineWidth",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.Line",Q);var V=function(){function t(t){this._multiLine=t,this._x=new f(0),this._y=new f(0),this._point=new d.Vector3(0,0,0)}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x.toString(this._multiLine._host)},set:function(t){this._x.toString(this._multiLine._host)!==t&&this._x.fromString(t)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y.toString(this._multiLine._host)},set:function(t){this._y.toString(this._multiLine._host)!==t&&this._y.fromString(t)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this._control},set:function(t){this._control!==t&&(this._control&&this._controlObserver&&(this._control.onDirtyObservable.remove(this._controlObserver),this._controlObserver=null),this._control=t,this._control&&(this._controlObserver=this._control.onDirtyObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},set:function(t){this._mesh!==t&&(this._mesh&&this._meshObserver&&this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver),this._mesh=t,this._mesh&&(this._meshObserver=this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype.resetLinks=function(){this.control=null,this.mesh=null},t.prototype.translate=function(){return this._point=this._translatePoint(),this._point},t.prototype._translatePoint=function(){if(null!=this._mesh)return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center,this._mesh.getWorldMatrix());if(null!=this._control)return new d.Vector3(this._control.centerX,this._control.centerY,1-d.Epsilon);var t=this._multiLine._host,e=this._x.getValueInPixel(t,Number(t._canvas.width)),i=this._y.getValueInPixel(t,Number(t._canvas.height));return new d.Vector3(e,i,1-d.Epsilon)},t.prototype.dispose=function(){this.resetLinks()},t}(),W=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._lineWidth=1,i.onPointUpdate=function(){i._markAsDirty()},i._automaticSize=!0,i.isHitTestVisible=!1,i._horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,i._verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,i._dash=[],i._points=[],i}return l(e,t),Object.defineProperty(e.prototype,"dash",{get:function(){return this._dash},set:function(t){this._dash!==t&&(this._dash=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype.getAt=function(t){return this._points[t]||(this._points[t]=new V(this)),this._points[t]},e.prototype.add=function(){for(var t=this,e=[],i=0;i0;)this.remove(this._points.length-1)},e.prototype.resetLinks=function(){this._points.forEach((function(t){null!=t&&t.resetLinks()}))},Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(t){this._lineWidth!==t&&(this._lineWidth=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalAlignment",{set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalAlignment",{set:function(t){},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"MultiLine"},e.prototype._draw=function(t){t.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),this._applyStates(t),t.strokeStyle=this.color,t.lineWidth=this._lineWidth,t.setLineDash(this._dash),t.beginPath();var e,i=!0;this._points.forEach((function(o){o&&(i?(t.moveTo(o._point.x,o._point.y),i=!1):o._point.z<1&&e.z<1?t.lineTo(o._point.x,o._point.y):t.moveTo(o._point.x,o._point.y),e=o._point)})),t.stroke(),t.restore()},e.prototype._additionalProcessing=function(){var t=this;this._minX=null,this._minY=null,this._maxX=null,this._maxY=null,this._points.forEach((function(e){e&&(e.translate(),(null==t._minX||e._point.xt._maxX)&&(t._maxX=e._point.x),(null==t._maxY||e._point.y>t._maxY)&&(t._maxY=e._point.y))})),null==this._minX&&(this._minX=0),null==this._minY&&(this._minY=0),null==this._maxX&&(this._maxX=0),null==this._maxY&&(this._maxY=0)},e.prototype._measure=function(){null!=this._minX&&null!=this._maxX&&null!=this._minY&&null!=this._maxY&&(this._currentMeasure.width=Math.abs(this._maxX-this._minX)+this._lineWidth,this._currentMeasure.height=Math.abs(this._maxY-this._minY)+this._lineWidth)},e.prototype._computeAlignment=function(){null!=this._minX&&null!=this._minY&&(this._currentMeasure.left=this._minX-this._lineWidth/2,this._currentMeasure.top=this._minY-this._lineWidth/2)},e.prototype.dispose=function(){this.reset(),t.prototype.dispose.call(this)},h([(0,d.serialize)()],e.prototype,"dash",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.MultiLine",W);var H=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._isChecked=!1,i._background="black",i._checkSizeRatio=.8,i._thickness=1,i.group="",i.onIsCheckedChangedObservable=new d.Observable,i.isPointerBlocker=!0,i}return l(e,t),Object.defineProperty(e.prototype,"thickness",{get:function(){return this._thickness},set:function(t){this._thickness!==t&&(this._thickness=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkSizeRatio",{get:function(){return this._checkSizeRatio},set:function(t){t=Math.max(Math.min(1,t),0),this._checkSizeRatio!==t&&(this._checkSizeRatio=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background!==t&&(this._background=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isChecked",{get:function(){return this._isChecked},set:function(t){var e=this;this._isChecked!==t&&(this._isChecked=t,this._markAsDirty(),this.onIsCheckedChangedObservable.notifyObservers(t),this._isChecked&&this._host&&this._host.executeOnAllControls((function(t){if(t!==e&&void 0!==t.group){var i=t;i.group===e.group&&(i.isChecked=!1)}})))},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"RadioButton"},e.prototype._draw=function(t){t.save(),this._applyStates(t);var e=this._currentMeasure.width-this._thickness,i=this._currentMeasure.height-this._thickness;if((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY),I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,1,t),t.fillStyle=this._isEnabled?this._background:this._disabledColor,t.fill(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),t.strokeStyle=this.color,t.lineWidth=this._thickness,t.stroke(),this._isChecked){t.fillStyle=this._isEnabled?this.color:this._disabledColor;var o=e*this._checkSizeRatio,r=i*this._checkSizeRatio;I.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,o/2-this._thickness/2,r/2-this._thickness/2,1,t),t.fill()}t.restore()},e.prototype._onPointerDown=function(e,i,o,r,n){return!!t.prototype._onPointerDown.call(this,e,i,o,r,n)&&(this.isReadOnly||this.isChecked||(this.isChecked=!0),!0)},e.AddRadioButtonWithHeader=function(t,i,o,r){var n=new w;n.isVertical=!1,n.height="30px";var a=new e;a.width="20px",a.height="20px",a.isChecked=o,a.color="green",a.group=i,a.onIsCheckedChangedObservable.add((function(t){return r(a,t)})),n.addControl(a);var s=new S;return s.text=t,s.width="180px",s.paddingLeft="5px",s.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,s.color="white",n.addControl(s),n},h([(0,d.serialize)()],e.prototype,"thickness",null),h([(0,d.serialize)()],e.prototype,"group",void 0),h([(0,d.serialize)()],e.prototype,"checkSizeRatio",null),h([(0,d.serialize)()],e.prototype,"background",null),h([(0,d.serialize)()],e.prototype,"isChecked",null),e}(I);(0,d.RegisterClass)("BABYLON.GUI.RadioButton",H);var G=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._thumbWidth=new f(20,f.UNITMODE_PIXEL,!1),i._minimum=0,i._maximum=100,i._value=50,i._isVertical=!1,i._barOffset=new f(5,f.UNITMODE_PIXEL,!1),i._isThumbClamped=!1,i._displayThumb=!0,i._step=0,i._lastPointerDownId=-1,i._effectiveBarOffset=0,i.onValueChangedObservable=new d.Observable,i._pointerIsDown=!1,i.isPointerBlocker=!0,i}return l(e,t),Object.defineProperty(e.prototype,"displayThumb",{get:function(){return this._displayThumb},set:function(t){this._displayThumb!==t&&(this._displayThumb=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this._step},set:function(t){this._step!==t&&(this._step=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barOffset",{get:function(){return this._barOffset.toString(this._host)},set:function(t){this._barOffset.toString(this._host)!==t&&this._barOffset.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barOffsetInPixels",{get:function(){return this._barOffset.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbWidth",{get:function(){return this._thumbWidth.toString(this._host)},set:function(t){this._thumbWidth.toString(this._host)!==t&&this._thumbWidth.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbWidthInPixels",{get:function(){return this._thumbWidth.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minimum",{get:function(){return this._minimum},set:function(t){this._minimum!==t&&(this._minimum=t,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){this._maximum!==t&&(this._maximum=t,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t=Math.max(Math.min(t,this._maximum),this._minimum),this._value!==t&&(this._value=t,this._markAsDirty(),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isThumbClamped",{get:function(){return this._isThumbClamped},set:function(t){this._isThumbClamped!==t&&(this._isThumbClamped=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"BaseSlider"},e.prototype._getThumbPosition=function(){return this.isVertical?(this.maximum-this.value)/(this.maximum-this.minimum)*this._backgroundBoxLength:(this.value-this.minimum)/(this.maximum-this.minimum)*this._backgroundBoxLength},e.prototype._getThumbThickness=function(t){var e=0;switch(t){case"circle":e=this._thumbWidth.isPixel?Math.max(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host);break;case"rectangle":e=this._thumbWidth.isPixel?Math.min(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)}return e},e.prototype._prepareRenderingData=function(t){this._effectiveBarOffset=0,this._renderLeft=this._currentMeasure.left,this._renderTop=this._currentMeasure.top,this._renderWidth=this._currentMeasure.width,this._renderHeight=this._currentMeasure.height,this._backgroundBoxLength=Math.max(this._currentMeasure.width,this._currentMeasure.height),this._backgroundBoxThickness=Math.min(this._currentMeasure.width,this._currentMeasure.height),this._effectiveThumbThickness=this._getThumbThickness(t),this.displayThumb&&(this._backgroundBoxLength-=this._effectiveThumbThickness),this.isVertical&&this._currentMeasure.height=this._selectors.length))return this._selectors[t]},t.prototype.removeSelector=function(t){t<0||t>=this._selectors.length||(this._groupPanel.removeControl(this._selectors[t]),this._selectors.splice(t,1))},t}(),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.addCheckbox=function(t,e,i){void 0===e&&(e=function(t){}),void 0===i&&(i=!1),i=i||!1;var o=new M;o.width="20px",o.height="20px",o.color="#364249",o.background="#CCCCCC",o.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o.onIsCheckedChangedObservable.add((function(t){e(t)}));var r=I.AddHeader(o,t,"200px",{isHorizontal:!0,controlFirst:!0});r.height="30px",r.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,r.left="4px",this.groupPanel.addControl(r),this.selectors.push(r),o.isChecked=i,this.groupPanel.parent&&this.groupPanel.parent.parent&&(o.color=this.groupPanel.parent.parent.buttonColor,o.background=this.groupPanel.parent.parent.buttonBackground)},e.prototype._setSelectorLabel=function(t,e){this.selectors[t].children[1].text=e},e.prototype._setSelectorLabelColor=function(t,e){this.selectors[t].children[1].color=e},e.prototype._setSelectorButtonColor=function(t,e){this.selectors[t].children[0].color=e},e.prototype._setSelectorButtonBackground=function(t,e){this.selectors[t].children[0].background=e},e}(j),X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectNb=0,e}return l(e,t),e.prototype.addRadio=function(t,e,i){void 0===e&&(e=function(t){}),void 0===i&&(i=!1);var o=this._selectNb++,r=new H;r.name=t,r.width="20px",r.height="20px",r.color="#364249",r.background="#CCCCCC",r.group=this.name,r.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,r.onIsCheckedChangedObservable.add((function(t){t&&e(o)}));var n=I.AddHeader(r,t,"200px",{isHorizontal:!0,controlFirst:!0});n.height="30px",n.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,n.left="4px",this.groupPanel.addControl(n),this.selectors.push(n),r.isChecked=i,this.groupPanel.parent&&this.groupPanel.parent.parent&&(r.color=this.groupPanel.parent.parent.buttonColor,r.background=this.groupPanel.parent.parent.buttonBackground)},e.prototype._setSelectorLabel=function(t,e){this.selectors[t].children[1].text=e},e.prototype._setSelectorLabelColor=function(t,e){this.selectors[t].children[1].color=e},e.prototype._setSelectorButtonColor=function(t,e){this.selectors[t].children[0].color=e},e.prototype._setSelectorButtonBackground=function(t,e){this.selectors[t].children[0].background=e},e}(j),K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.addSlider=function(t,e,i,o,r,n,a){void 0===e&&(e=function(t){}),void 0===i&&(i="Units"),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=function(t){return 0|t});var s=new U;s.name=i,s.value=n,s.minimum=o,s.maximum=r,s.width=.9,s.height="20px",s.color="#364249",s.background="#CCCCCC",s.borderColor="black",s.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,s.left="4px",s.paddingBottom="4px",s.onValueChangedObservable.add((function(t){s.parent.children[0].text=s.parent.children[0].name+": "+a(t)+" "+s.name,e(t)}));var l=I.AddHeader(s,t+": "+a(n)+" "+i,"30px",{isHorizontal:!1,controlFirst:!1});l.height="60px",l.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,l.left="4px",l.children[0].name=t,this.groupPanel.addControl(l),this.selectors.push(l),this.groupPanel.parent&&this.groupPanel.parent.parent&&(s.color=this.groupPanel.parent.parent.buttonColor,s.background=this.groupPanel.parent.parent.buttonBackground)},e.prototype._setSelectorLabel=function(t,e){this.selectors[t].children[0].name=e,this.selectors[t].children[0].text=e+": "+this.selectors[t].children[1].value+" "+this.selectors[t].children[1].name},e.prototype._setSelectorLabelColor=function(t,e){this.selectors[t].children[0].color=e},e.prototype._setSelectorButtonColor=function(t,e){this.selectors[t].children[1].color=e},e.prototype._setSelectorButtonBackground=function(t,e){this.selectors[t].children[1].background=e},e}(j),Z=function(t){function e(e,i){void 0===i&&(i=[]);var o=t.call(this,e)||this;if(o.name=e,o.groups=i,o._buttonColor="#364249",o._buttonBackground="#CCCCCC",o._headerColor="black",o._barColor="white",o._barHeight="2px",o._spacerHeight="20px",o._bars=new Array,o._groups=i,o.thickness=2,o._panel=new w,o._panel.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._panel.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._panel.top=5,o._panel.left=5,o._panel.width=.95,i.length>0){for(var r=0;r0&&this._addSpacer(),this._panel.addControl(t.groupPanel),this._groups.push(t),t.groupPanel.children[0].color=this._headerColor;for(var e=0;e=this._groups.length)){var e=this._groups[t];this._panel.removeControl(e.groupPanel),this._groups.splice(t,1),t=this._groups.length||(this._groups[e].groupPanel.children[0].text=t)},e.prototype.relabel=function(t,e,i){if(!(e<0||e>=this._groups.length)){var o=this._groups[e];i<0||i>=o.selectors.length||o._setSelectorLabel(i,t)}},e.prototype.removeFromGroupSelector=function(t,e){if(!(t<0||t>=this._groups.length)){var i=this._groups[t];e<0||e>=i.selectors.length||i.removeSelector(e)}},e.prototype.addToGroupCheckbox=function(t,e,i,o){void 0===i&&(i=function(){}),void 0===o&&(o=!1),t<0||t>=this._groups.length||this._groups[t].addCheckbox(e,i,o)},e.prototype.addToGroupRadio=function(t,e,i,o){void 0===i&&(i=function(){}),void 0===o&&(o=!1),t<0||t>=this._groups.length||this._groups[t].addRadio(e,i,o)},e.prototype.addToGroupSlider=function(t,e,i,o,r,n,a,s){void 0===i&&(i=function(){}),void 0===o&&(o="Units"),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===s&&(s=function(t){return 0|t}),t<0||t>=this._groups.length||this._groups[t].addSlider(e,i,o,r,n,a,s)},e}(T),q=function(t){function e(e){var i=t.call(this,e)||this;return i._freezeControls=!1,i._bucketWidth=0,i._bucketHeight=0,i._buckets={},i}return l(e,t),Object.defineProperty(e.prototype,"freezeControls",{get:function(){return this._freezeControls},set:function(t){if(this._freezeControls!==t){t||this._restoreMeasures(),this._freezeControls=!1;var e=this.host.getSize(),i=e.width,o=e.height,r=this.host.getContext(),n=new v(0,0,i,o);this.host._numLayoutCalls=0,this.host._rootContainer._layout(n,r),t&&(this._updateMeasures(),this._useBuckets()&&this._makeBuckets()),this._freezeControls=t,this.host.markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucketWidth",{get:function(){return this._bucketWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucketHeight",{get:function(){return this._bucketHeight},enumerable:!1,configurable:!0}),e.prototype.setBucketSizes=function(t,e){this._bucketWidth=t,this._bucketHeight=e,this._useBuckets()?this._freezeControls&&this._makeBuckets():this._buckets={}},e.prototype._useBuckets=function(){return this._bucketWidth>0&&this._bucketHeight>0},e.prototype._makeBuckets=function(){this._buckets={},this._bucketLen=Math.ceil(this.widthInPixels/this._bucketWidth),this._dispatchInBuckets(this._children),this._oldLeft=null,this._oldTop=null},e.prototype._dispatchInBuckets=function(t){for(var e=0;e0&&this._dispatchInBuckets(i._children)}},e.prototype._updateMeasures=function(){var t=0|this.leftInPixels,e=0|this.topInPixels;this._measureForChildren.left-=t,this._measureForChildren.top-=e,this._currentMeasure.left-=t,this._currentMeasure.top-=e,this._customData.origLeftForChildren=this._measureForChildren.left,this._customData.origTopForChildren=this._measureForChildren.top,this._customData.origLeft=this._currentMeasure.left,this._customData.origTop=this._currentMeasure.top,this._updateChildrenMeasures(this._children,t,e)},e.prototype._updateChildrenMeasures=function(t,e,i){for(var o=0;o0&&this._updateChildrenMeasures(r._children,e,i)}},e.prototype._restoreMeasures=function(){var t=0|this.leftInPixels,e=0|this.topInPixels;this._measureForChildren.left=this._customData.origLeftForChildren+t,this._measureForChildren.top=this._customData.origTopForChildren+e,this._currentMeasure.left=this._customData.origLeft+t,this._currentMeasure.top=this._customData.origTop+e},e.prototype._getTypeName=function(){return"ScrollViewerWindow"},e.prototype._additionalProcessing=function(e,i){t.prototype._additionalProcessing.call(this,e,i),this._parentMeasure=e,this._measureForChildren.left=this._currentMeasure.left,this._measureForChildren.top=this._currentMeasure.top,this._measureForChildren.width=e.width,this._measureForChildren.height=e.height},e.prototype._layout=function(e,i){return this._freezeControls?(this.invalidateRect(),!1):t.prototype._layout.call(this,e,i)},e.prototype._scrollChildren=function(t,e,i){for(var o=0;o0&&this._scrollChildren(r._children,e,i)}},e.prototype._scrollChildrenWithBuckets=function(t,e,i,o){for(var r=Math.max(0,Math.floor(-t/this._bucketWidth)),n=Math.floor((-t+this._parentMeasure.width-1)/this._bucketWidth),a=Math.floor((-e+this._parentMeasure.height-1)/this._bucketHeight),s=Math.max(0,Math.floor(-e/this._bucketHeight));s<=a;){for(var l=r;l<=n;++l){var _=s*this._bucketLen+l,h=this._buckets[_];if(h)for(var c=0;cthis._tempMeasure.left+this._tempMeasure.width||ethis._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(e-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(t-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var o;o=this.isVertical?-(e-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness):(t-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=i*o*(this.maximum-this.minimum),this._originX=t,this._originY=e},e.prototype._onPointerDown=function(e,i,o,r,n){return this._first=!0,t.prototype._onPointerDown.call(this,e,i,o,r,n)},e.prototype.serialize=function(e){t.prototype.serialize.call(this,e),this.backgroundGradient&&(e.backgroundGradient={},this.backgroundGradient.serialize(e.backgroundGradient))},e.prototype._parseFromContent=function(e,i){if(t.prototype._parseFromContent.call(this,e,i),e.backgroundGradient){var o=d.Tools.Instantiate("BABYLON.GUI."+e.backgroundGradient.className);this.backgroundGradient=new o,this.backgroundGradient.parse(e.backgroundGradient)}},h([(0,d.serialize)()],e.prototype,"borderColor",null),h([(0,d.serialize)()],e.prototype,"background",null),h([(0,d.serialize)()],e.prototype,"invertScrollDirection",null),e}(G);(0,d.RegisterClass)("BABYLON.GUI.Scrollbar",J);var $=function(t){function e(e){var i=t.call(this,e)||this;return i.name=e,i._thumbLength=.5,i._thumbHeight=1,i._barImageHeight=1,i._tempMeasure=new v(0,0,0,0),i._invertScrollDirection=!1,i.num90RotationInVerticalMode=1,i}return l(e,t),Object.defineProperty(e.prototype,"invertScrollDirection",{get:function(){return this._invertScrollDirection},set:function(t){this._invertScrollDirection=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundImage",{get:function(){return this._backgroundBaseImage},set:function(t){var e=this;this._backgroundBaseImage!==t&&(this._backgroundBaseImage=t,this.isVertical&&0!==this.num90RotationInVerticalMode?t.isLoaded?(this._backgroundImage=t._rotate90(this.num90RotationInVerticalMode,!0),this._markAsDirty()):t.onImageLoadedObservable.addOnce((function(){var i=t._rotate90(e.num90RotationInVerticalMode,!0);e._backgroundImage=i,i.isLoaded||i.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),e._markAsDirty()})):(this._backgroundImage=t,t&&!t.isLoaded&&t.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbImage",{get:function(){return this._thumbBaseImage},set:function(t){var e=this;this._thumbBaseImage!==t&&(this._thumbBaseImage=t,this.isVertical&&0!==this.num90RotationInVerticalMode?t.isLoaded?(this._thumbImage=t._rotate90(-this.num90RotationInVerticalMode,!0),this._markAsDirty()):t.onImageLoadedObservable.addOnce((function(){var i=t._rotate90(-e.num90RotationInVerticalMode,!0);e._thumbImage=i,i.isLoaded||i.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),e._markAsDirty()})):(this._thumbImage=t,t&&!t.isLoaded&&t.onImageLoadedObservable.addOnce((function(){e._markAsDirty()})),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(t){this._thumbLength!==t&&(this._thumbLength=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(t){this._thumbLength!==t&&(this._thumbHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(t){this._barImageHeight!==t&&(this._barImageHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"ImageScrollBar"},e.prototype._getThumbThickness=function(){return this._thumbWidth.isPixel?this._thumbWidth.getValue(this._host):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)},e.prototype._draw=function(t){t.save(),this._applyStates(t),this._prepareRenderingData("rectangle");var e=this._getThumbPosition(),i=this._renderLeft,o=this._renderTop,r=this._renderWidth,n=this._renderHeight;this._backgroundImage&&(this._tempMeasure.copyFromFloats(i,o,r,n),this.isVertical?(this._tempMeasure.copyFromFloats(i+r*(1-this._barImageHeight)*.5,this._currentMeasure.top,r*this._barImageHeight,n),this._tempMeasure.height+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)):(this._tempMeasure.copyFromFloats(this._currentMeasure.left,o+n*(1-this._barImageHeight)*.5,r,n*this._barImageHeight),this._tempMeasure.width+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)),this._backgroundImage._draw(t)),this.isVertical?this._tempMeasure.copyFromFloats(i-this._effectiveBarOffset+this._currentMeasure.width*(1-this._thumbHeight)*.5,this._currentMeasure.top+e,this._currentMeasure.width*this._thumbHeight,this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(this._currentMeasure.left+e,this._currentMeasure.top+this._currentMeasure.height*(1-this._thumbHeight)*.5,this._effectiveThumbThickness,this._currentMeasure.height*this._thumbHeight),this._thumbImage&&(this._thumbImage._currentMeasure.copyFrom(this._tempMeasure),this._thumbImage._draw(t)),t.restore()},e.prototype._updateValueFromPointer=function(t,e){0!=this.rotation&&(this._invertTransformMatrix.transformCoordinates(t,e,this._transformedPosition),t=this._transformedPosition.x,e=this._transformedPosition.y);var i=this._invertScrollDirection?-1:1;this._first&&(this._first=!1,this._originX=t,this._originY=e,(tthis._tempMeasure.left+this._tempMeasure.width||ethis._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(e-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(t-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var o;o=this.isVertical?-(e-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness):(t-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=i*o*(this.maximum-this.minimum),this._originX=t,this._originY=e},e.prototype._onPointerDown=function(e,i,o,r,n){return this._first=!0,t.prototype._onPointerDown.call(this,e,i,o,r,n)},h([(0,d.serialize)()],e.prototype,"num90RotationInVerticalMode",void 0),h([(0,d.serialize)()],e.prototype,"invertScrollDirection",null),e}(G),tt=function(t){function e(e,i){var o=t.call(this,e)||this;return o._barSize=20,o._pointerIsOver=!1,o._wheelPrecision=.05,o._thumbLength=.5,o._thumbHeight=1,o._barImageHeight=1,o._horizontalBarImageHeight=1,o._verticalBarImageHeight=1,o._oldWindowContentsWidth=0,o._oldWindowContentsHeight=0,o._forceHorizontalBar=!1,o._forceVerticalBar=!1,o._useImageBar=i||!1,o.onDirtyObservable.add((function(){o._horizontalBarSpace.color=o.color,o._verticalBarSpace.color=o.color,o._dragSpace.color=o.color})),o.onPointerEnterObservable.add((function(){o._pointerIsOver=!0})),o.onPointerOutObservable.add((function(){o._pointerIsOver=!1})),o._grid=new D,o._useImageBar?(o._horizontalBar=new $,o._verticalBar=new $):(o._horizontalBar=new J,o._verticalBar=new J),o._window=new q("scrollViewer_window"),o._window.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._window.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._grid.addColumnDefinition(1),o._grid.addColumnDefinition(0,!0),o._grid.addRowDefinition(1),o._grid.addRowDefinition(0,!0),t.prototype.addControl.call(o,o._grid),o._grid.addControl(o._window,0,0),o._verticalBarSpace=new T,o._verticalBarSpace.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._verticalBarSpace.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._verticalBarSpace.thickness=1,o._grid.addControl(o._verticalBarSpace,0,1),o._addBar(o._verticalBar,o._verticalBarSpace,!0,Math.PI),o._horizontalBarSpace=new T,o._horizontalBarSpace.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,o._horizontalBarSpace.verticalAlignment=I.VERTICAL_ALIGNMENT_TOP,o._horizontalBarSpace.thickness=1,o._grid.addControl(o._horizontalBarSpace,1,0),o._addBar(o._horizontalBar,o._horizontalBarSpace,!1,0),o._dragSpace=new T,o._dragSpace.thickness=1,o._grid.addControl(o._dragSpace,1,1),o._grid.clipChildren=!1,o._useImageBar||(o.barColor="grey",o.barBackground="transparent"),o}return l(e,t),Object.defineProperty(e.prototype,"horizontalBar",{get:function(){return this._horizontalBar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalBar",{get:function(){return this._verticalBar},enumerable:!1,configurable:!0}),e.prototype.addControl=function(t){return t?(this._window.addControl(t),this):this},e.prototype.removeControl=function(t){return this._window.removeControl(t),this},Object.defineProperty(e.prototype,"children",{get:function(){return this._window.children},enumerable:!1,configurable:!0}),e.prototype._flagDescendantsAsMatrixDirty=function(){for(var t=0,e=this._children;t1&&(t=1),this._wheelPrecision=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollBackground",{get:function(){return this._horizontalBarSpace.background},set:function(t){this._horizontalBarSpace.background!==t&&(this._horizontalBarSpace.background=t,this._verticalBarSpace.background=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barColor",{get:function(){return this._barColor},set:function(t){this._barColor!==t&&(this._barColor=t,this._horizontalBar.color=t,this._verticalBar.color=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbImage",{get:function(){return this._barImage},set:function(t){if(this._barImage!==t){this._barImage=t;var e=this._horizontalBar,i=this._verticalBar;e.thumbImage=t,i.thumbImage=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalThumbImage",{get:function(){return this._horizontalBarImage},set:function(t){this._horizontalBarImage!==t&&(this._horizontalBarImage=t,this._horizontalBar.thumbImage=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalThumbImage",{get:function(){return this._verticalBarImage},set:function(t){this._verticalBarImage!==t&&(this._verticalBarImage=t,this._verticalBar.thumbImage=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barSize",{get:function(){return this._barSize},set:function(t){this._barSize!==t&&(this._barSize=t,this._markAsDirty(),this._horizontalBar.isVisible&&this._grid.setRowDefinition(1,this._barSize,!0),this._verticalBar.isVisible&&this._grid.setColumnDefinition(1,this._barSize,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(t){if(this._thumbLength!==t){t<=0&&(t=.1),t>1&&(t=1),this._thumbLength=t;var e=this._horizontalBar,i=this._verticalBar;e.thumbLength=t,i.thumbLength=t,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(t){if(this._thumbHeight!==t){t<=0&&(t=.1),t>1&&(t=1),this._thumbHeight=t;var e=this._horizontalBar,i=this._verticalBar;e.thumbHeight=t,i.thumbHeight=t,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(t){if(this._barImageHeight!==t){t<=0&&(t=.1),t>1&&(t=1),this._barImageHeight=t;var e=this._horizontalBar,i=this._verticalBar;e.barImageHeight=t,i.barImageHeight=t,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalBarImageHeight",{get:function(){return this._horizontalBarImageHeight},set:function(t){this._horizontalBarImageHeight!==t&&(t<=0&&(t=.1),t>1&&(t=1),this._horizontalBarImageHeight=t,this._horizontalBar.barImageHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalBarImageHeight",{get:function(){return this._verticalBarImageHeight},set:function(t){this._verticalBarImageHeight!==t&&(t<=0&&(t=.1),t>1&&(t=1),this._verticalBarImageHeight=t,this._verticalBar.barImageHeight=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barBackground",{get:function(){return this._barBackground},set:function(t){if(this._barBackground!==t){this._barBackground=t;var e=this._horizontalBar,i=this._verticalBar;e.background=t,i.background=t,this._dragSpace.background=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"barImage",{get:function(){return this._barBackgroundImage},set:function(t){this._barBackgroundImage=t;var e=this._horizontalBar,i=this._verticalBar;e.backgroundImage=t,i.backgroundImage=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalBarImage",{get:function(){return this._horizontalBarBackgroundImage},set:function(t){this._horizontalBarBackgroundImage=t,this._horizontalBar.backgroundImage=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalBarImage",{get:function(){return this._verticalBarBackgroundImage},set:function(t){this._verticalBarBackgroundImage=t,this._verticalBar.backgroundImage=t},enumerable:!1,configurable:!0}),e.prototype._setWindowPosition=function(t){void 0===t&&(t=!0);var e=this.host.idealRatio,i=this._window._currentMeasure.width,o=this._window._currentMeasure.height;if(t||this._oldWindowContentsWidth!==i||this._oldWindowContentsHeight!==o){this._oldWindowContentsWidth=i,this._oldWindowContentsHeight=o;var r=this._clientWidth-i,n=this._clientHeight-o,a=this._horizontalBar.value/e*r+"px",s=this._verticalBar.value/e*n+"px";a!==this._window.left&&(this._window.left=a,this.freezeControls||(this._rebuildLayout=!0)),s!==this._window.top&&(this._window.top=s,this.freezeControls||(this._rebuildLayout=!0))}},e.prototype._updateScroller=function(){var t=this._window._currentMeasure.width,e=this._window._currentMeasure.height;this._horizontalBar.isVisible&&t<=this._clientWidth&&!this.forceHorizontalBar?(this._grid.setRowDefinition(1,0,!0),this._horizontalBar.isVisible=!1,this._horizontalBar.value=0,this._rebuildLayout=!0):!this._horizontalBar.isVisible&&(t>this._clientWidth||this.forceHorizontalBar)&&(this._grid.setRowDefinition(1,this._barSize,!0),this._horizontalBar.isVisible=!0,this._rebuildLayout=!0),this._verticalBar.isVisible&&e<=this._clientHeight&&!this.forceVerticalBar?(this._grid.setColumnDefinition(1,0,!0),this._verticalBar.isVisible=!1,this._verticalBar.value=0,this._rebuildLayout=!0):!this._verticalBar.isVisible&&(e>this._clientHeight||this.forceVerticalBar)&&(this._grid.setColumnDefinition(1,this._barSize,!0),this._verticalBar.isVisible=!0,this._rebuildLayout=!0),this._buildClientSizes();var i=this.host.idealRatio;this._horizontalBar.thumbWidth=.9*this._thumbLength*(this._clientWidth/i)+"px",this._verticalBar.thumbWidth=.9*this._thumbLength*(this._clientHeight/i)+"px"},e.prototype._link=function(e){t.prototype._link.call(this,e),this._attachWheel()},e.prototype._addBar=function(t,e,i,o){var r=this;t.paddingLeft=0,t.width="100%",t.height="100%",t.barOffset=0,t.value=0,t.maximum=1,t.horizontalAlignment=I.HORIZONTAL_ALIGNMENT_CENTER,t.verticalAlignment=I.VERTICAL_ALIGNMENT_CENTER,t.isVertical=i,t.rotation=o,t.isVisible=!1,e.addControl(t),t.onValueChangedObservable.add((function(){r._setWindowPosition()}))},e.prototype._attachWheel=function(){var t=this;this._host&&!this._onWheelObserver&&(this._onWheelObserver=this.onWheelObservable.add((function(e){t._pointerIsOver&&!t.isReadOnly&&(1==t._verticalBar.isVisible&&(e.y<0&&t._verticalBar.value>0?t._verticalBar.value-=t._wheelPrecision:e.y>0&&t._verticalBar.value0&&t._horizontalBar.value>0&&(t._horizontalBar.value-=t._wheelPrecision)))})))},e.prototype._renderHighlightSpecific=function(e){this.isHighlighted&&(t.prototype._renderHighlightSpecific.call(this,e),this._grid._renderHighlightSpecific(e),e.restore())},e.prototype.dispose=function(){this.onWheelObservable.remove(this._onWheelObserver),this._onWheelObserver=null,t.prototype.dispose.call(this)},h([(0,d.serialize)()],e.prototype,"wheelPrecision",null),h([(0,d.serialize)()],e.prototype,"scrollBackground",null),h([(0,d.serialize)()],e.prototype,"barColor",null),h([(0,d.serialize)()],e.prototype,"barSize",null),h([(0,d.serialize)()],e.prototype,"barBackground",null),e}(T);(0,d.RegisterClass)("BABYLON.GUI.ScrollViewer",tt);var et=function(t){function e(e,i){var o=t.call(this,e)||this;o.name=e,o.onIsActiveChangedObservable=new d.Observable,o.delegatePickingToChildren=!1,o._isActive=!1,o.group=null!=i?i:"",o.thickness=0,o.isPointerBlocker=!0;var r=null;return o.toActiveAnimation=function(){o.thickness=1},o.toInactiveAnimation=function(){o.thickness=0},o.pointerEnterActiveAnimation=function(){r=o.alpha,o.alpha-=.1},o.pointerOutActiveAnimation=function(){null!==r&&(o.alpha=r)},o.pointerDownActiveAnimation=function(){o.scaleX-=.05,o.scaleY-=.05},o.pointerUpActiveAnimation=function(){o.scaleX+=.05,o.scaleY+=.05},o.pointerEnterInactiveAnimation=function(){r=o.alpha,o.alpha-=.1},o.pointerOutInactiveAnimation=function(){null!==r&&(o.alpha=r)},o.pointerDownInactiveAnimation=function(){o.scaleX-=.05,o.scaleY-=.05},o.pointerUpInactiveAnimation=function(){o.scaleX+=.05,o.scaleY+=.05},o}return l(e,t),Object.defineProperty(e.prototype,"group",{get:function(){return this._group},set:function(t){this._group!==t&&(this._group=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(t){var e,i,o=this;this._isActive!==t&&(this._isActive=t,this._isActive?null===(e=this.toActiveAnimation)||void 0===e||e.call(this):null===(i=this.toInactiveAnimation)||void 0===i||i.call(this),this._markAsDirty(),this.onIsActiveChangedObservable.notifyObservers(t),this._isActive&&this._host&&this._group&&this._host.executeOnAllControls((function(t){if("ToggleButton"===t.typeName){if(t===o)return;var e=t;e.group===o.group&&(e.isActive=!1)}})))},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"ToggleButton"},e.prototype._processPicking=function(e,i,o,r,n,a,s,l){if(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this.notRenderable)return!1;if(!t.prototype.contains.call(this,e,i))return!1;if(this.delegatePickingToChildren){for(var _=!1,h=this._children.length-1;h>=0;h--){var c=this._children[h];if(c.isEnabled&&c.isHitTestVisible&&c.isVisible&&!c.notRenderable&&c.contains(e,i)){_=!0;break}}if(!_)return!1}return this._processObservables(r,e,i,o,n,a,s,l),!0},e.prototype._onPointerEnter=function(e,i){return!!t.prototype._onPointerEnter.call(this,e,i)&&(this.isReadOnly||(this._isActive?this.pointerEnterActiveAnimation&&this.pointerEnterActiveAnimation():this.pointerEnterInactiveAnimation&&this.pointerEnterInactiveAnimation()),!0)},e.prototype._onPointerOut=function(e,i,o){void 0===o&&(o=!1),this.isReadOnly||(this._isActive?this.pointerOutActiveAnimation&&this.pointerOutActiveAnimation():this.pointerOutInactiveAnimation&&this.pointerOutInactiveAnimation()),t.prototype._onPointerOut.call(this,e,i,o)},e.prototype._onPointerDown=function(e,i,o,r,n){return!!t.prototype._onPointerDown.call(this,e,i,o,r,n)&&(this.isReadOnly||(this._isActive?this.pointerDownActiveAnimation&&this.pointerDownActiveAnimation():this.pointerDownInactiveAnimation&&this.pointerDownInactiveAnimation()),!0)},e.prototype._onPointerUp=function(e,i,o,r,n,a){this.isReadOnly||(this._isActive?this.pointerUpActiveAnimation&&this.pointerUpActiveAnimation():this.pointerUpInactiveAnimation&&this.pointerUpInactiveAnimation()),t.prototype._onPointerUp.call(this,e,i,o,r,n,a)},e}(T);(0,d.RegisterClass)("BABYLON.GUI.ToggleButton",et);var it=function(){},ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onKeyPressObservable=new d.Observable,e.defaultButtonWidth="40px",e.defaultButtonHeight="40px",e.defaultButtonPaddingLeft="2px",e.defaultButtonPaddingRight="2px",e.defaultButtonPaddingTop="2px",e.defaultButtonPaddingBottom="2px",e.defaultButtonColor="#DDD",e.defaultButtonBackground="#070707",e.shiftButtonColor="#7799FF",e.selectedShiftThickness=1,e.shiftState=0,e._currentlyConnectedInputText=null,e._connectedInputTexts=[],e._onKeyPressObserver=null,e}return l(e,t),e.prototype._getTypeName=function(){return"VirtualKeyboard"},e.prototype._createKey=function(t,e){var i=this,o=R.CreateSimpleButton(t,t);return o.width=e&&e.width?e.width:this.defaultButtonWidth,o.height=e&&e.height?e.height:this.defaultButtonHeight,o.color=e&&e.color?e.color:this.defaultButtonColor,o.background=e&&e.background?e.background:this.defaultButtonBackground,o.paddingLeft=e&&e.paddingLeft?e.paddingLeft:this.defaultButtonPaddingLeft,o.paddingRight=e&&e.paddingRight?e.paddingRight:this.defaultButtonPaddingRight,o.paddingTop=e&&e.paddingTop?e.paddingTop:this.defaultButtonPaddingTop,o.paddingBottom=e&&e.paddingBottom?e.paddingBottom:this.defaultButtonPaddingBottom,o.thickness=0,o.isFocusInvisible=!0,o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY,o.onPointerUpObservable.add((function(){i.onKeyPressObservable.notifyObservers(t)})),o},e.prototype.addKeysRow=function(t,e){var i=new w;i.isVertical=!1,i.isFocusInvisible=!0;for(var o=null,r=0;ro.heightInPixels)&&(o=a),i.addControl(a)}i.height=o?o.height:this.defaultButtonHeight,this.addControl(i)},e.prototype.applyShiftState=function(t){if(this.children)for(var e=0;e1?this.selectedShiftThickness:0),a.text=t>0?a.text.toUpperCase():a.text.toLowerCase()}}}},Object.defineProperty(e.prototype,"connectedInputText",{get:function(){return this._currentlyConnectedInputText},enumerable:!1,configurable:!0}),e.prototype.connect=function(t){var e=this;if(!this._connectedInputTexts.some((function(e){return e.input===t}))){null===this._onKeyPressObserver&&(this._onKeyPressObserver=this.onKeyPressObservable.add((function(t){if(e._currentlyConnectedInputText){switch(e._currentlyConnectedInputText._host.focusedControl=e._currentlyConnectedInputText,t){case"⇧":return e.shiftState++,e.shiftState>2&&(e.shiftState=0),void e.applyShiftState(e.shiftState);case"←":return void(e._currentlyConnectedInputText instanceof A?e._currentlyConnectedInputText.alternativeProcessKey("Backspace"):e._currentlyConnectedInputText.processKey(8));case"↵":return void(e._currentlyConnectedInputText instanceof A?e._currentlyConnectedInputText.alternativeProcessKey("Enter"):e._currentlyConnectedInputText.processKey(13))}e._currentlyConnectedInputText instanceof A?e._currentlyConnectedInputText.alternativeProcessKey("",e.shiftState?t.toUpperCase():t):e._currentlyConnectedInputText.processKey(-1,e.shiftState?t.toUpperCase():t),1===e.shiftState&&(e.shiftState=0,e.applyShiftState(e.shiftState))}}))),this.isVisible=!1,this._currentlyConnectedInputText=t,t._connectedVirtualKeyboard=this;var i=t.onFocusObservable.add((function(){e._currentlyConnectedInputText=t,t._connectedVirtualKeyboard=e,e.isVisible=!0})),o=t.onBlurObservable.add((function(){t._connectedVirtualKeyboard=null,e._currentlyConnectedInputText=null,e.isVisible=!1}));this._connectedInputTexts.push({input:t,onBlurObserver:o,onFocusObserver:i})}},e.prototype.disconnect=function(t){var e=this;if(t){var i=this._connectedInputTexts.filter((function(e){return e.input===t}));1===i.length&&(this._removeConnectedInputObservables(i[0]),this._connectedInputTexts=this._connectedInputTexts.filter((function(e){return e.input!==t})),this._currentlyConnectedInputText===t&&(this._currentlyConnectedInputText=null))}else this._connectedInputTexts.forEach((function(t){e._removeConnectedInputObservables(t)})),this._connectedInputTexts.length=0;0===this._connectedInputTexts.length&&(this._currentlyConnectedInputText=null,this.onKeyPressObservable.remove(this._onKeyPressObserver),this._onKeyPressObserver=null)},e.prototype._removeConnectedInputObservables=function(t){t.input._connectedVirtualKeyboard=null,t.input.onFocusObservable.remove(t.onFocusObserver),t.input.onBlurObservable.remove(t.onBlurObserver)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.disconnect()},e.CreateDefaultLayout=function(t){var i=new e(t);return i.addKeysRow(["1","2","3","4","5","6","7","8","9","0","←"]),i.addKeysRow(["q","w","e","r","t","y","u","i","o","p"]),i.addKeysRow(["a","s","d","f","g","h","j","k","l",";","'","↵"]),i.addKeysRow(["⇧","z","x","c","v","b","n","m",",",".","/"]),i.addKeysRow([" "],[{width:"200px"}]),i},e.prototype._parseFromContent=function(e,i){var o=this;t.prototype._parseFromContent.call(this,e,i);for(var r=0,n=this.children;r0?(h.focusedControl=null,h._focusProperties.index=0,void(h._focusProperties.total=-1)):(h._focusNextElement(e),void t.event.preventDefault())}h._focusedControl&&(t.type===d.KeyboardEventTypes.KEYDOWN&&h._focusedControl.processKeyboard(t.event),t.skipOnPointerObservable=!0)})),h._rootContainer._link(h),h.hasAlpha=!0,c&&u||(h._resizeObserver=r.getEngine().onResizeObservable.add((function(){return h._onResize()})),h._onResize()),h._texture.isReady=!0,h}return l(e,t),Object.defineProperty(e.prototype,"numLayoutCalls",{get:function(){return this._numLayoutCalls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numRenderCalls",{get:function(){return this._numRenderCalls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderScale",{get:function(){return this._renderScale},set:function(t){t!==this._renderScale&&(this._renderScale=t,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background!==t&&(this._background=t,this.markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idealWidth",{get:function(){return this._idealWidth},set:function(t){this._idealWidth!==t&&(this._idealWidth=t,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idealHeight",{get:function(){return this._idealHeight},set:function(t){this._idealHeight!==t&&(this._idealHeight=t,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useSmallestIdeal",{get:function(){return this._useSmallestIdeal},set:function(t){this._useSmallestIdeal!==t&&(this._useSmallestIdeal=t,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderAtIdealSize",{get:function(){return this._renderAtIdealSize},set:function(t){this._renderAtIdealSize!==t&&(this._renderAtIdealSize=t,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idealRatio",{get:function(){var t=0,e=0;return this._idealWidth&&(t=this.getSize().width/this._idealWidth),this._idealHeight&&(e=this.getSize().height/this._idealHeight),this._useSmallestIdeal&&this._idealWidth&&this._idealHeight?window.innerWidth0&&(a=a.add(r.normalize().scale(o/n)))}})),a.length()>0&&(a=a.normalize().scale(i*(null!==(n=t.overlapDeltaMultiplier)&&void 0!==n?n:1)),t.linkOffsetXInPixels+=a.x,t.linkOffsetYInPixels+=a.y)}))},e.prototype.dispose=function(){var e=this.getScene();e&&(this._rootElement=null,e.onBeforeCameraRenderObservable.remove(this._renderObserver),this._resizeObserver&&e.getEngine().onResizeObservable.remove(this._resizeObserver),this._prePointerObserver&&e.onPrePointerObservable.remove(this._prePointerObserver),this._sceneRenderObserver&&e.onBeforeRenderObservable.remove(this._sceneRenderObserver),this._pointerObserver&&e.onPointerObservable.remove(this._pointerObserver),this._preKeyboardObserver&&e.onPreKeyboardObservable.remove(this._preKeyboardObserver),this._canvasPointerOutObserver&&e.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver),this._canvasBlurObserver&&e.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver),this._controlAddedObserver&&this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver),this._controlRemovedObserver&&this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver),this._layerToDispose&&(this._layerToDispose.texture=null,this._layerToDispose.dispose(),this._layerToDispose=null),this._rootContainer.dispose(),this.onClipboardObservable.clear(),this.onControlPickedObservable.clear(),this.onBeginRenderObservable.clear(),this.onEndRenderObservable.clear(),this.onBeginLayoutObservable.clear(),this.onEndLayoutObservable.clear(),this.onGuiReadyObservable.clear(),t.prototype.dispose.call(this))},e.prototype._onResize=function(){var t=this.getScene();if(t){var e=t.getEngine(),i=this.getSize(),o=e.getRenderWidth()*this._renderScale,r=e.getRenderHeight()*this._renderScale;this._renderAtIdealSize&&(this._idealWidth?(r=r*this._idealWidth/o,o=this._idealWidth):this._idealHeight&&(o=o*this._idealHeight/r,r=this._idealHeight)),i.width===o&&i.height===r||(this.scaleTo(o,r),this.markAsDirty(),(this._idealWidth||this._idealHeight)&&this._rootContainer._markAllAsDirty()),this.invalidateRect(0,0,i.width-1,i.height-1)}},e.prototype._getGlobalViewport=function(){var t=this.getSize(),e=this._fullscreenViewport.toGlobal(t.width,t.height),i=Math.round(e.width*(1/this.rootContainer.scaleX)),o=Math.round(e.height*(1/this.rootContainer.scaleY));return e.x+=(e.width-i)/2,e.y+=(e.height-o)/2,e.width=i,e.height=o,e},e.prototype.getProjectedPosition=function(t,e){var i=this.getProjectedPositionWithZ(t,e);return new d.Vector2(i.x,i.y)},e.prototype.getProjectedPositionWithZ=function(t,e){var i=this.getScene();if(!i)return d.Vector3.Zero();var o=this._getGlobalViewport(),r=d.Vector3.Project(t,e,i.getTransformMatrix(),o);return new d.Vector3(r.x,r.y,r.z)},e.prototype._checkUpdate=function(t,i){if(!this._layerToDispose||!t||t.layerMask&this._layerToDispose.layerMask){if(this._isFullscreen&&this._linkedControls.length){var o=this.getScene();if(!o)return;for(var r=this._getGlobalViewport(),n=function(t){if(!t.isVisible)return"continue";var e=t._linkedMesh;if(!e||e.isDisposed())return d.Tools.SetImmediate((function(){t.linkWithMesh(null)})),"continue";var i=e.getBoundingInfo?e.getBoundingInfo().boundingSphere.center:d.Vector3.ZeroReadOnly,n=d.Vector3.Project(i,e.getWorldMatrix(),o.getTransformMatrix(),r);if(n.z<0||n.z>1)return t.notRenderable=!0,"continue";t.notRenderable=!1,a.useInvalidateRectOptimization&&t.invalidateRect(),t._moveToProjectedPosition(n)},a=this,s=0,l=this._linkedControls;sl.width||r>l.height||(t.cameraToUseForPointers=i,e.x=l.x,e.y=l.y,e.width=l.width,e.height=l.height)}))}else n.viewport.toGlobalToRef(a.getRenderWidth(),a.getRenderHeight(),e);else e.x=0,e.y=0,e.width=a.getRenderWidth(),e.height=a.getRenderHeight();var _=o/a.getHardwareScalingLevel()-e.x,h=r/a.getHardwareScalingLevel()-(a.getRenderHeight()-e.y-e.height);if(this._shouldBlockPointer=!1,i){var c=i.event.pointerId||this._defaultMousePointerId;this._doPicking(_,h,i,i.type,c,i.event.button,i.event.deltaX,i.event.deltaY),(this._shouldBlockPointer&&!(i.type&this.skipBlockEvents)||this._capturingControl[c])&&(i.skipOnPointerObservable=!0)}else this._doPicking(_,h,null,d.PointerEventTypes.POINTERMOVE,this._defaultMousePointerId,0);t.cameraToUseForPointers=s},e.prototype.attach=function(){var t=this,e=this.getScene();if(e){var i=new d.Viewport(0,0,0,0);this._prePointerObserver=e.onPrePointerObservable.add((function(o){if((!e.isPointerCaptured(o.event.pointerId)||o.type!==d.PointerEventTypes.POINTERUP||t._capturedPointerIds.has(o.event.pointerId))&&(o.type===d.PointerEventTypes.POINTERMOVE||o.type===d.PointerEventTypes.POINTERUP||o.type===d.PointerEventTypes.POINTERDOWN||o.type===d.PointerEventTypes.POINTERWHEEL||o.type===d.PointerEventTypes.POINTERTAP)){if(o.type===d.PointerEventTypes.POINTERMOVE){if(e.isPointerCaptured(o.event.pointerId))return;o.event.pointerId&&(t._defaultMousePointerId=o.event.pointerId)}t._translateToPicking(e,i,o)}})),this._attachPickingToSceneRender(e,(function(){return t._translateToPicking(e,i,null)}),!1),this._attachToOnPointerOut(e),this._attachToOnBlur(e)}},e.prototype._focusNextElement=function(t){void 0===t&&(t=!0);var e=[];if(this.executeOnAllControls((function(t){t.isFocusInvisible||!t.isVisible||t.tabIndex<0||e.push(t)})),0!==e.length){e.sort((function(t,e){return 0===t.tabIndex?1:0===e.tabIndex?-1:t.tabIndex-e.tabIndex})),this._focusProperties.total=e.length;var i=-1;this._focusedControl?(i=e.indexOf(this._focusedControl)+(t?1:-1))<0?i=e.length-1:i>=e.length&&(i=0):i=t?0:e.length-1,e[i].focus(),this._focusProperties.index=i}},e.prototype.registerClipboardEvents=function(){self.addEventListener("copy",this._onClipboardCopy,!1),self.addEventListener("cut",this._onClipboardCut,!1),self.addEventListener("paste",this._onClipboardPaste,!1)},e.prototype.unRegisterClipboardEvents=function(){self.removeEventListener("copy",this._onClipboardCopy),self.removeEventListener("cut",this._onClipboardCut),self.removeEventListener("paste",this._onClipboardPaste)},e.prototype._transformUvs=function(t){var e,i=this.getTextureMatrix();if(i.isIdentityAs3x2())e=t;else{var o=d.TmpVectors.Matrix[0];i.getRowToRef(0,d.TmpVectors.Vector4[0]),i.getRowToRef(1,d.TmpVectors.Vector4[1]),i.getRowToRef(2,d.TmpVectors.Vector4[2]);var r=d.TmpVectors.Vector4[0],n=d.TmpVectors.Vector4[1],a=d.TmpVectors.Vector4[2];o.setRowFromFloats(0,r.x,r.y,0,0),o.setRowFromFloats(1,n.x,n.y,0,0),o.setRowFromFloats(2,0,0,1,0),o.setRowFromFloats(3,a.x,a.y,0,1),e=d.TmpVectors.Vector2[0],d.Vector2.TransformToRef(t,o,e)}if((this.wrapU===d.Texture.WRAP_ADDRESSMODE||this.wrapU===d.Texture.MIRROR_ADDRESSMODE)&&e.x>1){var s=e.x-Math.trunc(e.x);this.wrapU===d.Texture.MIRROR_ADDRESSMODE&&Math.trunc(e.x)%2==1&&(s=1-s),e.x=s}if((this.wrapV===d.Texture.WRAP_ADDRESSMODE||this.wrapV===d.Texture.MIRROR_ADDRESSMODE)&&e.y>1){var l=e.y-Math.trunc(e.y);this.wrapV===d.Texture.MIRROR_ADDRESSMODE&&Math.trunc(e.x)%2==1&&(l=1-l),e.y=l}return e},e.prototype.attachToMesh=function(t,e){var i=this;void 0===e&&(e=!0);var o=this.getScene();o&&(this._pointerObserver&&o.onPointerObservable.remove(this._pointerObserver),this._pointerObserver=o.onPointerObservable.add((function(e){if(e.type===d.PointerEventTypes.POINTERMOVE||e.type===d.PointerEventTypes.POINTERUP||e.type===d.PointerEventTypes.POINTERDOWN||e.type===d.PointerEventTypes.POINTERWHEEL){e.type===d.PointerEventTypes.POINTERMOVE&&e.event.pointerId&&(i._defaultMousePointerId=e.event.pointerId);var o=e.event.pointerId||i._defaultMousePointerId;if(e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh===t){var r=e.pickInfo.getTextureCoordinates();if(r){r=i._transformUvs(r);var n=i.getSize();i._doPicking(r.x*n.width,(i.applyYInversionOnUpdate?1-r.y:r.y)*n.height,e,e.type,o,e.event.button,e.event.deltaX,e.event.deltaY)}}else if(e.type===d.PointerEventTypes.POINTERUP){if(i._lastControlDown[o]&&i._lastControlDown[o]._forcePointerUp(o),delete i._lastControlDown[o],i.focusedControl){var a=i.focusedControl.keepsFocusWith(),s=!0;if(a)for(var l=0,_=a;l<_.length;l++){var h=_[l];if(i!==h._host){var c=h._host;if(c._lastControlOver[o]&&c._lastControlOver[o].isAscendant(h)){s=!1;break}}}s&&(i.focusedControl=null)}}else e.type===d.PointerEventTypes.POINTERMOVE&&(i._lastControlOver[o]&&i._lastControlOver[o]._onPointerOut(i._lastControlOver[o],e,!0),delete i._lastControlOver[o])}})),t.enablePointerMoveEvents=e,this._attachPickingToSceneRender(o,(function(){var e=i._defaultMousePointerId,r=null==o?void 0:o.pick(o.pointerX,o.pointerY);if(r&&r.hit&&r.pickedMesh===t){var n=r.getTextureCoordinates();if(n){n=i._transformUvs(n);var a=i.getSize();i._doPicking(n.x*a.width,(i.applyYInversionOnUpdate?1-n.y:n.y)*a.height,null,d.PointerEventTypes.POINTERMOVE,e,0)}}else i._lastControlOver[e]&&i._lastControlOver[e]._onPointerOut(i._lastControlOver[e],null,!0),delete i._lastControlOver[e]}),!0),this._attachToOnPointerOut(o),this._attachToOnBlur(o))},e.prototype.moveFocusToControl=function(t){this.focusedControl=t,this._lastPickedControl=t,this._blockNextFocusCheck=!0},e.prototype._manageFocus=function(){if(this._blockNextFocusCheck)return this._blockNextFocusCheck=!1,void(this._lastPickedControl=this._focusedControl);if(this._focusedControl&&this._focusedControl!==this._lastPickedControl){if(this._lastPickedControl.isFocusInvisible)return;this.focusedControl=null}},e.prototype._attachPickingToSceneRender=function(t,e,i){var o=this;this._sceneRenderObserver=t.onBeforeRenderObservable.add((function(){o.checkPointerEveryFrame&&(o._linkedControls.length>0||i)&&e()}))},e.prototype._attachToOnPointerOut=function(t){var e=this;this._canvasPointerOutObserver=t.getEngine().onCanvasPointerOutObservable.add((function(t){e._lastControlOver[t.pointerId]&&e._lastControlOver[t.pointerId]._onPointerOut(e._lastControlOver[t.pointerId],null),delete e._lastControlOver[t.pointerId],e._lastControlDown[t.pointerId]&&e._lastControlDown[t.pointerId]!==e._capturingControl[t.pointerId]&&(e._lastControlDown[t.pointerId]._forcePointerUp(t.pointerId),delete e._lastControlDown[t.pointerId])}))},e.prototype._attachToOnBlur=function(t){var e=this;this._canvasBlurObserver=t.getEngine().onCanvasBlurObservable.add((function(){Object.entries(e._lastControlDown).forEach((function(t){t[1]._onCanvasBlur()})),e.focusedControl=null,e._lastControlDown={}}))},e.prototype.serializeContent=function(){var t=this.getSize(),e={root:{},width:t.width,height:t.height};return this._rootContainer.serialize(e.root),e},e.prototype.parseSerializedObject=function(t,e,i){if(this._rootContainer=I.Parse(t.root,this,i),e){var o=t.width,r=t.height;"number"==typeof o&&"number"==typeof r&&o>=0&&r>=0?this.scaleTo(o,r):this.scaleTo(1920,1080)}},e.prototype.clone=function(t,i){var o=this.getScene();if(!o)return this;var r,n=this.getSize(),a=this.serializeContent();return(r=this._isFullscreen?e.CreateFullscreenUI(null!=t?t:"Clone of "+this.name):i?e.CreateForMesh(i,n.width,n.height):new e(null!=t?t:"Clone of "+this.name,n.width,n.height,o,!this.noMipmap,this.samplingMode)).parseSerializedObject(a),r},e.ParseFromSnippetAsync=function(t,i,o,r){return c(this,void 0,void 0,(function(){var n,a;return u(this,(function(s){switch(s.label){case 0:return n=null!=o?o:e.CreateFullscreenUI("ADT from snippet"),"_BLANK"===t?[2,n]:[4,e._LoadURLContentAsync(e.SnippetUrl+"/"+t.replace(/#/g,"/"),!0)];case 1:return a=s.sent(),n.parseSerializedObject(a,i,r),[2,n]}}))}))},e.prototype.parseFromSnippetAsync=function(t,i,o){return e.ParseFromSnippetAsync(t,i,this,o)},e.ParseFromFileAsync=function(t,i,o,r){return c(this,void 0,void 0,(function(){var n,a;return u(this,(function(s){switch(s.label){case 0:return n=null!=o?o:e.CreateFullscreenUI("ADT from URL"),[4,e._LoadURLContentAsync(t)];case 1:return a=s.sent(),n.parseSerializedObject(a,i,r),[2,n]}}))}))},e.prototype.parseFromURLAsync=function(t,i,o){return e.ParseFromFileAsync(t,i,this,o)},e._LoadURLContentAsync=function(t,e){return void 0===e&&(e=!1),""===t?Promise.reject("No URL provided"):new Promise((function(i,o){var r=new d.WebRequest;r.addEventListener("readystatechange",(function(){if(4==r.readyState)if(200==r.status){var t=void 0;if(e){var n=JSON.parse(JSON.parse(r.responseText).jsonPayload);t=n.encodedGui?new TextDecoder("utf-8").decode((0,d.DecodeBase64ToBinary)(n.encodedGui)):n.gui}else t=r.responseText;var a=JSON.parse(t);i(a)}else o("Unable to load")})),r.open("GET",t),r.send()}))},e._Overlaps=function(t,e){return!(t.centerX>e.centerX+e.widthInPixels||t.centerX+t.widthInPixelse.centerY+e.heightInPixels)},e.CreateForMesh=function(t,i,o,r,n,a,s,l){void 0===i&&(i=1024),void 0===o&&(o=1024),void 0===r&&(r=!0),void 0===n&&(n=!1),void 0===s&&(s=this._CreateMaterial),void 0===l&&(l=d.Texture.TRILINEAR_SAMPLINGMODE);var _=(0,d.RandomGUID)(),h=new e("AdvancedDynamicTexture for ".concat(t.name," [").concat(_,"]"),i,o,t.getScene(),!0,l,a);return s(t,_,h,n),h.attachToMesh(t,r),h},e._CreateMaterial=function(t,e,i,o){var r=(0,d.GetClass)("BABYLON.StandardMaterial");if(!r)throw"StandardMaterial needs to be imported before as it contains a side-effect required by your code.";var n=new r("AdvancedDynamicTextureMaterial for ".concat(t.name," [").concat(e,"]"),t.getScene());n.backFaceCulling=!1,n.diffuseColor=d.Color3.Black(),n.specularColor=d.Color3.Black(),o?(n.diffuseTexture=i,n.emissiveTexture=i,i.hasAlpha=!0):(n.emissiveTexture=i,n.opacityTexture=i),t.material=n},e.CreateForMeshTexture=function(t,i,o,r,n,a){void 0===i&&(i=1024),void 0===o&&(o=1024),void 0===r&&(r=!0),void 0===a&&(a=d.Texture.TRILINEAR_SAMPLINGMODE);var s=new e(t.name+" AdvancedDynamicTexture",i,o,t.getScene(),!0,a,n);return s.attachToMesh(t,r),s},e.CreateFullscreenUI=function(t,i,o,r,n){void 0===i&&(i=!0),void 0===o&&(o=null),void 0===r&&(r=d.Texture.BILINEAR_SAMPLINGMODE),void 0===n&&(n=!1);var a=!o||o._isScene?new e(t,0,0,o,!1,r):new e(t,o),s=a.getScene(),l=new d.Layer(t+"_layer",null,s,!i);if(l.texture=a,a._layerToDispose=l,a._isFullscreen=!0,a.useStandalone&&(l.layerMask=0),n&&s){var _=1/s.getEngine().getHardwareScalingLevel();a._rootContainer.scaleX=_,a._rootContainer.scaleY=_}return a.attach(),a},e.prototype.scale=function(e){t.prototype.scale.call(this,e),this.markAsDirty()},e.prototype.scaleTo=function(e,i){t.prototype.scaleTo.call(this,e,i),this.markAsDirty()},e.prototype._checkGuiIsReady=function(){this.guiIsReady()&&(this.onGuiReadyObservable.notifyObservers(this),this.onGuiReadyObservable.clear())},e.prototype.guiIsReady=function(){return this._rootContainer.isReady()},e.SnippetUrl=d.Constants.SnippetUrl,e.AllowGPUOptimizations=!0,e}(d.DynamicTexture),ut=function(){function t(t){this.texture=t,this._captureRenderTime=!1,this._renderTime=new d.PerfCounter,this._captureLayoutTime=!1,this._layoutTime=new d.PerfCounter,this._onBeginRenderObserver=null,this._onEndRenderObserver=null,this._onBeginLayoutObserver=null,this._onEndLayoutObserver=null}return Object.defineProperty(t.prototype,"renderTimeCounter",{get:function(){return this._renderTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutTimeCounter",{get:function(){return this._layoutTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"captureRenderTime",{get:function(){return this._captureRenderTime},set:function(t){var e=this;t!==this._captureRenderTime&&(this._captureRenderTime=t,t?(this._onBeginRenderObserver=this.texture.onBeginRenderObservable.add((function(){e._renderTime.beginMonitoring()})),this._onEndRenderObserver=this.texture.onEndRenderObservable.add((function(){e._renderTime.endMonitoring(!0)}))):(this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"captureLayoutTime",{get:function(){return this._captureLayoutTime},set:function(t){var e=this;t!==this._captureLayoutTime&&(this._captureLayoutTime=t,t?(this._onBeginLayoutObserver=this.texture.onBeginLayoutObservable.add((function(){e._layoutTime.beginMonitoring()})),this._onEndLayoutObserver=this.texture.onEndLayoutObservable.add((function(){e._layoutTime.endMonitoring(!0)}))):(this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null))},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null,this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null,this.texture=null},t}(),dt=function(t){function e(e,i,o){var r=t.call(this,e,i)||this;if(o){if(!o.useStandalone)throw new Error('AdvancedDynamicTexture "'.concat(e,'": the texture must have been created with the useStandalone property set to true'))}else o=ct.CreateFullscreenUI(e,void 0,{useStandalone:!0});return r._adt=o,r.outputTexture=r._frameGraph.createDanglingHandle(),r}return l(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t,this._adt.disablePicking=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gui",{get:function(){return this._adt},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){return this._adt.guiIsReady()&&this._adt._layerToDispose.isReady()},e.prototype.record=function(){var t=this;if(void 0===this.destinationTexture)throw new Error("FrameGraphGUITask: destinationTexture is required");this._frameGraph.resolveDanglingHandle(this.outputTexture,this.destinationTexture);var e=this._frameGraph.addRenderPass(this.name);e.setRenderTarget(this.outputTexture),e.setExecuteFunc((function(e){t._adt._checkUpdate(null),e.render(t._adt._layerToDispose)}));var i=this._frameGraph.addRenderPass(this.name+"_disabled",!0);i.setRenderTarget(this.outputTexture),i.setExecuteFunc((function(t){}))},e.prototype.dispose=function(){this._adt.dispose(),t.prototype.dispose.call(this)},e}(d.FrameGraphTask),ft=function(t){function e(e,i,o){var r=t.call(this,e,i,o)||this;return r.registerInput("destination",d.NodeRenderGraphBlockConnectionPointTypes.Texture),r.registerOutput("output",d.NodeRenderGraphBlockConnectionPointTypes.BasedOnInput),r.destination.addAcceptedConnectionPointTypes(d.NodeRenderGraphBlockConnectionPointTypes.TextureAll),r.output._typeConnectionSource=r.destination,r._gui=ct.CreateFullscreenUI(r.name,void 0,{useStandalone:!0}),r._frameGraphTask=new dt(r.name,i,r._gui),r}return l(e,t),Object.defineProperty(e.prototype,"task",{get:function(){return this._frameGraphTask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gui",{get:function(){return this._frameGraphTask.gui},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"GUI.NodeRenderGraphGUIBlock"},Object.defineProperty(e.prototype,"destination",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),e.prototype._buildBlock=function(e){t.prototype._buildBlock.call(this,e),this._frameGraphTask.name=this.name,this.output.value=this._frameGraphTask.outputTexture;var i=this.destination.connectedPoint;i&&(this._frameGraphTask.destinationTexture=i.value)},e}(d.NodeRenderGraphBlock);(0,d.RegisterClass)("BABYLON.GUI.NodeRenderGraphGUIBlock",ft);var pt="XmlLoader Exception : XML file is malformed or corrupted.",gt=function(){function t(t){void 0===t&&(t=null),this._nodes={},this._nodeTypes={element:1,attribute:2,text:3},this._isLoaded=!1,this._objectAttributes={textHorizontalAlignment:1,textVerticalAlignment:2,horizontalAlignment:3,verticalAlignment:4,stretch:5},t&&(this._parentClass=t)}return t.prototype._getChainElement=function(t){var e=window;this._parentClass&&(e=this._parentClass);var i=t;i=i.split(".");for(var o=0;o0&&c>u)throw"XmlLoader Exception : In the Grid element, the number of columns is defined in the first row, do not add more columns in the subsequent rows.";if(0==h){if(!n[f].attributes.getNamedItem("width"))throw"XmlLoader Exception : Width must be defined for all the grid columns in the first row";o=Number(n[f].attributes.getNamedItem("width").nodeValue),_=!!n[f].attributes.getNamedItem("isPixel")&&JSON.parse(n[f].attributes.getNamedItem("isPixel").nodeValue),e.addColumnDefinition(o,_)}a=n[f].children;for(var p=0;p1||(this.onPointerEnterObservable.notifyObservers(this,-1,t,this),this.pointerEnterAnimation&&this.pointerEnterAnimation(),0))},t.prototype._onPointerOut=function(t){this._enterCount--,this._enterCount>0||(this._enterCount=0,this.onPointerOutObservable.notifyObservers(this,-1,t,this),this.pointerOutAnimation&&this.pointerOutAnimation())},t.prototype._onPointerDown=function(t,e,i,o){return this._downCount++,this._downPointerIds[i]=this._downPointerIds[i]+1||1,1===this._downCount&&(this.onPointerDownObservable.notifyObservers(new bt(e,o),-1,t,this),this.pointerDownAnimation&&this.pointerDownAnimation(),!0)},t.prototype._onPointerUp=function(t,e,i,o,r){this._downCount--,this._downPointerIds[i]--,this._downPointerIds[i]<=0&&delete this._downPointerIds[i],this._downCount<0?this._downCount=0:0==this._downCount&&(r&&(this._enterCount>0||-1===this._enterCount)&&this.onPointerClickObservable.notifyObservers(new bt(e,o),-1,t,this),this.onPointerUpObservable.notifyObservers(new bt(e,o),-1,t,this),this.pointerUpAnimation&&this.pointerUpAnimation())},t.prototype.forcePointerUp=function(t){if(void 0===t&&(t=null),null!==t)this._onPointerUp(this,d.Vector3.Zero(),t,0,!0);else{for(var e in this._downPointerIds)this._onPointerUp(this,d.Vector3.Zero(),+e,0,!0);this._downCount>0&&(this._downCount=1,this._onPointerUp(this,d.Vector3.Zero(),0,0,!0))}},t.prototype._processObservables=function(t,e,i,o,r){if(this._isTouchButton3D(this)&&i&&(t=this._generatePointerEventType(t,i,this._downCount)),t===d.PointerEventTypes.POINTERMOVE){this._onPointerMove(this,e);var n=this._host._lastControlOver[o];return n&&n!==this&&n._onPointerOut(this),n!==this&&this._onPointerEnter(this),this._host._lastControlOver[o]=this,!0}return t===d.PointerEventTypes.POINTERDOWN?(this._onPointerDown(this,e,o,r),this._host._lastControlDown[o]=this,this._host._lastPickedControl=this,!0):(t===d.PointerEventTypes.POINTERUP||t===d.PointerEventTypes.POINTERDOUBLETAP)&&(this._host._lastControlDown[o]&&this._host._lastControlDown[o]._onPointerUp(this,e,o,r,!0),delete this._host._lastControlDown[o],!0)},t.prototype._disposeNode=function(){this._node&&(this._node.dispose(),this._node=null)},t.prototype.dispose=function(){this.onPointerDownObservable.clear(),this.onPointerEnterObservable.clear(),this.onPointerMoveObservable.clear(),this.onPointerOutObservable.clear(),this.onPointerUpObservable.clear(),this.onPointerClickObservable.clear(),this._disposeNode();for(var t=0,e=this._behaviors;ti));b++);else for(b=0;bi));g++);p=0;for(var m=0,v=this._children;m0,r.BORDER=this.renderBorders,r.HOVERLIGHT=this.renderHoverLight,this._albedoTexture){if(!this._albedoTexture.isReadyOrNotBlocking())return!1;r.TEXTURE=!0}else r.TEXTURE=!1;var n=o.getEngine();if(r.isDirty){r.markAsProcessed(),o.resetCachedMaterial();var a=[d.VertexBuffer.PositionKind];a.push(d.VertexBuffer.NormalKind),a.push(d.VertexBuffer.UVKind);var s=["world","viewProjection","innerGlowColor","albedoColor","borderWidth","edgeSmoothingValue","scaleFactor","borderMinValue","hoverColor","hoverPosition","hoverRadius","textureMatrix"],l=["albedoSampler"],_=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:s,uniformBuffersNames:_,samplers:l,defines:r,maxSimultaneousLights:4});var h=r.toString();e.setEffect(o.getEngine().createEffect("fluent",{attributes:a,uniformsNames:s,uniformBuffersNames:_,samplers:l,defines:h,fallbacks:null,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),r,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(r._renderId=o.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene(),r=i.materialDefines;if(r){var n=i.effect;if(n){if(this._activeEffect=n,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._mustRebind(o,n,i)&&(this._activeEffect.setColor4("albedoColor",this.albedoColor,this.alpha),r.INNERGLOW&&this._activeEffect.setColor4("innerGlowColor",this.innerGlowColor,this.innerGlowColorIntensity),r.BORDER&&(this._activeEffect.setFloat("borderWidth",this.borderWidth),this._activeEffect.setFloat("edgeSmoothingValue",this.edgeSmoothingValue),this._activeEffect.setFloat("borderMinValue",this.borderMinValue),e.getBoundingInfo().boundingBox.extendSize.multiplyToRef(e.scaling,d.TmpVectors.Vector3[0]),this._activeEffect.setVector3("scaleFactor",d.TmpVectors.Vector3[0])),r.HOVERLIGHT&&(this._activeEffect.setDirectColor4("hoverColor",this.hoverColor),this._activeEffect.setFloat("hoverRadius",this.hoverRadius),this._activeEffect.setVector3("hoverPosition",this.hoverPosition)),r.TEXTURE&&this._albedoTexture)){this._activeEffect.setTexture("albedoSampler",this._albedoTexture);var a=this._albedoTexture.getTextureMatrix();this._activeEffect.setMatrix("textureMatrix",a)}this._afterBind(e,this._activeEffect,i)}}},e.prototype.getActiveTextures=function(){return t.prototype.getActiveTextures.call(this)},e.prototype.hasTexture=function(e){return!!t.prototype.hasTexture.call(this,e)},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.GUI.FluentMaterial",e},e.prototype.getClassName=function(){return"FluentMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},h([(0,d.serialize)(),(0,d.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"innerGlowColorIntensity",void 0),h([(0,d.serializeAsColor3)()],e.prototype,"innerGlowColor",void 0),h([(0,d.serializeAsColor3)()],e.prototype,"albedoColor",void 0),h([(0,d.serialize)(),(0,d.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"renderBorders",void 0),h([(0,d.serialize)()],e.prototype,"borderWidth",void 0),h([(0,d.serialize)()],e.prototype,"edgeSmoothingValue",void 0),h([(0,d.serialize)()],e.prototype,"borderMinValue",void 0),h([(0,d.serialize)(),(0,d.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"renderHoverLight",void 0),h([(0,d.serialize)()],e.prototype,"hoverRadius",void 0),h([(0,d.serializeAsColor4)()],e.prototype,"hoverColor",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"hoverPosition",void 0),h([(0,d.serializeAsTexture)("albedoTexture")],e.prototype,"_albedoTexture",void 0),h([(0,d.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],e.prototype,"albedoTexture",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.FluentMaterial",Tt);var St=function(t){function e(e){var i=t.call(this,e)||this;return i._backPlateMargin=1.25,i}return l(e,t),Object.defineProperty(e.prototype,"backPlateMargin",{get:function(){return this._backPlateMargin},set:function(t){var e=this;this._backPlateMargin=t,this._children.length>=1&&(this.children.forEach((function(t){e._updateCurrentMinMax(t.position)})),this._updateMargins())},enumerable:!1,configurable:!0}),e.prototype._createNode=function(t){var e=new d.Mesh("menu_".concat(this.name),t);return this._backPlate=(0,d.CreateBox)("backPlate"+this.name,{size:1},t),this._backPlate.parent=e,e},e.prototype._affectMaterial=function(t){var e=this;this._backPlateMaterial=new Tt(this.name+"backPlateMaterial",t.getScene()),this._backPlateMaterial.albedoColor=new d.Color3(.08,.15,.55),this._backPlateMaterial.renderBorders=!0,this._backPlateMaterial.renderHoverLight=!0,this._pickedPointObserver=this._host.onPickedPointChangedObservable.add((function(t){t?(e._backPlateMaterial.hoverPosition=t,e._backPlateMaterial.hoverColor.a=1):e._backPlateMaterial.hoverColor.a=0})),this._backPlate.material=this._backPlateMaterial},e.prototype._mapGridNode=function(t,e){t.mesh&&(t.position=e.clone(),this._updateCurrentMinMax(e))},e.prototype._finalProcessing=function(){this._updateMargins()},e.prototype._updateCurrentMinMax=function(t){this._currentMin||(this._currentMin=t.clone(),this._currentMax=t.clone()),this._currentMin.minimizeInPlace(t),this._currentMax.maximizeInPlace(t)},e.prototype._updateMargins=function(){if(this._children.length>0){this._currentMin.addInPlaceFromFloats(-this._cellWidth/2,-this._cellHeight/2,0),this._currentMax.addInPlaceFromFloats(this._cellWidth/2,this._cellHeight/2,0);var t=this._currentMax.subtract(this._currentMin);this._backPlate.scaling.x=t.x+this._cellWidth*this.backPlateMargin,this._backPlate.scaling.y=t.y+this._cellHeight*this.backPlateMargin,this._backPlate.scaling.z=.001;for(var e=0;e0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}\nvoid Pick_Radius_B144(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid main()\n{vec3 Nrm_World_Q128;Nrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q131;vec3 Tangent_World_N_Q131;float Tangent_Length_Q131;Tangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q131=length(Tangent_World_Q131);Tangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;vec3 Binormal_World_Q132;vec3 Binormal_World_N_Q132;float Binormal_Length_Q132;Object_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);float Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;vec3 Result_Q177;Result_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));vec3 Result_Q178;Result_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));float Result_Q144;Pick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);vec3 Dir_Q140;PickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);float Radius_Q147;float Line_Width_Q147;RelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);vec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);vec3 New_P_Q129;vec2 New_UV_Q129;float Radial_Gradient_Q129;vec3 Radial_Dir_Q129;Move_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);vec3 Pos_World_Q115;Object_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);vec4 Blob_Info_Q180;\n#if BLOB_ENABLE\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180);\n#else\nBlob_Info_Q180=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q181;\n#if BLOB_ENABLE_2\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181);\n#else\nBlob_Info_Q181=vec4(0,0,0,0);\n#endif\nfloat Gradient1_Q130;float Gradient2_Q130;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130);\n#else\nGradient1_Q130=1.0;Gradient2_Q130=1.0;\n#endif\nvec2 Rect_UV_Q139;vec4 Rect_Parms_Q139;vec2 Scale_XY_Q139;vec2 Line_UV_Q139;Round_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);vec3 Line_Vertex_Q135;Line_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);vec3 Position=Pos_World_Q115;vec3 Normal=Dir_Q140;vec2 UV=Rect_UV_Q139;vec3 Tangent=Line_Vertex_Q135;vec3 Binormal=Nrm_World_Q128;vec4 Color=Out_Color_Q145;vec4 Extra1=Rect_Parms_Q139;vec4 Extra2=Blob_Info_Q180;vec4 Extra3=Blob_Info_Q181;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var Rt=function(t){function e(){var e=t.call(this)||this;return e.BLOB_ENABLE=!0,e.BLOB_ENABLE_2=!0,e.SMOOTH_EDGES=!0,e.IRIDESCENT_MAP_ENABLE=!0,e._needNormals=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),wt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.03,r.lineWidth=.01,r.absoluteSizes=!1,r._filterWidth=1,r.baseColor=new d.Color4(.0392157,.0666667,.207843,1),r.lineColor=new d.Color4(.14902,.133333,.384314,1),r.blobIntensity=.98,r.blobFarSize=.04,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.08,r.blobNearSize=.22,r.blobPulse=0,r.blobFade=0,r.blobNearSize2=.22,r.blobPulse2=0,r.blobFade2=0,r._rate=.135,r.highlightColor=new d.Color4(.98,.98,.98,1),r.highlightWidth=.25,r._highlightTransform=new d.Vector4(1,1,0,0),r._highlight=1,r.iridescenceIntensity=0,r.iridescenceEdgeIntensity=1,r._angle=-45,r.fadeOut=1,r._reflected=!0,r._frequency=1,r._verticalOffset=0,r.globalLeftIndexTipPosition=d.Vector3.Zero(),r._globalLeftIndexTipPosition4=d.Vector4.Zero(),r.globalRightIndexTipPosition=d.Vector3.Zero(),r._globalRightIndexTipPosition4=d.Vector4.Zero(),r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._blobTexture=new d.Texture(e.BLOB_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r._iridescentMap=new d.Texture(e.IM_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new Rt);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Absolute_Sizes_","_Filter_Width_","_Base_Color_","_Line_Color_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Rate_","_Highlight_Color_","_Highlight_Width_","_Highlight_Transform_","_Highlight_","_Iridescence_Intensity_","_Iridescence_Edge_Intensity_","_Angle_","_Fade_Out_","_Reflected_","_Frequency_","_Vertical_Offset_","_Iridescent_Map_","_Use_Global_Left_Index_","_Use_Global_Right_Index_","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position"],h=["_Blob_Texture_","_Iridescent_Map_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("fluentBackplate",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o,r;if(i.materialDefines){var n=i.effect;n&&(this._activeEffect=n,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",null!==(r=null===(o=this.getScene().activeCamera)||void 0===o?void 0:o.position)&&void 0!==r?r:d.Vector3.ZeroReadOnly),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Base_Color_",this.baseColor),this._activeEffect.setDirectColor4("_Line_Color_",this.lineColor),this._activeEffect.setFloat("_Radius_Top_Left_",1),this._activeEffect.setFloat("_Radius_Top_Right_",1),this._activeEffect.setFloat("_Radius_Bottom_Left_",1),this._activeEffect.setFloat("_Radius_Bottom_Right_",1),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setFloat("_Rate_",this._rate),this._activeEffect.setDirectColor4("_Highlight_Color_",this.highlightColor),this._activeEffect.setFloat("_Highlight_Width_",this.highlightWidth),this._activeEffect.setVector4("_Highlight_Transform_",this._highlightTransform),this._activeEffect.setFloat("_Highlight_",this._highlight),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setFloat("_Iridescence_Edge_Intensity_",this.iridescenceEdgeIntensity),this._activeEffect.setFloat("_Angle_",this._angle),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._activeEffect.setFloat("_Reflected_",this._reflected?1:0),this._activeEffect.setFloat("_Frequency_",this._frequency),this._activeEffect.setFloat("_Vertical_Offset_",this._verticalOffset),this._activeEffect.setTexture("_Iridescent_Map_",this._iridescentMap),this._activeEffect.setFloat("_Use_Global_Left_Index_",1),this._activeEffect.setFloat("_Use_Global_Right_Index_",1),this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x,this.globalLeftIndexTipPosition.y,this.globalLeftIndexTipPosition.z,1),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this._globalLeftIndexTipPosition4),this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x,this.globalRightIndexTipPosition.y,this.globalRightIndexTipPosition.z,1),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this._globalRightIndexTipPosition4),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),this._blobTexture.dispose(),this._iridescentMap.dispose()},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.FluentBackplateMaterial",e},e.prototype.getClassName=function(){return"FluentBackplateMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLOB_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png",e.IM_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"absoluteSizes",void 0),h([(0,d.serialize)()],e.prototype,"baseColor",void 0),h([(0,d.serialize)()],e.prototype,"lineColor",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"highlightColor",void 0),h([(0,d.serialize)()],e.prototype,"highlightWidth",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceEdgeIntensity",void 0),h([(0,d.serialize)()],e.prototype,"fadeOut",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalLeftIndexTipPosition",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalRightIndexTipPosition",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.FluentBackplateMaterial",wt);var Mt=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o._shareMaterials=i,o}return l(e,t),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._model.renderingGroupId},set:function(t){this._model.renderingGroupId=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"HolographicBackplate"},e.prototype._createNode=function(t){var i,o=this,r=(0,d.CreateBox)((null!==(i=this.name)&&void 0!==i?i:"HolographicBackplate")+"_CollisionMesh",{width:1,height:1,depth:1},t);return r.isPickable=!0,r.visibility=0,d.SceneLoader.ImportMeshAsync(void 0,e.MODEL_BASE_URL,e.MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.name="".concat(o.name,"_frontPlate"),e.isPickable=!1,e.parent=r,o._material&&(e.material=o._material),o._model=e})),r},e.prototype._createMaterial=function(t){this._material=new wt(this.name+" Material",t.getScene())},e.prototype._affectMaterial=function(t){this._shareMaterials?this._host._touchSharedMaterials.fluentBackplateMaterial?this._material=this._host._touchSharedMaterials.fluentBackplateMaterial:(this._createMaterial(t),this._host._touchSharedMaterials.fluentBackplateMaterial=this._material):this._createMaterial(t)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.shareMaterials||this._material.dispose(),this._model.dispose()},e.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.MODEL_FILENAME="mrtk-fluent-backplate.glb",e}(mt),Et=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o._shareMaterials=!0,o._shareMaterials=i,o.pointerEnterAnimation=function(){o.mesh&&o._frontPlate.setEnabled(!0)},o.pointerOutAnimation=function(){o.mesh&&o._frontPlate.setEnabled(!1)},o}return l(e,t),e.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(t){this._backPlate.renderingGroupId=t,this._textPlate.renderingGroupId=t,this._frontPlate.renderingGroupId=t,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tooltipText",{get:function(){return this._tooltipTextBlock?this._tooltipTextBlock.text:null},set:function(t){var e=this;if(t){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,d.CreatePlane)("",{size:1},this._backPlate._scene);var o=(0,d.CreatePlane)("",{size:1,sideOrientation:d.Mesh.DOUBLESIDE},this._backPlate._scene),r=new d.StandardMaterial("",this._backPlate._scene);r.diffuseColor=d.Color3.FromHexString("#212121"),o.material=r,o.isPickable=!1,this._tooltipMesh.addChild(o),o.position=d.Vector3.Forward(i).scale(.05),this._tooltipMesh.scaling.y=1/3,this._tooltipMesh.position=d.Vector3.Up().scale(.7).add(d.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._backPlate,this._tooltipTexture=ct.CreateForMesh(this._tooltipMesh),this._tooltipTextBlock=new S,this._tooltipTextBlock.scaleY=3,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=130,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new d.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=t)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this._text!==t&&(this._text=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(t){this._imageUrl!==t&&(this._imageUrl=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"HolographicButton"},e.prototype._rebuildContent=function(){this._disposeFacadeTexture();var t=new w;if(t.isVertical=!0,(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var e=new O;e.source=this._imageUrl,e.paddingTop="40px",e.height="180px",e.width="100px",e.paddingBottom="40px",t.addControl(e)}if(this._text){var i=new S;i.text=this._text,i.color="white",i.height="30px",i.fontSize=24,t.addControl(i)}this._frontPlate&&(this.content=t)},e.prototype._createNode=function(e){return this._backPlate=(0,d.CreateBox)(this.name+"BackMesh",{width:1,height:1,depth:.08},e),this._frontPlate=(0,d.CreateBox)(this.name+"FrontMesh",{width:1,height:1,depth:.08},e),this._frontPlate.parent=this._backPlate,this._frontPlate.position=d.Vector3.Forward(e.useRightHandedSystem).scale(-.08),this._frontPlate.isPickable=!1,this._frontPlate.setEnabled(!1),this._textPlate=t.prototype._createNode.call(this,e),this._textPlate.parent=this._backPlate,this._textPlate.position=d.Vector3.Forward(e.useRightHandedSystem).scale(-.08),this._textPlate.isPickable=!1,this._backPlate},e.prototype._applyFacade=function(t){this._plateMaterial.emissiveTexture=t,this._plateMaterial.opacityTexture=t},e.prototype._createBackMaterial=function(t){var e=this;this._backMaterial=new Tt(this.name+"Back Material",t.getScene()),this._backMaterial.renderHoverLight=!0,this._pickedPointObserver=this._host.onPickedPointChangedObservable.add((function(t){t?(e._backMaterial.hoverPosition=t,e._backMaterial.hoverColor.a=1):e._backMaterial.hoverColor.a=0}))},e.prototype._createFrontMaterial=function(t){this._frontMaterial=new Tt(this.name+"Front Material",t.getScene()),this._frontMaterial.innerGlowColorIntensity=0,this._frontMaterial.alpha=.5,this._frontMaterial.renderBorders=!0},e.prototype._createPlateMaterial=function(t){this._plateMaterial=new d.StandardMaterial(this.name+"Plate Material",t.getScene()),this._plateMaterial.specularColor=d.Color3.Black()},e.prototype._affectMaterial=function(t){this._shareMaterials?(this._host._sharedMaterials.backFluentMaterial?this._backMaterial=this._host._sharedMaterials.backFluentMaterial:(this._createBackMaterial(t),this._host._sharedMaterials.backFluentMaterial=this._backMaterial),this._host._sharedMaterials.frontFluentMaterial?this._frontMaterial=this._host._sharedMaterials.frontFluentMaterial:(this._createFrontMaterial(t),this._host._sharedMaterials.frontFluentMaterial=this._frontMaterial)):(this._createBackMaterial(t),this._createFrontMaterial(t)),this._createPlateMaterial(t),this._backPlate.material=this._backMaterial,this._frontPlate.material=this._frontMaterial,this._textPlate.material=this._plateMaterial,this._rebuildContent()},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._disposeTooltip(),this.shareMaterials||(this._backMaterial.dispose(),this._frontMaterial.dispose(),this._plateMaterial.dispose(),this._pickedPointObserver&&(this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._pickedPointObserver=null))},e}(xt);d.ShaderStore.ShadersStore.fluentButtonPixelShader="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform bool _Relative_Width_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool Enable_Fade;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool _Use_Blob_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Holo_Edge_Fragment_B35(\nvec4 Edges,\nfloat Edge_Width,\nout float NotEdge)\n{vec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));vec2 df=fwidth(c)*Edge_Width;vec2 g=clamp(c/df,0.0,1.0);NotEdge=g.x*g.y;}\nvoid Blob_Fragment_B39(\nvec2 UV,\nvec3 Blob_Info,\nsampler2D Blob_Texture,\nout vec4 Blob_Color)\n{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}\nvec2 FilterStep(vec2 Edge,vec2 X)\n{vec2 dX=max(fwidth(X),vec2(0.00001,0.00001));return clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);}\nvoid Wireframe_Fragment_B59(\nvec3 Widths,\nvec2 UV,\nfloat Proximity,\nvec4 Edge_Color,\nout vec4 Wireframe)\n{vec2 c=min(UV,vec2(1.0,1.0)-UV);vec2 g=FilterStep(Widths.xy*0.5,c); \nWireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;}\nvoid Proximity_B53(\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Proximity_Max_Intensity,\nfloat Proximity_Near_Radius,\nvec3 Position,\nvec3 Show_Selection,\nvec4 Extra1,\nfloat Dist_To_Face,\nfloat Intensity,\nout float Proximity)\n{vec2 delta1=Extra1.xy;vec2 delta2=Extra1.zw;float d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);Proximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;}\nvoid To_XYZ_B46(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid main()\n{float NotEdge_Q35;\n#if ENABLE_FADE\nHolo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35);\n#else\nNotEdge_Q35=1.0;\n#endif\nvec4 Blob_Color_Q39;float k=dot(vUV,vUV);vec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);vec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));Blob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));float Is_Quad_Q24;Is_Quad_Q24=vNormal.z;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));float X_Q46;float Y_Q46;float Z_Q46;To_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);float Proximity_Q53;Proximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);vec4 Wireframe_Q59;Wireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);vec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);vec4 Result_Q22;Result_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));vec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;vec4 Out_Color=Final_Color_Q37;float Clip_Threshold=0.0;bool To_sRGB=false;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.fluentButtonVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool _Enable_Fade_;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;void Blob_Vertex_B47(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nvec4 Vx_Color,\nvec2 UV,\nvec3 Face_Center,\nvec2 Face_Size,\nvec2 In_UV,\nfloat Blob_Fade_Length,\nfloat Selection_Fade,\nfloat Selection_Fade_Size,\nfloat Inner_Fade,\nvec3 Active_Face_Center,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nfloat Blob_Enabled,\nout vec3 Out_Position,\nout vec2 Out_UV,\nout vec3 Blob_Info)\n{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal);Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; \nvec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);}\nvec2 ProjectProximity(\nvec3 blobPosition,\nvec3 position,\nvec3 center,\nvec3 dir,\nvec3 xdir,\nvec3 ydir,\nout float vdistance\n)\n{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}\nvoid Proximity_Vertex_B66(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nvec3 Position,\nfloat Proximity_Far_Distance,\nfloat Relative_Scale,\nfloat Proximity_Anisotropy,\nvec3 Up,\nout vec4 Extra1,\nout float Distance_To_Face,\nout float Intensity)\n{vec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));vec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);float distz1,distz2;Extra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;Extra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;Distance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);Intensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);}\nvoid Holo_Edge_Vertex_B44(\nvec3 Incident,\nvec3 Normal,\nvec2 UV,\nvec3 Tangent,\nvec3 Bitangent,\nbool Smooth_Active_Face,\nfloat Active,\nout vec4 Holo_Edges)\n{float NdotI=dot(Incident,Normal);vec2 flip=(UV-vec2(0.5,0.5));float udot=dot(Incident,Tangent)*flip.x*NdotI;float uval=1.0-float(udot>0.0);float vdot=-dot(Incident,Bitangent)*flip.y*NdotI;float vval=1.0-float(vdot>0.0);float Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));uval=mix(uval,max(1.0,uval),Smooth_And_Active); \nvval=mix(vval,max(1.0,vval),Smooth_And_Active);Holo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));}\nvoid Object_To_World_Pos_B13(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Choose_Blob_B38(\nvec4 Vx_Color,\nvec3 Position1,\nvec3 Position2,\nbool Blob_Enable_1,\nbool Blob_Enable_2,\nfloat Near_Size_1,\nfloat Near_Size_2,\nfloat Blob_Inner_Fade_1,\nfloat Blob_Inner_Fade_2,\nfloat Blob_Pulse_1,\nfloat Blob_Pulse_2,\nfloat Blob_Fade_1,\nfloat Blob_Fade_2,\nout vec3 Position,\nout float Near_Size,\nout float Inner_Fade,\nout float Blob_Enable,\nout float Fade,\nout float Pulse)\n{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=float(Blob_Enable_1);float b2=float(Blob_Enable_2);Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}\nvoid Wireframe_Vertex_B51(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Edge_Width,\nvec2 Face_Size,\nout vec3 Wire_Vx_Pos,\nout vec2 UV,\nout vec2 Widths)\n{Widths.xy=Edge_Width/Face_Size;float x=dot(Position,Tangent);float y=dot(Position,Bitangent);float dx=0.5-abs(x);float newx=(0.5-dx*Widths.x*2.0)*sign(x);float dy=0.5-abs(y);float newy=(0.5-dy*Widths.y*2.0)*sign(y);Wire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;UV.x=dot(Wire_Vx_Pos,Tangent)+0.5;UV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;}\nvec2 ramp2(vec2 start,vec2 end,vec2 x)\n{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}\nfloat computeSelection(\nvec3 blobPosition,\nvec3 normal,\nvec3 tangent,\nvec3 bitangent,\nvec3 faceCenter,\nvec2 faceSize,\nfloat selectionFuzz,\nfloat farDistance,\nfloat fadeLength\n)\n{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}\nvoid Selection_Vertex_B48(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec2 Face_Size,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Selection_Fuzz,\nfloat Selected,\nfloat Far_Distance,\nfloat Fade_Length,\nvec3 Active_Face_Dir,\nout float Show_Selection)\n{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float Active=max(0.0,dot(Active_Face_Dir,Normal));Show_Selection=mix(max(select1,select2),1.0,Selected)*Active;}\nvoid Proximity_Visibility_B54(\nfloat Selection,\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Input_Width,\nfloat Proximity_Far_Distance,\nfloat Proximity_Radius,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nout float Width)\n{vec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;float boxMaxSize=length(boxEdges);float d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);vec3 blob1=Proximity_Center-d1*Active_Face_Dir;float d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);vec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;vec3 delta1=blob1-Active_Face_Center;vec3 delta2=blob2-Active_Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));}\nvoid Object_To_World_Dir_B67(\nvec3 Dir_Object,\nout vec3 Dir_World)\n{Dir_World=(world*vec4(Dir_Object,0.0)).xyz;}\nvoid main()\n{vec3 Active_Face_Center_Q49;Active_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));vec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);float Relative_Scale_Q57;\n#if RELATIVE_WIDTH\nRelative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz);\n#else\nRelative_Scale_Q57=1.0;\n#endif\nvec3 Tangent_World_Q30;Tangent_World_Q30=(world*vec4(tangent,0.0)).xyz;vec3 Binormal_World_Q31;Binormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;vec3 Normal_World_Q60;Normal_World_Q60=(world*vec4(normal,0.0)).xyz;vec3 Result_Q18=0.5*normal;vec3 Dir_World_Q67;Object_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);float Product_Q56=_Edge_Width_*Relative_Scale_Q57;vec3 Normal_World_N_Q29=normalize(Normal_World_Q60);vec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);vec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);vec3 Position_Q38;float Near_Size_Q38;float Inner_Fade_Q38;float Blob_Enable_Q38;float Fade_Q38;float Pulse_Q38;Choose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);vec3 Face_Center_Q33;Face_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;vec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));float Show_Selection_Q48;Selection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);vec3 Normalized_Q72=normalize(Dir_World_Q67);float Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));float Width_Q54;Proximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);vec3 Wire_Vx_Pos_Q51;vec2 UV_Q51;vec2 Widths_Q51;Wireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);vec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);vec3 Pos_World_Q13;Object_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);vec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);vec3 Out_Position_Q47;vec2 Out_UV_Q47;vec3 Blob_Info_Q47;Blob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);vec4 Extra1_Q66;float Distance_To_Face_Q66;float Intensity_Q66;Proximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);vec4 Holo_Edges_Q44;Holo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);vec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);vec3 Position=Out_Position_Q47;vec2 UV=Out_UV_Q47;vec3 Tangent=Blob_Info_Q47;vec3 Binormal=Vec3_Q19;vec3 Normal=Vec3_Q27;vec4 Extra1=Extra1_Q66;vec4 Color=Holo_Edges_Q44;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;}";var Ft=function(t){function e(){var e=t.call(this)||this;return e.RELATIVE_WIDTH=!0,e.ENABLE_FADE=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),Dt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.edgeWidth=.04,r.edgeColor=new d.Color4(.592157,.592157,.592157,1),r.proximityMaxIntensity=.45,r.proximityFarDistance=.16,r.proximityNearRadius=1.5,r.proximityAnisotropy=1,r.selectionFuzz=.5,r.selected=0,r.selectionFade=0,r.selectionFadeSize=.3,r.selectedDistance=.08,r.selectedFadeLength=.08,r.blobIntensity=.5,r.blobFarSize=.05,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.08,r.leftBlobEnable=!0,r.leftBlobNearSize=.025,r.leftBlobPulse=0,r.leftBlobFade=1,r.leftBlobInnerFade=.01,r.rightBlobEnable=!0,r.rightBlobNearSize=.025,r.rightBlobPulse=0,r.rightBlobFade=1,r.rightBlobInnerFade=.01,r.activeFaceDir=new d.Vector3(0,0,-1),r.activeFaceUp=new d.Vector3(0,1,0),r.enableFade=!0,r.fadeWidth=1.5,r.smoothActiveFace=!0,r.showFrame=!1,r.useBlobTexture=!0,r.globalLeftIndexTipPosition=d.Vector3.Zero(),r.globalRightIndexTipPosition=d.Vector3.Zero(),r.alphaMode=d.Constants.ALPHA_ADD,r.disableDepthWrite=!0,r.backFaceCulling=!1,r._blobTexture=new d.Texture(e.BLOB_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!0},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new Ft);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!0,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Edge_Width_","_Edge_Color_","_Relative_Width_","_Proximity_Max_Intensity_","_Proximity_Far_Distance_","_Proximity_Near_Radius_","_Proximity_Anisotropy_","_Selection_Fuzz_","_Selected_","_Selection_Fade_","_Selection_Fade_Size_","_Selected_Distance_","_Selected_Fade_Length_","_Blob_Enable_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Inner_Fade_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Enable_2_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Inner_Fade_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Active_Face_Dir_","_Active_Face_Up_","_Enable_Fade_","_Fade_Width_","_Smooth_Active_Face_","_Show_Frame_","_Use_Blob_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],h=["_Blob_Texture_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("fluentButton",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Edge_Width_",this.edgeWidth),this._activeEffect.setColor4("_Edge_Color_",new d.Color3(this.edgeColor.r,this.edgeColor.g,this.edgeColor.b),this.edgeColor.a),this._activeEffect.setFloat("_Proximity_Max_Intensity_",this.proximityMaxIntensity),this._activeEffect.setFloat("_Proximity_Far_Distance_",this.proximityFarDistance),this._activeEffect.setFloat("_Proximity_Near_Radius_",this.proximityNearRadius),this._activeEffect.setFloat("_Proximity_Anisotropy_",this.proximityAnisotropy),this._activeEffect.setFloat("_Selection_Fuzz_",this.selectionFuzz),this._activeEffect.setFloat("_Selected_",this.selected),this._activeEffect.setFloat("_Selection_Fade_",this.selectionFade),this._activeEffect.setFloat("_Selection_Fade_Size_",this.selectionFadeSize),this._activeEffect.setFloat("_Selected_Distance_",this.selectedDistance),this._activeEffect.setFloat("_Selected_Fade_Length_",this.selectedFadeLength),this._activeEffect.setFloat("_Blob_Enable_",this.leftBlobEnable?1:0),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.leftBlobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Inner_Fade_",this.leftBlobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_",this.leftBlobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.leftBlobFade),this._activeEffect.setFloat("_Blob_Enable_2_",this.rightBlobEnable?1:0),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.rightBlobNearSize),this._activeEffect.setFloat("_Blob_Inner_Fade_2_",this.rightBlobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_2_",this.rightBlobPulse),this._activeEffect.setFloat("_Blob_Fade_2_",this.rightBlobFade),this._activeEffect.setVector3("_Active_Face_Dir_",this.activeFaceDir),this._activeEffect.setVector3("_Active_Face_Up_",this.activeFaceUp),this._activeEffect.setFloat("_Fade_Width_",this.fadeWidth),this._activeEffect.setFloat("_Smooth_Active_Face_",this.smoothActiveFace?1:0),this._activeEffect.setFloat("_Show_Frame_",this.showFrame?1:0),this._activeEffect.setFloat("_Use_Blob_Texture_",this.useBlobTexture?1:0),this._activeEffect.setFloat("Use_Global_Left_Index",1),this._activeEffect.setFloat("Use_Global_Right_Index",1),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",new d.Vector4(this.globalLeftIndexTipPosition.x,this.globalLeftIndexTipPosition.y,this.globalLeftIndexTipPosition.z,1)),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",new d.Vector4(this.globalRightIndexTipPosition.x,this.globalRightIndexTipPosition.y,this.globalRightIndexTipPosition.z,1)),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.FluentButtonMaterial",e},e.prototype.getClassName=function(){return"FluentButtonMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLOB_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png",h([(0,d.serialize)()],e.prototype,"edgeWidth",void 0),h([(0,d.serializeAsColor4)()],e.prototype,"edgeColor",void 0),h([(0,d.serialize)()],e.prototype,"proximityMaxIntensity",void 0),h([(0,d.serialize)()],e.prototype,"proximityFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"proximityNearRadius",void 0),h([(0,d.serialize)()],e.prototype,"proximityAnisotropy",void 0),h([(0,d.serialize)()],e.prototype,"selectionFuzz",void 0),h([(0,d.serialize)()],e.prototype,"selected",void 0),h([(0,d.serialize)()],e.prototype,"selectionFade",void 0),h([(0,d.serialize)()],e.prototype,"selectionFadeSize",void 0),h([(0,d.serialize)()],e.prototype,"selectedDistance",void 0),h([(0,d.serialize)()],e.prototype,"selectedFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobEnable",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobPulse",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobFade",void 0),h([(0,d.serialize)()],e.prototype,"leftBlobInnerFade",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobEnable",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobPulse",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobFade",void 0),h([(0,d.serialize)()],e.prototype,"rightBlobInnerFade",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"activeFaceDir",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"activeFaceUp",void 0),h([(0,d.serialize)()],e.prototype,"enableFade",void 0),h([(0,d.serialize)()],e.prototype,"fadeWidth",void 0),h([(0,d.serialize)()],e.prototype,"smoothActiveFace",void 0),h([(0,d.serialize)()],e.prototype,"showFrame",void 0),h([(0,d.serialize)()],e.prototype,"useBlobTexture",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalLeftIndexTipPosition",void 0),h([(0,d.serializeAsVector3)()],e.prototype,"globalRightIndexTipPosition",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.FluentButtonMaterial",Dt);var kt=function(t){function e(e,i){var o=t.call(this,e)||this;return o._isNearPressed=!1,o._interactionSurfaceHeight=0,o._isToggleButton=!1,o._toggleState=!1,o._toggleButtonCallback=function(){o._onToggle(!o._toggleState)},o.onToggleObservable=new d.Observable,o.collidableFrontDirection=d.Vector3.Zero(),i&&(o.collisionMesh=i),o}return l(e,t),Object.defineProperty(e.prototype,"isActiveNearInteraction",{get:function(){return this._isNearPressed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collidableFrontDirection",{get:function(){if(this._collisionMesh){var t=d.TmpVectors.Vector3[0];return d.Vector3.TransformNormalToRef(this._collidableFrontDirection,this._collisionMesh.getWorldMatrix(),t),t.normalize()}return this._collidableFrontDirection},set:function(t){if(this._collidableFrontDirection=t.normalize(),this._collisionMesh){var e=d.TmpVectors.Matrix[0];e.copyFrom(this._collisionMesh.getWorldMatrix()),e.invert(),d.Vector3.TransformNormalToRef(this._collidableFrontDirection,e,this._collidableFrontDirection),this._collidableFrontDirection.normalize()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collisionMesh",{set:function(t){var e,i=this;this._collisionMesh&&(this._collisionMesh.isNearPickable=!1,(null===(e=this._collisionMesh.reservedDataStore)||void 0===e?void 0:e.GUI3D)&&(this._collisionMesh.reservedDataStore.GUI3D={}),this._collisionMesh.getChildMeshes().forEach((function(t){var e;t.isNearPickable=!1,(null===(e=t.reservedDataStore)||void 0===e?void 0:e.GUI3D)&&(t.reservedDataStore.GUI3D={})}))),this._collisionMesh=t,this._injectGUI3DReservedDataStore(this._collisionMesh).control=this,this._collisionMesh.isNearPickable=!0,this._collisionMesh.getChildMeshes().forEach((function(t){i._injectGUI3DReservedDataStore(t).control=i,t.isNearPickable=!0})),this.collidableFrontDirection=t.forward},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isToggleButton",{get:function(){return this._isToggleButton},set:function(t){t!==this._isToggleButton&&(this._isToggleButton=t,t?this.onPointerUpObservable.add(this._toggleButtonCallback):(this.onPointerUpObservable.removeCallback(this._toggleButtonCallback),this._toggleState&&this._onToggle(!1)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isToggled",{get:function(){return this._toggleState},set:function(t){this._isToggleButton&&this._toggleState!==t&&this._onToggle(t)},enumerable:!1,configurable:!0}),e.prototype._onToggle=function(t){this._toggleState=t,this.onToggleObservable.notifyObservers(t)},e.prototype._isInteractionInFrontOfButton=function(t){return this._getInteractionHeight(t,this._collisionMesh.getAbsolutePosition())>0},e.prototype.getPressDepth=function(t){if(!this._isNearPressed)return 0;var e=this._getInteractionHeight(t,this._collisionMesh.getAbsolutePosition());return this._interactionSurfaceHeight-e},e.prototype._getInteractionHeight=function(t,e){var i=this.collidableFrontDirection;if(0===i.length())return d.Vector3.Distance(t,e);var o=d.Vector3.Dot(e,i);return d.Vector3.Dot(t,i)-o},e.prototype._generatePointerEventType=function(t,e,i){if(t===d.PointerEventTypes.POINTERDOWN||t===d.PointerEventTypes.POINTERMOVE){if(!this._isInteractionInFrontOfButton(e))return d.PointerEventTypes.POINTERMOVE;this._isNearPressed=!0,this._interactionSurfaceHeight=this._getInteractionHeight(e,this._collisionMesh.getAbsolutePosition())}if(t===d.PointerEventTypes.POINTERUP){if(0==i)return d.PointerEventTypes.POINTERMOVE;this._isNearPressed=!1}return t},e.prototype._getTypeName=function(){return"TouchButton3D"},e.prototype._createNode=function(e){return t.prototype._createNode.call(this,e)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.onPointerUpObservable.removeCallback(this._toggleButtonCallback),this.onToggleObservable.clear(),this._collisionMesh&&this._collisionMesh.dispose()},e}(xt),Lt=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o._shareMaterials=!0,o._isBackplateVisible=!0,o._frontPlateDepth=.5,o._backPlateDepth=.04,o._backplateColor=new d.Color3(.08,.15,.55),o._backplateToggledColor=new d.Color3(.25,.4,.95),o._shareMaterials=i,o.pointerEnterAnimation=function(){o._frontMaterial.leftBlobEnable=!0,o._frontMaterial.rightBlobEnable=!0},o.pointerOutAnimation=function(){o._frontMaterial.leftBlobEnable=!1,o._frontMaterial.rightBlobEnable=!1},o.pointerDownAnimation=function(){o._frontPlate&&!o.isActiveNearInteraction&&(o._frontPlate.scaling.z=.2*o._frontPlateDepth,o._frontPlate.position=d.Vector3.Forward(o._frontPlate._scene.useRightHandedSystem).scale((o._frontPlateDepth-.2*o._frontPlateDepth)/2),o._textPlate.position=d.Vector3.Forward(o._textPlate._scene.useRightHandedSystem).scale(-(o._backPlateDepth+.2*o._frontPlateDepth)/2))},o.pointerUpAnimation=function(){o._frontPlate&&(o._frontPlate.scaling.z=o._frontPlateDepth,o._frontPlate.position=d.Vector3.Forward(o._frontPlate._scene.useRightHandedSystem).scale((o._frontPlateDepth-o._frontPlateDepth)/2),o._textPlate.position=d.Vector3.Forward(o._textPlate._scene.useRightHandedSystem).scale(-(o._backPlateDepth+o._frontPlateDepth)/2))},o.onPointerMoveObservable.add((function(t){if(o._frontPlate&&o.isActiveNearInteraction){var e=d.Vector3.Zero();if(o._backPlate.getWorldMatrix().decompose(e,void 0,void 0)){var i=o._getInteractionHeight(t,o._backPlate.getAbsolutePosition())/e.z;i=d.Scalar.Clamp(i-o._backPlateDepth/2,.2*o._frontPlateDepth,o._frontPlateDepth),o._frontPlate.scaling.z=i,o._frontPlate.position=d.Vector3.Forward(o._frontPlate._scene.useRightHandedSystem).scale((o._frontPlateDepth-i)/2),o._textPlate.position=d.Vector3.Forward(o._textPlate._scene.useRightHandedSystem).scale(-(o._backPlateDepth+i)/2)}}})),o._pointerHoverObserver=o.onPointerMoveObservable.add((function(t){o._frontMaterial.globalLeftIndexTipPosition=t})),o}return l(e,t),e.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(t){this._backPlate.renderingGroupId=t,this._textPlate.renderingGroupId=t,this._frontPlate.renderingGroupId=t,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._backPlate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tooltipText",{get:function(){return this._tooltipTextBlock?this._tooltipTextBlock.text:null},set:function(t){var e=this;if(t){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,d.CreatePlane)("",{size:1},this._backPlate._scene);var o=(0,d.CreatePlane)("",{size:1,sideOrientation:d.Mesh.DOUBLESIDE},this._backPlate._scene),r=new d.StandardMaterial("",this._backPlate._scene);r.diffuseColor=d.Color3.FromHexString("#212121"),o.material=r,o.isPickable=!1,this._tooltipMesh.addChild(o),o.position=d.Vector3.Forward(i).scale(.05),this._tooltipMesh.scaling.y=1/3,this._tooltipMesh.position=d.Vector3.Up().scale(.7).add(d.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._backPlate,this._tooltipTexture=ct.CreateForMesh(this._tooltipMesh),this._tooltipTextBlock=new S,this._tooltipTextBlock.scaleY=3,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=130,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new d.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=t)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this._text!==t&&(this._text=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(t){this._imageUrl!==t&&(this._imageUrl=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBackplateVisible",{set:function(t){this.mesh&&this._backMaterial&&(t&&!this._isBackplateVisible?this._backPlate.visibility=1:!t&&this._isBackplateVisible&&(this._backPlate.visibility=0)),this._isBackplateVisible=t},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"TouchHolographicButton"},e.prototype._rebuildContent=function(){this._disposeFacadeTexture();var t=new w;if(t.isVertical=!0,(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var e=new O;e.source=this._imageUrl,e.paddingTop="40px",e.height="180px",e.width="100px",e.paddingBottom="40px",t.addControl(e)}if(this._text){var i=new S;i.text=this._text,i.color="white",i.height="30px",i.fontSize=24,t.addControl(i)}this.content=t},e.prototype._createNode=function(i){var o,r=this;this.name=null!==(o=this.name)&&void 0!==o?o:"TouchHolographicButton";var n=(0,d.CreateBox)("".concat(this.name,"_collisionMesh"),{width:1,height:1,depth:this._frontPlateDepth},i);n.isPickable=!0,n.isNearPickable=!0,n.visibility=0,n.position=d.Vector3.Forward(i.useRightHandedSystem).scale(-this._frontPlateDepth/2),d.SceneLoader.ImportMeshAsync(void 0,e.MODEL_BASE_URL,e.MODEL_FILENAME,i).then((function(t){var e=(0,d.CreateBox)("${this.name}_alphaMesh",{width:1,height:1,depth:1},i);e.isPickable=!1,e.material=new d.StandardMaterial("${this.name}_alphaMesh_material",i),e.material.alpha=.15;var o=t.meshes[1];o.name="".concat(r.name,"_frontPlate"),o.isPickable=!1,o.scaling.z=r._frontPlateDepth,e.parent=o,o.parent=n,r._frontMaterial&&(o.material=r._frontMaterial),r._frontPlate=o})),this._backPlate=(0,d.CreateBox)("".concat(this.name,"_backPlate"),{width:1,height:1,depth:this._backPlateDepth},i),this._backPlate.position=d.Vector3.Forward(i.useRightHandedSystem).scale(this._backPlateDepth/2),this._backPlate.isPickable=!1,this._textPlate=t.prototype._createNode.call(this,i),this._textPlate.name="".concat(this.name,"_textPlate"),this._textPlate.isPickable=!1,this._textPlate.position=d.Vector3.Forward(i.useRightHandedSystem).scale(-this._frontPlateDepth/2),this._backPlate.addChild(n),this._backPlate.addChild(this._textPlate);var a=new d.TransformNode("{this.name}_root",i);return this._backPlate.setParent(a),this.collisionMesh=n,this.collidableFrontDirection=this._backPlate.forward.negate(),a},e.prototype._applyFacade=function(t){this._plateMaterial.emissiveTexture=t,this._plateMaterial.opacityTexture=t,this._plateMaterial.diffuseColor=new d.Color3(.4,.4,.4)},e.prototype._createBackMaterial=function(t){this._backMaterial=new Tt(this.name+"backPlateMaterial",t.getScene()),this._backMaterial.albedoColor=this._backplateColor,this._backMaterial.renderBorders=!0,this._backMaterial.renderHoverLight=!1},e.prototype._createFrontMaterial=function(t){this._frontMaterial=new Dt(this.name+"Front Material",t.getScene())},e.prototype._createPlateMaterial=function(t){this._plateMaterial=new d.StandardMaterial(this.name+"Plate Material",t.getScene()),this._plateMaterial.specularColor=d.Color3.Black()},e.prototype._onToggle=function(e){this._backMaterial&&(this._backMaterial.albedoColor=e?this._backplateToggledColor:this._backplateColor),t.prototype._onToggle.call(this,e)},e.prototype._affectMaterial=function(t){this._shareMaterials?(this._host._touchSharedMaterials.backFluentMaterial?this._backMaterial=this._host._touchSharedMaterials.backFluentMaterial:(this._createBackMaterial(t),this._host._touchSharedMaterials.backFluentMaterial=this._backMaterial),this._host._touchSharedMaterials.frontFluentMaterial?this._frontMaterial=this._host._touchSharedMaterials.frontFluentMaterial:(this._createFrontMaterial(t),this._host._touchSharedMaterials.frontFluentMaterial=this._frontMaterial)):(this._createBackMaterial(t),this._createFrontMaterial(t)),this._createPlateMaterial(t),this._backPlate.material=this._backMaterial,this._textPlate.material=this._plateMaterial,this._isBackplateVisible||(this._backPlate.visibility=0),this._frontPlate&&(this._frontPlate.material=this._frontMaterial),this._rebuildContent()},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._disposeTooltip(),this.onPointerMoveObservable.remove(this._pointerHoverObserver),this.shareMaterials||(this._backMaterial.dispose(),this._frontMaterial.dispose(),this._plateMaterial.dispose(),this._pickedPointObserver&&(this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._pickedPointObserver=null))},e.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.MODEL_FILENAME="mrtk-fluent-button.glb",e}(kt),Nt=function(){function t(){this.followBehaviorEnabled=!1,this.sixDofDragBehaviorEnabled=!0,this.surfaceMagnetismBehaviorEnabled=!0,this._followBehavior=new d.FollowBehavior,this._sixDofDragBehavior=new d.SixDofDragBehavior,this._surfaceMagnetismBehavior=new d.SurfaceMagnetismBehavior}return Object.defineProperty(t.prototype,"name",{get:function(){return"Default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"followBehavior",{get:function(){return this._followBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sixDofDragBehavior",{get:function(){return this._sixDofDragBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surfaceMagnetismBehavior",{get:function(){return this._surfaceMagnetismBehavior},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.attach=function(t,e,i){this._scene=t.getScene(),this.attachedNode=t,this._addObservables(),this._followBehavior.attach(t),this._sixDofDragBehavior.attach(t),this._sixDofDragBehavior.draggableMeshes=e||null,this._sixDofDragBehavior.faceCameraOnDragStart=!0,this._surfaceMagnetismBehavior.attach(t,this._scene),i&&(this._surfaceMagnetismBehavior.meshes=i),this._surfaceMagnetismBehavior.enabled=!1},t.prototype.detach=function(){this.attachedNode=null,this._removeObservables(),this._followBehavior.detach(),this._sixDofDragBehavior.detach(),this._surfaceMagnetismBehavior.detach()},t.prototype._addObservables=function(){var t=this;this._onBeforeRenderObserver=this._scene.onBeforeRenderObservable.add((function(){t._followBehavior._enabled=!t._sixDofDragBehavior.isMoving&&t.followBehaviorEnabled})),this._onDragObserver=this._sixDofDragBehavior.onDragObservable.add((function(e){t._sixDofDragBehavior.disableMovement=t._surfaceMagnetismBehavior.findAndUpdateTarget(e.pickInfo)}))},t.prototype._removeObservables=function(){this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._sixDofDragBehavior.onDragObservable.remove(this._onDragObserver)},t}();d.ShaderStore.ShadersStore.handleVertexShader="precision highp float;attribute vec3 position;uniform vec3 positionOffset;uniform mat4 worldViewProjection;uniform float scale;void main(void) {vec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);gl_Position=worldViewProjection*vPos;}";d.ShaderStore.ShadersStore.handlePixelShader="uniform vec3 color;void main(void) {gl_FragColor=vec4(color,1.0);}";var At,zt=function(t){function e(e,i){var o=t.call(this,e,i,"handle",{attributes:["position"],uniforms:["worldViewProjection","color","scale","positionOffset"],needAlphaBlending:!1,needAlphaTesting:!1})||this;return o._hover=!1,o._drag=!1,o._color=new d.Color3,o._scale=1,o._lastTick=-1,o.animationLength=100,o.hoverColor=new d.Color3(0,.467,.84),o.baseColor=new d.Color3(1,1,1),o.hoverScale=.75,o.baseScale=.35,o.dragScale=.55,o._positionOffset=d.Vector3.Zero(),o._updateInterpolationTarget(),o._lastTick=Date.now(),o._onBeforeRender=o.getScene().onBeforeRenderObservable.add((function(){var t=Date.now(),e=t-o._lastTick,i=o._targetScale-o._scale,r=d.TmpColors.Color3[0].copyFrom(o._targetColor).subtractToRef(o._color,d.TmpColors.Color3[0]);o._scale=o._scale+i*e/o.animationLength,r.scaleToRef(e/o.animationLength,r),o._color.addToRef(r,o._color),o.setColor3("color",o._color),o.setFloat("scale",o._scale),o.setVector3("positionOffset",o._positionOffset),o._lastTick=t})),o}return l(e,t),Object.defineProperty(e.prototype,"hover",{get:function(){return this._hover},set:function(t){this._hover=t,this._updateInterpolationTarget()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drag",{get:function(){return this._drag},set:function(t){this._drag=t,this._updateInterpolationTarget()},enumerable:!1,configurable:!0}),e.prototype._updateInterpolationTarget=function(){this.drag?(this._targetColor=this.hoverColor,this._targetScale=this.dragScale):this.hover?(this._targetColor=this.hoverColor,this._targetScale=this.hoverScale):(this._targetColor=this.baseColor,this._targetScale=this.baseScale)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.getScene().onBeforeRenderObservable.remove(this._onBeforeRender)},e}(d.ShaderMaterial);!function(t){t[t.IDLE=0]="IDLE",t[t.HOVER=1]="HOVER",t[t.DRAG=2]="DRAG"}(At||(At={}));var Qt=function(){function t(t,e){this._state=0,this._materials=[],this._scene=e,this._gizmo=t,this.node=this.createNode(),this.node.reservedDataStore={handle:this}}return Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gizmo",{get:function(){return this._gizmo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hover",{set:function(t){t?this._state|=1:this._state&=-2,this._updateMaterial()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drag",{set:function(t){t?this._state|=2:this._state&=-3,this._updateMaterial()},enumerable:!1,configurable:!0}),t.prototype._createMaterial=function(t){var e=new zt("handle",this._scene);return t&&(e._positionOffset=t),e},t.prototype._updateMaterial=function(){for(var t=this._state,e=0,i=this._materials;ei?this.minDimensions.x/t.x:this.minDimensions.y/t.y}this._dimensions.copyFrom(t).scaleInPlace(e),this._updatePivot(),this._positionElements()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"titleBarHeight",{get:function(){return this._titleBarHeight},set:function(t){this._titleBarHeight=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._titleBar.renderingGroupId},set:function(t){this._titleBar.renderingGroupId=t,this._titleBarTitle.renderingGroupId=t,this._contentPlate.renderingGroupId=t,this._backPlate.renderingGroupId=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this._titleText},set:function(t){this._titleText=t,this._titleTextComponent&&(this._titleTextComponent.text=t)},enumerable:!1,configurable:!0}),e.prototype._applyFacade=function(t){this._contentMaterial.albedoTexture=t,this._resetContentPositionAndZoom(),this._applyContentViewport(),t.attachToMesh(this._contentPlate,!0)},e.prototype._addControl=function(t){t._host=this._host,this._host.utilityLayer&&t._prepareNode(this._host.utilityLayer.utilityLayerScene)},e.prototype._getTypeName=function(){return"HolographicSlate"},e.prototype._positionElements=function(){var t=this._followButton,i=this._closeButton,o=this._titleBar,r=this._titleBarTitle,n=this._contentPlate,a=this._backPlate;if(t&&i&&o){i.scaling.setAll(this.titleBarHeight),t.scaling.setAll(this.titleBarHeight),i.position.copyFromFloats(this.dimensions.x-this.titleBarHeight/2,-this.titleBarHeight/2,0).addInPlace(this.origin),t.position.copyFromFloats(this.dimensions.x-3*this.titleBarHeight/2,-this.titleBarHeight/2,0).addInPlace(this.origin);var s=this.dimensions.y-this.titleBarHeight-this.titleBarMargin,l=n.getScene().useRightHandedSystem;o.scaling.set(this.dimensions.x,this.titleBarHeight,d.Epsilon),r.scaling.set(this.dimensions.x-2*this.titleBarHeight,this.titleBarHeight,d.Epsilon),n.scaling.copyFromFloats(this.dimensions.x,s,d.Epsilon),a.scaling.copyFromFloats(this.dimensions.x,s,d.Epsilon),o.position.copyFromFloats(this.dimensions.x/2,-this.titleBarHeight/2,0).addInPlace(this.origin),r.position.copyFromFloats(this.dimensions.x/2-this.titleBarHeight,-this.titleBarHeight/2,l?d.Epsilon:-d.Epsilon).addInPlace(this.origin),n.position.copyFromFloats(this.dimensions.x/2,-(this.titleBarHeight+this.titleBarMargin+s/2),0).addInPlace(this.origin),a.position.copyFromFloats(this.dimensions.x/2,-(this.titleBarHeight+this.titleBarMargin+s/2),l?-d.Epsilon:d.Epsilon).addInPlace(this.origin),this._titleTextComponent.host.scaleTo(e._DEFAULT_TEXT_RESOLUTION_Y*r.scaling.x/r.scaling.y,e._DEFAULT_TEXT_RESOLUTION_Y);var _=this.dimensions.x/s;this._contentViewport.width=this._contentScaleRatio,this._contentViewport.height=this._contentScaleRatio/_,this._applyContentViewport(),this._gizmo&&this._gizmo.updateBoundingBox()}},e.prototype._applyContentViewport=function(){var t;if((null===(t=this._contentPlate)||void 0===t?void 0:t.material)&&this._contentPlate.material.albedoTexture){var e=this._contentPlate.material.albedoTexture;e.uScale=this._contentScaleRatio,e.vScale=this.fitContentToDimensions?this._contentScaleRatio:this._contentScaleRatio/this._contentViewport.width*this._contentViewport.height,e.uOffset=this._contentViewport.x,e.vOffset=this._contentViewport.y}},e.prototype._resetContentPositionAndZoom=function(){this._contentViewport.x=0,this._contentViewport.y=0,this._contentScaleRatio=1},e.prototype._updatePivot=function(){if(this.mesh){var t=new d.Vector3(.5*this.dimensions.x,.5*-this.dimensions.y,d.Epsilon);t.addInPlace(this.origin),t.z=0;var e=new d.Vector3(0,0,0);d.Vector3.TransformCoordinatesToRef(e,this.mesh.computeWorldMatrix(!0),e),this.mesh.setPivotPoint(t);var i=new d.Vector3(0,0,0);d.Vector3.TransformCoordinatesToRef(i,this.mesh.computeWorldMatrix(!0),i),this.mesh.position.addInPlace(e).subtractInPlace(i)}},e.prototype._createNode=function(t){var i=this,o=new d.Mesh("slate_"+this.name,t);this._titleBar=(0,d.CreateBox)("titleBar_"+this.name,{size:1},t),this._titleBarTitle=(0,d.CreatePlane)("titleText_"+this.name,{size:1},t),this._titleBarTitle.parent=o,this._titleBarTitle.isPickable=!1;var r=ct.CreateForMesh(this._titleBarTitle);if(this._titleTextComponent=new S("titleText_"+this.name,this._titleText),this._titleTextComponent.textWrapping=2,this._titleTextComponent.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,this._titleTextComponent.color="white",this._titleTextComponent.fontSize=e._DEFAULT_TEXT_RESOLUTION_Y/2,this._titleTextComponent.paddingLeft=e._DEFAULT_TEXT_RESOLUTION_Y/4,r.addControl(this._titleTextComponent),t.useRightHandedSystem){var n=new d.Vector4(0,0,1,1);this._contentPlate=(0,d.CreatePlane)("contentPlate_"+this.name,{size:1,sideOrientation:d.VertexData.BACKSIDE,frontUVs:n},t),this._backPlate=(0,d.CreatePlane)("backPlate_"+this.name,{size:1,sideOrientation:d.VertexData.FRONTSIDE},t)}else n=new d.Vector4(0,0,1,1),this._contentPlate=(0,d.CreatePlane)("contentPlate_"+this.name,{size:1,sideOrientation:d.VertexData.FRONTSIDE,frontUVs:n},t),this._backPlate=(0,d.CreatePlane)("backPlate_"+this.name,{size:1,sideOrientation:d.VertexData.BACKSIDE},t);this._titleBar.parent=o,this._titleBar.isNearGrabbable=!0,this._contentPlate.parent=o,this._backPlate.parent=o,this._attachContentPlateBehavior(),this._addControl(this._followButton),this._addControl(this._closeButton);var a=this._followButton,s=this._closeButton;return a.node.parent=o,s.node.parent=o,this._positionElements(),this._followButton.imageUrl=e.ASSETS_BASE_URL+e.FOLLOW_ICON_FILENAME,this._closeButton.imageUrl=e.ASSETS_BASE_URL+e.CLOSE_ICON_FILENAME,this._followButton.isBackplateVisible=!1,this._closeButton.isBackplateVisible=!1,this._followButton.onToggleObservable.add((function(t){i._defaultBehavior.followBehaviorEnabled=t,i._defaultBehavior.followBehaviorEnabled&&i._defaultBehavior.followBehavior.recenter()})),this._closeButton.onPointerClickObservable.add((function(){i.dispose()})),o.rotationQuaternion=d.Quaternion.Identity(),o.isVisible=!1,o},e.prototype._attachContentPlateBehavior=function(){var t=this;this._contentDragBehavior.attach(this._contentPlate),this._contentDragBehavior.moveAttached=!1,this._contentDragBehavior.useObjectOrientationForDragging=!0,this._contentDragBehavior.updateDragPlane=!1;var e,i,o=new d.Vector3,r=new d.Vector3,n=new d.Vector3,a=new d.Vector3,s=new d.Vector2;this._contentDragBehavior.onDragStartObservable.add((function(s){t.node&&(e=t._contentViewport.clone(),i=t.node.computeWorldMatrix(!0),o.copyFrom(s.dragPlanePoint),r.set(t.dimensions.x,t.dimensions.y,d.Epsilon),r.y-=t.titleBarHeight+t.titleBarMargin,d.Vector3.TransformNormalToRef(r,i,r),n.copyFromFloats(0,1,0),d.Vector3.TransformNormalToRef(n,i,n),a.copyFromFloats(1,0,0),d.Vector3.TransformNormalToRef(a,i,a),n.normalize(),n.scaleInPlace(1/d.Vector3.Dot(n,r)),a.normalize(),a.scaleInPlace(1/d.Vector3.Dot(a,r)))}));var l=new d.Vector3;this._contentDragBehavior.onDragObservable.add((function(i){t.fitContentToDimensions||(l.copyFrom(i.dragPlanePoint),l.subtractInPlace(o),s.copyFromFloats(d.Vector3.Dot(l,a),d.Vector3.Dot(l,n)),t._contentViewport.x=d.Scalar.Clamp(e.x-l.x,0,1-t._contentViewport.width*t._contentScaleRatio),t._contentViewport.y=d.Scalar.Clamp(e.y-l.y,0,1-t._contentViewport.height*t._contentScaleRatio),t._applyContentViewport())}))},e.prototype._affectMaterial=function(t){this._titleBarMaterial=new wt("".concat(this.name," plateMaterial"),t.getScene()),this._contentMaterial=new Tt("".concat(this.name," contentMaterial"),t.getScene()),this._contentMaterial.renderBorders=!0,this._backMaterial=new wt("".concat(this.name," backPlate"),t.getScene()),this._backMaterial.lineWidth=d.Epsilon,this._backMaterial.radius=.005,this._backMaterial.backFaceCulling=!0,this._titleBar.material=this._titleBarMaterial,this._contentPlate.material=this._contentMaterial,this._backPlate.material=this._backMaterial,this._resetContent(),this._applyContentViewport()},e.prototype._prepareNode=function(e){var i=this;t.prototype._prepareNode.call(this,e),this._gizmo=new Ht(this._host.utilityLayer),this._gizmo.attachedSlate=this,this._defaultBehavior=new Nt,this._defaultBehavior.attach(this.node,[this._titleBar]),this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add((function(){i._followButton.isToggled=!1})),this._positionChangedObserver=this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add((function(){i._gizmo.updateBoundingBox()})),this._updatePivot(),this.resetDefaultAspectAndPose(!1)},e.prototype.resetDefaultAspectAndPose=function(t){if(void 0===t&&(t=!0),this._host&&this._host.utilityLayer&&this.node){var e=this._host.utilityLayer.utilityLayerScene,i=e.activeCamera;if(i){var o=i.getWorldMatrix(),r=d.Vector3.TransformNormal(d.Vector3.Backward(e.useRightHandedSystem),o);this.origin.setAll(0),this._gizmo.updateBoundingBox();var n=this.node.getAbsolutePivotPoint();this.node.position.equalsToFloats(0,0,0)&&this.node.position.copyFrom(i.position).subtractInPlace(r).subtractInPlace(n),this.node.rotationQuaternion=d.Quaternion.FromLookDirectionLH(r,new d.Vector3(0,1,0)),t&&(this.dimensions=this.defaultDimensions)}}},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._titleBarMaterial.dispose(),this._contentMaterial.dispose(),this._titleBar.dispose(),this._titleBarTitle.dispose(),this._contentPlate.dispose(),this._backPlate.dispose(),this._followButton.dispose(),this._closeButton.dispose(),this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.remove(this._positionChangedObserver),this._defaultBehavior.detach(),this._gizmo.dispose(),this._contentDragBehavior.detach()},e.ASSETS_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.CLOSE_ICON_FILENAME="IconClose.png",e.FOLLOW_ICON_FILENAME="IconFollowMe.png",e._DEFAULT_TEXT_RESOLUTION_Y=102.4,e}(vt),Ut=function(t){function e(e,i){var o=t.call(this,i)||this;return o._currentMesh=e,o.pointerEnterAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1.1)},o.pointerOutAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/1.1)},o.pointerDownAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(.95)},o.pointerUpAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/.95)},o}return l(e,t),e.prototype._getTypeName=function(){return"MeshButton3D"},e.prototype._createNode=function(t){var e=this;return this._currentMesh.getChildMeshes().forEach((function(t){e._injectGUI3DReservedDataStore(t).control=e})),this._currentMesh},e.prototype._affectMaterial=function(t){},e}(xt),jt=function(t){function e(e){var i=t.call(this,e)||this;return i._isPinned=!1,i._defaultBehavior=new Nt,i._dragObserver=i._defaultBehavior.sixDofDragBehavior.onDragObservable.add((function(){i.isPinned=!0})),i.backPlateMargin=1,i}return l(e,t),Object.defineProperty(e.prototype,"defaultBehavior",{get:function(){return this._defaultBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPinned",{get:function(){return this._isPinned},set:function(t){this._pinButton.isToggled===t?(this._isPinned=t,this._defaultBehavior.followBehaviorEnabled=!t):this._pinButton.isToggled=t},enumerable:!1,configurable:!0}),e.prototype._createPinButton=function(t){var i=this,o=new Lt("pin"+this.name,!1);return o.imageUrl=e._ASSETS_BASE_URL+e._PIN_ICON_FILENAME,o.parent=this,o._host=this._host,o.isToggleButton=!0,o.onToggleObservable.add((function(t){i.isPinned=t})),this._host.utilityLayer&&(o._prepareNode(this._host.utilityLayer.utilityLayerScene),o.scaling.scaleInPlace(St.MENU_BUTTON_SCALE),o.node&&(o.node.parent=t)),o},e.prototype._createNode=function(e){var i=t.prototype._createNode.call(this,e);return this._pinButton=this._createPinButton(i),this.isPinned=!1,this._defaultBehavior.attach(i,[this._backPlate]),this._defaultBehavior.followBehavior.ignoreCameraPitchAndRoll=!0,this._defaultBehavior.followBehavior.pitchOffset=-15,this._defaultBehavior.followBehavior.minimumDistance=.3,this._defaultBehavior.followBehavior.defaultDistance=.4,this._defaultBehavior.followBehavior.maximumDistance=.6,this._backPlate.isNearGrabbable=!0,i.isVisible=!1,i},e.prototype._finalProcessing=function(){t.prototype._finalProcessing.call(this),this._pinButton.position.copyFromFloats((this._backPlate.scaling.x+St.MENU_BUTTON_SCALE)/2,this._backPlate.scaling.y/2,0)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._defaultBehavior.sixDofDragBehavior.onDragObservable.remove(this._dragObserver),this._defaultBehavior.detach()},e._ASSETS_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e._PIN_ICON_FILENAME="IconPin.png",e}(St),Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype._mapGridNode=function(t,e){var i=t.mesh;if(i){t.position=e.clone();var o=d.TmpVectors.Vector3[0];switch(o.copyFrom(e),this.orientation){case Pt.FACEORIGIN_ORIENTATION:case Pt.FACEFORWARD_ORIENTATION:o.addInPlace(new d.Vector3(0,0,1)),i.lookAt(o);break;case Pt.FACEFORWARDREVERSED_ORIENTATION:case Pt.FACEORIGINREVERSED_ORIENTATION:o.addInPlace(new d.Vector3(0,0,-1)),i.lookAt(o)}}},e}(It),Xt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._iteration=100,e}return l(e,t),Object.defineProperty(e.prototype,"iteration",{get:function(){return this._iteration},set:function(t){var e=this;this._iteration!==t&&(this._iteration=t,d.Tools.SetImmediate((function(){e._arrangeChildren()})))},enumerable:!1,configurable:!0}),e.prototype._mapGridNode=function(t,e){var i=t.mesh,o=this._scatterMapping(e);if(i){switch(this.orientation){case Pt.FACEORIGIN_ORIENTATION:case Pt.FACEFORWARD_ORIENTATION:i.lookAt(new d.Vector3(0,0,1));break;case Pt.FACEFORWARDREVERSED_ORIENTATION:case Pt.FACEORIGINREVERSED_ORIENTATION:i.lookAt(new d.Vector3(0,0,-1))}t.position=o}},e.prototype._scatterMapping=function(t){return t.x=(1-2*Math.random())*this._cellWidth,t.y=(1-2*Math.random())*this._cellHeight,t},e.prototype._finalProcessing=function(){for(var t=[],e=0,i=this._children;eo?-1:0}));for(var n=Math.pow(this.margin,2),a=Math.max(this._cellWidth,this._cellHeight),s=d.TmpVectors.Vector2[0],l=d.TmpVectors.Vector3[0],_=0;_0.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }\nreturn C;}\nvoid Sky_Environment_B50(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{Reflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}\nvoid Min_Segment_Distance_B65(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}\nif (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}\nvoid To_XYZ_B74(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Finger_Positions_B64(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}\nvoid VaryHSV_B108(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}\nvoid Remap_Range_B114(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid To_HSV_B75(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Conditional_Float_B36(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Greater_Than_B37(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}\nvoid Remap_Range_B105(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid main()\n{vec2 XY_Q85;XY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q27;vec3 Tangent_World_N_Q27;float Tangent_Length_Q27;Tangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q27=length(Tangent_World_Q27);Tangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;vec3 Normal_World_Q60;vec3 Normal_World_N_Q60;float Normal_Length_Q60;Object_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);float X_Q78;float Y_Q78;float Z_Q78;To_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);vec3 Nrm_World_Q26;Nrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q28;vec3 Binormal_World_N_Q28;float Binormal_Length_Q28;Object_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);float Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;float Result_Q69;Pick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);float Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;bool Not_Greater_Than_Q37;bool Greater_Than_Q37;Greater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);vec4 Linear_Q101;Linear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q101.a=_Left_Color_.a;vec4 Linear_Q102;Linear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q102.a=_Right_Color_.a;vec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;vec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);float Result_Q36;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);float Result_Q94;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);vec3 New_P_Q130;vec2 New_UV_Q130;float Radial_Gradient_Q130;vec3 Radial_Dir_Q130;vec3 New_Normal_Q130;Move_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);float X_Q98;float Y_Q98;X_Q98=New_UV_Q130.x;Y_Q98=New_UV_Q130.y;vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);vec3 Nrm_World_Q32;Object_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);vec4 Blob_Info_Q23;\n#if BLOB_ENABLE\nBlob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23);\n#else\nBlob_Info_Q23=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q24;\n#if BLOB_ENABLE_2\nBlob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24);\n#else\nBlob_Info_Q24=vec4(0,0,0,0);\n#endif\nfloat Out_Q105;Remap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);float X_Q86;float Y_Q86;float Z_Q86;To_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);vec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);float Minus_F_Q87=-Z_Q86;float R_Q99;float G_Q99;float B_Q99;float A_Q99;R_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;float ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);float Result_Q93;Conditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);vec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);vec3 Position=Pos_World_Q12;vec3 Normal=Nrm_World_Q32;vec2 UV=XY_Q85;vec3 Tangent=Tangent_World_N_Q27;vec3 Binormal=Difference_Q61;vec4 Color=Out_Color_Q34;vec4 Extra1=Vec4_Q89;vec4 Extra2=Blob_Info_Q23;vec4 Extra3=Blob_Info_Q24;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var Kt=function(t){function e(){var e=t.call(this)||this;return e.SKY_ENABLED=!0,e.BLOB_ENABLE_2=!0,e.IRIDESCENCE_ENABLED=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),Zt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.6,r.bevelFront=.6,r.bevelFrontStretch=.077,r.bevelBack=0,r.bevelBackStretch=0,r.radiusTopLeft=1,r.radiusTopRight=1,r.radiusBottomLeft=1,r.radiusBottomRight=1,r.bulgeEnabled=!1,r.bulgeHeight=-.323,r.bulgeRadius=.73,r.sunIntensity=1.102,r.sunTheta=.76,r.sunPhi=.526,r.indirectDiffuse=.658,r.albedo=new d.Color4(.0117647,.505882,.996078,1),r.specular=0,r.shininess=10,r.sharpness=0,r.subsurface=0,r.leftGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.rightGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.reflection=.749,r.frontReflect=0,r.edgeReflect=.09,r.power=8.13,r.skyColor=new d.Color4(.0117647,.964706,.996078,1),r.horizonColor=new d.Color4(.0117647,.333333,.996078,1),r.groundColor=new d.Color4(0,.254902,.996078,1),r.horizonPower=1,r.width=.02,r.fuzz=.5,r.minFuzz=.001,r.clipFade=.01,r.hueShift=0,r.saturationShift=0,r.valueShift=0,r.blobPosition=new d.Vector3(0,0,.1),r.blobIntensity=.5,r.blobNearSize=.01,r.blobFarSize=.03,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.576,r.blobPulse=0,r.blobFade=1,r.blobPosition2=new d.Vector3(.2,0,.1),r.blobNearSize2=.01,r.blobPulse2=0,r.blobFade2=1,r.blobTexture=new d.Texture("",r.getScene()),r.leftIndexPosition=new d.Vector3(0,0,1),r.rightIndexPosition=new d.Vector3(-1,-1,-1),r.leftIndexMiddlePosition=new d.Vector3(0,0,0),r.rightIndexMiddlePosition=new d.Vector3(0,0,0),r.decalScaleXY=new d.Vector2(1.5,1.5),r.decalFrontOnly=!0,r.rimIntensity=.287,r.rimHueShift=0,r.rimSaturationShift=0,r.rimValueShift=-1,r.iridescenceIntensity=0,r.useGlobalLeftIndex=1,r.useGlobalRightIndex=1,r.globalLeftIndexTipProximity=0,r.globalRightIndexTipProximity=0,r.globalLeftIndexTipPosition=new d.Vector4(.5,0,-.55,1),r.globaRightIndexTipPosition=new d.Vector4(0,0,0,1),r.globalLeftThumbTipPosition=new d.Vector4(.5,0,-.55,1),r.globalRightThumbTipPosition=new d.Vector4(0,0,0,1),r.globalLeftIndexMiddlePosition=new d.Vector4(.5,0,-.55,1),r.globalRightIndexMiddlePosition=new d.Vector4(0,0,0,1),r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._blueGradientTexture=new d.Texture(e.BLUE_GRADIENT_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r._decalTexture=new d.Texture("",r.getScene()),r._reflectionMapTexture=new d.Texture("",r.getScene()),r._indirectEnvTexture=new d.Texture("",r.getScene()),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new Kt);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Bevel_Front_","_Bevel_Front_Stretch_","_Bevel_Back_","_Bevel_Back_Stretch_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Bulge_Enabled_","_Bulge_Height_","_Bulge_Radius_","_Sun_Intensity_","_Sun_Theta_","_Sun_Phi_","_Indirect_Diffuse_","_Albedo_","_Specular_","_Shininess_","_Sharpness_","_Subsurface_","_Left_Color_","_Right_Color_","_Reflection_","_Front_Reflect_","_Edge_Reflect_","_Power_","_Sky_Color_","_Horizon_Color_","_Ground_Color_","_Horizon_Power_","_Reflection_Map_","_Indirect_Environment_","_Width_","_Fuzz_","_Min_Fuzz_","_Clip_Fade_","_Hue_Shift_","_Saturation_Shift_","_Value_Shift_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Left_Index_Pos_","_Right_Index_Pos_","_Left_Index_Middle_Pos_","_Right_Index_Middle_Pos_","_Decal_","_Decal_Scale_XY_","_Decal_Front_Only_","_Rim_Intensity_","_Rim_Texture_","_Rim_Hue_Shift_","_Rim_Saturation_Shift_","_Rim_Value_Shift_","_Iridescence_Intensity_","_Iridescence_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Middle_Position;","Global_Right_Index_Middle_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],h=["_Rim_Texture_","_Iridescence_Texture_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlSliderBar",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o,this._materialContext)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){if(i.materialDefines){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Bevel_Front_",this.bevelFront),this._activeEffect.setFloat("_Bevel_Front_Stretch_",this.bevelFrontStretch),this._activeEffect.setFloat("_Bevel_Back_",this.bevelBack),this._activeEffect.setFloat("_Bevel_Back_Stretch_",this.bevelBackStretch),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Bulge_Enabled_",this.bulgeEnabled?1:0),this._activeEffect.setFloat("_Bulge_Height_",this.bulgeHeight),this._activeEffect.setFloat("_Bulge_Radius_",this.bulgeRadius),this._activeEffect.setFloat("_Sun_Intensity_",this.sunIntensity),this._activeEffect.setFloat("_Sun_Theta_",this.sunTheta),this._activeEffect.setFloat("_Sun_Phi_",this.sunPhi),this._activeEffect.setFloat("_Indirect_Diffuse_",this.indirectDiffuse),this._activeEffect.setDirectColor4("_Albedo_",this.albedo),this._activeEffect.setFloat("_Specular_",this.specular),this._activeEffect.setFloat("_Shininess_",this.shininess),this._activeEffect.setFloat("_Sharpness_",this.sharpness),this._activeEffect.setFloat("_Subsurface_",this.subsurface),this._activeEffect.setDirectColor4("_Left_Color_",this.leftGradientColor),this._activeEffect.setDirectColor4("_Right_Color_",this.rightGradientColor),this._activeEffect.setFloat("_Reflection_",this.reflection),this._activeEffect.setFloat("_Front_Reflect_",this.frontReflect),this._activeEffect.setFloat("_Edge_Reflect_",this.edgeReflect),this._activeEffect.setFloat("_Power_",this.power),this._activeEffect.setDirectColor4("_Sky_Color_",this.skyColor),this._activeEffect.setDirectColor4("_Horizon_Color_",this.horizonColor),this._activeEffect.setDirectColor4("_Ground_Color_",this.groundColor),this._activeEffect.setFloat("_Horizon_Power_",this.horizonPower),this._activeEffect.setTexture("_Reflection_Map_",this._reflectionMapTexture),this._activeEffect.setTexture("_Indirect_Environment_",this._indirectEnvTexture),this._activeEffect.setFloat("_Width_",this.width),this._activeEffect.setFloat("_Fuzz_",this.fuzz),this._activeEffect.setFloat("_Min_Fuzz_",this.minFuzz),this._activeEffect.setFloat("_Clip_Fade_",this.clipFade),this._activeEffect.setFloat("_Hue_Shift_",this.hueShift),this._activeEffect.setFloat("_Saturation_Shift_",this.saturationShift),this._activeEffect.setFloat("_Value_Shift_",this.valueShift),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this.blobTexture),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setVector3("_Left_Index_Pos_",this.leftIndexPosition),this._activeEffect.setVector3("_Right_Index_Pos_",this.rightIndexPosition),this._activeEffect.setVector3("_Left_Index_Middle_Pos_",this.leftIndexMiddlePosition),this._activeEffect.setVector3("_Right_Index_Middle_Pos_",this.rightIndexMiddlePosition),this._activeEffect.setTexture("_Decal_",this._decalTexture),this._activeEffect.setVector2("_Decal_Scale_XY_",this.decalScaleXY),this._activeEffect.setFloat("_Decal_Front_Only_",this.decalFrontOnly?1:0),this._activeEffect.setFloat("_Rim_Intensity_",this.rimIntensity),this._activeEffect.setTexture("_Rim_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("_Rim_Hue_Shift_",this.rimHueShift),this._activeEffect.setFloat("_Rim_Saturation_Shift_",this.rimSaturationShift),this._activeEffect.setFloat("_Rim_Value_Shift_",this.rimValueShift),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setTexture("_Iridescence_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("Use_Global_Left_Index",this.useGlobalLeftIndex),this._activeEffect.setFloat("Use_Global_Right_Index",this.useGlobalRightIndex),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this.globalLeftIndexTipPosition),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this.globaRightIndexTipPosition),this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position",this.globalLeftThumbTipPosition),this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position",this.globalRightThumbTipPosition),this._activeEffect.setVector4("Global_Left_Index_Middle_Position",this.globalLeftIndexMiddlePosition),this._activeEffect.setVector4("Global_Right_Index_Middle_Position",this.globalRightIndexMiddlePosition),this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity",this.globalLeftIndexTipProximity),this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity",this.globalRightIndexTipProximity),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),this._reflectionMapTexture.dispose(),this._indirectEnvTexture.dispose(),this._blueGradientTexture.dispose(),this._decalTexture.dispose()},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.MRDLSliderBarMaterial",e},e.prototype.getClassName=function(){return"MRDLSliderBarMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLUE_GRADIENT_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"bevelFront",void 0),h([(0,d.serialize)()],e.prototype,"bevelFrontStretch",void 0),h([(0,d.serialize)()],e.prototype,"bevelBack",void 0),h([(0,d.serialize)()],e.prototype,"bevelBackStretch",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopRight",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomRight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeEnabled",void 0),h([(0,d.serialize)()],e.prototype,"bulgeHeight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeRadius",void 0),h([(0,d.serialize)()],e.prototype,"sunIntensity",void 0),h([(0,d.serialize)()],e.prototype,"sunTheta",void 0),h([(0,d.serialize)()],e.prototype,"sunPhi",void 0),h([(0,d.serialize)()],e.prototype,"indirectDiffuse",void 0),h([(0,d.serialize)()],e.prototype,"albedo",void 0),h([(0,d.serialize)()],e.prototype,"specular",void 0),h([(0,d.serialize)()],e.prototype,"shininess",void 0),h([(0,d.serialize)()],e.prototype,"sharpness",void 0),h([(0,d.serialize)()],e.prototype,"subsurface",void 0),h([(0,d.serialize)()],e.prototype,"leftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"rightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"reflection",void 0),h([(0,d.serialize)()],e.prototype,"frontReflect",void 0),h([(0,d.serialize)()],e.prototype,"edgeReflect",void 0),h([(0,d.serialize)()],e.prototype,"power",void 0),h([(0,d.serialize)()],e.prototype,"skyColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonColor",void 0),h([(0,d.serialize)()],e.prototype,"groundColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonPower",void 0),h([(0,d.serialize)()],e.prototype,"width",void 0),h([(0,d.serialize)()],e.prototype,"fuzz",void 0),h([(0,d.serialize)()],e.prototype,"minFuzz",void 0),h([(0,d.serialize)()],e.prototype,"clipFade",void 0),h([(0,d.serialize)()],e.prototype,"hueShift",void 0),h([(0,d.serialize)()],e.prototype,"saturationShift",void 0),h([(0,d.serialize)()],e.prototype,"valueShift",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition2",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"blobTexture",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"decalScaleXY",void 0),h([(0,d.serialize)()],e.prototype,"decalFrontOnly",void 0),h([(0,d.serialize)()],e.prototype,"rimIntensity",void 0),h([(0,d.serialize)()],e.prototype,"rimHueShift",void 0),h([(0,d.serialize)()],e.prototype,"rimSaturationShift",void 0),h([(0,d.serialize)()],e.prototype,"rimValueShift",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLSliderBarMaterial",Zt);d.ShaderStore.ShadersStore.mrdlSliderThumbPixelShader="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B180(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }\nreturn C;}\nvoid Sky_Environment_B200(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{Reflected_Color=SampleEnv_Bid200(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}\nvoid Min_Segment_Distance_B215(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}\nif (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}\nvoid To_XYZ_B224(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Finger_Positions_B214(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}\nvoid VaryHSV_B258(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}\nvoid Remap_Range_B264(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid To_HSV_B225(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Conditional_Float_B186(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Greater_Than_B187(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}\nvoid Remap_Range_B255(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid main()\n{vec2 XY_Q235;XY_Q235=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q177;vec3 Tangent_World_N_Q177;float Tangent_Length_Q177;Tangent_World_Q177=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q177=length(Tangent_World_Q177);Tangent_World_N_Q177=Tangent_World_Q177/Tangent_Length_Q177;vec3 Normal_World_Q210;vec3 Normal_World_N_Q210;float Normal_Length_Q210;Object_To_World_Dir_B210(vec3(0,0,1),Normal_World_Q210,Normal_World_N_Q210,Normal_Length_Q210);float X_Q228;float Y_Q228;float Z_Q228;To_XYZ_B228(position,X_Q228,Y_Q228,Z_Q228);vec3 Nrm_World_Q176;Nrm_World_Q176=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q178;vec3 Binormal_World_N_Q178;float Binormal_Length_Q178;Object_To_World_Dir_B178(vec3(0,1,0),Binormal_World_Q178,Binormal_World_N_Q178,Binormal_Length_Q178);float Anisotropy_Q179=Tangent_Length_Q177/Binormal_Length_Q178;float Result_Q219;Pick_Radius_B219(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q219);float Anisotropy_Q203=Binormal_Length_Q178/Normal_Length_Q210;bool Not_Greater_Than_Q187;bool Greater_Than_Q187;Greater_Than_B187(Z_Q228,0.0,Not_Greater_Than_Q187,Greater_Than_Q187);vec4 Linear_Q251;Linear_Q251.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q251.a=_Left_Color_.a;vec4 Linear_Q252;Linear_Q252.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q252.a=_Right_Color_.a;vec3 Difference_Q211=vec3(0,0,0)-Normal_World_N_Q210;vec4 Out_Color_Q184=vec4(X_Q228,Y_Q228,Z_Q228,1);float Result_Q186;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_,_Bevel_Front_,Result_Q186);float Result_Q244;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q244);vec3 New_P_Q280;vec2 New_UV_Q280;float Radial_Gradient_Q280;vec3 Radial_Dir_Q280;vec3 New_Normal_Q280;Move_Verts_B280(Anisotropy_Q179,position,Result_Q219,Result_Q186,normal,Anisotropy_Q203,Result_Q244,New_P_Q280,New_UV_Q280,Radial_Gradient_Q280,Radial_Dir_Q280,New_Normal_Q280);float X_Q248;float Y_Q248;X_Q248=New_UV_Q280.x;Y_Q248=New_UV_Q280.y;vec3 Pos_World_Q162;Object_To_World_Pos_B162(New_P_Q280,Pos_World_Q162);vec3 Nrm_World_Q182;Object_To_World_Normal_B182(New_Normal_Q280,Nrm_World_Q182);vec4 Blob_Info_Q173;\n#if BLOB_ENABLE\nBlob_Vertex_B173(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q173);\n#else\nBlob_Info_Q173=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q174;\n#if BLOB_ENABLE_2\nBlob_Vertex_B174(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q174);\n#else\nBlob_Info_Q174=vec4(0,0,0,0);\n#endif\nfloat Out_Q255;Remap_Range_B255(0.0,1.0,0.0,1.0,X_Q248,Out_Q255);float X_Q236;float Y_Q236;float Z_Q236;To_XYZ_B228(Nrm_World_Q182,X_Q236,Y_Q236,Z_Q236);vec4 Color_At_T_Q247=mix(Linear_Q251,Linear_Q252,Out_Q255);float Minus_F_Q237=-Z_Q236;float R_Q249;float G_Q249;float B_Q249;float A_Q249;R_Q249=Color_At_T_Q247.r; G_Q249=Color_At_T_Q247.g; B_Q249=Color_At_T_Q247.b; A_Q249=Color_At_T_Q247.a;float ClampF_Q238=clamp(0.0,Minus_F_Q237,1.0);float Result_Q243;Conditional_Float_B243(_Decal_Front_Only_,ClampF_Q238,1.0,Result_Q243);vec4 Vec4_Q239=vec4(Result_Q243,Radial_Gradient_Q280,G_Q249,B_Q249);vec3 Position=Pos_World_Q162;vec3 Normal=Nrm_World_Q182;vec2 UV=XY_Q235;vec3 Tangent=Tangent_World_N_Q177;vec3 Binormal=Difference_Q211;vec4 Color=Out_Color_Q184;vec4 Extra1=Vec4_Q239;vec4 Extra2=Blob_Info_Q173;vec4 Extra3=Blob_Info_Q174;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var qt=function(t){function e(){var e=t.call(this)||this;return e.SKY_ENABLED=!0,e.BLOB_ENABLE_2=!0,e.IRIDESCENCE_ENABLED=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),Jt=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.157,r.bevelFront=.065,r.bevelFrontStretch=.077,r.bevelBack=.031,r.bevelBackStretch=0,r.radiusTopLeft=1,r.radiusTopRight=1,r.radiusBottomLeft=1,r.radiusBottomRight=1,r.bulgeEnabled=!1,r.bulgeHeight=-.323,r.bulgeRadius=.73,r.sunIntensity=2,r.sunTheta=.937,r.sunPhi=.555,r.indirectDiffuse=1,r.albedo=new d.Color4(.0117647,.505882,.996078,1),r.specular=0,r.shininess=10,r.sharpness=0,r.subsurface=.31,r.leftGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.rightGradientColor=new d.Color4(.0117647,.505882,.996078,1),r.reflection=.749,r.frontReflect=0,r.edgeReflect=.09,r.power=8.1,r.skyColor=new d.Color4(.0117647,.960784,.996078,1),r.horizonColor=new d.Color4(.0117647,.333333,.996078,1),r.groundColor=new d.Color4(0,.254902,.996078,1),r.horizonPower=1,r.width=.02,r.fuzz=.5,r.minFuzz=.001,r.clipFade=.01,r.hueShift=0,r.saturationShift=0,r.valueShift=0,r.blobPosition=new d.Vector3(0,0,.1),r.blobIntensity=.5,r.blobNearSize=.01,r.blobFarSize=.03,r.blobNearDistance=0,r.blobFarDistance=.08,r.blobFadeLength=.576,r.blobPulse=0,r.blobFade=1,r.blobPosition2=new d.Vector3(.2,0,.1),r.blobNearSize2=.01,r.blobPulse2=0,r.blobFade2=1,r.blobTexture=new d.Texture("",r.getScene()),r.leftIndexPosition=new d.Vector3(0,0,1),r.rightIndexPosition=new d.Vector3(-1,-1,-1),r.leftIndexMiddlePosition=new d.Vector3(0,0,0),r.rightIndexMiddlePosition=new d.Vector3(0,0,0),r.decalScaleXY=new d.Vector2(1.5,1.5),r.decalFrontOnly=!0,r.rimIntensity=.287,r.rimHueShift=0,r.rimSaturationShift=0,r.rimValueShift=-1,r.iridescenceIntensity=0,r.useGlobalLeftIndex=1,r.useGlobalRightIndex=1,r.globalLeftIndexTipProximity=0,r.globalRightIndexTipProximity=0,r.globalLeftIndexTipPosition=new d.Vector4(.5,0,-.55,1),r.globaRightIndexTipPosition=new d.Vector4(0,0,0,1),r.globalLeftThumbTipPosition=new d.Vector4(.5,0,-.55,1),r.globalRightThumbTipPosition=new d.Vector4(0,0,0,1),r.globalLeftIndexMiddlePosition=new d.Vector4(.5,0,-.55,1),r.globalRightIndexMiddlePosition=new d.Vector4(0,0,0,1),r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._blueGradientTexture=new d.Texture(e.BLUE_GRADIENT_TEXTURE_URL,o,!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r._decalTexture=new d.Texture("",r.getScene()),r._reflectionMapTexture=new d.Texture("",r.getScene()),r._indirectEnvTexture=new d.Texture("",r.getScene()),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new qt);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Bevel_Front_","_Bevel_Front_Stretch_","_Bevel_Back_","_Bevel_Back_Stretch_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Bulge_Enabled_","_Bulge_Height_","_Bulge_Radius_","_Sun_Intensity_","_Sun_Theta_","_Sun_Phi_","_Indirect_Diffuse_","_Albedo_","_Specular_","_Shininess_","_Sharpness_","_Subsurface_","_Left_Color_","_Right_Color_","_Reflection_","_Front_Reflect_","_Edge_Reflect_","_Power_","_Sky_Color_","_Horizon_Color_","_Ground_Color_","_Horizon_Power_","_Reflection_Map_","_Indirect_Environment_","_Width_","_Fuzz_","_Min_Fuzz_","_Clip_Fade_","_Hue_Shift_","_Saturation_Shift_","_Value_Shift_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Left_Index_Pos_","_Right_Index_Pos_","_Left_Index_Middle_Pos_","_Right_Index_Middle_Pos_","_Decal_","_Decal_Scale_XY_","_Decal_Front_Only_","_Rim_Intensity_","_Rim_Texture_","_Rim_Hue_Shift_","_Rim_Saturation_Shift_","_Rim_Value_Shift_","_Iridescence_Intensity_","_Iridescence_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Middle_Position;","Global_Right_Index_Middle_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],h=["_Rim_Texture_","_Iridescence_Texture_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlSliderThumb",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){if(i.materialDefines){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Bevel_Front_",this.bevelFront),this._activeEffect.setFloat("_Bevel_Front_Stretch_",this.bevelFrontStretch),this._activeEffect.setFloat("_Bevel_Back_",this.bevelBack),this._activeEffect.setFloat("_Bevel_Back_Stretch_",this.bevelBackStretch),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Bulge_Enabled_",this.bulgeEnabled?1:0),this._activeEffect.setFloat("_Bulge_Height_",this.bulgeHeight),this._activeEffect.setFloat("_Bulge_Radius_",this.bulgeRadius),this._activeEffect.setFloat("_Sun_Intensity_",this.sunIntensity),this._activeEffect.setFloat("_Sun_Theta_",this.sunTheta),this._activeEffect.setFloat("_Sun_Phi_",this.sunPhi),this._activeEffect.setFloat("_Indirect_Diffuse_",this.indirectDiffuse),this._activeEffect.setDirectColor4("_Albedo_",this.albedo),this._activeEffect.setFloat("_Specular_",this.specular),this._activeEffect.setFloat("_Shininess_",this.shininess),this._activeEffect.setFloat("_Sharpness_",this.sharpness),this._activeEffect.setFloat("_Subsurface_",this.subsurface),this._activeEffect.setDirectColor4("_Left_Color_",this.leftGradientColor),this._activeEffect.setDirectColor4("_Right_Color_",this.rightGradientColor),this._activeEffect.setFloat("_Reflection_",this.reflection),this._activeEffect.setFloat("_Front_Reflect_",this.frontReflect),this._activeEffect.setFloat("_Edge_Reflect_",this.edgeReflect),this._activeEffect.setFloat("_Power_",this.power),this._activeEffect.setDirectColor4("_Sky_Color_",this.skyColor),this._activeEffect.setDirectColor4("_Horizon_Color_",this.horizonColor),this._activeEffect.setDirectColor4("_Ground_Color_",this.groundColor),this._activeEffect.setFloat("_Horizon_Power_",this.horizonPower),this._activeEffect.setTexture("_Reflection_Map_",this._reflectionMapTexture),this._activeEffect.setTexture("_Indirect_Environment_",this._indirectEnvTexture),this._activeEffect.setFloat("_Width_",this.width),this._activeEffect.setFloat("_Fuzz_",this.fuzz),this._activeEffect.setFloat("_Min_Fuzz_",this.minFuzz),this._activeEffect.setFloat("_Clip_Fade_",this.clipFade),this._activeEffect.setFloat("_Hue_Shift_",this.hueShift),this._activeEffect.setFloat("_Saturation_Shift_",this.saturationShift),this._activeEffect.setFloat("_Value_Shift_",this.valueShift),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this.blobTexture),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setVector3("_Left_Index_Pos_",this.leftIndexPosition),this._activeEffect.setVector3("_Right_Index_Pos_",this.rightIndexPosition),this._activeEffect.setVector3("_Left_Index_Middle_Pos_",this.leftIndexMiddlePosition),this._activeEffect.setVector3("_Right_Index_Middle_Pos_",this.rightIndexMiddlePosition),this._activeEffect.setTexture("_Decal_",this._decalTexture),this._activeEffect.setVector2("_Decal_Scale_XY_",this.decalScaleXY),this._activeEffect.setFloat("_Decal_Front_Only_",this.decalFrontOnly?1:0),this._activeEffect.setFloat("_Rim_Intensity_",this.rimIntensity),this._activeEffect.setTexture("_Rim_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("_Rim_Hue_Shift_",this.rimHueShift),this._activeEffect.setFloat("_Rim_Saturation_Shift_",this.rimSaturationShift),this._activeEffect.setFloat("_Rim_Value_Shift_",this.rimValueShift),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setTexture("_Iridescence_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("Use_Global_Left_Index",this.useGlobalLeftIndex),this._activeEffect.setFloat("Use_Global_Right_Index",this.useGlobalRightIndex),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this.globalLeftIndexTipPosition),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this.globaRightIndexTipPosition),this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position",this.globalLeftThumbTipPosition),this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position",this.globalRightThumbTipPosition),this._activeEffect.setVector4("Global_Left_Index_Middle_Position",this.globalLeftIndexMiddlePosition),this._activeEffect.setVector4("Global_Right_Index_Middle_Position",this.globalRightIndexMiddlePosition),this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity",this.globalLeftIndexTipProximity),this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity",this.globalRightIndexTipProximity),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),this._reflectionMapTexture.dispose(),this._indirectEnvTexture.dispose(),this._blueGradientTexture.dispose(),this._decalTexture.dispose()},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.MRDLSliderThumbMaterial",e},e.prototype.getClassName=function(){return"MRDLSliderThumbMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLUE_GRADIENT_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"bevelFront",void 0),h([(0,d.serialize)()],e.prototype,"bevelFrontStretch",void 0),h([(0,d.serialize)()],e.prototype,"bevelBack",void 0),h([(0,d.serialize)()],e.prototype,"bevelBackStretch",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopRight",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomRight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeEnabled",void 0),h([(0,d.serialize)()],e.prototype,"bulgeHeight",void 0),h([(0,d.serialize)()],e.prototype,"bulgeRadius",void 0),h([(0,d.serialize)()],e.prototype,"sunIntensity",void 0),h([(0,d.serialize)()],e.prototype,"sunTheta",void 0),h([(0,d.serialize)()],e.prototype,"sunPhi",void 0),h([(0,d.serialize)()],e.prototype,"indirectDiffuse",void 0),h([(0,d.serialize)()],e.prototype,"albedo",void 0),h([(0,d.serialize)()],e.prototype,"specular",void 0),h([(0,d.serialize)()],e.prototype,"shininess",void 0),h([(0,d.serialize)()],e.prototype,"sharpness",void 0),h([(0,d.serialize)()],e.prototype,"subsurface",void 0),h([(0,d.serialize)()],e.prototype,"leftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"rightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"reflection",void 0),h([(0,d.serialize)()],e.prototype,"frontReflect",void 0),h([(0,d.serialize)()],e.prototype,"edgeReflect",void 0),h([(0,d.serialize)()],e.prototype,"power",void 0),h([(0,d.serialize)()],e.prototype,"skyColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonColor",void 0),h([(0,d.serialize)()],e.prototype,"groundColor",void 0),h([(0,d.serialize)()],e.prototype,"horizonPower",void 0),h([(0,d.serialize)()],e.prototype,"width",void 0),h([(0,d.serialize)()],e.prototype,"fuzz",void 0),h([(0,d.serialize)()],e.prototype,"minFuzz",void 0),h([(0,d.serialize)()],e.prototype,"clipFade",void 0),h([(0,d.serialize)()],e.prototype,"hueShift",void 0),h([(0,d.serialize)()],e.prototype,"saturationShift",void 0),h([(0,d.serialize)()],e.prototype,"valueShift",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition2",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"blobTexture",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexPosition",void 0),h([(0,d.serialize)()],e.prototype,"leftIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"rightIndexMiddlePosition",void 0),h([(0,d.serialize)()],e.prototype,"decalScaleXY",void 0),h([(0,d.serialize)()],e.prototype,"decalFrontOnly",void 0),h([(0,d.serialize)()],e.prototype,"rimIntensity",void 0),h([(0,d.serialize)()],e.prototype,"rimHueShift",void 0),h([(0,d.serialize)()],e.prototype,"rimSaturationShift",void 0),h([(0,d.serialize)()],e.prototype,"rimValueShift",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLSliderThumbMaterial",Jt);d.ShaderStore.ShadersStore.mrdlBackplatePixelShader="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;void FastLinearTosRGB_B353(\nvec4 Linear,\nout vec4 sRGB)\n{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}\nvoid Round_Rect_Fragment_B332(\nfloat Radius,\nfloat Line_Width,\nvec4 Line_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Line_Visibility,\nvec4 Rect_Parms,\nvec4 Fill_Color,\nout vec4 Color)\n{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;}\nvoid Iridescence_B343(\nvec3 Position,\nvec3 Normal,\nvec2 UV,\nvec3 Axis,\nvec3 Eye,\nvec4 Tint,\nsampler2D Texture,\nbool Reflected,\nfloat Frequency,\nfloat Vertical_Offset,\nout vec4 Color)\n{vec3 i=normalize(Position-Eye);vec3 r=reflect(i,Normal);float idota=dot(i,Axis);float idotr=dot(i,r);float x=Reflected ? idotr : idota;vec2 xy;xy.x=fract((x*Frequency+1.0)*0.5+UV.y*Vertical_Offset);xy.y=0.5;Color=texture(Texture,xy);Color.rgb*=Tint.rgb;}\nvoid Scale_RGB_B346(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Scale_RGB_B344(\nfloat Scalar,\nvec4 Color,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Line_Fragment_B362(\nvec4 Base_Color,\nvec4 Highlight_Color,\nfloat Highlight_Width,\nvec3 Line_Vertex,\nfloat Highlight,\nout vec4 Line_Color)\n{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);}\nvoid Edge_B356(\nvec4 RectParms,\nfloat Radius,\nfloat Line_Width,\nvec2 UV,\nfloat Edge_Width,\nfloat Edge_Power,\nout float Result)\n{float d=length(max(abs(UV)-RectParms.xy,0.0));float edge=1.0-clamp((1.0-d/(Radius-Line_Width))/Edge_Width,0.0,1.0);Result=pow(edge,Edge_Power);}\nvoid Gradient_B355(\nvec4 Gradient_Color,\nvec4 Top_Left,\nvec4 Top_Right,\nvec4 Bottom_Left,\nvec4 Bottom_Right,\nvec2 UV,\nout vec4 Result)\n{vec3 top=Top_Left.rgb+(Top_Right.rgb-Top_Left.rgb)*UV.x;vec3 bottom=Bottom_Left.rgb+(Bottom_Right.rgb-Bottom_Left.rgb)*UV.x;Result.rgb=Gradient_Color.rgb*(bottom+(top-bottom)*UV.y);Result.a=1.0;}\nvoid main()\n{float X_Q338;float Y_Q338;float Z_Q338;float W_Q338;X_Q338=vExtra2.x;Y_Q338=vExtra2.y;Z_Q338=vExtra2.z;W_Q338=vExtra2.w;vec4 Color_Q343;\n#if IRIDESCENCE_ENABLE\nIridescence_B343(vPosition,vNormal,vUV,vBinormal,cameraPosition,_Iridescence_Tint_,_Iridescent_Map_,_Reflected_,_Frequency_,_Vertical_Offset_,Color_Q343);\n#else\nColor_Q343=vec4(0,0,0,0);\n#endif\nvec4 Result_Q344;Scale_RGB_B344(_Iridescence_Intensity_,Color_Q343,Result_Q344);vec4 Line_Color_Q362;Line_Fragment_B362(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q362);float Result_Q356;\n#if EDGE_ONLY\nEdge_B356(vExtra1,Z_Q338,W_Q338,vUV,_Edge_Width_,_Edge_Power_,Result_Q356);\n#else\nResult_Q356=1.0;\n#endif\nvec2 Vec2_Q339=vec2(X_Q338,Y_Q338);vec4 Result_Q355;Gradient_B355(_Gradient_Color_,_Top_Left_,_Top_Right_,_Bottom_Left_,_Bottom_Right_,Vec2_Q339,Result_Q355);vec4 Linear_Q348;Linear_Q348.rgb=clamp(Result_Q355.rgb*Result_Q355.rgb,0.0,1.0);Linear_Q348.a=Result_Q355.a;vec4 Result_Q346;Scale_RGB_B346(Linear_Q348,Result_Q356,Result_Q346);vec4 Sum_Q345=Result_Q346+Result_Q344;vec4 Color_At_T_Q347=mix(Line_Color_Q362,Result_Q346,_Line_Gradient_Blend_);vec4 Base_And_Iridescent_Q350;Base_And_Iridescent_Q350=_Base_Color_+vec4(Sum_Q345.rgb,0.0);vec4 Sum_Q349=Color_At_T_Q347+_Iridescence_Edge_Intensity_*Color_Q343;vec4 Result_Q351=Sum_Q349; Result_Q351.a=1.0;vec4 Color_Q332;Round_Rect_Fragment_B332(Z_Q338,W_Q338,Result_Q351,_Filter_Width_,vUV,1.0,vExtra1,Base_And_Iridescent_Q350,Color_Q332);vec4 Result_Q354=_Fade_Out_*Color_Q332;vec4 sRGB_Q353;FastLinearTosRGB_B353(Result_Q354,sRGB_Q353);vec4 Out_Color=sRGB_Q353;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.mrdlBackplateVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec3 tangent;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;void Object_To_World_Pos_B314(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Round_Rect_Vertex_B357(\nvec2 UV,\nfloat Radius,\nfloat Margin,\nfloat Anisotropy,\nfloat Gradient1,\nfloat Gradient2,\nvec3 Normal,\nvec4 Color_Scale_Translate,\nout vec2 Rect_UV,\nout vec4 Rect_Parms,\nout vec2 Scale_XY,\nout vec2 Line_UV,\nout vec2 Color_UV_Info)\n{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; \nRect_Parms.w=Gradient2;Color_UV_Info=(Line_UV+vec2(0.5,0.5))*Color_Scale_Translate.xy+Color_Scale_Translate.zw;}\nvoid Line_Vertex_B333(\nvec2 Scale_XY,\nvec2 UV,\nfloat Time,\nfloat Rate,\nvec4 Highlight_Transform,\nout vec3 Line_Vertex)\n{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; }\nvoid PickDir_B334(\nfloat Degrees,\nvec3 DirX,\nvec3 DirY,\nout vec3 Dir)\n{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;}\nvoid Move_Verts_B327(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir)\n{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);}\nvoid Pick_Radius_B336(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Edge_AA_Vertex_B328(\nvec3 Position_World,\nvec3 Position_Object,\nvec3 Normal_Object,\nvec3 Eye,\nfloat Radial_Gradient,\nvec3 Radial_Dir,\nvec3 Tangent,\nout float Gradient1,\nout float Gradient2)\n{vec3 I=(Eye-Position_World);vec3 T=(vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { \nGradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}\nvoid Object_To_World_Dir_B330(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}\nvoid RelativeOrAbsoluteDetail_B341(\nfloat Nominal_Radius,\nfloat Nominal_LineWidth,\nbool Absolute_Measurements,\nfloat Height,\nout float Radius,\nout float Line_Width)\n{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;}\nvoid main()\n{vec3 Nrm_World_Q326;Nrm_World_Q326=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q329;vec3 Tangent_World_N_Q329;float Tangent_Length_Q329;Tangent_World_Q329=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q329=length(Tangent_World_Q329);Tangent_World_N_Q329=Tangent_World_Q329/Tangent_Length_Q329;vec3 Binormal_World_Q330;vec3 Binormal_World_N_Q330;float Binormal_Length_Q330;Object_To_World_Dir_B330(vec3(0,1,0),Binormal_World_Q330,Binormal_World_N_Q330,Binormal_Length_Q330);float Radius_Q341;float Line_Width_Q341;RelativeOrAbsoluteDetail_B341(_Radius_,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q330,Radius_Q341,Line_Width_Q341);vec3 Dir_Q334;PickDir_B334(_Angle_,Tangent_World_N_Q329,Binormal_World_N_Q330,Dir_Q334);float Result_Q336;Pick_Radius_B336(Radius_Q341,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q336);float Anisotropy_Q331=Tangent_Length_Q329/Binormal_Length_Q330;vec4 Out_Color_Q337=vec4(Result_Q336,Line_Width_Q341,0,1);vec3 New_P_Q327;vec2 New_UV_Q327;float Radial_Gradient_Q327;vec3 Radial_Dir_Q327;Move_Verts_B327(Anisotropy_Q331,position,Result_Q336,New_P_Q327,New_UV_Q327,Radial_Gradient_Q327,Radial_Dir_Q327);vec3 Pos_World_Q314;Object_To_World_Pos_B314(New_P_Q327,Pos_World_Q314);float Gradient1_Q328;float Gradient2_Q328;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B328(Pos_World_Q314,position,normal,cameraPosition,Radial_Gradient_Q327,Radial_Dir_Q327,tangent,Gradient1_Q328,Gradient2_Q328);\n#else\nGradient1_Q328=1.0;Gradient2_Q328=1.0;\n#endif\nvec2 Rect_UV_Q357;vec4 Rect_Parms_Q357;vec2 Scale_XY_Q357;vec2 Line_UV_Q357;vec2 Color_UV_Info_Q357;Round_Rect_Vertex_B357(New_UV_Q327,Result_Q336,0.0,Anisotropy_Q331,Gradient1_Q328,Gradient2_Q328,normal,vec4(1,1,0,0),Rect_UV_Q357,Rect_Parms_Q357,Scale_XY_Q357,Line_UV_Q357,Color_UV_Info_Q357);vec3 Line_Vertex_Q333;Line_Vertex_B333(Scale_XY_Q357,Line_UV_Q357,(20.0),_Rate_,_Highlight_Transform_,Line_Vertex_Q333);float X_Q359;float Y_Q359;X_Q359=Color_UV_Info_Q357.x;Y_Q359=Color_UV_Info_Q357.y;vec4 Vec4_Q358=vec4(X_Q359,Y_Q359,Result_Q336,Line_Width_Q341);vec3 Position=Pos_World_Q314;vec3 Normal=Nrm_World_Q326;vec2 UV=Rect_UV_Q357;vec3 Tangent=Line_Vertex_Q333;vec3 Binormal=Dir_Q334;vec4 Color=Out_Color_Q337;vec4 Extra1=Rect_Parms_Q357;vec4 Extra2=Vec4_Q358;vec4 Extra3=vec4(0,0,0,0);gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vExtra1=Extra1;vExtra2=Extra2;}";var $t=function(t){function e(){var e=t.call(this)||this;return e.IRIDESCENCE_ENABLE=!0,e.SMOOTH_EDGES=!0,e._needNormals=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),te=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.3,r.lineWidth=.003,r.absoluteSizes=!1,r._filterWidth=1,r.baseColor=new d.Color4(0,0,0,1),r.lineColor=new d.Color4(.2,.262745,.4,1),r.radiusTopLeft=1,r.radiusTopRight=1,r.radiusBottomLeft=1,r.radiusBottomRight=1,r._rate=0,r.highlightColor=new d.Color4(.239216,.435294,.827451,1),r.highlightWidth=0,r._highlightTransform=new d.Vector4(1,1,0,0),r._highlight=1,r.iridescenceIntensity=.45,r.iridescenceEdgeIntensity=1,r.iridescenceTint=new d.Color4(1,1,1,1),r._angle=-45,r.fadeOut=1,r._reflected=!0,r._frequency=1,r._verticalOffset=0,r.gradientColor=new d.Color4(.74902,.74902,.74902,1),r.topLeftGradientColor=new d.Color4(.00784314,.294118,.580392,1),r.topRightGradientColor=new d.Color4(.305882,0,1,1),r.bottomLeftGradientColor=new d.Color4(.133333,.258824,.992157,1),r.bottomRightGradientColor=new d.Color4(.176471,.176471,.619608,1),r.edgeWidth=.5,r.edgePower=1,r.edgeLineGradientBlend=.5,r.alphaMode=d.Constants.ALPHA_DISABLE,r.backFaceCulling=!1,r._iridescentMapTexture=new d.Texture(e.IRIDESCENT_MAP_TEXTURE_URL,r.getScene(),!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!1},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new $t);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Absolute_Sizes_","_Filter_Width_","_Base_Color_","_Line_Color_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Rate_","_Highlight_Color_","_Highlight_Width_","_Highlight_Transform_","_Highlight_","_Iridescence_Intensity_","_Iridescence_Edge_Intensity_","_Iridescence_Tint_","_Iridescent_Map_","_Angle_","_Reflected_","_Frequency_","_Vertical_Offset_","_Gradient_Color_","_Top_Left_","_Top_Right_","_Bottom_Left_","_Bottom_Right_","_Edge_Width_","_Edge_Power_","_Line_Gradient_Blend_","_Fade_Out_"],h=["_Iridescent_Map_"],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlBackplate",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){if(i.materialDefines){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Base_Color_",this.baseColor),this._activeEffect.setDirectColor4("_Line_Color_",this.lineColor),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Rate_",this._rate),this._activeEffect.setDirectColor4("_Highlight_Color_",this.highlightColor),this._activeEffect.setFloat("_Highlight_Width_",this.highlightWidth),this._activeEffect.setVector4("_Highlight_Transform_",this._highlightTransform),this._activeEffect.setFloat("_Highlight_",this._highlight),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setFloat("_Iridescence_Edge_Intensity_",this.iridescenceEdgeIntensity),this._activeEffect.setDirectColor4("_Iridescence_Tint_",this.iridescenceTint),this._activeEffect.setTexture("_Iridescent_Map_",this._iridescentMapTexture),this._activeEffect.setFloat("_Angle_",this._angle),this._activeEffect.setFloat("_Reflected_",this._reflected?1:0),this._activeEffect.setFloat("_Frequency_",this._frequency),this._activeEffect.setFloat("_Vertical_Offset_",this._verticalOffset),this._activeEffect.setDirectColor4("_Gradient_Color_",this.gradientColor),this._activeEffect.setDirectColor4("_Top_Left_",this.topLeftGradientColor),this._activeEffect.setDirectColor4("_Top_Right_",this.topRightGradientColor),this._activeEffect.setDirectColor4("_Bottom_Left_",this.bottomLeftGradientColor),this._activeEffect.setDirectColor4("_Bottom_Right_",this.bottomRightGradientColor),this._activeEffect.setFloat("_Edge_Width_",this.edgeWidth),this._activeEffect.setFloat("_Edge_Power_",this.edgePower),this._activeEffect.setFloat("_Line_Gradient_Blend_",this.edgeLineGradientBlend),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return e.customType="BABYLON.MRDLBackplateMaterial",e},e.prototype.getClassName=function(){return"MRDLBackplateMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.IRIDESCENT_MAP_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"absoluteSizes",void 0),h([(0,d.serialize)()],e.prototype,"baseColor",void 0),h([(0,d.serialize)()],e.prototype,"lineColor",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusTopRight",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomLeft",void 0),h([(0,d.serialize)()],e.prototype,"radiusBottomRight",void 0),h([(0,d.serialize)()],e.prototype,"highlightColor",void 0),h([(0,d.serialize)()],e.prototype,"highlightWidth",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceIntensity",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceEdgeIntensity",void 0),h([(0,d.serialize)()],e.prototype,"iridescenceTint",void 0),h([(0,d.serialize)()],e.prototype,"fadeOut",void 0),h([(0,d.serialize)()],e.prototype,"gradientColor",void 0),h([(0,d.serialize)()],e.prototype,"topLeftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"topRightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"bottomLeftGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"bottomRightGradientColor",void 0),h([(0,d.serialize)()],e.prototype,"edgeWidth",void 0),h([(0,d.serialize)()],e.prototype,"edgePower",void 0),h([(0,d.serialize)()],e.prototype,"edgeLineGradientBlend",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLBackplateMaterial",te);var ee=function(t){function e(e,i){var o=t.call(this,e)||this;return o.onValueChangedObservable=new d.Observable,o._sliderBackplateVisible=i||!1,o._minimum=0,o._maximum=100,o._step=0,o._value=50,o}return l(e,t),Object.defineProperty(e.prototype,"mesh",{get:function(){return this.node?this._sliderThumb:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minimum",{get:function(){return this._minimum},set:function(t){this._minimum!==t&&(this._minimum=Math.max(t,0),this._value=Math.max(Math.min(this._value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){this._maximum!==t&&(this._maximum=Math.max(t,this._minimum),this._value=Math.max(Math.min(this._value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this._step},set:function(t){this._step!==t&&(this._step=Math.max(Math.min(t,this._maximum-this._minimum),0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){this._value!==t&&(this._value=Math.max(Math.min(t,this._maximum),this._minimum),this._sliderThumb&&(this._sliderThumb.position.x=this._convertToPosition(this.value)),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.node?this._sliderBar.position.x-this._sliderBar.scaling.x/2:-.5},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.node?this._sliderBar.position.x+this._sliderBar.scaling.x/2:.5},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBarMaterial",{get:function(){return this._sliderBarMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderThumbMaterial",{get:function(){return this._sliderThumbMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBackplateMaterial",{get:function(){return this._sliderBackplateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBar",{get:function(){return this._sliderBar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderThumb",{get:function(){return this._sliderThumb},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sliderBackplate",{get:function(){return this._sliderBackplate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{set:function(t){var e;this._isVisible!==t&&(this._isVisible=t,null===(e=this.node)||void 0===e||e.setEnabled(t))},enumerable:!1,configurable:!0}),e.prototype._createNode=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_sliderbackplate"),{width:1,height:1,depth:1},t);return o.isPickable=!1,o.visibility=0,o.scaling=new d.Vector3(1,.5,.8),d.SceneLoader.ImportMeshAsync(void 0,e.MODEL_BASE_URL,e.MODEL_FILENAME,t).then((function(t){t.meshes.forEach((function(t){t.isPickable=!1}));var e=t.meshes[1],r=t.meshes[1].clone("".concat(i.name,"_sliderbar"),o),n=t.meshes[1].clone("".concat(i.name,"_sliderthumb"),o);e.visibility=0,i._sliderBackplateVisible&&(e.visibility=1,e.name="".concat(i.name,"_sliderbackplate"),e.scaling.x=1,e.scaling.z=.2,e.parent=o,i._sliderBackplateMaterial&&(e.material=i._sliderBackplateMaterial),i._sliderBackplate=e),r&&(r.parent=o,r.position.z=-.1,r.scaling=new d.Vector3(.8,.04,.3),i._sliderBarMaterial&&(r.material=i._sliderBarMaterial),i._sliderBar=r),n&&(n.parent=o,n.isPickable=!0,n.position.z=-.115,n.scaling=new d.Vector3(.025,.3,.6),n.position.x=i._convertToPosition(i.value),n.addBehavior(i._createBehavior()),i._sliderThumbMaterial&&(n.material=i._sliderThumbMaterial),i._sliderThumb=n),i._injectGUI3DReservedDataStore(o).control=i,o.getChildMeshes().forEach((function(t){i._injectGUI3DReservedDataStore(t).control=i}))})),this._affectMaterial(o),o},e.prototype._affectMaterial=function(t){var e,i,o;this._sliderBackplateMaterial=null!==(e=this._sliderBackplateMaterial)&&void 0!==e?e:new te("".concat(this.name,"_sliderbackplate_material"),t.getScene()),this._sliderBarMaterial=null!==(i=this._sliderBarMaterial)&&void 0!==i?i:new Zt("".concat(this.name,"_sliderbar_material"),t.getScene()),this._sliderThumbMaterial=null!==(o=this._sliderThumbMaterial)&&void 0!==o?o:new Jt("".concat(this.name,"_sliderthumb_material"),t.getScene())},e.prototype._createBehavior=function(){var t=this,e=new d.PointerDragBehavior({dragAxis:d.Vector3.Right()});return e.moveAttached=!1,e.onDragStartObservable.add((function(){t._draggedPosition=t._sliderThumb.position.x})),e.onDragObservable.add((function(e){t._draggedPosition+=e.dragDistance/t.scaling.x,t.value=t._convertToValue(t._draggedPosition)})),e},e.prototype._convertToPosition=function(t){var e=(t-this.minimum)/(this.maximum-this.minimum)*(this.end-this.start)+this.start;return Math.min(Math.max(e,this.start),this.end)},e.prototype._convertToValue=function(t){var e=(t-this.start)/(this.end-this.start)*(this.maximum-this.minimum);return e=this.step?Math.round(e/this.step)*this.step:e,Math.max(Math.min(this.minimum+e,this._maximum),this._minimum)},e.prototype.dispose=function(){var e,i,o,r,n,a;t.prototype.dispose.call(this),null===(e=this._sliderBar)||void 0===e||e.dispose(),null===(i=this._sliderThumb)||void 0===i||i.dispose(),null===(o=this._sliderBarMaterial)||void 0===o||o.dispose(),null===(r=this._sliderThumbMaterial)||void 0===r||r.dispose(),null===(n=this._sliderBackplate)||void 0===n||n.dispose(),null===(a=this._sliderBackplateMaterial)||void 0===a||a.dispose()},e.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",e.MODEL_FILENAME="mrtk-fluent-backplate.glb",e}(mt),ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._radius=5,e}return l(e,t),Object.defineProperty(e.prototype,"radius",{get:function(){return this._radius},set:function(t){var e=this;this._radius!==t&&(this._radius=t,d.Tools.SetImmediate((function(){e._arrangeChildren()})))},enumerable:!1,configurable:!0}),e.prototype._mapGridNode=function(t,e){var i=t.mesh;if(i){var o=this._sphericalMapping(e);switch(t.position=o,this.orientation){case Pt.FACEORIGIN_ORIENTATION:i.lookAt(new d.Vector3(2*o.x,2*o.y,2*o.z));break;case Pt.FACEORIGINREVERSED_ORIENTATION:i.lookAt(new d.Vector3(-o.x,-o.y,-o.z));break;case Pt.FACEFORWARD_ORIENTATION:break;case Pt.FACEFORWARDREVERSED_ORIENTATION:i.rotate(d.Axis.Y,Math.PI,0)}}},e.prototype._sphericalMapping=function(t){var e=new d.Vector3(0,0,this._radius),i=t.y/this._radius,o=-t.x/this._radius;return d.Matrix.RotationYawPitchRollToRef(o,i,0,d.TmpVectors.Matrix[0]),d.Vector3.TransformNormal(e,d.TmpVectors.Matrix[0])},e}(It),oe=function(t){function e(e){void 0===e&&(e=!1);var i=t.call(this)||this;return i._isVertical=!1,i.margin=.1,i._isVertical=e,i}return l(e,t),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){var e=this;this._isVertical!==t&&(this._isVertical=t,d.Tools.SetImmediate((function(){e._arrangeChildren()})))},enumerable:!1,configurable:!0}),e.prototype._arrangeChildren=function(){for(var t,e=0,i=0,o=0,r=[],n=d.Matrix.Invert(this.node.computeWorldMatrix(!0)),a=0,s=this._children;a0?this.margin:0)}},e}(Pt),re=function(t){function e(e,i){var o=t.call(this,i,e)||this;return o._currentMesh=e,o.pointerEnterAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1.1)},o.pointerOutAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/1.1)},o.pointerDownAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(.95)},o.pointerUpAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/.95)},o}return l(e,t),e.prototype._getTypeName=function(){return"TouchMeshButton3D"},e.prototype._createNode=function(){var t=this;return this._currentMesh.getChildMeshes().forEach((function(e){t._injectGUI3DReservedDataStore(e).control=t})),this._currentMesh},e.prototype._affectMaterial=function(t){},e}(kt);d.ShaderStore.ShadersStore.mrdlBackglowPixelShader="uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;float BiasFunc(float b,float v) {return pow(v,log(clamp(b,0.001,0.999))/log(0.5));}\nvoid Fuzzy_Round_Rect_B33(\nfloat Size_X,\nfloat Size_Y,\nfloat Radius_X,\nfloat Radius_Y,\nfloat Line_Width,\nvec2 UV,\nfloat Outer_Fuzz,\nfloat Max_Outer_Fuzz,\nout float Rect_Distance,\nout float Inner_Distance)\n{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius_X,Radius_Y),halfSize),vec2(0.001,0.001));float radius=min(r.x,r.y)-Max_Outer_Fuzz;vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);float d=distance(nearestp,v);Inner_Distance=clamp(1.0-(radius-d)/Line_Width,0.0,1.0);Rect_Distance=clamp(1.0-(d-radius)/Outer_Fuzz,0.0,1.0)*Inner_Distance;}\nvoid main()\n{float X_Q42;float Y_Q42;X_Q42=vNormal.x;Y_Q42=vNormal.y;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Sqrt_F_Q27=sqrt(MaxAB_Q24);float Power_Q43=pow(MaxAB_Q24,_Intensity_Fade_In_Exponent_);float Value_At_T_Q26=mix(_Outer_Fuzz_Start_,_Outer_Fuzz_End_,Sqrt_F_Q27);float Product_Q23=_Max_Intensity_*Power_Q43;float Rect_Distance_Q33;float Inner_Distance_Q33;Fuzzy_Round_Rect_B33(X_Q42,Y_Q42,_Bevel_Radius_,_Bevel_Radius_,_Line_Width_,vUV,Value_At_T_Q26,_Outer_Fuzz_Start_,Rect_Distance_Q33,Inner_Distance_Q33);float Power_Q44=pow(Inner_Distance_Q33,_Blend_Exponent_);float Result_Q45=pow(BiasFunc(_Bias_,Rect_Distance_Q33),_Falloff_);vec4 Color_At_T_Q25=mix(_Inner_Color_,_Color_,Power_Q44);float Product_Q22=Result_Q45*Product_Q23;vec4 Result_Q28=Product_Q22*Color_At_T_Q25;vec4 Out_Color=Result_Q28;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.mrdlBackglowVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;varying vec3 vNormal;varying vec2 vUV;void main()\n{vec3 Dir_World_Q41=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q40=(world*vec4((cross(normal,tangent)),0.0)).xyz;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Length_Q16=length(Dir_World_Q41);float Length_Q17=length(Dir_World_Q40);bool Greater_Than_Q37=MaxAB_Q24>0.0;vec3 Sizes_Q35;vec2 XY_Q35;Sizes_Q35=(_Absolute_Sizes_ ? vec3(Length_Q16,Length_Q17,0) : vec3(Length_Q16/Length_Q17,1,0));XY_Q35=(uv-vec2(0.5,0.5))*Sizes_Q35.xy;vec3 Result_Q38=Greater_Than_Q37 ? position : vec3(0,0,0);vec3 Pos_World_Q39=(world*vec4(Result_Q38,1.0)).xyz;vec3 Position=Pos_World_Q39;vec3 Normal=Sizes_Q35;vec2 UV=XY_Q35;vec3 Tangent=vec3(0,0,0);vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;}";var ne=function(t){function e(){var e=t.call(this)||this;return e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),ae=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o.bevelRadius=.16,o.lineWidth=.16,o.absoluteSizes=!1,o.tuningMotion=0,o.motion=1,o.maxIntensity=.7,o.intensityFadeInExponent=2,o.outerFuzzStart=.04,o.outerFuzzEnd=.04,o.color=new d.Color4(.682353,.698039,1,1),o.innerColor=new d.Color4(.356863,.392157,.796078,1),o.blendExponent=1.5,o.falloff=2,o.bias=.5,o.alphaMode=d.Constants.ALPHA_ADD,o.disableDepthWrite=!0,o.backFaceCulling=!1,o}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new ne);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Bevel_Radius_","_Line_Width_","_Absolute_Sizes_","_Tuning_Motion_","_Motion_","_Max_Intensity_","_Intensity_Fade_In_Exponent_","_Outer_Fuzz_Start_","_Outer_Fuzz_End_","_Color_","_Inner_Color_","_Blend_Exponent_","_Falloff_","_Bias_"],h=[],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlBackglow",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setFloat("_Bevel_Radius_",this.bevelRadius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Tuning_Motion_",this.tuningMotion),this._activeEffect.setFloat("_Motion_",this.motion),this._activeEffect.setFloat("_Max_Intensity_",this.maxIntensity),this._activeEffect.setFloat("_Intensity_Fade_In_Exponent_",this.intensityFadeInExponent),this._activeEffect.setFloat("_Outer_Fuzz_Start_",this.outerFuzzStart),this._activeEffect.setFloat("_Outer_Fuzz_End_",this.outerFuzzEnd),this._activeEffect.setDirectColor4("_Color_",this.color),this._activeEffect.setDirectColor4("_Inner_Color_",this.innerColor),this._activeEffect.setFloat("_Blend_Exponent_",this.blendExponent),this._activeEffect.setFloat("_Falloff_",this.falloff),this._activeEffect.setFloat("_Bias_",this.bias),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var t=d.SerializationHelper.Serialize(this);return t.customType="BABYLON.MRDLBackglowMaterial",t},e.prototype.getClassName=function(){return"MRDLBackglowMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},h([(0,d.serialize)()],e.prototype,"bevelRadius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"absoluteSizes",void 0),h([(0,d.serialize)()],e.prototype,"tuningMotion",void 0),h([(0,d.serialize)()],e.prototype,"motion",void 0),h([(0,d.serialize)()],e.prototype,"maxIntensity",void 0),h([(0,d.serialize)()],e.prototype,"intensityFadeInExponent",void 0),h([(0,d.serialize)()],e.prototype,"outerFuzzStart",void 0),h([(0,d.serialize)()],e.prototype,"outerFuzzEnd",void 0),h([(0,d.serialize)()],e.prototype,"color",void 0),h([(0,d.serialize)()],e.prototype,"innerColor",void 0),h([(0,d.serialize)()],e.prototype,"blendExponent",void 0),h([(0,d.serialize)()],e.prototype,"falloff",void 0),h([(0,d.serialize)()],e.prototype,"bias",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLBackglowMaterial",ae);d.ShaderStore.ShadersStore.mrdlFrontplatePixelShader="uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Scale_Color_B54(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=Scalar*Color;}\nvoid Scale_RGB_B50(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Proximity_Fragment_B51(\nfloat Proximity_Max_Intensity,\nfloat Proximity_Near_Radius,\nvec4 Deltas,\nfloat Show_Selection,\nfloat Distance_Fade1,\nfloat Distance_Fade2,\nfloat Strength,\nout float Proximity)\n{float proximity1=(1.0-clamp(length(Deltas.xy)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade1;float proximity2=(1.0-clamp(length(Deltas.zw)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade2;Proximity=Strength*(Proximity_Max_Intensity*max(proximity1,proximity2) *(1.0-Show_Selection)+Show_Selection);}\nvoid Blob_Fragment_B56(\nvec2 UV,\nvec3 Blob_Info,\nsampler2D Blob_Texture,\nout vec4 Blob_Color)\n{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}\nvoid Round_Rect_Fragment_B61(\nfloat Radius,\nvec4 Line_Color,\nfloat Filter_Width,\nfloat Line_Visibility,\nvec4 Fill_Color,\nbool Smooth_Edges,\nvec4 Rect_Parms,\nout float Inside_Rect)\n{float d=length(max(abs(Rect_Parms.zw)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);Inside_Rect=Smooth_Edges ? clamp((Radius-d)/dx,0.0,1.0) : 1.0-step(Radius,d);}\nvoid main()\n{float Is_Quad_Q53;Is_Quad_Q53=vNormal.z;vec4 Blob_Color_Q56;Blob_Fragment_B56(vUV,vTangent,_Blob_Texture_,Blob_Color_Q56);float X_Q52;float Y_Q52;float Z_Q52;float W_Q52;X_Q52=vExtra3.x;Y_Q52=vExtra3.y;Z_Q52=vExtra3.z;W_Q52=vExtra3.w;float Proximity_Q51;Proximity_Fragment_B51(_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vExtra2,X_Q52,Y_Q52,Z_Q52,1.0,Proximity_Q51);float Inside_Rect_Q61;Round_Rect_Fragment_B61(W_Q52,vec4(1,1,1,1),_Filter_Width_,1.0,vec4(0,0,0,0),_Smooth_Edges_,vExtra1,Inside_Rect_Q61);vec4 Result_Q50;Scale_RGB_B50(_Edge_Color_,Proximity_Q51,Result_Q50);vec4 Result_Q47=Inside_Rect_Q61*Blob_Color_Q56;vec4 Color_At_T_Q48=mix(Result_Q50,Result_Q47,Is_Quad_Q53);vec4 Result_Q54;Scale_Color_B54(Color_At_T_Q48,_Fade_Out_,Result_Q54);vec4 Out_Color=Result_Q54;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";d.ShaderStore.ShadersStore.mrdlFrontplateVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Blob_Vertex_B40(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nvec4 Vx_Color,\nvec2 UV,\nvec3 Face_Center,\nvec2 Face_Size,\nvec2 In_UV,\nfloat Blob_Fade_Length,\nfloat Selection_Fade,\nfloat Selection_Fade_Size,\nfloat Inner_Fade,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nfloat Blob_Enabled,\nfloat DistanceOffset,\nout vec3 Out_Position,\nout vec2 Out_UV,\nout vec3 Blob_Info,\nout vec2 Blob_Relative_UV)\n{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal)+DistanceOffset*Blob_Far_Distance;Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; \nvec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);Blob_Relative_UV=blobClipped/Face_Size.y;}\nvoid Round_Rect_Vertex_B36(\nvec2 UV,\nvec3 Tangent,\nvec3 Binormal,\nfloat Radius,\nfloat Anisotropy,\nvec2 Blob_Center_UV,\nout vec2 Rect_UV,\nout vec2 Scale_XY,\nout vec4 Rect_Parms)\n{Scale_XY=vec2(Anisotropy,1.0);Rect_UV=(UV-vec2(0.5,0.5))*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius);Rect_Parms.zw=Blob_Center_UV;}\nvec2 ProjectProximity(\nvec3 blobPosition,\nvec3 position,\nvec3 center,\nvec3 dir,\nvec3 xdir,\nvec3 ydir,\nout float vdistance\n)\n{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}\nvoid Proximity_Vertex_B33(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec3 Position,\nfloat Proximity_Far_Distance,\nfloat Relative_Scale,\nfloat Proximity_Anisotropy,\nvec3 Normal,\nvec3 Tangent,\nvec3 Binormal,\nout vec4 Extra,\nout float Distance_To_Face,\nout float Distance_Fade1,\nout float Distance_Fade2)\n{float distz1,distz2;Extra.xy=ProjectProximity(Blob_Position,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz1)/Relative_Scale;Extra.zw=ProjectProximity(Blob_Position_2,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz2)/Relative_Scale;Distance_To_Face=dot(Normal,Position-Face_Center);Distance_Fade1=1.0-clamp(distz1/Proximity_Far_Distance,0.0,1.0);Distance_Fade2=1.0-clamp(distz2/Proximity_Far_Distance,0.0,1.0);}\nvoid Object_To_World_Pos_B12(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Choose_Blob_B27(\nvec4 Vx_Color,\nvec3 Position1,\nvec3 Position2,\nbool Blob_Enable_1,\nbool Blob_Enable_2,\nfloat Near_Size_1,\nfloat Near_Size_2,\nfloat Blob_Inner_Fade_1,\nfloat Blob_Inner_Fade_2,\nfloat Blob_Pulse_1,\nfloat Blob_Pulse_2,\nfloat Blob_Fade_1,\nfloat Blob_Fade_2,\nout vec3 Position,\nout float Near_Size,\nout float Inner_Fade,\nout float Blob_Enable,\nout float Fade,\nout float Pulse)\n{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=Blob_Enable_1 ? 1.0 : 0.0;float b2=Blob_Enable_2 ? 1.0 : 0.0;Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}\nvoid Move_Verts_B32(\nvec2 UV,\nfloat Radius,\nfloat Anisotropy,\nfloat Line_Width,\nfloat Visible,\nout vec3 New_P,\nout vec2 New_UV)\n{vec2 xy=2.0*UV-vec2(0.5,0.5);vec2 center=clamp(xy,0.0,1.0);vec2 delta=2.0*(xy-center);float deltaLength=length(delta);vec2 aniso=vec2(1.0/Anisotropy,1.0);center=(center-vec2(0.5,0.5))*(1.0-2.0*Radius*aniso);New_UV=vec2((2.0-2.0*deltaLength)*Visible,0.0);float deltaRadius= (Radius-Line_Width*New_UV.x);New_P.xy=(center+deltaRadius/deltaLength *aniso*delta);New_P.z=0.0;}\nvoid Object_To_World_Dir_B14(\nvec3 Dir_Object,\nout vec3 Binormal_World)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;}\nvoid Proximity_Visibility_B55(\nfloat Selection,\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Proximity_Far_Distance,\nfloat Proximity_Radius,\nvec3 Face_Center,\nvec3 Normal,\nvec2 Face_Size,\nfloat Gaze,\nout float Width)\n{float boxMaxSize=length(Face_Size)*0.5;float d1=dot(Proximity_Center-Face_Center,Normal);vec3 blob1=Proximity_Center-d1*Normal;float d2=dot(Proximity_Center_2-Face_Center,Normal);vec3 blob2=Proximity_Center_2-d2*Normal;vec3 delta1=blob1-Face_Center;vec3 delta2=blob2-Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));Width=max(Gaze,Width);}\nvec2 ramp2(vec2 start,vec2 end,vec2 x)\n{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}\nfloat computeSelection(\nvec3 blobPosition,\nvec3 normal,\nvec3 tangent,\nvec3 bitangent,\nvec3 faceCenter,\nvec2 faceSize,\nfloat selectionFuzz,\nfloat farDistance,\nfloat fadeLength\n)\n{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}\nvoid Selection_Vertex_B31(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec2 Face_Size,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Selection_Fuzz,\nfloat Selected,\nfloat Far_Distance,\nfloat Fade_Length,\nvec3 Active_Face_Dir,\nout float Show_Selection)\n{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);Show_Selection=mix(max(select1,select2),1.0,Selected);}\nvoid main()\n{vec3 Vec3_Q29=vec3(vec2(0,0).x,vec2(0,0).y,color.r);vec3 Nrm_World_Q24;Nrm_World_Q24=normalize((world*vec4(normal,0.0)).xyz);vec3 Face_Center_Q30;Face_Center_Q30=(world*vec4(vec3(0,0,0),1.0)).xyz;vec3 Tangent_World_Q13;Tangent_World_Q13=(world*vec4(tangent,0.0)).xyz;vec3 Result_Q42;Result_Q42=_Use_Global_Left_Index_ ? Global_Left_Index_Tip_Position.xyz : _Blob_Position_;vec3 Result_Q43;Result_Q43=_Use_Global_Right_Index_ ? Global_Right_Index_Tip_Position.xyz : _Blob_Position_2_;float Value_At_T_Q58=mix(_Blob_Near_Size_,_Blob_Pulse_Max_Size_,_Blob_Pulse_);float Value_At_T_Q59=mix(_Blob_Near_Size_2_,_Blob_Pulse_Max_Size_,_Blob_Pulse_2_);vec3 Cross_Q70=cross(normal,tangent);float Product_Q45=_Gaze_Intensity_*_Gaze_Focus_;float Step_Q46=step(0.0001,Product_Q45);vec3 Tangent_World_N_Q15=normalize(Tangent_World_Q13);vec3 Position_Q27;float Near_Size_Q27;float Inner_Fade_Q27;float Blob_Enable_Q27;float Fade_Q27;float Pulse_Q27;Choose_Blob_B27(color,Result_Q42,Result_Q43,_Blob_Enable_,_Blob_Enable_2_,Value_At_T_Q58,Value_At_T_Q59,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q27,Near_Size_Q27,Inner_Fade_Q27,Blob_Enable_Q27,Fade_Q27,Pulse_Q27);vec3 Binormal_World_Q14;Object_To_World_Dir_B14(Cross_Q70,Binormal_World_Q14);float Anisotropy_Q21=length(Tangent_World_Q13)/length(Binormal_World_Q14);vec3 Binormal_World_N_Q16=normalize(Binormal_World_Q14);vec2 Face_Size_Q35;float ScaleY_Q35;Face_Size_Q35=vec2(length(Tangent_World_Q13),length(Binormal_World_Q14));ScaleY_Q35=Face_Size_Q35.y;float Out_Radius_Q38;float Out_Line_Width_Q38;Out_Radius_Q38=_Relative_To_Height_ ? _Radius_ : _Radius_/ScaleY_Q35;Out_Line_Width_Q38=_Relative_To_Height_ ? _Line_Width_ : _Line_Width_/ScaleY_Q35;float Show_Selection_Q31;Selection_Vertex_B31(Result_Q42,Result_Q43,Face_Center_Q30,Face_Size_Q35,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,vec3(0,0,-1),Show_Selection_Q31);float MaxAB_Q41=max(Show_Selection_Q31,Product_Q45);float Width_Q55;Proximity_Visibility_B55(Show_Selection_Q31,Result_Q42,Result_Q43,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Face_Center_Q30,Nrm_World_Q24,Face_Size_Q35,Step_Q46,Width_Q55);vec3 New_P_Q32;vec2 New_UV_Q32;Move_Verts_B32(uv,Out_Radius_Q38,Anisotropy_Q21,Out_Line_Width_Q38,Width_Q55,New_P_Q32,New_UV_Q32);vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q32,Pos_World_Q12);vec3 Out_Position_Q40;vec2 Out_UV_Q40;vec3 Blob_Info_Q40;vec2 Blob_Relative_UV_Q40;Blob_Vertex_B40(Pos_World_Q12,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Position_Q27,_Blob_Intensity_,Near_Size_Q27,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q30,Face_Size_Q35,New_UV_Q32,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q27,Pulse_Q27,Fade_Q27,Blob_Enable_Q27,0.0,Out_Position_Q40,Out_UV_Q40,Blob_Info_Q40,Blob_Relative_UV_Q40);vec2 Rect_UV_Q36;vec2 Scale_XY_Q36;vec4 Rect_Parms_Q36;Round_Rect_Vertex_B36(New_UV_Q32,Tangent_World_Q13,Binormal_World_Q14,Out_Radius_Q38,Anisotropy_Q21,Blob_Relative_UV_Q40,Rect_UV_Q36,Scale_XY_Q36,Rect_Parms_Q36);vec4 Extra_Q33;float Distance_To_Face_Q33;float Distance_Fade1_Q33;float Distance_Fade2_Q33;Proximity_Vertex_B33(Result_Q42,Result_Q43,Face_Center_Q30,Pos_World_Q12,_Proximity_Far_Distance_,1.0,_Proximity_Anisotropy_,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Extra_Q33,Distance_To_Face_Q33,Distance_Fade1_Q33,Distance_Fade2_Q33);vec4 Vec4_Q37=vec4(MaxAB_Q41,Distance_Fade1_Q33,Distance_Fade2_Q33,Out_Radius_Q38);vec3 Position=Out_Position_Q40;vec3 Normal=Vec3_Q29;vec2 UV=Out_UV_Q40;vec3 Tangent=Blob_Info_Q40;vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);vec4 Extra1=Rect_Parms_Q36;vec4 Extra2=Extra_Q33;vec4 Extra3=Vec4_Q37;gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;vTangent=Tangent;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";var se=function(t){function e(){var e=t.call(this)||this;return e.SMOOTH_EDGES=!0,e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),le=function(t){function e(i,o){var r=t.call(this,i,o)||this;return r.radius=.12,r.lineWidth=.01,r.relativeToHeight=!1,r._filterWidth=1,r.edgeColor=new d.Color4(.53,.53,.53,1),r.blobEnable=!0,r.blobPosition=new d.Vector3(100,100,100),r.blobIntensity=.5,r.blobNearSize=.032,r.blobFarSize=.048,r.blobNearDistance=.008,r.blobFarDistance=.064,r.blobFadeLength=.04,r.blobInnerFade=.01,r.blobPulse=0,r.blobFade=1,r.blobPulseMaxSize=.05,r.blobEnable2=!0,r.blobPosition2=new d.Vector3(10,10.1,-.6),r.blobNearSize2=.008,r.blobInnerFade2=.1,r.blobPulse2=0,r.blobFade2=1,r.gazeIntensity=.8,r.gazeFocus=0,r.selectionFuzz=.5,r.selected=1,r.selectionFade=.2,r.selectionFadeSize=0,r.selectedDistance=.08,r.selectedFadeLength=.08,r.proximityMaxIntensity=.45,r.proximityFarDistance=.16,r.proximityNearRadius=.016,r.proximityAnisotropy=1,r.useGlobalLeftIndex=!0,r.useGlobalRightIndex=!0,r.fadeOut=1,r.alphaMode=d.Constants.ALPHA_ADD,r.disableDepthWrite=!0,r.backFaceCulling=!1,r._blobTexture=new d.Texture(e.BLOB_TEXTURE_URL,o,!0,!1,d.Texture.NEAREST_SAMPLINGMODE),r}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new se);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!1,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Relative_To_Height_","_Filter_Width_","_Edge_Color_","_Fade_Out_","_Smooth_Edges_","_Blob_Enable_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Inner_Fade_","_Blob_Pulse_","_Blob_Fade_","_Blob_Pulse_Max_Size_","_Blob_Enable_2_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Inner_Fade_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Gaze_Intensity_","_Gaze_Focus_","_Blob_Texture_","_Selection_Fuzz_","_Selected_","_Selection_Fade_","_Selection_Fade_Size_","_Selected_Distance_","_Selected_Fade_Length_","_Proximity_Max_Intensity_","_Proximity_Far_Distance_","_Proximity_Near_Radius_","_Proximity_Anisotropy_","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","_Use_Global_Left_Index_","_Use_Global_Right_Index_"],h=[],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlFrontplate",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Relative_To_Height_",this.relativeToHeight?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Edge_Color_",this.edgeColor),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._activeEffect.setFloat("_Blob_Enable_",this.blobEnable?1:0),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Inner_Fade_",this.blobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setFloat("_Blob_Pulse_Max_Size_",this.blobPulseMaxSize),this._activeEffect.setFloat("_Blob_Enable_2_",this.blobEnable2?1:0),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Inner_Fade_2_",this.blobInnerFade2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setFloat("_Gaze_Intensity_",this.gazeIntensity),this._activeEffect.setFloat("_Gaze_Focus_",this.gazeFocus),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Selection_Fuzz_",this.selectionFuzz),this._activeEffect.setFloat("_Selected_",this.selected),this._activeEffect.setFloat("_Selection_Fade_",this.selectionFade),this._activeEffect.setFloat("_Selection_Fade_Size_",this.selectionFadeSize),this._activeEffect.setFloat("_Selected_Distance_",this.selectedDistance),this._activeEffect.setFloat("_Selected_Fade_Length_",this.selectedFadeLength),this._activeEffect.setFloat("_Proximity_Max_Intensity_",this.proximityMaxIntensity),this._activeEffect.setFloat("_Proximity_Far_Distance_",this.proximityFarDistance),this._activeEffect.setFloat("_Proximity_Near_Radius_",this.proximityNearRadius),this._activeEffect.setFloat("_Proximity_Anisotropy_",this.proximityAnisotropy),this._activeEffect.setFloat("_Use_Global_Left_Index_",this.useGlobalLeftIndex?1:0),this._activeEffect.setFloat("_Use_Global_Right_Index_",this.useGlobalRightIndex?1:0),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var t=d.SerializationHelper.Serialize(this);return t.customType="BABYLON.MRDLFrontplateMaterial",t},e.prototype.getClassName=function(){return"MRDLFrontplateMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},e.BLOB_TEXTURE_URL="",h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"lineWidth",void 0),h([(0,d.serialize)()],e.prototype,"relativeToHeight",void 0),h([(0,d.serialize)()],e.prototype,"edgeColor",void 0),h([(0,d.serialize)()],e.prototype,"blobEnable",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition",void 0),h([(0,d.serialize)()],e.prototype,"blobIntensity",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize",void 0),h([(0,d.serialize)()],e.prototype,"blobFarSize",void 0),h([(0,d.serialize)()],e.prototype,"blobNearDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"blobFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"blobInnerFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse",void 0),h([(0,d.serialize)()],e.prototype,"blobFade",void 0),h([(0,d.serialize)()],e.prototype,"blobPulseMaxSize",void 0),h([(0,d.serialize)()],e.prototype,"blobEnable2",void 0),h([(0,d.serialize)()],e.prototype,"blobPosition2",void 0),h([(0,d.serialize)()],e.prototype,"blobNearSize2",void 0),h([(0,d.serialize)()],e.prototype,"blobInnerFade2",void 0),h([(0,d.serialize)()],e.prototype,"blobPulse2",void 0),h([(0,d.serialize)()],e.prototype,"blobFade2",void 0),h([(0,d.serialize)()],e.prototype,"gazeIntensity",void 0),h([(0,d.serialize)()],e.prototype,"gazeFocus",void 0),h([(0,d.serialize)()],e.prototype,"selectionFuzz",void 0),h([(0,d.serialize)()],e.prototype,"selected",void 0),h([(0,d.serialize)()],e.prototype,"selectionFade",void 0),h([(0,d.serialize)()],e.prototype,"selectionFadeSize",void 0),h([(0,d.serialize)()],e.prototype,"selectedDistance",void 0),h([(0,d.serialize)()],e.prototype,"selectedFadeLength",void 0),h([(0,d.serialize)()],e.prototype,"proximityMaxIntensity",void 0),h([(0,d.serialize)()],e.prototype,"proximityFarDistance",void 0),h([(0,d.serialize)()],e.prototype,"proximityNearRadius",void 0),h([(0,d.serialize)()],e.prototype,"proximityAnisotropy",void 0),h([(0,d.serialize)()],e.prototype,"useGlobalLeftIndex",void 0),h([(0,d.serialize)()],e.prototype,"useGlobalRightIndex",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLFrontplateMaterial",le);d.ShaderStore.ShadersStore.mrdlInnerquadPixelShader="uniform vec3 cameraPosition;varying vec2 vUV;varying vec3 vTangent;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;float FilterStep_Bid194(float edge,float x,float filterWidth)\n{float dx=max(1.0E-5,fwidth(x)*filterWidth);return max((x+dx*0.5-max(edge,x-dx*0.5))/dx,0.0);}\nvoid Round_Rect_B194(\nfloat Size_X,\nfloat Size_Y,\nfloat Radius,\nvec4 Rect_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Glow_Fraction,\nfloat Glow_Max,\nfloat Glow_Falloff,\nout vec4 Color)\n{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius,Radius),halfSize),vec2(0.01,0.01));vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);vec2 delta=(v-nearestp)/max(vec2(0.01,0.01),r);float Distance=length(delta);float insideRect=1.0-FilterStep_Bid194(1.0-Glow_Fraction,Distance,Filter_Width);float glow=clamp((1.0-Distance)/Glow_Fraction,0.0,1.0);glow=pow(glow,Glow_Falloff);Color=Rect_Color*max(insideRect,glow*Glow_Max);}\nvoid main()\n{float X_Q192;float Y_Q192;float Z_Q192;X_Q192=vTangent.x;Y_Q192=vTangent.y;Z_Q192=vTangent.z;vec4 Color_Q194;Round_Rect_B194(X_Q192,1.0,Y_Q192,_Color_,_Filter_Width_,vUV,_Glow_Fraction_,_Glow_Max_,_Glow_Falloff_,Color_Q194);vec4 Out_Color=Color_Q194;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}\n";d.ShaderStore.ShadersStore.mrdlInnerquadVertexShader="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;varying vec2 vUV;varying vec3 vTangent;void main()\n{vec3 Pos_World_Q189;Pos_World_Q189=(world*vec4(position,1.0)).xyz;vec3 Dir_World_Q190;Dir_World_Q190=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q191;Dir_World_Q191=(world*vec4((cross(normal,tangent)),0.0)).xyz;float Length_Q180=length(Dir_World_Q190);float Length_Q181=length(Dir_World_Q191);float Quotient_Q184=Length_Q180/Length_Q181;float Quotient_Q195=_Radius_/Length_Q181;vec2 Result_Q193;Result_Q193=vec2((uv.x-0.5)*Length_Q180/Length_Q181,(uv.y-0.5));float Result_Q198=_Fixed_Radius_ ? Quotient_Q195 : _Radius_;vec3 Vec3_Q183=vec3(Quotient_Q184,Result_Q198,0);vec3 Position=Pos_World_Q189;vec3 Normal=vec3(0,0,0);vec2 UV=Result_Q193;vec3 Tangent=Vec3_Q183;vec3 Binormal=vec3(0,0,0);vec4 Color=color;gl_Position=viewProjection*vec4(Position,1);vUV=UV;vTangent=Tangent;}\n";var _e=function(t){function e(){var e=t.call(this)||this;return e._needNormals=!0,e._needUVs=!0,e.rebuild(),e}return l(e,t),e}(d.MaterialDefines),he=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o.color=new d.Color4(1,1,1,.05),o.radius=.12,o.fixedRadius=!0,o._filterWidth=1,o.glowFraction=0,o.glowMax=.5,o.glowFalloff=2,o.alphaMode=d.Constants.ALPHA_COMBINE,o.backFaceCulling=!1,o}return l(e,t),e.prototype.needAlphaBlending=function(){return!0},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.isReadyForSubMesh=function(t,e){var i=e._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;e.materialDefines||(e.materialDefines=new _e);var o=e.materialDefines,r=this.getScene();if(this._isReadyForSubMesh(e))return!0;var n=r.getEngine();if((0,d.PrepareDefinesForAttributes)(t,o,!0,!1),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var a=new d.EffectFallbacks;o.FOG&&a.addFallback(1,"FOG"),(0,d.HandleFallbacksForShadows)(o,a),o.IMAGEPROCESSINGPOSTPROCESS=r.imageProcessingConfiguration.applyByPostProcess;var s=[d.VertexBuffer.PositionKind];o.NORMAL&&s.push(d.VertexBuffer.NormalKind),o.UV1&&s.push(d.VertexBuffer.UVKind),o.UV2&&s.push(d.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&s.push(d.VertexBuffer.ColorKind),o.TANGENT&&s.push(d.VertexBuffer.TangentKind),(0,d.PrepareAttributesForInstances)(s,o);var l=o.toString(),_=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Color_","_Radius_","_Fixed_Radius_","_Filter_Width_","_Glow_Fraction_","_Glow_Max_","_Glow_Falloff_"],h=[],c=[];(0,d.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:o,maxSimultaneousLights:4}),e.setEffect(r.getEngine().createEffect("mrdlInnerquad",{attributes:s,uniformsNames:_,uniformBuffersNames:c,samplers:h,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},n),o)}return!(!e.effect||!e.effect.isReady()||(o._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},e.prototype.bindForSubMesh=function(t,e,i){var o=this.getScene();if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(t),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",o.activeCamera.position),this._activeEffect.setDirectColor4("_Color_",this.color),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Fixed_Radius_",this.fixedRadius?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setFloat("_Glow_Fraction_",this.glowFraction),this._activeEffect.setFloat("_Glow_Max_",this.glowMax),this._activeEffect.setFloat("_Glow_Falloff_",this.glowFalloff),this._afterBind(e,this._activeEffect,i))}},e.prototype.getAnimatables=function(){return[]},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e)},e.prototype.clone=function(t){var i=this;return d.SerializationHelper.Clone((function(){return new e(t,i.getScene())}),this)},e.prototype.serialize=function(){var t=d.SerializationHelper.Serialize(this);return t.customType="BABYLON.MRDLInnerquadMaterial",t},e.prototype.getClassName=function(){return"MRDLInnerquadMaterial"},e.Parse=function(t,i,o){return d.SerializationHelper.Parse((function(){return new e(t.name,i)}),t,i,o)},h([(0,d.serialize)()],e.prototype,"color",void 0),h([(0,d.serialize)()],e.prototype,"radius",void 0),h([(0,d.serialize)()],e.prototype,"fixedRadius",void 0),h([(0,d.serialize)()],e.prototype,"glowFraction",void 0),h([(0,d.serialize)()],e.prototype,"glowMax",void 0),h([(0,d.serialize)()],e.prototype,"glowFalloff",void 0),e}(d.PushMaterial);(0,d.RegisterClass)("BABYLON.GUI.MRDLInnerquadMaterial",he);var ce=function(t){function e(e,i){void 0===i&&(i=!0);var o=t.call(this,e)||this;return o.width=1,o.height=1,o.radius=.14,o.textSizeInPixels=18,o.imageSizeInPixels=40,o.plateMaterialColor=new d.Color3(.4,.4,.4),o.frontPlateDepth=.2,o.backPlateDepth=.04,o.backGlowOffset=.1,o.flatPlaneDepth=.001,o.innerQuadRadius=o.radius-.04,o.innerQuadColor=new d.Color4(0,0,0,0),o.innerQuadToggledColor=new d.Color4(.5197843,.6485234,.9607843,.6),o.innerQuadHoverColor=new d.Color4(1,1,1,.05),o.innerQuadToggledHoverColor=new d.Color4(.5197843,.6485234,.9607843,1),o._isBackplateVisible=!0,o._shareMaterials=!0,o._shareMaterials=i,o.pointerEnterAnimation=function(){o._frontPlate&&o._textPlate&&!o.isToggleButton&&o._performEnterExitAnimation(1),o.isToggleButton&&o._innerQuadMaterial&&(o.isToggled?o._innerQuadMaterial.color=o.innerQuadToggledHoverColor:o._innerQuadMaterial.color=o.innerQuadHoverColor)},o.pointerOutAnimation=function(){o._frontPlate&&o._textPlate&&!o.isToggleButton&&o._performEnterExitAnimation(-.8),o.isToggleButton&&o._innerQuadMaterial&&o._onToggle(o.isToggled)},o.pointerDownAnimation=function(){},o.pointerUpAnimation=function(){},o._pointerClickObserver=o.onPointerClickObservable.add((function(){o._frontPlate&&o._backGlow&&!o.isActiveNearInteraction&&o._performClickAnimation(),o.isToggleButton&&o._innerQuadMaterial&&o._onToggle(o.isToggled)})),o._pointerEnterObserver=o.onPointerEnterObservable.add((function(){o.pointerEnterAnimation()})),o._pointerOutObserver=o.onPointerOutObservable.add((function(){o.pointerOutAnimation()})),o._toggleObserver=o.onToggleObservable.add((function(t){o._innerQuadMaterial.color=t?o.innerQuadToggledColor:o.innerQuadColor})),o}return l(e,t),e.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(t){this._backPlate.renderingGroupId=t,this._textPlate.renderingGroupId=t,this._frontPlate.renderingGroupId=t,this._backGlow.renderingGroupId=t,this._innerQuad.renderingGroupId=t,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._backPlate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tooltipText",{get:function(){var t;return(null===(t=this._tooltipTextBlock)||void 0===t?void 0:t.text)||null},set:function(t){var e=this;if(t){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,d.CreatePlane)("",{size:1},this._backPlate._scene),this._tooltipMesh.position=d.Vector3.Down().scale(.7).add(d.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._frontPlateCollisionMesh,this._tooltipTexture=ct.CreateForMesh(this._tooltipMesh);var o=new T;o.height=.25,o.width=.8,o.cornerRadius=25,o.color="#ffffff",o.thickness=20,o.background="#060668",this._tooltipTexture.addControl(o),this._tooltipTextBlock=new S,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=100,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new d.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){e._tooltipFade&&e._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=t)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this._text!==t&&(this._text=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subtext",{get:function(){return this._subtext},set:function(t){this._subtext!==t&&(this._subtext=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(t){this._imageUrl!==t&&(this._imageUrl=t,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backGlowMaterial",{get:function(){return this._backGlowMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"innerQuadMaterial",{get:function(){return this._innerQuadMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBackplateVisible",{set:function(t){this.mesh&&this._backMaterial&&(t&&!this._isBackplateVisible?this._backPlate.visibility=1:!t&&this._isBackplateVisible&&(this._backPlate.visibility=0)),this._isBackplateVisible=t},enumerable:!1,configurable:!0}),e.prototype._getTypeName=function(){return"TouchHolographicButton"},e.prototype._rebuildContent=function(){var t;t=this._getAspectRatio()<=1?this._alignContentVertically():this._alignContentHorizontally(),this.content=t},e.prototype._getAspectRatio=function(){return this.width/this.height},e.prototype._alignContentVertically=function(){var t=new w;if(t.isVertical=!0,(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var e=new O;e.source=this._imageUrl,e.heightInPixels=180,e.widthInPixels=100,e.paddingTopInPixels=40,e.paddingBottomInPixels=40,t.addControl(e)}if(this._text){var i=new S;i.text=this._text,i.color="white",i.heightInPixels=30,i.fontSize=24,t.addControl(i)}return t},e.prototype._alignContentHorizontally=function(){var t=240,e=15,i=new T;i.widthInPixels=t,i.heightInPixels=t,i.color="transparent",i.setPaddingInPixels(e,e,e,e),t-=30;var o=new w;if(o.isVertical=!1,o.scaleY=this._getAspectRatio(),(0,d.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var r=new T("".concat(this.name,"_image"));r.widthInPixels=this.imageSizeInPixels,r.heightInPixels=this.imageSizeInPixels,r.color="transparent",t-=this.imageSizeInPixels;var n=new O;n.source=this._imageUrl,r.addControl(n),o.addControl(r)}if(this._text){var a=new S("".concat(this.name,"_text"));if(a.text=this._text,a.color="white",a.fontSize=this.textSizeInPixels,a.widthInPixels=t,this._imageUrl&&(a.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,a.paddingLeftInPixels=e),this._subtext){var s=new D;s.addColumnDefinition(1),s.addRowDefinition(.5),s.addRowDefinition(.5),s.widthInPixels=t,s.heightInPixels=45;var l=new S("".concat(this.name,"_subtext"));l.text=this._subtext,l.color="#EEEEEEAB",l.fontSize=.75*this.textSizeInPixels,l.fontWeight="600",this._imageUrl&&(l.textHorizontalAlignment=I.HORIZONTAL_ALIGNMENT_LEFT,l.paddingLeftInPixels=e),s.addControl(a,0),s.addControl(l,1),o.addControl(s)}else o.addControl(a)}return i.addControl(o),i},e.prototype._createNode=function(e){var i;this.name=null!==(i=this.name)&&void 0!==i?i:"TouchHolographicButton";var o=this._createBackPlate(e),r=this._createFrontPlate(e),n=this._createInnerQuad(e),a=this._createBackGlow(e);this._frontPlateCollisionMesh=r,this._textPlate=t.prototype._createNode.call(this,e),this._textPlate.name="".concat(this.name,"_textPlate"),this._textPlate.isPickable=!1,this._textPlate.scaling.x=this.width,this._textPlate.parent=r,this._backPlate=o,this._backPlate.position=d.Vector3.Forward(e.useRightHandedSystem).scale(this.backPlateDepth/2),this._backPlate.isPickable=!1,this._backPlate.addChild(r),this._backPlate.addChild(n),a&&this._backPlate.addChild(a);var s=new d.TransformNode("".concat(this.name,"_root"),e);return this._backPlate.setParent(s),this.collisionMesh=r,this.collidableFrontDirection=this._backPlate.forward.negate(),s},e.prototype._createBackPlate=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_backPlate"),{},t);return o.isPickable=!1,o.visibility=0,o.scaling.z=.2,d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.BACKPLATE_MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.visibility=0,i._isBackplateVisible&&(e.visibility=1,e.name="".concat(i.name,"_backPlate"),e.isPickable=!1,e.scaling.x=i.width,e.scaling.y=i.height,e.parent=o),i._backMaterial&&(e.material=i._backMaterial),i._backPlate=e})),o},e.prototype._createFrontPlate=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_frontPlate"),{width:this.width,height:this.height,depth:this.frontPlateDepth},t);return o.isPickable=!0,o.isNearPickable=!0,o.visibility=0,o.position=d.Vector3.Forward(t.useRightHandedSystem).scale((this.backPlateDepth-this.frontPlateDepth)/2),d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.FRONTPLATE_MODEL_FILENAME,t).then((function(e){var r=(0,d.CreateBox)("".concat(i.name,"_collisionPlate"),{width:i.width,height:i.height},t);r.isPickable=!1,r.scaling.z=i.frontPlateDepth,r.visibility=0,r.parent=o,i._collisionPlate=r;var n=e.meshes[1];n.name="".concat(i.name,"_frontPlate"),n.isPickable=!1,n.scaling.x=i.width-i.backGlowOffset,n.scaling.y=i.height-i.backGlowOffset,n.position=d.Vector3.Forward(t.useRightHandedSystem).scale(-.5),n.parent=r,i.isToggleButton&&(n.visibility=0),i._frontMaterial&&(n.material=i._frontMaterial),i._textPlate.scaling.x=1,i._textPlate.parent=n,i._frontPlate=n})),o},e.prototype._createInnerQuad=function(t){var i=this,o=(0,d.CreateBox)("".concat(this.name,"_innerQuad"),{},t);return o.isPickable=!1,o.visibility=0,o.scaling.z=this.flatPlaneDepth,o.position.z+=this.backPlateDepth/2-this.flatPlaneDepth,d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.INNERQUAD_MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.name="".concat(i.name,"_innerQuad"),e.isPickable=!1,e.scaling.x=i.width-i.backGlowOffset,e.scaling.y=i.height-i.backGlowOffset,e.parent=o,i._innerQuadMaterial&&(e.material=i._innerQuadMaterial),i._innerQuad=e})),o},e.prototype._createBackGlow=function(t){var i=this;if(!this.isToggleButton){var o=(0,d.CreateBox)("".concat(this.name,"_backGlow"),{},t);return o.isPickable=!1,o.visibility=0,o.scaling.z=this.flatPlaneDepth,o.position.z+=this.backPlateDepth/2-2*this.flatPlaneDepth,d.SceneLoader.ImportMeshAsync(void 0,e.MRTK_ASSET_BASE_URL,e.BACKGLOW_MODEL_FILENAME,t).then((function(t){var e=t.meshes[1];e.name="".concat(i.name,"_backGlow"),e.isPickable=!1,e.scaling.x=i.width-i.backGlowOffset,e.scaling.y=i.height-i.backGlowOffset,e.parent=o,i._backGlowMaterial&&(e.material=i._backGlowMaterial),i._backGlow=e})),o}},e.prototype._applyFacade=function(t){this._plateMaterial.emissiveTexture=t,this._plateMaterial.opacityTexture=t,this._plateMaterial.diffuseColor=this.plateMaterialColor},e.prototype._performClickAnimation=function(){for(var t=new d.AnimationGroup("Click Animation Group"),e=0,i=[{name:"backGlowMotion",mesh:this._backGlow,property:"material.motion",keys:[{frame:0,values:[0,0,0]},{frame:20,values:[1,.0144,.0144]},{frame:40,values:[.0027713229489760476,0,0]},{frame:45,values:[.0027713229489760476]}]},{name:"_collisionPlateZSlide",mesh:this._collisionPlate,property:"position.z",keys:[{frame:0,values:[0,0,0]},{frame:20,values:[d.Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth/2).z,0,0]},{frame:40,values:[0,.005403332496794331]},{frame:45,values:[0]}]},{name:"_collisionPlateZScale",mesh:this._collisionPlate,property:"scaling.z",keys:[{frame:0,values:[this.frontPlateDepth,0,0]},{frame:20,values:[this.backPlateDepth,0,0]},{frame:40,values:[this.frontPlateDepth,.0054]},{frame:45,values:[this.frontPlateDepth]}]}];e0){var e=t/this._customControlScaling;this._customControlScaling=t,this._rootContainer.children.forEach((function(i){i.scaling.scaleInPlace(e),1!==t&&(i._isScaledByManager=!0)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useRealisticScaling",{get:function(){return this.controlScaling===t.MRTK_REALISTIC_SCALING},set:function(e){this.controlScaling=e?t.MRTK_REALISTIC_SCALING:1},enumerable:!1,configurable:!0}),t.prototype._handlePointerOut=function(t,e){var i=this._lastControlOver[t];i&&(i._onPointerOut(i),delete this._lastControlOver[t]),e&&this._lastControlDown[t]&&(this._lastControlDown[t].forcePointerUp(),delete this._lastControlDown[t]),this.onPickedPointChangedObservable.notifyObservers(null)},t.prototype._doPicking=function(t){var e,i,o;if(!this._utilityLayer||!this._utilityLayer.shouldRender||!this._utilityLayer.utilityLayerScene.activeCamera)return!1;var r=t.event,n=r.pointerId||0,a=r.button,s=t.pickInfo;if(s&&this.onPickingObservable.notifyObservers(s.pickedMesh),!s||!s.hit)return this._handlePointerOut(n,t.type===d.PointerEventTypes.POINTERUP),!1;s.pickedPoint&&this.onPickedPointChangedObservable.notifyObservers(s.pickedPoint);var l=null===(i=null===(e=s.pickedMesh.reservedDataStore)||void 0===e?void 0:e.GUI3D)||void 0===i?void 0:i.control;return l&&!l._processObservables(t.type,s.pickedPoint,(null===(o=s.originMesh)||void 0===o?void 0:o.position)||null,n,a)&&t.type===d.PointerEventTypes.POINTERMOVE&&(this._lastControlOver[n]&&this._lastControlOver[n]._onPointerOut(this._lastControlOver[n]),delete this._lastControlOver[n]),t.type===d.PointerEventTypes.POINTERUP&&(this._lastControlDown[r.pointerId]&&(this._lastControlDown[r.pointerId].forcePointerUp(),delete this._lastControlDown[r.pointerId]),("touch"===r.pointerType||"xr"===r.pointerType&&this._scene.getEngine().hostInformation.isMobile)&&this._handlePointerOut(n,!1)),!0},Object.defineProperty(t.prototype,"rootContainer",{get:function(){return this._rootContainer},enumerable:!1,configurable:!0}),t.prototype.containsControl=function(t){return this._rootContainer.containsControl(t)},t.prototype.addControl=function(t){return this._rootContainer.addControl(t),1!==this._customControlScaling&&(t.scaling.scaleInPlace(this._customControlScaling),t._isScaledByManager=!0),this},t.prototype.removeControl=function(t){return this._rootContainer.removeControl(t),t._isScaledByManager&&(t.scaling.scaleInPlace(1/this._customControlScaling),t._isScaledByManager=!1),this},t.prototype.dispose=function(){for(var t in this._rootContainer.dispose(),this._sharedMaterials)Object.prototype.hasOwnProperty.call(this._sharedMaterials,t)&&this._sharedMaterials[t].dispose();for(var t in this._sharedMaterials={},this._touchSharedMaterials)Object.prototype.hasOwnProperty.call(this._touchSharedMaterials,t)&&this._touchSharedMaterials[t].dispose();this._touchSharedMaterials={},this._pointerOutObserver&&this._utilityLayer&&(this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver),this._pointerOutObserver=null),this.onPickedPointChangedObservable.clear(),this.onPickingObservable.clear();var e=this._utilityLayer?this._utilityLayer.utilityLayerScene:null;e&&this._pointerObserver&&(e.onPointerObservable.remove(this._pointerObserver),this._pointerObserver=null),this._scene&&this._sceneDisposeObserver&&(this._scene.onDisposeObservable.remove(this._sceneDisposeObserver),this._sceneDisposeObserver=null),this._utilityLayer&&this._utilityLayer.dispose()},t.MRTK_REALISTIC_SCALING=.032,t}(),de=void 0!==o.g?o.g:"undefined"!=typeof window?window:void 0;void 0!==de&&(de.BABYLON=de.BABYLON||{},de.BABYLON.GUI||(de.BABYLON.GUI=n));const fe=a;return r.default})())); //# sourceMappingURL=babylon.gui.min.js.map \ No newline at end of file diff --git a/src/libs/babylon.inspector.bundle.js b/src/libs/babylon.inspector.bundle.js index 969ac806..68b2533b 100644 --- a/src/libs/babylon.inspector.bundle.js +++ b/src/libs/babylon.inspector.bundle.js @@ -1,3 +1,3 @@ /*! For license information please see babylon.inspector.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs"),require("babylonjs-materials"),require("babylonjs"),require("babylonjs-gui"),require("babylonjs-gui-editor"),require("babylonjs-loaders"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define("babylonjs-inspector",["babylonjs","babylonjs-materials","babylonjs","babylonjs-gui","babylonjs-gui-editor","babylonjs-loaders","babylonjs-serializers"],t):"object"==typeof exports?exports["babylonjs-inspector"]=t(require("babylonjs"),require("babylonjs-materials"),require("babylonjs"),require("babylonjs-gui"),require("babylonjs-gui-editor"),require("babylonjs-loaders"),require("babylonjs-serializers")):e.INSPECTOR=t(e.BABYLON,e.BABYLON,e.BABYLON.Debug,e.BABYLON.GUI,e.BABYLON,e.BABYLON,e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,((e,t,s,r,n,o,a)=>(()=>{var i={729:(e,t,s)=>{"use strict";s.d(t,{A:()=>h});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o),i=s(1721),l=s.n(i),p=new URL(s(4149),s.b),c=a()(n()),d=l()(p);c.push([e.id,`#inspector-host{position:absolute;right:0px;top:0px;bottom:0px}#__resizable_base__{display:none}#actionTabs{background:#333;height:100%;margin:0;padding:0;display:grid;grid-template-rows:auto 1fr;font:14px "Arial";overflow:hidden}#actionTabs .hoverIcon:hover{opacity:.8}#actionTabs #header{height:30px;font-size:16px;color:#fff;background:#222;grid-row:1;text-align:center;display:grid;grid-template-columns:30px 1fr 50px;user-select:none}#actionTabs #header #logo{grid-column:1;width:24px;height:24px;display:flex;align-self:center;justify-self:center}#actionTabs #header #back{grid-column:1;display:grid;align-self:center;justify-self:center;cursor:pointer}#actionTabs #header #title{grid-column:2;display:grid;align-items:center;text-align:center}#actionTabs #header #commands{grid-column:3;display:grid;align-items:center;grid-template-columns:1fr 1fr}#actionTabs #header #commands .expand{grid-column:1;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs #header #commands .close{grid-column:2;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu{display:grid;grid-row:2;grid-template-rows:40px 1fr;font:14px "Arial";overflow:hidden}#actionTabs .tabsMenu .labels{grid-row:1;display:flex;align-items:center;justify-items:center;border-bottom:1px solid #fff;margin:0;padding:0}#actionTabs .tabsMenu .labels .label{font-size:24px;color:#fff;width:40px;display:flex;align-content:center;justify-content:center;border:1px solid rgba(0,0,0,0);border-bottom:none;background:#333;padding:5px;height:28px;cursor:pointer}#actionTabs .tabsMenu .labels .label.active{border-color:#fff;border-bottom:2px solid rgba(0,0,0,0);margin-bottom:-2px}#actionTabs .tabsMenu .panes{grid-row:2;display:grid;grid-template-rows:100%;overflow:hidden}#actionTabs .tabsMenu .panes .infoMessage{opacity:.5;color:#fff;margin:15px 5px 0px 5px}#actionTabs .tabsMenu .panes .gradient-step{display:grid;grid-template-rows:100%;grid-template-columns:20px 30px 40px auto 20px 30px;padding-top:5px;padding-left:5px;padding-bottom:5px;align-items:center}#actionTabs .tabsMenu .panes .gradient-step .step{grid-row:1;grid-column:1}#actionTabs .tabsMenu .panes .gradient-step .color1{height:100%}#actionTabs .tabsMenu .panes .gradient-step .color2{height:100%;padding-left:5px}#actionTabs .tabsMenu .panes .gradient-step .factor1{grid-row:1;grid-column:2;cursor:pointer}#actionTabs .tabsMenu .panes .gradient-step .factor2{padding-left:5px;grid-row:1;grid-column:3;cursor:pointer}#actionTabs .tabsMenu .panes .gradient-step .factor2 .grayed{background:gray;border-color:gray}#actionTabs .tabsMenu .panes .gradient-step .numeric-input{width:calc(100% - 5px)}#actionTabs .tabsMenu .panes .gradient-step .icon{cursor:pointer}#actionTabs .tabsMenu .panes .gradient-step .step-value{margin-left:5px;grid-row:1;grid-column:3;text-align:right;margin-right:5px}#actionTabs .tabsMenu .panes .gradient-step .step-slider{grid-row:1;grid-column:4;display:grid;justify-content:stretch;align-content:center;margin-right:12px}#actionTabs .tabsMenu .panes .gradient-step .step-slider input{width:100%}#actionTabs .tabsMenu .panes .gradient-step .step-slider .range:hover{opacity:1}#actionTabs .tabsMenu .panes .gradient-step .step-slider .range{-webkit-appearance:none;height:6px;background:#d3d3d3;border-radius:5px;outline:none;opacity:.7;transition:opacity .2s}#actionTabs .tabsMenu .panes .gradient-step .step-slider .range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:14px;height:14px;border-radius:50%;background:#337ab7;cursor:pointer}#actionTabs .tabsMenu .panes .gradient-step .step-slider .range::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#337ab7;cursor:pointer}#actionTabs .tabsMenu .panes .gradient-step .gradient-copy{grid-row:1;grid-column:5;display:grid;align-content:center;justify-content:center}#actionTabs .tabsMenu .panes .gradient-step .gradient-copy .img{height:20px;width:20px}#actionTabs .tabsMenu .panes .gradient-step .gradient-copy .img:hover{cursor:pointer}#actionTabs .tabsMenu .panes .gradient-step .gradient-delete{grid-row:1;grid-column:6;display:grid;align-content:center;justify-content:center}#actionTabs .tabsMenu .panes .gradient-step .gradient-delete .img{height:20px;width:20px}#actionTabs .tabsMenu .panes .gradient-step .gradient-delete .img:hover{cursor:pointer}#actionTabs .tabsMenu .panes .pane{color:#fff;overflow-x:hidden;overflow-y:auto;height:100%;user-select:none}#actionTabs .tabsMenu .panes .pane .animation-info{border-left:#adff2f 3px solid;margin-left:5px;padding-left:5px !important}#actionTabs .tabsMenu .panes .pane .underline{border-bottom:.5px solid hsla(0,0%,100%,.5)}#actionTabs .tabsMenu .panes .pane .textureLinkLine{display:grid;grid-template-columns:auto 1fr}#actionTabs .tabsMenu .panes .pane .textureLinkLine .debug{grid-column:1;margin-left:5px;margin-right:5px;display:block;align-items:center;justify-items:center;cursor:pointer;opacity:.5}#actionTabs .tabsMenu .panes .pane .textureLinkLine .debug.selected{opacity:1}#actionTabs .tabsMenu .panes .pane .textureLinkLine .textLine{grid-column:2}#actionTabs .tabsMenu .panes .pane .textureLinkLine .actionIcon{display:inline-block;margin-top:6px;margin-right:4px}#actionTabs .tabsMenu .panes .pane .messageLine{text-align:center;font-size:12px;font-style:italic;opacity:.6}#actionTabs .tabsMenu .panes .pane .iconMessageLine{padding-left:2px;height:30px;display:grid;grid-template-columns:30px 1fr}#actionTabs .tabsMenu .panes .pane .iconMessageLine .icon{grid-column:1;display:grid;align-items:center;justify-items:center}#actionTabs .tabsMenu .panes .pane .iconMessageLine .value{grid-column:2;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .color-picker{height:calc(100% - 8px);margin:4px;width:100%}#actionTabs .tabsMenu .panes .pane .color-picker .color-rect{height:calc(100% - 4px);border:2px #fff solid;cursor:pointer;min-height:18px}#actionTabs .tabsMenu .panes .pane .color-picker .color-picker-cover{position:fixed;top:0px;right:0px;bottom:0px;left:0px;z-index:100}#actionTabs .tabsMenu .panes .pane .color-picker .color-picker-float{position:absolute}#actionTabs .tabsMenu .panes .pane .linkButtonLine{padding-left:2px;height:30px;display:grid;grid-template-columns:1fr auto 20px}#actionTabs .tabsMenu .panes .pane .linkButtonLine .link{grid-column:1;display:flex;align-items:center;text-decoration:underline;cursor:pointer}#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button{grid-column:2}#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button{background:#222;border:1px solid #337ab7;margin:5px 10px 5px 10px;color:#fff;padding:4px 5px;opacity:.9;cursor:pointer}#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button:hover{opacity:1}#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button:active{background:#282828}#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button:focus{border:1px solid #337ab7;outline:0px}#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-icon{grid-column:3;display:grid;align-content:center}#actionTabs .tabsMenu .panes .pane .textLine{padding-left:2px;height:30px;display:grid;grid-template-columns:1fr auto}#actionTabs .tabsMenu .panes .pane .textLine.indented{grid-template-columns:100%}#actionTabs .tabsMenu .panes .pane .textLine.indented .link-value{grid-column:1;text-align:start;margin-left:20px;opacity:.6;max-width:unset}#actionTabs .tabsMenu .panes .pane .textLine.indented .value{grid-column:1;text-align:start;margin-left:20px;opacity:.6;max-width:unset}#actionTabs .tabsMenu .panes .pane .textLine.reduced-opacity{opacity:.6;padding-left:25px}#actionTabs .tabsMenu .panes .pane .textLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .textLine .link-value{grid-column:2;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-align:end;opacity:.8;margin:5px;margin-top:7px;max-width:140px;text-decoration:underline;cursor:pointer}#actionTabs .tabsMenu .panes .pane .textLine .value{grid-column:2;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-align:end;opacity:.8;margin:5px;margin-top:7px;max-width:200px;user-select:text}#actionTabs .tabsMenu .panes .pane .textLine .value.check{color:green}#actionTabs .tabsMenu .panes .pane .textLine .value.uncheck{color:red}#actionTabs .tabsMenu .panes .pane .gradient-container{margin-top:3px}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-label{height:30px;display:grid;align-content:center}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step{display:grid;grid-template-rows:100%;grid-template-columns:25px 50px 55px 40px auto 20px 5px;padding-top:5px;padding-left:5px;padding-bottom:5px;align-items:center;border-left:orange 3px solid}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step{grid-row:1;grid-column:1}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .color1{height:100%}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .color2{height:100%;padding-left:5px}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .factor1{grid-row:1;grid-column:2;cursor:pointer}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .factor2{padding-left:5px;grid-row:1;grid-column:3;cursor:pointer}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .factor2 .grayed{background:gray;border-color:gray}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .numeric-input{width:calc(100% - 5px)}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step-value{margin-left:5px;grid-row:1;grid-column:4;text-align:right;margin-right:5px}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step-slider{grid-row:1;grid-column:5;display:grid;justify-content:stretch;align-content:center;margin-right:5px}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step-slider input{width:100%}#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .gradient-delete{grid-row:1;grid-column:6;display:grid;align-content:center;justify-content:center}#actionTabs .tabsMenu .panes .pane .textInputLine{padding-left:2px;height:30px;display:grid;grid-template-columns:1fr 120px}#actionTabs .tabsMenu .panes .pane .textInputLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .textInputLine .value{display:flex;align-items:center;grid-column:2}#actionTabs .tabsMenu .panes .pane .textInputLine .value input{width:110px}#actionTabs .tabsMenu .panes .pane .buttonLine{height:30px;display:grid;align-items:center;justify-items:stretch}#actionTabs .tabsMenu .panes .pane .buttonLine input[type=file]{display:none}#actionTabs .tabsMenu .panes .pane .buttonLine .file-upload{background:#222;border:1px solid #337ab7;margin:5px 10px 5px 10px;color:#fff;padding:4px 5px;font-size:13px;opacity:.9;cursor:pointer;text-align:center}#actionTabs .tabsMenu .panes .pane .buttonLine .file-upload:hover{opacity:1}#actionTabs .tabsMenu .panes .pane .buttonLine .file-upload:active{transform:scale(0.98);transform-origin:.5 .5}#actionTabs .tabsMenu .panes .pane .buttonLine button{background:#222;border:1px solid #337ab7;margin:5px 10px 5px 10px;color:#fff;padding:4px 5px;opacity:.9;cursor:pointer}#actionTabs .tabsMenu .panes .pane .buttonLine button:hover{opacity:1}#actionTabs .tabsMenu .panes .pane .buttonLine button:active{background:#282828}#actionTabs .tabsMenu .panes .pane .buttonLine button:focus{border:1px solid #337ab7;outline:0px}#actionTabs .tabsMenu .panes .pane .radioLine{padding-left:2px;height:30px;display:grid;grid-template-columns:1fr 24px}#actionTabs .tabsMenu .panes .pane .radioLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer{grid-column:2;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .radio{display:none}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .radio:checked+label:before{border-color:#337ab7}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .radio:checked+label:after{transform:scale(1)}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio{display:inline-block;height:14px;position:relative;padding:0 24px;margin-bottom:0;cursor:pointer;vertical-align:bottom}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:before,#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:after{position:absolute;content:"";border-radius:50%;transition:all .3s ease;transition-property:transform,border-color}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:before{left:0px;top:0;width:16px;height:16px;border:2px solid #fff}#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:after{top:6px;left:6px;width:8px;height:8px;transform:scale(0);background:#337ab7}#actionTabs .tabsMenu .panes .pane .radioLine .copy{grid-column:3;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .radioLine .copy img{height:100%}#actionTabs .tabsMenu .panes .pane .vector3Line{padding-left:2px;display:grid}#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine{display:grid;grid-template-columns:1fr auto 20px;height:30px}#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .label{grid-column:1;display:flex;align-items:center;white-space:nowrap;overflow:hidden}#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .vector{grid-column:2;display:flex;align-items:center;text-align:right;opacity:.8;padding-left:5px}#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .expand{grid-column:3;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .copy{grid-column:4;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .copy img{height:100%}#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine{display:grid;padding-right:5px;border-left:1px solid #337ab7}#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine .numeric{display:grid;grid-template-columns:1fr auto}#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine .numeric-label{text-align:right;grid-column:1;display:flex;align-items:center;justify-self:right;margin-right:10px}#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine .numeric-value{width:120px;grid-column:2;display:flex;align-items:center;border:1px solid #337ab7}#actionTabs .tabsMenu .panes .pane .checkBoxLine{padding-left:2px;height:30px;display:grid;grid-template-columns:1fr auto 20px 10px}#actionTabs .tabsMenu .panes .pane .checkBoxLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox{grid-column:2;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl{position:relative;display:block;height:14px;width:34px;margin-right:5px;background:#898989;border-radius:100px;cursor:pointer;transition:all .3s ease}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl.checked{background:#337ab7}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl:after{position:absolute;left:3px;top:2px;display:block;width:10px;height:10px;border-radius:100px;background:#fff;box-shadow:0px 3px 3px rgba(0,0,0,.05);content:"";transition:all .15s ease}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl:after.checked{left:20px;background:#164975}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl.checked:after{position:absolute;top:2px;display:block;width:10px;height:10px;border-radius:100px;background:#fff;box-shadow:0px 3px 3px rgba(0,0,0,.05);content:"";transition:all .15s ease;left:20px;background:#164975}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl:active:after{transform:scale(1.15, 0.85)}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .hidden{display:none}#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .icon{display:none}#actionTabs .tabsMenu .panes .pane .checkBoxLine .copy{grid-column:3;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .checkBoxLine .copy img{height:100%}#actionTabs .tabsMenu .panes .pane .textureLine{display:grid;grid-template-rows:30px auto}#actionTabs .tabsMenu .panes .pane .textureLine .control{margin-top:2px;grid-row:1;display:grid;grid-template-columns:1fr 40px 40px 40px 40px 40px 1fr}#actionTabs .tabsMenu .panes .pane .textureLine .control .red{grid-column:2}#actionTabs .tabsMenu .panes .pane .textureLine .control .green{grid-column:3}#actionTabs .tabsMenu .panes .pane .textureLine .control .blue{grid-column:4}#actionTabs .tabsMenu .panes .pane .textureLine .control .alpha{grid-column:5}#actionTabs .tabsMenu .panes .pane .textureLine .control .all{grid-column:6}#actionTabs .tabsMenu .panes .pane .textureLine .control3D{margin-top:2px;grid-row:1;display:grid;grid-template-columns:1fr 40px 40px 40px 40px 40px 40px 1fr}#actionTabs .tabsMenu .panes .pane .textureLine .control3D .px{grid-column:2}#actionTabs .tabsMenu .panes .pane .textureLine .control3D .nx{grid-column:3}#actionTabs .tabsMenu .panes .pane .textureLine .control3D .py{grid-column:4}#actionTabs .tabsMenu .panes .pane .textureLine .control3D .ny{grid-column:5}#actionTabs .tabsMenu .panes .pane .textureLine .control3D .pz{grid-column:6}#actionTabs .tabsMenu .panes .pane .textureLine .control3D .nz{grid-column:7}#actionTabs .tabsMenu .panes .pane .textureLine .command{border:1px solid rgba(0,0,0,0);background:rgba(0,0,0,0);color:#fff}#actionTabs .tabsMenu .panes .pane .textureLine .selected{border:1px solid #337ab7}#actionTabs .tabsMenu .panes .pane .textureLine .preview{grid-row:2;display:grid;align-self:center;justify-self:center;height:256px;width:256px;margin-top:5px;margin-bottom:5px;border:1px solid #fff;background-size:32px 32px;background-color:#fff;background-image:url(${d})}#actionTabs .tabsMenu .panes .pane .gltf-extension-property{margin-left:30px;border-left:1px solid #337ab7}#actionTabs .tabsMenu .panes .pane .floatLine{padding-left:2px;height:30px;display:grid;grid-template-columns:1fr 120px}#actionTabs .tabsMenu .panes .pane .floatLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .floatLine .value{grid-column:2;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .floatLine .value input{width:110px}#actionTabs .tabsMenu .panes .pane .floatLine .copy{grid-column:3;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .floatLine .copy img{height:100%}#actionTabs .tabsMenu .panes .pane .sliderLine{padding-left:2px;height:30px;display:grid;grid-template-rows:100%;grid-template-columns:1fr 50px auto}#actionTabs .tabsMenu .panes .pane .sliderLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .sliderLine .withMargins{margin-left:5px}#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine{padding-left:2px}#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input{width:35px}#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input::-webkit-outer-spin-button,#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input[type=number]{-moz-appearance:textfield}#actionTabs .tabsMenu .panes .pane .sliderLine .slider{grid-column:3;grid-row:1;margin-right:5px;width:90%;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range{-webkit-appearance:none;width:100%;height:6px;background:#d3d3d3;border-radius:5px;outline:none;opacity:.7;transition:opacity .2s}#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range.overflow{background-color:red}#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range:hover{opacity:1}#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:14px;height:14px;border-radius:50%;background:#337ab7;cursor:pointer}#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#337ab7;cursor:pointer}#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .copy{display:none}#actionTabs .tabsMenu .panes .pane .sliderLine .copy{grid-column:4;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .sliderLine .copy img{height:100%}#actionTabs .tabsMenu .panes .pane .color3Line{padding-left:2px;display:grid}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine{height:30px;display:grid;grid-template-columns:1fr auto 20px}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3{grid-column:2;width:50px;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input[type=color]{-webkit-appearance:none;border:1px solid hsla(0,0%,100%,.5);padding:0;width:30px;height:20px}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input[type=color]::-webkit-color-swatch-wrapper{padding:0}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input[type=color]::-webkit-color-swatch{border:none}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input{margin-right:5px}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .expand{grid-column:3;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .copy{grid-column:4;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .copy img{height:100%}#actionTabs .tabsMenu .panes .pane .color3Line .secondLine{display:grid;padding-right:5px;border-left:1px solid #337ab7}#actionTabs .tabsMenu .panes .pane .color3Line .secondLine .numeric{display:grid;grid-template-columns:1fr auto}#actionTabs .tabsMenu .panes .pane .color3Line .secondLine .numeric-label{text-align:right;grid-column:1;display:flex;align-items:center;justify-self:right;margin-right:10px}#actionTabs .tabsMenu .panes .pane .color3Line .secondLine .numeric-value{width:120px;grid-column:2;display:flex;align-items:center;border:1px solid #337ab7}#actionTabs .tabsMenu .panes .pane .listLine{padding-left:2px;height:30px;display:grid;grid-template-columns:1fr auto 20px 10px}#actionTabs .tabsMenu .panes .pane .listLine .label{grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .listLine .options{grid-column:2;display:flex;align-items:center;margin-right:5px}#actionTabs .tabsMenu .panes .pane .listLine .options select{width:115px}#actionTabs .tabsMenu .panes .pane .listLine .copy{grid-column:3;display:grid;align-items:center;justify-items:center;cursor:pointer}#actionTabs .tabsMenu .panes .pane .listLine .copy img{height:100%}#actionTabs .tabsMenu .panes .pane .paneContainer{margin-top:3px;display:grid;grid-template-rows:100%;grid-template-columns:100%}#actionTabs .tabsMenu .panes .pane .paneContainer .paneList{border-left:3px solid rgba(0,0,0,0)}#actionTabs .tabsMenu .panes .pane .paneContainer:hover .paneList{border-left:3px solid rgba(51,122,183,.8)}#actionTabs .tabsMenu .panes .pane .paneContainer:hover .paneContainer-content .header .title{border-left:3px solid #337ab7}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-highlight-border{grid-row:1;grid-column:1;opacity:1;border:3px solid red;margin-bottom:-5px;z-index:100;transition:opacity 250ms;pointer-events:none}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-highlight-border.transparent{opacity:0}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content{grid-row:1;grid-column:1}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header{display:grid;grid-template-columns:1fr auto;background:#555;height:30px;padding-right:5px;cursor:pointer}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header .title{border-left:3px solid rgba(0,0,0,0);padding-left:5px;grid-column:1;display:flex;align-items:center}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header .collapse{grid-column:2;display:flex;align-items:center;justify-items:center;transform-origin:center}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header .collapse.closed{transform:rotate(180deg)}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .paneList>div:not(:last-child){border-bottom:.5px solid hsla(0,0%,100%,.1)}#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .fragment>div:not(:last-child){border-bottom:.5px solid hsla(0,0%,100%,.1)}`,"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/actionTabs.scss"],names:[],mappings:"AAEA,gBACI,iBAAA,CACA,SAAA,CACA,OAAA,CACA,UAAA,CAGJ,oBACI,YAAA,CAGJ,YACI,eAAA,CACA,WAAA,CACA,QAAA,CACA,SAAA,CACA,YAAA,CACA,2BAAA,CACA,iBAAA,CACA,eAAA,CAEA,6BACI,UAAA,CAGJ,oBACI,WAAA,CACA,cAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,iBAAA,CACA,YAAA,CACA,mCAAA,CACA,gBAAA,CAEA,0BACI,aAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,iBAAA,CACA,mBAAA,CAGJ,0BACI,aAAA,CACA,YAAA,CACA,iBAAA,CACA,mBAAA,CACA,cAAA,CAGJ,2BACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,iBAAA,CAGJ,8BACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,6BAAA,CAEA,sCACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAGJ,qCACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAKZ,sBACI,YAAA,CACA,UAAA,CACA,2BAAA,CACA,iBAAA,CACA,eAAA,CAEA,8BACI,UAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,4BAAA,CACA,QAAA,CACA,SAAA,CAEA,qCACI,cAAA,CACA,UAAA,CACA,UAAA,CACA,YAAA,CACA,oBAAA,CACA,sBAAA,CACA,8BAAA,CACA,kBAAA,CACA,eAAA,CACA,WAAA,CACA,WAAA,CACA,cAAA,CAEA,4CACI,iBAAA,CACA,qCAAA,CACA,kBAAA,CAKZ,6BACI,UAAA,CACA,YAAA,CACA,uBAAA,CAEA,eAAA,CAEA,0CACI,UAAA,CACA,UAAA,CACA,uBAAA,CAGJ,4CACI,YAAA,CACA,uBAAA,CACA,mDAAA,CACA,eAAA,CACA,gBAAA,CACA,kBAAA,CACA,kBAAA,CAEA,kDACI,UAAA,CACA,aAAA,CAGJ,oDACI,WAAA,CAGJ,oDACI,WAAA,CACA,gBAAA,CAGJ,qDACI,UAAA,CACA,aAAA,CACA,cAAA,CAGJ,qDACI,gBAAA,CACA,UAAA,CACA,aAAA,CACA,cAAA,CAEA,6DACI,eAAA,CACA,iBAAA,CAIR,2DACI,sBAAA,CAGJ,kDACI,cAAA,CAGJ,wDACI,eAAA,CACA,UAAA,CACA,aAAA,CACA,gBAAA,CACA,gBAAA,CAGJ,yDACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,uBAAA,CACA,oBAAA,CACA,iBAAA,CAEA,+DACI,UAAA,CAEJ,sEACI,SAAA,CAGJ,gEACI,uBAAA,CACA,UAAA,CACA,kBAAA,CACA,iBAAA,CACA,YAAA,CACA,UAAA,CACA,sBAAA,CAGJ,sFACI,uBAAA,CACA,eAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CAGJ,kFACI,UAAA,CACA,WAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CAIR,2DACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,oBAAA,CACA,sBAAA,CAEA,gEACI,WAAA,CACA,UAAA,CAEJ,sEACI,cAAA,CAGR,6DACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,oBAAA,CACA,sBAAA,CACA,kEACI,WAAA,CACA,UAAA,CAEJ,wEACI,cAAA,CAKZ,mCACI,UAAA,CAEA,iBAAA,CACA,eAAA,CACA,WAAA,CAEA,gBAAA,CAEA,mDACI,6BAAA,CACA,eAAA,CACA,2BAAA,CAGJ,8CACI,2CAAA,CAGJ,oDACI,YAAA,CACA,8BAAA,CAEA,2DACI,aAAA,CACA,eAAA,CACA,gBAAA,CACA,aAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,UAAA,CAEA,oEACI,SAAA,CAIR,8DACI,aAAA,CAGJ,gEACI,oBAAA,CACA,cAAA,CACA,gBAAA,CAIR,gDACI,iBAAA,CACA,cAAA,CACA,iBAAA,CACA,UAAA,CAGJ,oDACI,gBAtUA,CAuUA,WAAA,CACA,YAAA,CACA,8BAAA,CAEA,0DACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CAGJ,2DACI,aAAA,CACA,YAAA,CACA,kBAAA,CAIR,iDACI,uBAAA,CACA,UAAA,CACA,UAAA,CAEA,6DACI,uBAAA,CACA,qBAAA,CACA,cAAA,CACA,eAAA,CAGJ,qEACI,cAAA,CACA,OAAA,CACA,SAAA,CACA,UAAA,CACA,QAAA,CACA,WAAA,CAGJ,qEACI,iBAAA,CAIR,mDACI,gBApXA,CAqXA,WAAA,CACA,YAAA,CACA,mCAAA,CAEA,yDACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,yBAAA,CACA,cAAA,CAGJ,gEACI,aAAA,CAEA,uEACI,eAAA,CACA,wBAAA,CACA,wBAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,cAAA,CAGJ,6EACI,SAAA,CAGJ,8EACI,kBAAA,CAGJ,6EACI,wBAAA,CACA,WAAA,CAIR,8DACI,aAAA,CACA,YAAA,CACA,oBAAA,CAIR,6CACI,gBApaA,CAqaA,WAAA,CACA,YAAA,CACA,8BAAA,CAEA,sDACI,0BAAA,CAEA,kEACI,aAAA,CACA,gBAAA,CACA,gBAAA,CACA,UAAA,CACA,eAAA,CAGJ,6DACI,aAAA,CACA,gBAAA,CACA,gBAAA,CACA,UAAA,CACA,eAAA,CAIR,6DACI,UAAA,CACA,iBAAA,CAGJ,oDACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,yDACI,aAAA,CACA,kBAAA,CACA,sBAAA,CACA,eAAA,CACA,cAAA,CACA,UAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CACA,yBAAA,CACA,cAAA,CAGJ,oDACI,aAAA,CACA,kBAAA,CACA,sBAAA,CACA,eAAA,CACA,cAAA,CACA,UAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CACA,gBAAA,CAEA,0DACI,WAAA,CAGJ,4DACI,SAAA,CAKZ,uDACI,cAAA,CAEA,uEACI,WAAA,CACA,YAAA,CACA,oBAAA,CAGJ,sEACI,YAAA,CACA,uBAAA,CACA,uDAAA,CACA,eAAA,CACA,gBAAA,CACA,kBAAA,CACA,kBAAA,CACA,4BAAA,CAEA,4EACI,UAAA,CACA,aAAA,CAGJ,8EACI,WAAA,CAGJ,8EACI,WAAA,CACA,gBAAA,CAGJ,+EACI,UAAA,CACA,aAAA,CACA,cAAA,CAGJ,+EACI,gBAAA,CACA,UAAA,CACA,aAAA,CACA,cAAA,CAEA,uFACI,eAAA,CACA,iBAAA,CAIR,qFACI,sBAAA,CAGJ,kFACI,eAAA,CACA,UAAA,CACA,aAAA,CACA,gBAAA,CACA,gBAAA,CAGJ,mFACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,uBAAA,CACA,oBAAA,CACA,gBAAA,CAEA,yFACI,UAAA,CAIR,uFACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,oBAAA,CACA,sBAAA,CAKZ,kDACI,gBAnkBA,CAokBA,WAAA,CACA,YAAA,CACA,+BAAA,CAEA,yDACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,yDACI,YAAA,CACA,kBAAA,CACA,aAAA,CAEA,+DACI,WAAA,CAKZ,+CACI,WAAA,CACA,YAAA,CACA,kBAAA,CACA,qBAAA,CAEA,gEACI,YAAA,CAGJ,4DACI,eAAA,CACA,wBAAA,CACA,wBAAA,CACA,UAAA,CACA,eAAA,CACA,cAAA,CACA,UAAA,CACA,cAAA,CACA,iBAAA,CAGJ,kEACI,SAAA,CAGJ,mEACI,qBAAA,CACA,sBAAA,CAGJ,sDACI,eAAA,CACA,wBAAA,CACA,wBAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,cAAA,CAGJ,4DACI,SAAA,CAGJ,6DACI,kBAAA,CAGJ,4DACI,wBAAA,CACA,WAAA,CAIR,8CACI,gBAjpBA,CAkpBA,WAAA,CACA,YAAA,CACA,8BAAA,CAEA,qDACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,8DACI,aAAA,CACA,YAAA,CACA,kBAAA,CAEA,qEACI,YAAA,CAEA,0FACI,oBAAA,CAEJ,yFACI,kBAAA,CAIR,6EACI,oBAAA,CACA,WAAA,CACA,iBAAA,CACA,cAAA,CACA,eAAA,CACA,cAAA,CACA,qBAAA,CACA,uKAEI,iBAAA,CACA,UAAA,CACA,iBAAA,CACA,uBAAA,CACA,0CAAA,CAEJ,oFACI,QAAA,CACA,KAAA,CACA,UAAA,CACA,WAAA,CACA,qBAAA,CAEJ,mFACI,OAAA,CACA,QAAA,CACA,SAAA,CACA,UAAA,CACA,kBAAA,CACA,kBAAA,CAKZ,oDACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,wDACI,WAAA,CAKZ,gDACI,gBA3tBA,CA4tBA,YAAA,CAEA,2DACI,YAAA,CACA,mCAAA,CACA,WAAA,CAEA,kEACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,eAAA,CAGJ,mEACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,gBAAA,CACA,UAAA,CACA,gBAAA,CAGJ,mEACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAGJ,iEACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,qEACI,WAAA,CAKZ,4DACI,YAAA,CACA,iBAAA,CACA,6BAAA,CAEA,qEACI,YAAA,CACA,8BAAA,CAGJ,2EACI,gBAAA,CACA,aAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,iBAAA,CAGJ,2EACI,WAAA,CACA,aAAA,CACA,YAAA,CACA,kBAAA,CACA,wBAAA,CAKZ,iDACI,gBAtyBA,CAuyBA,WAAA,CACA,YAAA,CACA,wCAAA,CAEA,wDACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,2DACI,aAAA,CAEA,YAAA,CACA,kBAAA,CAEA,gEACI,iBAAA,CACA,aAAA,CACA,WAAA,CACA,UAAA,CACA,gBAAA,CACA,kBAAA,CACA,mBAAA,CACA,cAAA,CACA,uBAAA,CAEA,wEACI,kBAAA,CAIR,sEACI,iBAAA,CACA,QAAA,CACA,OAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,mBAAA,CACA,eAAA,CACA,sCAAA,CACA,UAAA,CACA,wBAAA,CAEA,8EACI,SAAA,CACA,kBAAA,CAIR,8EACI,iBAAA,CACA,OAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,mBAAA,CACA,eAAA,CACA,sCAAA,CACA,UAAA,CACA,wBAAA,CACA,SAAA,CACA,kBAAA,CAGJ,6EACI,2BAAA,CAGJ,mEACI,YAAA,CAGJ,iEACI,YAAA,CAIR,uDACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,2DACI,WAAA,CAKZ,gDACI,YAAA,CACA,4BAAA,CAEA,yDACI,cAAA,CACA,UAAA,CACA,YAAA,CACA,sDAAA,CAEA,8DACI,aAAA,CAGJ,gEACI,aAAA,CAGJ,+DACI,aAAA,CAGJ,gEACI,aAAA,CAGJ,8DACI,aAAA,CAIR,2DACI,cAAA,CACA,UAAA,CACA,YAAA,CACA,2DAAA,CAEA,+DACI,aAAA,CAGJ,+DACI,aAAA,CAGJ,+DACI,aAAA,CAGJ,+DACI,aAAA,CAGJ,+DACI,aAAA,CAGJ,+DACI,aAAA,CAIR,yDACI,8BAAA,CACA,wBAAA,CACA,UAAA,CAGJ,0DACI,wBAAA,CAGJ,yDACI,UAAA,CACA,YAAA,CACA,iBAAA,CACA,mBAAA,CACA,YAAA,CACA,WAAA,CACA,cAAA,CACA,iBAAA,CACA,qBAAA,CACA,yBAAA,CACA,qBAAA,CACA,wDAAA,CAIR,4DACI,gBAAA,CACA,6BAAA,CAGJ,8CACI,gBAh+BA,CAi+BA,WAAA,CACA,YAAA,CACA,+BAAA,CAEA,qDACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,qDACI,aAAA,CAEA,YAAA,CACA,kBAAA,CAEA,2DACI,WAAA,CAIR,oDACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,wDACI,WAAA,CAKZ,+CACI,gBAngCA,CAogCA,WAAA,CACA,YAAA,CACA,uBAAA,CACA,mCAAA,CAEA,sDACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,4DACI,eAAA,CAGJ,0DACI,gBAphCJ,CAshCI,iEACI,aAAA,CACA,YAAA,CACA,kBAAA,CAEA,uEACI,UAAA,CAGJ,oMAEI,uBAAA,CACA,QAAA,CAGJ,oFACI,yBAAA,CAKZ,uDACI,aAAA,CACA,UAAA,CACA,gBAAA,CACA,SAAA,CACA,YAAA,CACA,kBAAA,CAEA,8DACI,uBAAA,CACA,UAAA,CACA,UAAA,CACA,kBAAA,CACA,iBAAA,CACA,YAAA,CACA,UAAA,CACA,sBAAA,CAEA,uEACI,oBAAA,CAIR,oEACI,SAAA,CAGJ,oFACI,uBAAA,CACA,eAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CAGJ,gFACI,UAAA,CACA,WAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CAKJ,gEACI,YAAA,CAIR,qDACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,yDACI,WAAA,CAKZ,+CACI,gBA5mCA,CA6mCA,YAAA,CAEA,0DACI,WAAA,CACA,YAAA,CACA,mCAAA,CAEA,iEACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,kEACI,aAAA,CACA,UAAA,CAEA,YAAA,CACA,kBAAA,CAEA,oFACI,uBAAA,CACA,mCAAA,CACA,SAAA,CACA,UAAA,CACA,WAAA,CAEJ,kHACI,SAAA,CAEJ,0GACI,WAAA,CAGJ,wEACI,gBAAA,CAIR,kEACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAGJ,gEACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,oEACI,WAAA,CAKZ,2DACI,YAAA,CACA,iBAAA,CACA,6BAAA,CAEA,oEACI,YAAA,CACA,8BAAA,CAGJ,0EACI,gBAAA,CACA,aAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,iBAAA,CAGJ,0EACI,WAAA,CACA,aAAA,CACA,YAAA,CACA,kBAAA,CACA,wBAAA,CAKZ,6CACI,gBAtsCA,CAusCA,WAAA,CACA,YAAA,CACA,wCAAA,CAEA,oDACI,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,sDACI,aAAA,CAEA,YAAA,CACA,kBAAA,CACA,gBAAA,CAEA,6DACI,WAAA,CAIR,mDACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CACA,uDACI,WAAA,CAKZ,kDACI,cAAA,CACA,YAAA,CACA,uBAAA,CACA,0BAAA,CAEA,4DACI,mCAAA,CAIA,kEACI,yCAAA,CAKI,8FACI,6BAAA,CAMhB,kFACI,UAAA,CACA,aAAA,CACA,SAAA,CACA,oBAAA,CACA,kBAAA,CACA,WAAA,CACA,wBAAA,CACA,mBAAA,CAEA,8FACI,SAAA,CAIR,yEACI,UAAA,CACA,aAAA,CAEA,iFACI,YAAA,CACA,8BAAA,CACA,eAAA,CACA,WAAA,CACA,iBAAA,CACA,cAAA,CAEA,wFACI,mCAAA,CACA,gBAAA,CACA,aAAA,CACA,YAAA,CACA,kBAAA,CAGJ,2FACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,uBAAA,CAEA,kGACI,wBAAA,CAKZ,wGACI,2CAAA,CAGJ,wGACI,2CAAA",sourceRoot:""}]),c.locals={};const h=c},5030:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#performance-viewer{display:grid;height:100%;width:100%;grid-template-columns:300px 1fr;font-family:"acumin-pro"}#performance-viewer .performancePlayheadButton{grid-area:liveButton;height:30px;width:100px;justify-self:right;background-color:#dcdfe1;color:#2e3f47;outline:2px #2e3f47;margin:5px;position:absolute;top:10px;right:10px}#performance-viewer #performance-viewer-sidebar{display:flex;flex-direction:column;overflow-y:scroll;border:2px solid gray}#performance-viewer #performance-viewer-sidebar .sidebar-item{display:grid;width:100%;height:30px;font-size:14px;padding:2.5px 0px;align-items:center}#performance-viewer #performance-viewer-sidebar .header{color:#fff;grid-template-columns:10px 9fr 1fr 10px}#performance-viewer #performance-viewer-sidebar .header .category{grid-column:2}#performance-viewer #performance-viewer-sidebar .header .value{grid-column:3}#performance-viewer #performance-viewer-sidebar .version-header{background-color:#2e3f47;color:#fff;grid-template-columns:10px 1fr 1fr 10px;font-size:14px;height:35px}#performance-viewer #performance-viewer-sidebar .version-header .category{grid-column:2}#performance-viewer #performance-viewer-sidebar .version-header .value{grid-column:3;display:flex;justify-content:end}#performance-viewer #performance-viewer-sidebar .category-header{background-color:#4a5960;text-transform:uppercase;font-size:14px;height:30px}#performance-viewer #performance-viewer-sidebar .category-header .checkBoxLine{color:#dcdfe1}#performance-viewer #performance-viewer-sidebar .measure{color:#000;grid-template-columns:18px 6fr 1fr;font-family:"acumin-pro-condensed"}#performance-viewer #performance-viewer-sidebar .measure .category{display:grid;grid-template-columns:18px 7px 18px 10px 1fr;grid-column:2;align-items:center}#performance-viewer #performance-viewer-sidebar .measure .category .color-picker{grid-column:3}#performance-viewer #performance-viewer-sidebar .measure .category .sidebar-item-label{grid-column:5}#performance-viewer #performance-viewer-sidebar .measure .value{grid-column:3}#performance-viewer #performance-viewer-sidebar .measure:nth-child(odd){background-color:#dcdfe1}#performance-viewer #performance-viewer-sidebar .measure:nth-child(even){background-color:#ebedee}#performance-viewer #performance-viewer-sidebar .checkBoxLine{color:#4a5960;width:100%;height:100%;display:flex;justify-content:center;align-items:center}#performance-viewer #performance-viewer-sidebar .checkBoxLine .disabled{color:#d3d3d3}#performance-viewer #performance-viewer-sidebar .color-picker{width:100%}#performance-viewer #performance-viewer-sidebar .color-picker .color-rect{height:18px;width:18px;cursor:pointer}#performance-viewer #performance-viewer-sidebar .color-picker .color-picker-cover{position:fixed;top:0px;right:0px;bottom:0px;left:0px;z-index:100}#performance-viewer #performance-viewer-sidebar .color-picker .color-picker-float{position:absolute}#performance-viewer #performance-viewer-sidebar .color-picker .color-picker-float .color-picker-container{width:200px}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss"],names:[],mappings:"AAGA,oBACI,YAAA,CACA,WAAA,CACA,UAAA,CACA,+BAAA,CACA,wBAAA,CAEA,+CACI,oBAAA,CACA,WAZO,CAaP,WAAA,CACA,kBAAA,CACA,wBAAA,CACA,aAAA,CACA,mBAAA,CACA,UAAA,CACA,iBAAA,CACA,QAAA,CACA,UAAA,CAGJ,gDACI,YAAA,CACA,qBAAA,CACA,iBAAA,CAEA,qBAAA,CAEA,8DACI,YAAA,CACA,UAAA,CACA,WAAA,CACA,cAAA,CACA,iBAAA,CACA,kBAAA,CAGJ,wDACI,UAAA,CACA,uCAAA,CAEA,kEACI,aAAA,CAGJ,+DACI,aAAA,CAIR,gEACI,wBAAA,CACA,UAAA,CACA,uCAAA,CACA,cAAA,CACA,WAAA,CAEA,0EACI,aAAA,CAGJ,uEACI,aAAA,CACA,YAAA,CACA,mBAAA,CAKR,iEACI,wBAAA,CACA,wBAAA,CACA,cAAA,CACA,WAAA,CAEA,+EACI,aAAA,CAIR,yDACI,UAAA,CACA,kCAAA,CACA,kCAAA,CAEA,mEACI,YAAA,CACA,4CAAA,CACA,aAAA,CACA,kBAAA,CAEA,iFACI,aAAA,CAGJ,uFACI,aAAA,CAIR,gEACI,aAAA,CAKR,wEACI,wBAAA,CAIJ,yEACI,wBAAA,CAGJ,8DACI,aAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,wEACI,aAAA,CAIR,8DACI,UAAA,CAEA,0EACI,WArIH,CAsIG,UAtIH,CAuIG,cAAA,CAGJ,kFACI,cAAA,CACA,OAAA,CACA,SAAA,CACA,UAAA,CACA,QAAA,CACA,WAAA,CAGJ,kFACI,iBAAA,CAEA,0GACI,WAAA",sourceRoot:""}]),a.locals={};const i=a},2685:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#bottom-bar{display:grid;grid-template-rows:100%;grid-template-columns:10px 210px 10px 1fr 10px 61px 10px}#bottom-bar #bottom-bar-total{grid-row:1;grid-column:6;color:#fff;background:#222;height:25px;align-self:center;font-size:12pt}#bottom-bar #bottom-bar-total #clip-range{width:100%}#bottom-bar .control-button .control-button-image{display:unset}#bottom-bar .control-button .control-button-hover-image{display:none}#bottom-bar .control-button:hover{cursor:pointer}#bottom-bar .control-button:hover .control-button-image{display:none}#bottom-bar .control-button:hover .control-button-hover-image{display:unset}#bottom-bar .control-button:active{transform-origin:50% 50%;transform:scale(0.96)}#bottom-bar #media-player{grid-row:1;grid-column:2;display:grid;align-self:center;justify-self:center;grid-template-rows:100%;grid-template-columns:23px 23px 23px 23px 23px 23px 23px}#bottom-bar #media-player #start-key{grid-row:1;grid-column:1}#bottom-bar #media-player #prev-frame{grid-row:1;grid-column:2}#bottom-bar #media-player #first-key{grid-row:1;grid-column:3}#bottom-bar #media-player #rev-key{grid-row:1;grid-column:4}#bottom-bar #media-player #fwd-key{grid-row:1;grid-column:5}#bottom-bar #media-player #next-key{grid-row:1;grid-column:6}#bottom-bar #media-player #next-frame{grid-row:1;grid-column:7}#bottom-bar #media-player #end-key{grid-row:1;grid-column:8}#bottom-bar #range-selector{grid-row:1;grid-column:4;background:#222;width:100%;height:calc(100% - 20px);margin:10px 0;position:relative}#bottom-bar #range-selector #range-scrollbar{position:absolute;left:2px;top:2px;right:2px;bottom:2px;background:#666;display:grid;grid-template-rows:100%;grid-template-columns:20px auto 1fr auto 20px;color:#222;font-family:"acumin-pro-condensed";font-size:14px;min-width:70px}#bottom-bar #range-selector #range-scrollbar #left-handle{grid-row:1;grid-column:1}#bottom-bar #range-selector #range-scrollbar #right-handle{grid-row:1;grid-column:5}#bottom-bar #range-selector #range-scrollbar #from-key{grid-row:1;grid-column:2;align-self:center;justify-self:center;user-select:none;pointer-events:none}#bottom-bar #range-selector #range-scrollbar #to-key{grid-row:1;grid-column:4;align-self:center;justify-self:center;user-select:none;pointer-events:none}#bottom-bar #range-selector #range-scrollbar .handle{width:20px;align-self:center;justify-self:center;cursor:pointer;user-select:none}#bottom-bar #range-selector #range-scrollbar .handle img{pointer-events:none}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss"],names:[],mappings:"AAAA,YACI,YAAA,CACA,uBAAA,CACA,wDAAA,CAEA,8BACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,eAAA,CACA,WAAA,CACA,iBAAA,CACA,cAAA,CAEA,0CACI,UAAA,CAKJ,kDACI,aAAA,CAGJ,wDACI,YAAA,CAGJ,kCACI,cAAA,CAEA,wDACI,YAAA,CAGJ,8DACI,aAAA,CAIR,mCACI,wBAAA,CACA,qBAAA,CAIR,0BACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,iBAAA,CACA,mBAAA,CACA,uBAAA,CACA,wDAAA,CAEA,qCACI,UAAA,CACA,aAAA,CAGJ,sCACI,UAAA,CACA,aAAA,CAGJ,qCACI,UAAA,CACA,aAAA,CAGJ,mCACI,UAAA,CACA,aAAA,CAGJ,mCACI,UAAA,CACA,aAAA,CAGJ,oCACI,UAAA,CACA,aAAA,CAGJ,sCACI,UAAA,CACA,aAAA,CAGJ,mCACI,UAAA,CACA,aAAA,CAIR,4BACI,UAAA,CACA,aAAA,CACA,eAAA,CACA,UAAA,CACA,wBAAA,CACA,aAAA,CACA,iBAAA,CAEA,6CACI,iBAAA,CACA,QAAA,CACA,OAAA,CACA,SAAA,CACA,UAAA,CACA,eAAA,CACA,YAAA,CACA,uBAAA,CACA,6CAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CACA,cAAA,CAEA,0DACI,UAAA,CACA,aAAA,CAGJ,2DACI,UAAA,CACA,aAAA,CAGJ,uDACI,UAAA,CACA,aAAA,CACA,iBAAA,CACA,mBAAA,CACA,gBAAA,CACA,mBAAA,CAGJ,qDACI,UAAA,CACA,aAAA,CACA,iBAAA,CACA,mBAAA,CACA,gBAAA,CACA,mBAAA,CAGJ,qDACI,UAAA,CACA,iBAAA,CACA,mBAAA,CACA,cAAA,CACA,gBAAA,CAEA,yDACI,mBAAA",sourceRoot:""}]),a.locals={};const i=a},7159:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#canvas-zone{display:grid;grid-template-columns:100%;grid-template-rows:30px 1fr 10px 40px;overflow:hidden;position:relative}#canvas-zone #graph{grid-column:1;grid-row:2;width:100%;height:100%;background:#222;display:grid;grid-template-columns:100%;grid-template-rows:100%;overflow:hidden;position:relative}#canvas-zone #graph #svg-graph-grid{grid-column:1;grid-row:1;width:100%;height:100%;pointer-events:none;z-index:1}#canvas-zone #graph #svg-graph-grid:focus{outline:none}#canvas-zone #graph #svg-graph-horizontal{grid-column:1;grid-row:1;margin-left:40px;width:calc(100% - 40px);height:100%;pointer-events:none;z-index:1}#canvas-zone #graph #svg-graph-horizontal:focus{outline:none}#canvas-zone #graph #dark-rectangle{grid-column:1;grid-row:1;margin-left:40px;width:calc(100% - 40px);height:100%;background:#111;opacity:.2;pointer-events:none;position:absolute}#canvas-zone #graph #block-rectangle{grid-column:1;grid-row:1;width:40px;height:100%;background:#222;z-index:1}#canvas-zone #graph #svg-graph-curves{grid-column:1;grid-row:1;margin-left:40px;width:calc(100% - 40px);height:100%;z-index:2}#canvas-zone #graph #svg-graph-curves:focus{outline:none}#canvas-zone #graph #selection-rectangle{grid-column:1;grid-row:1;width:calc(100% - 40px);height:100%;pointer-events:none;position:absolute;left:40px;visibility:hidden;border:1px dashed #fff}#canvas-zone #range-frame-bar{grid-column:1;grid-row:4;width:100%;height:100%;background:#222;pointer-events:none;display:grid;grid-template-rows:100%;grid-template-columns:100%;pointer-events:none;user-select:none}#canvas-zone #range-frame-bar #svg-range-frames{grid-column:1;grid-row:1;width:100%;height:100%}#canvas-zone #frame-bar{grid-column:1;grid-row:1;width:100%;height:100%;background:#222;pointer-events:none;display:grid;grid-template-rows:100%;grid-template-columns:40px 1fr}#canvas-zone #frame-bar #angle-unit{grid-column:1;grid-row:1;background:#111}#canvas-zone #frame-bar #frames{grid-column:1/3;grid-row:1;width:100%;height:100%;display:grid;grid-template-rows:100%;grid-template-columns:100%}#canvas-zone #frame-bar #frames #svg-frames{margin-left:40px;grid-column:1;grid-row:1;width:calc(100% - 40px);height:100%}#canvas-zone #play-head-control{grid-column:1;grid-row:1;position:absolute;height:30px;left:40px;width:calc(100% - 40px)}#canvas-zone #play-head-control-2{grid-column:1;grid-row:4;position:absolute;height:30px;left:0px;width:100%}#canvas-zone #play-head{grid-column:1;grid-row:1/3;position:absolute;top:0;height:calc(100% - 5px);width:22px;margin-left:40px;display:grid;grid-template-columns:100%;grid-template-rows:22px 1fr;transform:translateX(-50%);pointer-events:none;z-index:3}#canvas-zone #play-head #play-head-bar{grid-row:2;grid-column:1;justify-self:center;width:1.5px;background:#fff;height:100%;pointer-events:none}#canvas-zone #play-head #play-head-circle{grid-row:1;grid-column:1;width:22px;height:22px;border-radius:50%;background:#fff;font-family:"acumin-pro-condensed";font-size:8pt;display:grid;align-content:center;justify-content:center;color:#555;cursor:pointer}#canvas-zone #angle-mode{grid-column:1;grid-row:1;width:40px;height:100%;z-index:1;background:#222}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss"],names:[],mappings:"AAAA,aACI,YAAA,CACA,0BAAA,CACA,qCAAA,CACA,eAAA,CACA,iBAAA,CAEA,oBACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CACA,YAAA,CACA,0BAAA,CACA,uBAAA,CACA,eAAA,CACA,iBAAA,CAEA,oCACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,mBAAA,CACA,SAAA,CAEA,0CACI,YAAA,CAIR,0CACI,aAAA,CACA,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,WAAA,CACA,mBAAA,CACA,SAAA,CAEA,gDACI,YAAA,CAIR,oCACI,aAAA,CACA,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,WAAA,CACA,eAAA,CACA,UAAA,CACA,mBAAA,CACA,iBAAA,CAGJ,qCACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CACA,SAAA,CAGJ,sCACI,aAAA,CACA,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,WAAA,CACA,SAAA,CAEA,4CACI,YAAA,CAIR,yCACI,aAAA,CACA,UAAA,CACA,uBAAA,CACA,WAAA,CACA,mBAAA,CACA,iBAAA,CACA,SAAA,CACA,iBAAA,CAEA,sBAAA,CAIR,8BACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CACA,mBAAA,CACA,YAAA,CACA,uBAAA,CACA,0BAAA,CACA,mBAAA,CACA,gBAAA,CAEA,gDACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CAIR,wBACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CACA,mBAAA,CAEA,YAAA,CACA,uBAAA,CACA,8BAAA,CAEA,oCACI,aAAA,CACA,UAAA,CACA,eAAA,CAGJ,gCACI,eAAA,CAEA,UAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,uBAAA,CACA,0BAAA,CAEA,4CACI,gBAAA,CACA,aAAA,CACA,UAAA,CACA,uBAAA,CACA,WAAA,CAKZ,gCACI,aAAA,CACA,UAAA,CACA,iBAAA,CACA,WAAA,CACA,SAAA,CACA,uBAAA,CAGJ,kCACI,aAAA,CACA,UAAA,CACA,iBAAA,CACA,WAAA,CACA,QAAA,CACA,UAAA,CAGJ,wBACI,aAAA,CACA,YAAA,CACA,iBAAA,CACA,KAAA,CACA,uBAAA,CACA,UAAA,CACA,gBAAA,CACA,YAAA,CACA,0BAAA,CACA,2BAAA,CACA,0BAAA,CACA,mBAAA,CACA,SAAA,CAEA,uCACI,UAAA,CACA,aAAA,CACA,mBAAA,CACA,WAAA,CACA,eAAA,CACA,WAAA,CACA,mBAAA,CAGJ,0CACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,eAAA,CACA,kCAAA,CACA,aAAA,CACA,YAAA,CACA,oBAAA,CACA,sBAAA,CACA,UAAA,CACA,cAAA,CAIR,yBACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,SAAA,CACA,eAAA",sourceRoot:""}]),a.locals={};const i=a},2667:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#curve-editor{background:#333;width:100%;height:100%;display:grid;grid-template-rows:40px calc(100% - 85px) 45px;grid-template-columns:10px 210px 10px 1fr 10px}#curve-editor #top-bar{background:#333;grid-row:1;grid-column:1/6;width:100%;height:100%}#curve-editor #bottom-bar{background:#333;grid-row:3;grid-column:1/6;width:100%;height:100%}#curve-editor #canvas-zone{grid-row:2;grid-column:4;width:100%;height:100%;background:#333}#curve-editor #sidebar{grid-row:2;grid-column:2;width:100%;height:100%;background:#111}#curve-editor .action-button:hover{background:#666;color:#fff;cursor:pointer}#curve-editor .action-button.active{background:#111}#curve-editor .action-button:active{transform-origin:50% 50%;transform:scale(0.96)}#curve-editor .push-button{cursor:pointer}#curve-editor .push-button.active{background:#666}#curve-editor .text-input{color:#fff;background:#000;font-family:"acumin-pro-condensed";font-size:11pt;border:0;margin:3px 1px;text-align:end;padding-right:4px}#curve-editor .text-input:focus{outline:none}#curve-editor .text-input:disabled{background:#444;border:#555 solid 1px}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss"],names:[],mappings:"AAAA,cACI,eAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,8CAAA,CACA,8CAAA,CAEA,uBACI,eAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,WAAA,CAGJ,0BACI,eAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,WAAA,CAGJ,2BACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CAGJ,uBACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CAIA,mCACI,eAAA,CACA,UAAA,CACA,cAAA,CAGJ,oCACI,eAAA,CAGJ,oCACI,wBAAA,CACA,qBAAA,CAIR,2BACI,cAAA,CACA,kCACI,eAAA,CAIR,0BACI,UAAA,CACA,eAAA,CACA,kCAAA,CACA,cAAA,CACA,QAAA,CACA,cAAA,CACA,cAAA,CACA,iBAAA,CAEA,gCACI,YAAA,CAGJ,mCACI,eAAA,CACA,qBAAA",sourceRoot:""}]),a.locals={};const i=a},9465:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#sideBar{display:grid;grid-template-columns:100%;grid-template-rows:30px 1fr}#sideBar #menu-bar{background:#252525;grid-row:1;grid-column:1;width:100%;height:100%;display:grid;grid-template-rows:100%;grid-template-columns:30px 30px 30px 30px 1fr 52px 3px}#sideBar #menu-bar.small{grid-template-columns:0px 0px 30px 30px 1fr 52px 3px}#sideBar #menu-bar #add-animation{grid-row:1;grid-column:1}#sideBar #menu-bar #load-animation{grid-row:1;grid-column:2}#sideBar #menu-bar #save-animation{grid-row:1;grid-column:3}#sideBar #menu-bar #edit-animation{grid-row:1;grid-column:4}#sideBar #menu-bar #framerate-animation{grid-row:1;grid-column:6}#sideBar .simple-button{width:80px;height:20px;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt;background:#444;border:0;line-height:12px;cursor:pointer;align-self:center;justify-self:center;border-radius:0}#sideBar .simple-button:active{transform-origin:center;transform:scale(0.95)}#sideBar #save-animation-pane{width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:1fr 40px auto}#sideBar #save-animation-pane #save-animation-list{grid-row:1;grid-column:1;width:100%;height:100%;display:flex;flex-direction:column;padding-top:5px}#sideBar #save-animation-pane #save-animation-list .save-animation-list-entry{height:20px;margin-left:10px;display:flex;align-content:center;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt;line-height:15px}#sideBar #save-animation-pane #save-animation-buttons{grid-row:2;grid-column:1;width:100%;height:100%;display:grid;grid-template-rows:100%;grid-template-columns:10px 1fr 10px 1fr 10px;align-items:center}#sideBar #save-animation-pane #save-animation-buttons #save-snippet{grid-row:1;grid-column:2}#sideBar #save-animation-pane #save-animation-buttons #save-file{grid-row:1;grid-column:4}#sideBar #save-animation-pane #save-animation-snippet{grid-row:3;grid-column:1;width:calc(100% - 31px);height:20px;align-content:center;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt;padding-left:31px;background:#252525}#sideBar #load-animation-pane{width:100%;height:100%;display:grid;grid-template-columns:75px 1fr;grid-template-rows:10px 20px 10px 20px 10px 20px 1fr auto;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt}#sideBar #load-animation-pane #load-animation-snippet-id-label{grid-row:2;grid-column:1;justify-self:end;margin-right:10px}#sideBar #load-animation-pane #load-animation-local-file-label{grid-row:6;grid-column:1;justify-self:end;margin-right:10px}#sideBar #load-animation-pane #load-snippet-id{grid-row:2;grid-column:2;margin-right:10px;border:0;background:#252525;width:127px;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt}#sideBar #load-animation-pane #load-snippet{grid-row:4;grid-column:2;width:60px;justify-self:left}#sideBar #load-animation-pane input[type=file]{display:none}#sideBar #load-animation-pane #file-snippet-label{grid-row:6;grid-column:2;width:60px;justify-self:left;text-align:center;line-height:18px}#sideBar #load-animation-pane #load-animation-snippet{grid-row:8;grid-column:1/3;width:calc(100% - 31px);height:20px;align-content:center;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt;padding-left:31px;background:#252525}#sideBar #add-animation-pane{grid-column:1;grid-row:2;width:100%;height:100%;display:grid;grid-template-columns:75px 1fr;grid-template-rows:10px 20px 10px 20px 10px 20px 10px 20px 10px 20px 10px 20px 1fr;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt}#sideBar #add-animation-pane .input-text{border:0;background:#252525;width:127px;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt}#sideBar #add-animation-pane .option{background:#252525;color:#fff;border:0}#sideBar #add-animation-pane #add-animation-display-name-label{grid-row:2;grid-column:1;justify-self:end;margin-right:10px}#sideBar #add-animation-pane #add-animation-mode-label{grid-row:4;grid-column:1;justify-self:end;margin-right:10px}#sideBar #add-animation-pane #add-animation-property-label{grid-row:6;grid-column:1;justify-self:end;margin-right:10px}#sideBar #add-animation-pane #add-animation-type-label{grid-row:8;grid-column:1;justify-self:end;margin-right:10px}#sideBar #add-animation-pane #add-animation-loop-mode-label{grid-row:10;grid-column:1;justify-self:end;margin-right:10px}#sideBar #add-animation-pane #add-animation-name{grid-row:2;grid-column:2;margin-right:10px}#sideBar #add-animation-pane #add-animation-mode{grid-row:4;grid-column:2;margin-right:10px;width:calc(100% - 10px)}#sideBar #add-animation-pane #add-animation-property{grid-row:6;grid-column:2;margin-right:10px;width:calc(100% - 10px)}#sideBar #add-animation-pane #add-animation-type{grid-row:8;grid-column:2;margin-right:10px}#sideBar #add-animation-pane #add-animation-loop-mode{grid-row:10;grid-column:2;margin-right:10px}#sideBar #add-animation-pane #add-animation{grid-row:12;grid-column:2;justify-self:left}#sideBar #edit-animation-pane{grid-column:1;grid-row:2;width:100%;height:100%;display:grid;grid-template-columns:75px 1fr;grid-template-rows:10px 20px 10px 20px 10px 20px 10px 20px 1fr;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt;background:#111}#sideBar #edit-animation-pane .input-text{border:0;background:#252525;width:127px;color:#fff;font-family:"acumin-pro-condensed";font-size:10pt}#sideBar #edit-animation-pane .option{background:#252525;color:#fff;border:0}#sideBar #edit-animation-pane #edit-animation-display-name-label{grid-row:2;grid-column:1;justify-self:end;margin-right:10px}#sideBar #edit-animation-pane #edit-animation-property-label{grid-row:4;grid-column:1;justify-self:end;margin-right:10px}#sideBar #edit-animation-pane #edit-animation-loop-mode-label{grid-row:6;grid-column:1;justify-self:end;margin-right:10px}#sideBar #edit-animation-pane #edit-animation-name{grid-row:2;grid-column:2;margin-right:10px}#sideBar #edit-animation-pane #edit-animation-property{grid-row:4;grid-column:2;margin-right:10px}#sideBar #edit-animation-pane #edit-animation-loop-mode{grid-row:6;grid-column:2;margin-right:10px}#sideBar #edit-animation-pane #edit-animation{grid-row:8;grid-column:1/3;display:grid;grid-template-columns:50% 50%;grid-template-rows:100%}#sideBar #edit-animation-pane #edit-animation #edit-animation-ok{grid-row:1;grid-column:1}#sideBar #edit-animation-pane #edit-animation #edit-animation-cancel{grid-row:1;grid-column:2}#sideBar #animation-list{background:#111;grid-row:2;grid-column:1;width:100%;height:100%}#sideBar #animation-list .animation-entry{height:20px;display:grid;grid-template-columns:20px 10px 1fr 20px 20px;grid-template-rows:100%}#sideBar #animation-list .animation-entry.isActive{background:#444}#sideBar #animation-list .animation-entry .animation-active-indicator{grid-row:1;grid-column:1;display:grid;margin:5px;padding-top:2px}#sideBar #animation-list .animation-entry .animation-chevron{grid-row:1;grid-column:2;display:grid;align-content:center;padding-top:5px;cursor:pointer}#sideBar #animation-list .animation-entry .animation-chevron .animation-chevron-image.collapsed{transform-origin:50% 50%;transform:rotateZ(-90deg)}#sideBar #animation-list .animation-entry .animation-name{cursor:pointer;grid-row:1;grid-column:3;font-family:"acumin-pro-condensed";font-size:10.5pt;color:#fff;display:grid;align-self:center;margin-left:5px;user-select:none}#sideBar #animation-list .animation-entry .animation-options{grid-row:1;grid-column:4}#sideBar #animation-list .animation-entry .animation-delete{grid-row:1;grid-column:5}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss"],names:[],mappings:"AAAA,SACI,YAAA,CACA,0BAAA,CACA,2BAAA,CAEA,mBACI,kBAAA,CACA,UAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,uBAAA,CACA,sDAAA,CAEA,yBACI,oDAAA,CAGJ,kCACI,UAAA,CACA,aAAA,CAGJ,mCACI,UAAA,CACA,aAAA,CAGJ,mCACI,UAAA,CACA,aAAA,CAGJ,mCACI,UAAA,CACA,aAAA,CAGJ,wCACI,UAAA,CACA,aAAA,CAIR,wBACI,UAAA,CACA,WAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CACA,eAAA,CACA,QAAA,CACA,gBAAA,CACA,cAAA,CACA,iBAAA,CACA,mBAAA,CACA,eAAA,CAEA,+BACI,uBAAA,CACA,qBAAA,CAIR,8BACI,UAAA,CACA,WAAA,CACA,YAAA,CACA,0BAAA,CACA,gCAAA,CAEA,mDACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,qBAAA,CACA,eAAA,CAEA,8EACI,WAAA,CACA,gBAAA,CACA,YAAA,CACA,oBAAA,CACA,UAAA,CAEA,kCAAA,CACA,cAAA,CACA,gBAAA,CAIR,sDACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,uBAAA,CACA,4CAAA,CACA,kBAAA,CAEA,oEACI,UAAA,CACA,aAAA,CAGJ,iEACI,UAAA,CACA,aAAA,CAIR,sDACI,UAAA,CACA,aAAA,CACA,uBAAA,CACA,WAAA,CACA,oBAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CACA,iBAAA,CACA,kBAAA,CAIR,8BACI,UAAA,CACA,WAAA,CACA,YAAA,CACA,8BAAA,CACA,yDAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CAEA,+DACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,+DACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,+CACI,UAAA,CACA,aAAA,CACA,iBAAA,CACA,QAAA,CACA,kBAAA,CACA,WAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CAGJ,4CACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,iBAAA,CAGJ,+CACI,YAAA,CAGJ,kDACI,UAAA,CACA,aAAA,CACA,UAAA,CACA,iBAAA,CACA,iBAAA,CACA,gBAAA,CAGJ,sDACI,UAAA,CACA,eAAA,CACA,uBAAA,CACA,WAAA,CACA,oBAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CACA,iBAAA,CACA,kBAAA,CAIR,6BACI,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,8BAAA,CACA,kFAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CAEA,yCACI,QAAA,CACA,kBAAA,CACA,WAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CAGJ,qCACI,kBAAA,CACA,UAAA,CACA,QAAA,CAGJ,+DACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,uDACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,2DACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,uDACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,4DACI,WAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,iDACI,UAAA,CACA,aAAA,CACA,iBAAA,CAGJ,iDACI,UAAA,CACA,aAAA,CACA,iBAAA,CACA,uBAAA,CAGJ,qDACI,UAAA,CACA,aAAA,CACA,iBAAA,CACA,uBAAA,CAGJ,iDACI,UAAA,CACA,aAAA,CACA,iBAAA,CAGJ,sDACI,WAAA,CACA,aAAA,CACA,iBAAA,CAGJ,4CACI,WAAA,CACA,aAAA,CACA,iBAAA,CAIR,8BACI,aAAA,CACA,UAAA,CAEA,UAAA,CACA,WAAA,CACA,YAAA,CACA,8BAAA,CACA,8DAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CACA,eAAA,CAEA,0CACI,QAAA,CACA,kBAAA,CACA,WAAA,CACA,UAAA,CACA,kCAAA,CACA,cAAA,CAGJ,sCACI,kBAAA,CACA,UAAA,CACA,QAAA,CAGJ,iEACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,6DACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,8DACI,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAGJ,mDACI,UAAA,CACA,aAAA,CACA,iBAAA,CAGJ,uDACI,UAAA,CACA,aAAA,CACA,iBAAA,CAGJ,wDACI,UAAA,CACA,aAAA,CACA,iBAAA,CAGJ,8CACI,UAAA,CACA,eAAA,CACA,YAAA,CACA,6BAAA,CACA,uBAAA,CAEA,iEACI,UAAA,CACA,aAAA,CAGJ,qEACI,UAAA,CACA,aAAA,CAKZ,yBACI,eAAA,CACA,UAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CAEA,0CACI,WAAA,CACA,YAAA,CACA,6CAAA,CACA,uBAAA,CAEA,mDACI,eAAA,CAGJ,sEACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,UAAA,CACA,eAAA,CAGJ,6DACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,oBAAA,CACA,eAAA,CACA,cAAA,CAGI,gGACI,wBAAA,CACA,yBAAA,CAKZ,0DACI,cAAA,CACA,UAAA,CACA,aAAA,CACA,kCAAA,CACA,gBAAA,CACA,UAAA,CACA,YAAA,CACA,iBAAA,CACA,eAAA,CACA,gBAAA,CAGJ,6DACI,UAAA,CACA,aAAA,CAGJ,4DACI,UAAA,CACA,aAAA",sourceRoot:""}]),a.locals={};const i=a},2063:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#top-bar{display:grid;grid-template-columns:40px 200px 75px 8px 75px 8px 40px 40px 40px 40px 40px 40px 40px 40px 1fr 40px;grid-template-rows:100%}#top-bar .disabled{opacity:20%;pointer-events:none}#top-bar #top-bar-logo{grid-row:1;grid-column:1}#top-bar #top-bar-parent-name{grid-row:1;grid-column:2;font-family:"acumin-pro-condensed";font-size:15pt;color:#fff;display:grid;align-content:center;padding-bottom:5px}#top-bar #key-frame{grid-row:1;grid-column:3;height:24px;display:grid;align-self:center}#top-bar #key-value{grid-row:1;grid-column:5;height:24px;display:grid;align-self:center}#top-bar #new-key{grid-row:1;grid-column:7}#top-bar #frame-canvas{grid-row:1;grid-column:8}#top-bar #flatten-tangent{grid-row:1;grid-column:9}#top-bar #linear-tangent{grid-row:1;grid-column:10}#top-bar #break-tangent{grid-row:1;grid-column:11}#top-bar #unify-tangent{grid-row:1;grid-column:12}#top-bar #step-tangent{grid-row:1;grid-column:13}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss"],names:[],mappings:"AAAA,SACI,YAAA,CACA,mGAAA,CACA,uBAAA,CAEA,mBACI,WAAA,CACA,mBAAA,CAGJ,uBACI,UAAA,CACA,aAAA,CAGJ,8BACI,UAAA,CACA,aAAA,CACA,kCAAA,CACA,cAAA,CACA,UAAA,CACA,YAAA,CACA,oBAAA,CACA,kBAAA,CAGJ,oBACI,UAAA,CACA,aAAA,CACA,WAAA,CACA,YAAA,CACA,iBAAA,CAGJ,oBACI,UAAA,CACA,aAAA,CACA,WAAA,CACA,YAAA,CACA,iBAAA,CAGJ,kBACI,UAAA,CACA,aAAA,CAGJ,uBACI,UAAA,CACA,aAAA,CAGJ,0BACI,UAAA,CACA,aAAA,CAGJ,yBACI,UAAA,CACA,cAAA,CAGJ,wBACI,UAAA,CACA,cAAA,CAGJ,wBACI,UAAA,CACA,cAAA,CAGJ,uBACI,UAAA,CACA,cAAA",sourceRoot:""}]),a.locals={};const i=a},2181:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#texture-editor{height:100%;width:100%;color:#fff;background-color:#1e1e1e;font-family:"acumin-pro-condensed"}#texture-editor .icon{width:40px;height:40px}#texture-editor .icon.button{background-color:#333}#texture-editor .icon.button:hover{background-color:#4a4a4a;cursor:pointer}#texture-editor .icon.button.active{background-color:#666}#texture-editor .icon.button:active{background-color:#837c7c}#texture-editor .has-tooltip{display:inline-block}#texture-editor .has-tooltip .tooltip{visibility:hidden;background-color:#fff;z-index:1;position:absolute;opacity:0;transition:opacity .5s;line-height:normal;font-size:14px;padding:0px 5px;color:#000}#texture-editor .has-tooltip:hover .tooltip{visibility:visible;opacity:1}#texture-editor #properties{width:100%;height:40px;display:flex;align-items:center;font-size:12px;color:#fff;user-select:none;background-color:#333}#texture-editor #properties .tab{display:inline-flex;line-height:40px;height:40px;flex-shrink:0;flex-grow:0;border-right:2px solid #1e1e1e;background-color:#333}#texture-editor #properties #left{overflow:hidden;height:40px;flex-grow:1;flex-shrink:1;display:flex;flex-wrap:wrap}#texture-editor #properties #left #dimensions-tab form{display:flex}#texture-editor #properties #left #dimensions-tab label{margin-left:15px;font-size:15px;color:#afafaf}#texture-editor #properties #left #dimensions-tab label input{width:40px;height:24px;background-color:#000;color:#fff;border:0;font-size:12px;text-align:"left";font-family:"acumin-pro-condensed";font-size:15px;padding-left:8px}#texture-editor #properties #left #dimensions-tab label:last-of-type{margin-right:8px}#texture-editor #properties #right-tab{margin-right:0;flex-grow:0;flex-shrink:0}#texture-editor #properties #right-tab input[type=file]{display:none}#texture-editor #properties .pixel-data{width:45px;color:#afafaf;display:flex;justify-content:space-between;font-size:15px}#texture-editor #properties .pixel-data:first-of-type{margin-left:15px}#texture-editor #properties .pixel-data:last-of-type{padding-right:15px}#texture-editor #properties .pixel-data .value{display:inline-block;width:30px;color:#fff}#texture-editor #toolbar{position:absolute;top:60px;left:0;width:40px;display:flex;flex-direction:column;justify-content:left}#texture-editor #toolbar #tools{display:flex;flex-direction:column}#texture-editor #toolbar #add-tool{position:relative}#texture-editor #toolbar #add-tool #add-tool-popup{background-color:#333;width:348px;margin-left:40px;position:absolute;top:0px;height:40px;padding-left:4px;line-height:40px;user-select:none}#texture-editor #toolbar #add-tool #add-tool-popup button{background:#222;border:1px solid #337ab7;margin:5px 10px 5px 10px;color:#fff;padding:4px 5px;opacity:.9;cursor:pointer}#texture-editor #toolbar #color{margin-top:8px}#texture-editor #toolbar #color #active-color-bg{border-radius:50%;width:20px;height:20px;margin:10px;position:relative;background-image:linear-gradient(45deg, #808080 25%, transparent 25%),linear-gradient(-45deg, #808080 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #808080 75%),linear-gradient(-45deg, transparent 75%, #808080 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0px}#texture-editor #toolbar #color #active-color{width:20px;height:20px;position:absolute;top:0;left:0;border-radius:50%}#texture-editor #toolbar #color-picker{position:absolute;margin-left:40px}#texture-editor #channels-bar{position:absolute;top:60px;right:0;width:80px;background:#666;user-select:none}#texture-editor #channels-bar .channel{color:#fff;border-bottom:2px solid #232323;width:80px;height:40px;font-size:16px;display:flex;align-items:center}#texture-editor #channels-bar .channel.uneditable{background:#333}#texture-editor #channels-bar .channel:hover{cursor:pointer}#texture-editor #channels-bar .channel:last-of-type{border-bottom:none}#texture-editor #canvas-ui{width:100%;height:calc(100% - 70px);outline:none}#texture-editor #tool-ui{background-color:#333;position:absolute;right:0;bottom:30px}#texture-editor #tool-ui label{display:flex;flex-direction:column;align-items:center}#texture-editor #tool-ui input[type=range]{background:#d3d3d3}#texture-editor #bottom-bar{height:30px;width:100%;background-color:#333;font-size:14px;user-select:none;line-height:30px;position:relative}#texture-editor #bottom-bar #file-url{left:30px;position:absolute}#texture-editor #bottom-bar #mip-level{right:30px;position:absolute}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss"],names:[],mappings:"AAAA,gBACI,WAAA,CACA,UAAA,CACA,UAAA,CACA,wBAAA,CACA,kCAAA,CAEA,sBACI,UAAA,CACA,WAAA,CACA,6BACI,qBAAA,CACA,mCACI,wBAAA,CACA,cAAA,CAGJ,oCACI,qBAAA,CAGJ,oCACI,wBAAA,CAKZ,6BACI,oBAAA,CACA,sCACI,iBAAA,CACA,qBAAA,CACA,SAAA,CACA,iBAAA,CACA,SAAA,CACA,sBAAA,CACA,kBAAA,CACA,cAAA,CACA,eAAA,CACA,UAAA,CAGJ,4CACI,kBAAA,CACA,SAAA,CAIR,4BACI,UAAA,CACA,WAAA,CAEA,YAAA,CACA,kBAAA,CACA,cAAA,CACA,UAAA,CACA,gBAAA,CACA,qBAAA,CAEA,iCACI,mBAAA,CACA,gBAAA,CACA,WAAA,CACA,aAAA,CACA,WAAA,CACA,8BAAA,CACA,qBAAA,CAEJ,kCACI,eAAA,CACA,WAAA,CACA,WAAA,CACA,aAAA,CACA,YAAA,CACA,cAAA,CAEI,uDACI,YAAA,CAEJ,wDACI,gBAAA,CACA,cAAA,CACA,aAAA,CACA,8DACI,UAAA,CACA,WAAA,CACA,qBAAA,CACA,UAAA,CACA,QAAA,CACA,cAAA,CACA,iBAAA,CACA,kCAAA,CACA,cAAA,CACA,gBAAA,CAGJ,qEACI,gBAAA,CAKhB,uCACI,cAAA,CACA,WAAA,CACA,aAAA,CAEA,wDACI,YAAA,CAIR,wCACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,6BAAA,CACA,cAAA,CACA,sDACI,gBAAA,CAEJ,qDACI,kBAAA,CAEJ,+CACI,oBAAA,CACA,UAAA,CACA,UAAA,CAKZ,yBACI,iBAAA,CACA,QAAA,CACA,MAAA,CACA,UAAA,CACA,YAAA,CACA,qBAAA,CACA,oBAAA,CAEA,gCACI,YAAA,CACA,qBAAA,CAGJ,mCACI,iBAAA,CACA,mDACI,qBAAA,CACA,WAAA,CACA,gBAAA,CACA,iBAAA,CACA,OAAA,CACA,WAAA,CACA,gBAAA,CACA,gBAAA,CACA,gBAAA,CACA,0DACI,eAAA,CACA,wBAAA,CACA,wBAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,cAAA,CAKZ,gCACI,cAAA,CACA,iDACI,iBAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CACA,iBAAA,CACA,sOAAA,CAEA,yBAAA,CACA,mDACI,CAKR,8CACI,UAAA,CACA,WAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,iBAAA,CAGR,uCACI,iBAAA,CACA,gBAAA,CAIR,8BACI,iBAAA,CACA,QAAA,CACA,OAAA,CACA,UAAA,CACA,eAAA,CACA,gBAAA,CACA,uCACI,UAAA,CACA,+BAAA,CACA,UAAA,CACA,WAAA,CACA,cAAA,CACA,YAAA,CACA,kBAAA,CAEA,kDACI,eAAA,CAGJ,6CACI,cAAA,CAGJ,oDACI,kBAAA,CAKZ,2BACI,UAAA,CACA,wBAAA,CACA,YAAA,CAGJ,yBACI,qBAAA,CACA,iBAAA,CACA,OAAA,CACA,WAAA,CAEA,+BACI,YAAA,CACA,qBAAA,CACA,kBAAA,CAGJ,2CACI,kBAAA,CAIR,4BACI,WAAA,CACA,UAAA,CACA,qBAAA,CACA,cAAA,CACA,gBAAA,CACA,gBAAA,CACA,iBAAA,CACA,sCACI,SAAA,CACA,iBAAA,CAEJ,uCACI,UAAA,CACA,iBAAA",sourceRoot:""}]),a.locals={};const i=a},8335:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,"#metadata-container textarea{display:block;margin:4px;width:calc(100% - 14px);min-height:100px;max-height:500px;resize:vertical}.meta-string textarea{background:#fe9}.meta-json textarea{background:#9df}.meta-object textarea{background:#d9f}.meta-object-protect textarea{background:#b0b0b0}.buttonLine.disabled{opacity:20%;pointer-events:none}.copy-root{display:grid;justify-content:end;height:30px}.copy-container{height:30px;width:30px;cursor:pointer}.hoverIcon:hover{opacity:.8}.type-status{padding:5px 15px}","",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss"],names:[],mappings:"AACI,6BACI,aAAA,CACA,UAAA,CACA,uBAAA,CACA,gBAAA,CACA,gBAAA,CACA,eAAA,CAKJ,sBACI,eAAA,CAKJ,oBACI,eAAA,CAKJ,sBACI,eAAA,CAKJ,8BACI,kBAAA,CAKJ,qBACI,WAAA,CACA,mBAAA,CAIR,WACI,YAAA,CACA,mBAAA,CACA,WAAA,CAGJ,gBACI,WAAA,CACA,UAAA,CACA,cAAA,CAGJ,iBACI,UAAA,CAGJ,aACI,gBAAA",sourceRoot:""}]),a.locals={};const i=a},8555:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#embed-host{position:absolute;right:0px;top:0px;bottom:0px;z-index:10}#__resizable_base__{display:none}#embed{background:#333;height:100%;margin:0;padding:0;display:grid;grid-template-rows:30px 1fr;font:14px "Arial";overflow:hidden}#embed #header{font-size:16px;color:#fff;background:#222;grid-row:1;text-align:center;display:grid;grid-template-columns:30px 1fr 50px;user-select:none}#embed #header #logo{grid-column:1;width:24px;height:24px;display:flex;align-self:center;justify-self:center}#embed #header #back{grid-column:1;display:grid;align-self:center;justify-self:center;cursor:pointer}#embed #header #title{grid-column:2;display:grid;align-items:center;text-align:center}#embed #header #commands{grid-column:3;display:grid;align-items:center;grid-template-columns:1fr 1fr}#embed #header #commands .expand{grid-column:1;display:grid;align-items:center;justify-items:center;cursor:pointer}#embed #header #commands .close{grid-column:2;display:grid;align-items:center;justify-items:center;cursor:pointer}#embed #split{grid-row:2;overflow:hidden}#embed #split.splitPopup{display:grid;grid-template-rows:300px 2px 1fr}#embed #split.splitPopup .panes{margin-bottom:1px}#embed #split #topPart{grid-row:1;overflow:hidden;display:grid;grid-auto-rows:100%}#embed #split #separator{grid-row:2;background:#fff;opacity:.1}#embed #split #bottomPart{overflow:hidden;grid-row:3;display:grid;grid-auto-rows:100%}#embed #split .gutter.gutter-vertical{background-image:none;background:#444;cursor:row-resize}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/embedHost/embedHost.scss"],names:[],mappings:"AAAA,YACI,iBAAA,CACA,SAAA,CACA,OAAA,CACA,UAAA,CACA,UAAA,CAGJ,oBACI,YAAA,CAGJ,OACI,eAAA,CACA,WAAA,CACA,QAAA,CACA,SAAA,CACA,YAAA,CACA,2BAAA,CACA,iBAAA,CACA,eAAA,CAEA,eACI,cAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,iBAAA,CACA,YAAA,CACA,mCAAA,CACA,gBAAA,CAEA,qBACI,aAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,iBAAA,CACA,mBAAA,CAGJ,qBACI,aAAA,CACA,YAAA,CACA,iBAAA,CACA,mBAAA,CACA,cAAA,CAGJ,sBACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,iBAAA,CAGJ,yBACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,6BAAA,CAEA,iCACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAGJ,gCACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAKZ,cACI,UAAA,CACA,eAAA,CAEA,yBACI,YAAA,CACA,gCAAA,CAEA,gCACI,iBAAA,CAIR,uBACI,UAAA,CACA,eAAA,CACA,YAAA,CACA,mBAAA,CAGJ,yBACI,UAAA,CACA,eAAA,CACA,UAAA,CAGJ,0BACI,eAAA,CACA,UAAA,CACA,YAAA,CACA,mBAAA,CAGJ,sCACI,qBAAA,CACA,eAAA,CACA,iBAAA",sourceRoot:""}]),a.locals={};const i=a},6771:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'#scene-explorer-host{position:absolute;left:0px;top:0px;bottom:0px}#scene-explorer-host:focus{outline:none}#__resizable_base__{display:none}.context-menu{background:#222}.context-menu .react-contextmenu-item{padding:10px;cursor:pointer}.context-menu .react-contextmenu-item:hover{background:#555}.react-contextmenu.context-menu.react-contextmenu--visible{z-index:99;transform:scale(1)}#sceneExplorer{background:#333;height:100%;margin:0;padding:0;display:grid;grid-template-rows:auto 1fr;font:14px "Arial"}#sceneExplorer:focus{outline:none}#sceneExplorer #header{height:30px;font-size:16px;color:#fff;background:#222;grid-row:1;text-align:center;display:grid;grid-template-columns:30px 1fr 50px;user-select:none}#sceneExplorer #header #logo{position:relative;grid-column:1;width:24px;height:24px;left:0;display:flex;align-self:center;justify-self:center}#sceneExplorer #header #title{grid-column:2;display:grid;align-items:center;text-align:center}#sceneExplorer #header #commands{grid-column:3;display:grid;align-items:center;grid-template-columns:1fr 1fr}#sceneExplorer #header #commands .expand{grid-column:1;display:grid;align-items:center;justify-items:center;cursor:pointer}#sceneExplorer #header #commands .close{grid-column:2;display:grid;align-items:center;justify-items:center;cursor:pointer}#sceneExplorer #tree{grid-row:2;overflow-x:hidden;overflow-y:auto}#sceneExplorer .filter{display:flex;align-items:stretch}#sceneExplorer .filter input{width:100%;margin:10px 40px 5px 40px;display:block;border:none;padding:0;border-bottom:solid 1px #337ab7;background:linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgb(51, 122, 183) 4%);background-position:-1000px 0;background-size:1000px 100%;background-repeat:no-repeat;color:#fff}#sceneExplorer .filter input::placeholder{color:#d3d3d3}#sceneExplorer .filter input:focus{box-shadow:none;outline:none;background-position:0 0}#sceneExplorer .groupContainer{margin-left:0px;color:#fff;margin-top:0px;margin-bottom:0px;height:24px;user-select:none;align-self:center;display:grid;align-items:center}#sceneExplorer .groupContainer:hover{background:#444}#sceneExplorer .groupContainer .expandableHeader{display:grid;grid-template-columns:1fr 20px}#sceneExplorer .groupContainer .expandableHeader .text{grid-column:1;display:grid;grid-template-columns:20px 1fr}#sceneExplorer .groupContainer .expandableHeader .text .arrow{grid-column:1;margin-left:0px;color:#fff;cursor:pointer;display:inline-block;margin-right:6px;opacity:.5}#sceneExplorer .groupContainer .expandableHeader .text .text-value{grid-column:2;display:flex;align-items:center}#sceneExplorer .groupContainer .expandableHeader .expandAll{opacity:.5;grid-column:2;margin-right:10px}#sceneExplorer .icon{display:grid;align-items:center;justify-items:center;cursor:pointer}#sceneExplorer .itemContainer{margin-left:0px;color:#fff;margin-top:0px;margin-bottom:0px;height:24px;user-select:none;display:grid;grid-template-columns:20px 1fr}#sceneExplorer .itemContainer:hover{background:#444}#sceneExplorer .itemContainer.selected{background:#bbb;color:#000}#sceneExplorer .itemContainer .isNotActive{opacity:.3}#sceneExplorer .itemContainer .arrow{grid-column:1;color:#fff;opacity:.6}#sceneExplorer .itemContainer .popup{width:200px;visibility:hidden;background-color:#444;color:#fff;border:1px solid hsla(0,0%,100%,.5);position:absolute;z-index:1;margin-left:-180px;box-sizing:border-box}#sceneExplorer .itemContainer .popup.show{visibility:visible}#sceneExplorer .itemContainer .popup:focus{outline:none}#sceneExplorer .itemContainer .popup .popupMenu{padding:6px 5px 5px 10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:18px}#sceneExplorer .itemContainer .popup .popupMenu:hover{background:#fff;color:#333}#sceneExplorer .itemContainer .sceneNode{grid-column:2;margin-left:-10px;display:grid;grid-template-columns:1fr 20px 20px 20px 20px 10px 20px 20px auto 5px;align-items:center;cursor:pointer}#sceneExplorer .itemContainer .sceneNode .sceneTitle{grid-column:1;margin-right:5px;display:flex;align-items:center;height:24px}#sceneExplorer .itemContainer .sceneNode .translation{grid-column:2;opacity:.6}#sceneExplorer .itemContainer .sceneNode .translation.selected{opacity:1}#sceneExplorer .itemContainer .sceneNode .rotation{grid-column:3;opacity:.6}#sceneExplorer .itemContainer .sceneNode .rotation.selected{opacity:1}#sceneExplorer .itemContainer .sceneNode .scaling{grid-column:4;opacity:.6}#sceneExplorer .itemContainer .sceneNode .scaling.selected{opacity:1}#sceneExplorer .itemContainer .sceneNode .bounding{grid-column:5;opacity:.6}#sceneExplorer .itemContainer .sceneNode .bounding.selected{opacity:1}#sceneExplorer .itemContainer .sceneNode .separator{grid-column:6;margin-left:5px;width:5px;display:flex;align-items:center;height:18px;border-left:solid 1px #337ab7}#sceneExplorer .itemContainer .sceneNode .pickingMode{grid-column:7;opacity:.6}#sceneExplorer .itemContainer .sceneNode .pickingMode.selected{opacity:1}#sceneExplorer .itemContainer .sceneNode .coordinates{grid-column:8;opacity:.6}#sceneExplorer .itemContainer .sceneNode .coordinates.selected{opacity:1}#sceneExplorer .itemContainer .sceneNode .refresh{grid-column:9}#sceneExplorer .itemContainer .sceneNode .extensions{width:20px;grid-column:10}#sceneExplorer .itemContainer .targetedAnimationTools{grid-column:2;width:100%;display:grid;grid-template-columns:1fr auto 5px;align-items:center;min-width:0}#sceneExplorer .itemContainer .targetedAnimationTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .animationGroupTools{grid-column:2;width:100%;display:grid;grid-template-columns:1fr auto 5px;align-items:center;min-width:0}#sceneExplorer .itemContainer .animationGroupTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .soundTools{grid-column:2;width:100%;display:grid;grid-template-columns:1fr auto 5px;align-items:center;min-width:0}#sceneExplorer .itemContainer .soundTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .meshTools{grid-column:2;width:100%;display:grid;grid-template-columns:1fr auto 20px 20px auto 5px;align-items:center;min-width:0}#sceneExplorer .itemContainer .meshTools .edit{width:20px;grid-column:2}#sceneExplorer .itemContainer .meshTools .bounding-box{grid-column:3;opacity:.5}#sceneExplorer .itemContainer .meshTools .bounding-box.selected{opacity:1}#sceneExplorer .itemContainer .meshTools .visibility{grid-column:4}#sceneExplorer .itemContainer .meshTools .extensions{width:20px;grid-column:5}#sceneExplorer .itemContainer .cameraTools{grid-column:2;display:grid;grid-template-columns:1fr 20px 20px auto 5px;align-items:center}#sceneExplorer .itemContainer .cameraTools .activeCamera{grid-column:2}#sceneExplorer .itemContainer .cameraTools .enableGizmo{grid-column:3}#sceneExplorer .itemContainer .cameraTools .extensions{width:20px;grid-column:4}#sceneExplorer .itemContainer .lightTools{grid-column:2;display:grid;grid-template-columns:1fr 20px 20px auto 5px;align-items:center}#sceneExplorer .itemContainer .lightTools .visibility{grid-column:2}#sceneExplorer .itemContainer .lightTools .enableGizmo{grid-column:3}#sceneExplorer .itemContainer .lightTools .extensions{width:20px;grid-column:4}#sceneExplorer .itemContainer .spriteTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .spriteTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .spriteManagerTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .spriteManagerTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .materialTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .materialTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .materialTools .icon{display:grid;align-items:center;justify-items:center;cursor:pointer}#sceneExplorer .itemContainer .particleSystemTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .particleSystemTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .effectLayerTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .effectLayerTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .postProcessTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .postProcessTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .renderingPipelineTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .renderingPipelineTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .textureTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .textureTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .adtextureTools{grid-column:2;display:grid;grid-template-columns:1fr 20px 20px auto 5px;align-items:center}#sceneExplorer .itemContainer .adtextureTools .edit{grid-column:2}#sceneExplorer .itemContainer .adtextureTools .pickingMode{grid-column:3;opacity:.6}#sceneExplorer .itemContainer .adtextureTools .pickingMode.selected{opacity:1}#sceneExplorer .itemContainer .adtextureTools .extensions{width:20px;grid-column:3}#sceneExplorer .itemContainer .controlTools{grid-column:2;display:grid;grid-template-columns:1fr 20px 20px auto 5px;align-items:center}#sceneExplorer .itemContainer .controlTools .highlight{grid-column:2}#sceneExplorer .itemContainer .controlTools .visibility{grid-column:3}#sceneExplorer .itemContainer .controlTools .extensions{width:20px;grid-column:4}#sceneExplorer .itemContainer .transformNodeTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .transformNodeTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .skeletonTools{grid-column:2;display:grid;grid-template-columns:1fr auto 5px;align-items:center}#sceneExplorer .itemContainer .skeletonTools .extensions{width:20px;grid-column:2}#sceneExplorer .itemContainer .title{grid-column:1;background:rgba(0,0,0,0);white-space:nowrap;overflow:hidden;min-width:0;margin-right:5px;display:grid;align-items:center;grid-template-columns:25px 1fr;height:24px;cursor:pointer}#sceneExplorer .itemContainer .title .titleIcon{grid-column:1;display:grid;align-items:center;justify-items:center}#sceneExplorer .itemContainer .title .titleText{grid-column:2;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}',"",{version:3,sources:["webpack://./../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss"],names:[],mappings:"AAAA,qBACI,iBAAA,CACA,QAAA,CACA,OAAA,CACA,UAAA,CAEA,2BACI,YAAA,CAIR,oBACI,YAAA,CAGJ,cACI,eAAA,CAEA,sCACI,YAAA,CACA,cAAA,CAEA,4CACI,eAAA,CAKZ,2DACI,UAAA,CACA,kBAAA,CAGJ,eACI,eAAA,CACA,WAAA,CACA,QAAA,CACA,SAAA,CACA,YAAA,CACA,2BAAA,CACA,iBAAA,CAEA,qBACI,YAAA,CAGJ,uBACI,WAAA,CACA,cAAA,CACA,UAAA,CACA,eAAA,CACA,UAAA,CACA,iBAAA,CACA,YAAA,CACA,mCAAA,CACA,gBAAA,CAEA,6BACI,iBAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,MAAA,CACA,YAAA,CACA,iBAAA,CACA,mBAAA,CAGJ,8BACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,iBAAA,CAGJ,iCACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,6BAAA,CAEA,yCACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAGJ,wCACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAKZ,qBACI,UAAA,CAEA,iBAAA,CACA,eAAA,CAGJ,uBACI,YAAA,CACA,mBAAA,CAEA,6BACI,UAAA,CACA,yBAAA,CACA,aAAA,CACA,WAAA,CACA,SAAA,CACA,+BAAA,CACA,uFAAA,CACA,6BAAA,CACA,2BAAA,CACA,2BAAA,CACA,UAAA,CAGJ,0CACI,aAAA,CAGJ,mCACI,eAAA,CACA,YAAA,CACA,uBAAA,CAIR,+BACI,eAAA,CACA,UAAA,CACA,cAAA,CACA,iBAAA,CACA,WAAA,CAEA,gBAAA,CAEA,iBAAA,CACA,YAAA,CACA,kBAAA,CAEA,qCACI,eAAA,CAGJ,iDACI,YAAA,CACA,8BAAA,CAEA,uDACI,aAAA,CACA,YAAA,CACA,8BAAA,CAEA,8DACI,aAAA,CACA,eAAA,CACA,UAAA,CACA,cAAA,CACA,oBAAA,CACA,gBAAA,CACA,UAAA,CAGJ,mEACI,aAAA,CACA,YAAA,CACA,kBAAA,CAIR,4DACI,UAAA,CACA,aAAA,CACA,iBAAA,CAKZ,qBACI,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAGJ,8BACI,eAAA,CACA,UAAA,CACA,cAAA,CACA,iBAAA,CACA,WAAA,CACA,gBAAA,CACA,YAAA,CACA,8BAAA,CAEA,oCACI,eAAA,CAGJ,uCACI,eAAA,CACA,UAAA,CAGJ,2CACI,UAAA,CAGJ,qCACI,aAAA,CACA,UAAA,CACA,UAAA,CAGJ,qCACI,WAAA,CACA,iBAAA,CACA,qBAAA,CACA,UAAA,CACA,mCAAA,CACA,iBAAA,CACA,SAAA,CACA,kBAAA,CACA,qBAAA,CAEA,0CACI,kBAAA,CAGJ,2CACI,YAAA,CAGJ,gDACI,wBAAA,CACA,eAAA,CACA,kBAAA,CACA,sBAAA,CACA,WAAA,CAEA,sDACI,eAAA,CACA,UAAA,CAKZ,yCACI,aAAA,CACA,iBAAA,CACA,YAAA,CACA,qEAAA,CACA,kBAAA,CACA,cAAA,CAEA,qDACI,aAAA,CACA,gBAAA,CACA,YAAA,CACA,kBAAA,CACA,WAAA,CAGJ,sDACI,aAAA,CACA,UAAA,CAEA,+DACI,SAAA,CAIR,mDACI,aAAA,CACA,UAAA,CAEA,4DACI,SAAA,CAIR,kDACI,aAAA,CACA,UAAA,CACA,2DACI,SAAA,CAIR,mDACI,aAAA,CACA,UAAA,CACA,4DACI,SAAA,CAIR,oDACI,aAAA,CACA,eAAA,CACA,SAAA,CACA,YAAA,CACA,kBAAA,CACA,WAAA,CACA,6BAAA,CAGJ,sDACI,aAAA,CACA,UAAA,CAEA,+DACI,SAAA,CAIR,sDACI,aAAA,CACA,UAAA,CAEA,+DACI,SAAA,CAIR,kDACI,aAAA,CAGJ,qDACI,UAAA,CACA,cAAA,CAIR,sDACI,aAAA,CACA,UAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CACA,WAAA,CAEA,kEACI,UAAA,CACA,aAAA,CAIR,mDACI,aAAA,CACA,UAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CACA,WAAA,CAEA,+DACI,UAAA,CACA,aAAA,CAIR,0CACI,aAAA,CACA,UAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CACA,WAAA,CAEA,sDACI,UAAA,CACA,aAAA,CAIR,yCACI,aAAA,CACA,UAAA,CACA,YAAA,CACA,iDAAA,CACA,kBAAA,CACA,WAAA,CAEA,+CACI,UAAA,CACA,aAAA,CAGJ,uDACI,aAAA,CACA,UAAA,CAEA,gEACI,SAAA,CAIR,qDACI,aAAA,CAGJ,qDACI,UAAA,CACA,aAAA,CAIR,2CACI,aAAA,CACA,YAAA,CACA,4CAAA,CACA,kBAAA,CAEA,yDACI,aAAA,CAGJ,wDACI,aAAA,CAGJ,uDACI,UAAA,CACA,aAAA,CAIR,0CACI,aAAA,CACA,YAAA,CACA,4CAAA,CACA,kBAAA,CAEA,sDACI,aAAA,CAGJ,uDACI,aAAA,CAGJ,sDACI,UAAA,CACA,aAAA,CAIR,2CACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,uDACI,UAAA,CACA,aAAA,CAIR,kDACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,8DACI,UAAA,CACA,aAAA,CAIR,6CACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,yDACI,UAAA,CACA,aAAA,CAGJ,mDACI,YAAA,CACA,kBAAA,CACA,oBAAA,CACA,cAAA,CAIR,mDACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,+DACI,UAAA,CACA,aAAA,CAIR,gDACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,4DACI,UAAA,CACA,aAAA,CAIR,gDACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,4DACI,UAAA,CACA,aAAA,CAIR,sDACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,kEACI,UAAA,CACA,aAAA,CAIR,4CACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,wDACI,UAAA,CACA,aAAA,CAIR,8CACI,aAAA,CACA,YAAA,CACA,4CAAA,CACA,kBAAA,CAEA,oDACI,aAAA,CAGJ,2DACI,aAAA,CACA,UAAA,CAEA,oEACI,SAAA,CAIR,0DACI,UAAA,CACA,aAAA,CAIR,4CACI,aAAA,CACA,YAAA,CACA,4CAAA,CACA,kBAAA,CAEA,uDACI,aAAA,CAGJ,wDACI,aAAA,CAGJ,wDACI,UAAA,CACA,aAAA,CAIR,kDACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,8DACI,UAAA,CACA,aAAA,CAIR,6CACI,aAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CAEA,yDACI,UAAA,CACA,aAAA,CAIR,qCACI,aAAA,CACA,wBAAA,CACA,kBAAA,CACA,eAAA,CACA,WAAA,CACA,gBAAA,CACA,YAAA,CACA,kBAAA,CACA,8BAAA,CACA,WAAA,CACA,cAAA,CAEA,gDACI,aAAA,CACA,YAAA,CACA,kBAAA,CACA,oBAAA,CAGJ,gDACI,aAAA,CACA,kBAAA,CACA,sBAAA,CACA,eAAA",sourceRoot:""}]),a.locals={};const i=a},5228:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3234),n=s.n(r),o=s(7474),a=s.n(o)()(n());a.push([e.id,'.color-picker-container{width:320px;height:300px;background-color:#fff;display:grid;grid-template-columns:100%;grid-template-rows:50% 50px 60px 40px 1fr auto;font-family:"acumin-pro-condensed";font-weight:normal;font-size:14px}.color-picker-container.with-hints{height:380px}.color-picker-container .color-picker-saturation{grid-row:1;grid-column:1;display:grid;grid-template-columns:100%;grid-template-rows:100%;position:relative;cursor:pointer}.color-picker-container .color-picker-saturation .color-picker-saturation-white{grid-row:1;grid-column:1;background:linear-gradient(to right, #fff, rgba(255, 255, 255, 0))}.color-picker-container .color-picker-saturation .color-picker-saturation-black{grid-row:1;grid-column:1;background:linear-gradient(to top, #000, rgba(0, 0, 0, 0))}.color-picker-container .color-picker-saturation .color-picker-saturation-cursor{pointer-events:none;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;transform:translate(-2px, -2px);position:absolute}.color-picker-container .color-picker-hue{grid-row:2;grid-column:1;display:grid;margin:10px;grid-template-columns:24% 76%;grid-template-rows:100%}.color-picker-container .color-picker-hue .color-picker-hue-color{grid-row:1;grid-column:1;align-self:center;justify-self:center;width:30px;height:30px;border-radius:15px;border:1px solid #000}.color-picker-container .color-picker-hue .color-picker-hue-slider{grid-row:1;grid-column:2;align-self:center;height:16px;position:relative;cursor:pointer;background:linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)}.color-picker-container .color-picker-hue .color-picker-hue-slider .color-picker-hue-cursor{pointer-events:none;width:8px;height:18px;transform:translate(-4px, -2px);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);position:absolute}.color-picker-container .color-picker-component{display:grid;margin:5px;grid-template-columns:100%;grid-template-rows:50% 50%}.color-picker-container .color-picker-component .color-picker-component-value{justify-self:center;align-self:center;grid-row:1;grid-column:1;margin-bottom:4px}.color-picker-container .color-picker-component .color-picker-component-value input{width:50px}.color-picker-container .color-picker-component .color-picker-component-label{justify-self:center;align-self:center;grid-row:2;grid-column:1;color:#000}.color-picker-container .color-picker-rgb{grid-row:3;grid-column:1;display:grid;margin:10px;grid-template-columns:20% 6.66% 20% 6.66% 20% 6.66% 20%;grid-template-rows:100%}.color-picker-container .red{grid-row:1;grid-column:1}.color-picker-container .green{grid-row:1;grid-column:3}.color-picker-container .blue{grid-row:1;grid-column:5}.color-picker-container .alpha{grid-row:1;grid-column:7}.color-picker-container .alpha.grayed{opacity:.5}.color-picker-container .color-picker-hex{grid-row:4;grid-column:1;display:grid;grid-template-columns:20% 80%;grid-template-rows:100%}.color-picker-container .color-picker-hex .color-picker-hex-label{justify-self:center;align-self:center;grid-row:1;grid-column:1;margin-left:10px;color:#000}.color-picker-container .color-picker-hex .color-picker-hex-value{justify-self:left;align-self:center;grid-row:1;grid-column:2;margin-left:10px;margin-right:10px}.color-picker-container .color-picker-hex .color-picker-hex-value input{width:70px}.color-picker-container .color-picker-warning{color:#000;font-size:11px;padding:4px;justify-self:left;align-self:center;grid-row:6;grid-column:1}',"",{version:3,sources:["webpack://./../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss"],names:[],mappings:"AAAA,wBACI,WAAA,CACA,YAAA,CACA,qBAAA,CACA,YAAA,CACA,0BAAA,CACA,8CAAA,CACA,kCAAA,CACA,kBAAA,CACA,cAAA,CAEA,mCACI,YAAA,CAGJ,iDACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,0BAAA,CACA,uBAAA,CACA,iBAAA,CACA,cAAA,CAEA,gFACI,UAAA,CACA,aAAA,CAEA,kEAAA,CAGJ,gFACI,UAAA,CACA,aAAA,CAEA,0DAAA,CAGJ,iFACI,mBAAA,CACA,SAAA,CACA,UAAA,CACA,uFACI,CAGJ,iBAAA,CACA,+BAAA,CACA,iBAAA,CAIR,0CACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,WAAA,CACA,6BAAA,CACA,uBAAA,CAEA,kEACI,UAAA,CACA,aAAA,CACA,iBAAA,CACA,mBAAA,CACA,UAAA,CACA,WAAA,CACA,kBAAA,CACA,qBAAA,CAGJ,mEACI,UAAA,CACA,aAAA,CACA,iBAAA,CACA,WAAA,CACA,iBAAA,CACA,cAAA,CAEA,0GAAA,CAEA,4FACI,mBAAA,CACA,SAAA,CACA,WAAA,CACA,+BAAA,CACA,wBAAA,CACA,sCAAA,CACA,iBAAA,CAKZ,gDACI,YAAA,CACA,UAAA,CACA,0BAAA,CACA,0BAAA,CAEA,8EACI,mBAAA,CACA,iBAAA,CACA,UAAA,CACA,aAAA,CACA,iBAAA,CAEA,oFACI,UAAA,CAIR,8EACI,mBAAA,CACA,iBAAA,CACA,UAAA,CACA,aAAA,CACA,UAAA,CAIR,0CACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,WAAA,CACA,uDAAA,CACA,uBAAA,CAGJ,6BACI,UAAA,CACA,aAAA,CAGJ,+BACI,UAAA,CACA,aAAA,CAGJ,8BACI,UAAA,CACA,aAAA,CAGJ,+BACI,UAAA,CACA,aAAA,CAEA,sCACI,UAAA,CAIR,0CACI,UAAA,CACA,aAAA,CACA,YAAA,CACA,6BAAA,CACA,uBAAA,CAEA,kEACI,mBAAA,CACA,iBAAA,CACA,UAAA,CACA,aAAA,CACA,gBAAA,CACA,UAAA,CAGJ,kEACI,iBAAA,CACA,iBAAA,CACA,UAAA,CACA,aAAA,CACA,gBAAA,CACA,iBAAA,CAEA,wEACI,UAAA,CAKZ,8CACI,UAAA,CACA,cAAA,CACA,WAAA,CACA,iBAAA,CACA,iBAAA,CACA,UAAA,CACA,aAAA",sourceRoot:""}]),a.locals={};const i=a},7474:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s="",r=void 0!==t[5];return t[4]&&(s+="@supports (".concat(t[4],") {")),t[2]&&(s+="@media ".concat(t[2]," {")),r&&(s+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),s+=e(t),r&&(s+="}"),t[2]&&(s+="}"),t[4]&&(s+="}"),s})).join("")},t.i=function(e,s,r,n,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var i=0;i0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),s&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=s):c[2]=s),n&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=n):c[4]="".concat(n)),t.push(c))}},t}},1721:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},3234:e=>{"use strict";e.exports=function(e){var t=e[1],s=e[3];if(!s)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),o="/*# ".concat(n," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},1684:function(e){e.exports=function(e){function t(r){if(s[r])return s[r].exports;var n=s[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var s={};return t.m=e,t.c=s,t.p="",t(0)}([function(e,t,s){var r,n,o={}.hasOwnProperty,a=[].indexOf||function(e){for(var t=0,s=this.length;t0&&s.data&&(this.groups.has(s.data)?this.groups.get(s.data).push(n):this.groups.set(s.data,[n])),this.frames.push(s)},t.prototype.render=function(){var e,t,s;if(this.running)throw new Error("Already running");if(null==this.options.width||null==this.options.height)throw new Error("Width and height must be set prior to rendering");if(this.running=!0,this.nextFrame=0,this.finishedFrames=0,this.imageParts=function(){var e,t,s;for(s=[],e=0,t=this.frames.length;0<=t?et;0<=t?++e:--e)s.push(null);return s}.call(this),t=this.spawnWorkers(),!0===this.options.globalPalette)this.renderNextFrame();else for(e=0,s=t;0<=s?es;0<=s?++e:--e)this.renderNextFrame();return this.emit("start"),this.emit("progress",0)},t.prototype.abort=function(){for(var e;null!=(e=this.activeWorkers.shift());)this.log("killing active worker"),e.terminate();return this.running=!1,this.emit("abort")},t.prototype.spawnWorkers=function(){var e,t,s;return e=Math.min(this.options.workers,this.frames.length),function(){s=[];for(var r=t=this.freeWorkers.length;t<=e?re;t<=e?r++:r--)s.push(r);return s}.apply(this).forEach(function(e){return function(t){var s;return e.log("spawning worker "+t),(s=new Worker(e.options.workerScript)).onmessage=function(t){return e.activeWorkers.splice(e.activeWorkers.indexOf(s),1),e.freeWorkers.push(s),e.frameFinished(t.data,!1)},e.freeWorkers.push(s)}}(this)),e},t.prototype.frameFinished=function(e,t){var s,r,n,o;if(this.finishedFrames++,t?(s=this.frames.indexOf(e),r=this.groups.get(e.data)[0],this.log("frame "+(s+1)+" is duplicate of "+r+" - "+this.activeWorkers.length+" active"),this.imageParts[s]={indexOfFirstInGroup:r}):(this.log("frame "+(e.index+1)+" finished - "+this.activeWorkers.length+" active"),this.emit("progress",this.finishedFrames/this.frames.length),this.imageParts[e.index]=e),!0===this.options.globalPalette&&!t&&(this.options.globalPalette=e.globalPalette,this.log("global palette analyzed"),this.frames.length>2))for(n=1,o=this.freeWorkers.length;1<=o?no;1<=o?++n:--n)this.renderNextFrame();return a.call(this.imageParts,null)>=0?this.renderNextFrame():this.finishRendering()},t.prototype.finishRendering=function(){var e,t,s,r,n,o,a,i,l,p,c,d,h,u,b,A,m,g,C,f;for(n=o=0,p=(m=this.imageParts).length;o=this.frames.length))return e=this.frames[this.nextFrame++],(t=this.frames.indexOf(e))>0&&this.groups.has(e.data)&&this.groups.get(e.data)[0]!==t?void setTimeout(function(t){return function(){return t.frameFinished(e,!0)}}(this),0):(r=this.freeWorkers.shift(),s=this.getTask(e),this.log("starting frame "+(s.index+1)+" of "+this.frames.length),this.activeWorkers.push(r),r.postMessage(s))},t.prototype.getContextData=function(e){return e.getImageData(0,0,this.options.width,this.options.height).data},t.prototype.getImageData=function(e){var t;return null==this._canvas&&(this._canvas=document.createElement("canvas"),this._canvas.width=this.options.width,this._canvas.height=this.options.height),(t=this._canvas.getContext("2d")).setFill=this.options.background,t.fillRect(0,0,this.options.width,this.options.height),t.drawImage(e,0,0),this.getContextData(t)},t.prototype.getTask=function(e){var t,s;if(s={index:t=this.frames.indexOf(e),last:t===this.frames.length-1,delay:e.delay,transparent:e.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:!0},null!=e.data)s.data=e.data;else if(null!=e.context)s.data=this.getContextData(e.context);else{if(null==e.image)throw new Error("Invalid frame");s.data=this.getImageData(e.image)}return s},t.prototype.log=function(e){if(this.options.debug)return console.log(e)},t}(r),e.exports=n},function(e,t){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var t,s,a,i,l,p;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(o(s=this._events[e]))return!1;if(r(s))switch(arguments.length){case 1:s.call(this);break;case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),s.apply(this,i)}else if(n(s))for(i=Array.prototype.slice.call(arguments,1),a=(p=s.slice()).length,l=0;l0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,t){function s(){this.removeListener(e,s),n||(n=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var n=!1;return s.listener=t,this.on(e,s),this},s.prototype.removeListener=function(e,t){var s,o,a,i;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(s=this._events[e]).length,o=-1,s===t||r(s.listener)&&s.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(s)){for(i=a;i-- >0;)if(s[i]===t||s[i].listener&&s[i].listener===t){o=i;break}if(o<0)return this;1===s.length?(s.length=0,delete this._events[e]):s.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},s.prototype.removeAllListeners=function(e){var t,s;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(s=this._events[e]))this.removeListener(e,s);else if(s)for(;s.length;)this.removeListener(e,s[s.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},s.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t){var s,r,n,o,a;a=navigator.userAgent.toLowerCase(),o=navigator.platform.toLowerCase(),n="ie"===(s=a.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0])[1]&&document.documentMode,(r={name:"version"===s[1]?s[3]:s[1],version:n||parseFloat("opera"===s[1]&&s[4]?s[4]:s[2]),platform:{name:a.match(/ip(?:ad|od|hone)/)?"ios":(a.match(/(?:webos|android)/)||o.match(/mac|win|linux/)||["other"])[0]}})[r.name]=!0,r[r.name+parseInt(r.version,10)]=!0,r.platform[r.platform.name]=!0,e.exports=r}])},772:e=>{"use strict";var t=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},s=0;s<10;s++)t["_"+String.fromCharCode(s)]=s;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var o,a,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l{"use strict";var r=s(8565);function n(){}function o(){}o.resetWarningCache=n,e.exports=function(){function e(e,t,s,n,o,a){if(a!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:n};return s.PropTypes=s,s}},764:(e,t,s)=>{e.exports=s(878)()},8565:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},315:(e,t,s)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var s=l(t);if(s&&s.has(e))return s.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,s&&s.set(e,n),n}(s(7460)),o=i(s(764)),a=i(s(1122));function i(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(l=function(e){return e?s:t})(e)}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(l,e);var t,s,o,i=(s=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(s);if(o){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),h(c(t=i.call(this,e)),"handleKeyNavigation",(function(e){if(!1!==t.state.isVisible)switch(e.keyCode){case 37:case 27:e.preventDefault(),t.hideMenu(e);break;case 38:e.preventDefault(),t.selectChildren(!0);break;case 40:e.preventDefault(),t.selectChildren(!1);break;case 39:t.tryToOpenSubMenu(e);break;case 13:e.preventDefault(),t.tryToOpenSubMenu(e);var s=t.seletedItemRef&&t.seletedItemRef.props&&t.seletedItemRef.props.disabled;t.seletedItemRef&&t.seletedItemRef.ref instanceof HTMLElement&&!s?t.seletedItemRef.ref.click():t.hideMenu(e)}})),h(c(t),"handleForceClose",(function(){t.setState({forceSubMenuOpen:!1})})),h(c(t),"tryToOpenSubMenu",(function(e){t.state.selectedItem&&t.state.selectedItem.type===t.getSubMenuType()&&(e.preventDefault(),t.setState({forceSubMenuOpen:!0}))})),h(c(t),"selectChildren",(function(e){var s=t.state.selectedItem,r=[],o=0,i={};if(n.default.Children.forEach(t.props.children,(function e(s,l){s&&([a.default,t.getSubMenuType()].indexOf(s.type)<0?n.default.Children.forEach(s.props.children,e):s.props.divider||(s.props.disabled&&(++o,i[l]=!0),r.push(s)))})),o!==r.length){var l=function(t){var s=t;do{e?--s:++s,s<0?s=r.length-1:s>=r.length&&(s=0)}while(s!==t&&i[s]);return s===t?null:s}(r.indexOf(s));null!==l&&t.setState({selectedItem:r[l],forceSubMenuOpen:!1})}})),h(c(t),"onChildMouseMove",(function(e){t.state.selectedItem!==e&&t.setState({selectedItem:e,forceSubMenuOpen:!1})})),h(c(t),"onChildMouseLeave",(function(){t.setState({selectedItem:null,forceSubMenuOpen:!1})})),h(c(t),"renderChildren",(function(e){return n.default.Children.map(e,(function(e){var s={};return n.default.isValidElement(e)?[a.default,t.getSubMenuType()].indexOf(e.type)<0?(s.children=t.renderChildren(e.props.children),n.default.cloneElement(e,s)):(s.onMouseLeave=t.onChildMouseLeave.bind(c(t)),e.type===t.getSubMenuType()&&(s.forceOpen=t.state.forceSubMenuOpen&&t.state.selectedItem===e,s.forceClose=t.handleForceClose,s.parentKeyNavigationHandler=t.handleKeyNavigation),e.props.divider||t.state.selectedItem!==e?(s.onMouseMove=function(){return t.onChildMouseMove(e)},n.default.cloneElement(e,s)):(s.selected=!0,s.ref=function(e){t.seletedItemRef=e},n.default.cloneElement(e,s))):e}))})),t.seletedItemRef=null,t.state={selectedItem:null,forceSubMenuOpen:!1},t}return t=l,Object.defineProperty(t,"prototype",{writable:!1}),t}(n.Component);t.default=u,h(u,"propTypes",{children:o.default.node.isRequired})},6824:(e,t,s)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=u(s(7460)),o=u(s(764)),a=u(s(3368)),i=u(s(772)),l=u(s(9225)),p=u(s(315)),c=u(s(2349)),d=s(5451),h=s(3645);function u(e){return e&&e.__esModule?e:{default:e}}function b(e,t){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r={top:s,left:e};if(!t.menu)return r;var n=window,o=n.innerWidth,a=n.innerHeight,i=t.menu.getBoundingClientRect();return s+i.height>a&&(r.top-=i.height),e+i.width>o&&(r.left-=i.width),r.top<0&&(r.top=i.height0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r={top:s,left:e};if(!t.menu)return r;var n=window,o=n.innerWidth,a=n.innerHeight,i=t.menu.getBoundingClientRect();return r.left=e-i.width,s+i.height>a&&(r.top-=i.height),r.left<0&&(r.left+=i.width),r.top<0&&(r.top=i.heighto&&(r.left=i.width{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var s=d(t);if(s&&s.has(e))return s.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,s&&s.set(e,n),n}(s(7460)),o=c(s(764)),a=c(s(3368)),i=c(s(772)),l=s(5451),p=s(3645);function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(d=function(e){return e?s:t})(e)}function h(e,t){for(var s=0;s=0&&0===t.button&&(t.persist(),t.stopPropagation(),e.mouseDownTimeoutId=setTimeout((function(){return e.handleContextClick(t)}),e.props.holdToDisplay)),(0,p.callIfExists)(e.props.attributes.onMouseDown,t)})),m(b(e),"handleMouseUp",(function(t){0===t.button&&clearTimeout(e.mouseDownTimeoutId),(0,p.callIfExists)(e.props.attributes.onMouseUp,t)})),m(b(e),"handleMouseOut",(function(t){0===t.button&&clearTimeout(e.mouseDownTimeoutId),(0,p.callIfExists)(e.props.attributes.onMouseOut,t)})),m(b(e),"handleTouchstart",(function(t){e.touchHandled=!1,e.props.holdToDisplay>=0&&(t.persist(),t.stopPropagation(),e.touchstartTimeoutId=setTimeout((function(){e.handleContextClick(t),e.touchHandled=!0}),e.props.holdToDisplay)),(0,p.callIfExists)(e.props.attributes.onTouchStart,t)})),m(b(e),"handleTouchEnd",(function(t){e.touchHandled&&t.preventDefault(),clearTimeout(e.touchstartTimeoutId),(0,p.callIfExists)(e.props.attributes.onTouchEnd,t)})),m(b(e),"handleContextMenu",(function(t){t.button===e.props.mouseButton&&e.handleContextClick(t),(0,p.callIfExists)(e.props.attributes.onContextMenu,t)})),m(b(e),"handleMouseClick",(function(t){t.button===e.props.mouseButton&&e.handleContextClick(t),(0,p.callIfExists)(e.props.attributes.onClick,t)})),m(b(e),"handleContextClick",(function(t){if(!(e.props.disable||e.props.disableIfShiftIsPressed&&t.shiftKey)){t.preventDefault(),t.stopPropagation();var s=t.clientX||t.touches&&t.touches[0].pageX,r=t.clientY||t.touches&&t.touches[0].pageY;e.props.posX&&(s-=e.props.posX),e.props.posY&&(r-=e.props.posY),(0,l.hideMenu)();var n=(0,p.callIfExists)(e.props.collect,e.props),o={position:{x:s,y:r},target:e.elem,id:e.props.id};n&&"function"==typeof n.then?n.then((function(e){o.data=(0,i.default)({},e,{target:t.target}),(0,l.showMenu)(o)})):(o.data=(0,i.default)({},n,{target:t.target}),(0,l.showMenu)(o))}})),m(b(e),"elemRef",(function(t){e.elem=t})),e}return t=g,(s=[{key:"render",value:function(){var e=this.props,t=e.renderTag,s=e.attributes,r=e.children,o=(0,i.default)({},s,{className:(0,a.default)(p.cssClasses.menuWrapper,s.className),onContextMenu:this.handleContextMenu,onClick:this.handleMouseClick,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onTouchStart:this.handleTouchstart,onTouchEnd:this.handleTouchEnd,onMouseOut:this.handleMouseOut,ref:this.elemRef});return n.default.createElement(t,o,r)}}])&&h(t.prototype,s),Object.defineProperty(t,"prototype",{writable:!1}),g}(n.Component);t.default=g,m(g,"propTypes",{id:o.default.string.isRequired,children:o.default.node.isRequired,attributes:o.default.object,collect:o.default.func,disable:o.default.bool,holdToDisplay:o.default.number,posX:o.default.number,posY:o.default.number,renderTag:o.default.elementType,mouseButton:o.default.number,disableIfShiftIsPressed:o.default.bool}),m(g,"defaultProps",{attributes:{},collect:function(){return null},disable:!1,holdToDisplay:1e3,renderTag:"div",posX:0,posY:0,mouseButton:2,disableIfShiftIsPressed:!1})},1122:(e,t,s)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var s=d(t);if(s&&s.has(e))return s.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,s&&s.set(e,n),n}(s(7460)),o=c(s(764)),a=c(s(3368)),i=c(s(772)),l=s(5451),p=s(3645);function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(d=function(e){return e?s:t})(e)}function h(){return h=Object.assign||function(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=h(s(7460)),o=h(s(764)),a=h(s(3368)),i=h(s(772)),l=s(5451),p=h(s(315)),c=s(3645),d=h(s(9225));function h(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign||function(e){for(var t=1;tr?o.bottom=0:o.top=0,n.righte?r.bottom=0:r.top=0,s.left<0?r.left="100%":r.right="100%",r})),C(m(t),"hideMenu",(function(e){e.preventDefault(),t.hideSubMenu(e)})),C(m(t),"hideSubMenu",(function(e){e.detail&&e.detail.id&&t.menu&&e.detail.id!==t.menu.id||(t.props.forceOpen&&t.props.forceClose(),t.setState({visible:!1,selectedItem:null}),t.unregisterHandlers())})),C(m(t),"handleClick",(function(e){e.preventDefault(),t.props.disabled||((0,c.callIfExists)(t.props.onClick,e,(0,i.default)({},t.props.data,c.store.data),c.store.target),t.props.onClick&&!t.props.preventCloseOnClick&&(0,l.hideMenu)())})),C(m(t),"handleMouseEnter",(function(){t.closetimer&&clearTimeout(t.closetimer),t.props.disabled||t.state.visible||(t.opentimer=setTimeout((function(){return t.setState({visible:!0,selectedItem:null})}),t.props.hoverDelay))})),C(m(t),"handleMouseLeave",(function(){t.opentimer&&clearTimeout(t.opentimer),t.state.visible&&(t.closetimer=setTimeout((function(){return t.setState({visible:!1,selectedItem:null})}),t.props.hoverDelay))})),C(m(t),"menuRef",(function(e){t.menu=e})),C(m(t),"subMenuRef",(function(e){t.subMenu=e})),C(m(t),"registerHandlers",(function(){document.removeEventListener("keydown",t.props.parentKeyNavigationHandler),document.addEventListener("keydown",t.handleKeyNavigation)})),C(m(t),"unregisterHandlers",(function(e){document.removeEventListener("keydown",t.handleKeyNavigation),e||document.addEventListener("keydown",t.props.parentKeyNavigationHandler)})),t.state=(0,i.default)({},t.state,{visible:!1}),t}return t=f,(s=[{key:"componentDidMount",value:function(){this.listenId=d.default.register((function(){}),this.hideSubMenu)}},{key:"getSubMenuType",value:function(){return f}},{key:"shouldComponentUpdate",value:function(e,t){return this.isVisibilityChange=!(this.state.visible===t.visible&&this.props.forceOpen===e.forceOpen||this.state.visible&&e.forceOpen||this.props.forceOpen&&t.visible),!0}},{key:"componentDidUpdate",value:function(){var e=this;this.isVisibilityChange&&(this.props.forceOpen||this.state.visible?(window.requestAnimationFrame||setTimeout)((function(){var t=e.props.rtl?e.getRTLMenuPosition():e.getMenuPosition();e.subMenu.style.removeProperty("top"),e.subMenu.style.removeProperty("bottom"),e.subMenu.style.removeProperty("left"),e.subMenu.style.removeProperty("right"),(0,c.hasOwnProp)(t,"top")&&(e.subMenu.style.top=t.top),(0,c.hasOwnProp)(t,"left")&&(e.subMenu.style.left=t.left),(0,c.hasOwnProp)(t,"bottom")&&(e.subMenu.style.bottom=t.bottom),(0,c.hasOwnProp)(t,"right")&&(e.subMenu.style.right=t.right),e.subMenu.classList.add(c.cssClasses.menuVisible),e.registerHandlers(),e.setState({selectedItem:null})})):(this.subMenu.addEventListener("transitionend",(function t(){e.subMenu.removeEventListener("transitionend",t),e.subMenu.style.removeProperty("bottom"),e.subMenu.style.removeProperty("right"),e.subMenu.style.top=0,e.subMenu.style.left="100%",e.unregisterHandlers()})),this.subMenu.classList.remove(c.cssClasses.menuVisible)))}},{key:"componentWillUnmount",value:function(){this.listenId&&d.default.unregister(this.listenId),this.opentimer&&clearTimeout(this.opentimer),this.closetimer&&clearTimeout(this.closetimer),this.unregisterHandlers(!0)}},{key:"render",value:function(){var e,t=this.props,s=t.children,r=t.attributes,o=t.disabled,i=t.title,l=t.selected,p=this.state.visible,d={ref:this.menuRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,className:(0,a.default)(c.cssClasses.menuItem,c.cssClasses.subMenu,r.listClassName),style:{position:"relative"}},h={className:(0,a.default)(c.cssClasses.menuItem,r.className,(e={},C(e,(0,a.default)(c.cssClasses.menuItemDisabled,r.disabledClassName),o),C(e,(0,a.default)(c.cssClasses.menuItemActive,r.visibleClassName),p),C(e,(0,a.default)(c.cssClasses.menuItemSelected,r.selectedClassName),l),e)),onMouseMove:this.props.onMouseMove,onMouseOut:this.props.onMouseOut,onClick:this.handleClick},b={ref:this.subMenuRef,style:{position:"absolute",transition:"opacity 1ms",top:0,left:"100%"},className:(0,a.default)(c.cssClasses.menu,this.props.className)};return n.default.createElement("nav",u({},d,{role:"menuitem",tabIndex:"-1","aria-haspopup":"true"}),n.default.createElement("div",u({},r,h),i),n.default.createElement("nav",u({},b,{role:"menu",tabIndex:"-1"}),this.renderChildren(s)))}}])&&b(t.prototype,s),Object.defineProperty(t,"prototype",{writable:!1}),f}(p.default);t.default=f,C(f,"propTypes",{children:o.default.node.isRequired,attributes:o.default.object,title:o.default.node.isRequired,className:o.default.string,disabled:o.default.bool,hoverDelay:o.default.number,rtl:o.default.bool,selected:o.default.bool,onMouseMove:o.default.func,onMouseOut:o.default.func,forceOpen:o.default.bool,forceClose:o.default.func,parentKeyNavigationHandler:o.default.func}),C(f,"defaultProps",{disabled:!1,hoverDelay:500,attributes:{},className:"",rtl:!1,selected:!1,onMouseMove:function(){return null},onMouseOut:function(){return null},forceOpen:!1,forceClose:function(){return null},parentKeyNavigationHandler:function(){return null}})},5451:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MENU_SHOW=t.MENU_HIDE=void 0,t.dispatchGlobalEvent=l,t.hideMenu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;l(i,(0,n.default)({},e,{type:i}),t)},t.showMenu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;l(a,(0,n.default)({},e,{type:a}),t)};var r,n=(r=s(772))&&r.__esModule?r:{default:r},o=s(3645),a="REACT_CONTEXTMENU_SHOW";t.MENU_SHOW=a;var i="REACT_CONTEXTMENU_HIDE";function l(e,t){var s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;"function"==typeof window.CustomEvent?s=new window.CustomEvent(e,{detail:t}):(s=document.createEvent("CustomEvent")).initCustomEvent(e,!1,!0,t),r&&(r.dispatchEvent(s),(0,n.default)(o.store,t))}t.MENU_HIDE=i},857:(e,t,s)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t){return function(s){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(C,s);var o,i,l,A,m=(o=C,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(o);if(i){var s=u(this).constructor;e=Reflect.construct(t,arguments,s)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,e)});function C(t){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,C),b(h(s=m.call(this,t)),"handleShow",(function(t){if(t.detail.id===e){var r=t.detail.data,n={};for(var o in r)g.includes(o)||(n[o]=r[o]);s.setState({trigger:n})}})),b(h(s),"handleHide",(function(){s.setState({trigger:null})})),s.state={trigger:null},s}return l=C,(A=[{key:"componentDidMount",value:function(){this.listenId=a.default.register(this.handleShow,this.handleHide)}},{key:"componentWillUnmount",value:function(){this.listenId&&a.default.unregister(this.listenId)}},{key:"render",value:function(){return n.default.createElement(t,p({},this.props,{id:e,trigger:this.state.trigger}))}}])&&c(l.prototype,A),Object.defineProperty(l,"prototype",{writable:!1}),C}(n.Component)}};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var s=l(t);if(s&&s.has(e))return s.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,s&&s.set(e,n),n}(s(7460)),o=i(s(774)),a=i(s(9225));function i(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(l=function(e){return e?s:t})(e)}function p(){return p=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var s=0,r=new Array(t);s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(5451),n=s(3645);function o(e,t){for(var s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callIfExists=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r{"use strict";Object.defineProperty(t,"tz",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"Rc",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"Dr",{enumerable:!0,get:function(){return o.default}});var r=a(s(6824)),n=a(s(774)),o=a(s(1122));a(s(2349)),a(s(857)),s(5451);function a(e){return e&&e.__esModule?e:{default:e}}},3903:(e,t,s)=>{"use strict";var r=s(7460),n=s(772),o=s(9798);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s