var INSPECTOR;!(function(e){var t=(function(){function t(n,i,r,a,s){var o=this;if(this._popupMode=!1,this._initialTab=r,this._parentElement=a,this._scene=n,t.DOCUMENT=window.document,t.WINDOW=window,BABYLON.Canvas2D||BABYLON.Tools.LoadScript("https://www.babylonjs.com/babylon.canvas2d.js",(function(){})),i)this.openPopup(!0);else{var l=this._scene.getEngine().getRenderingCanvas(),p=l.parentElement,c=(t.WINDOW.getComputedStyle(p),t.WINDOW.getComputedStyle(l));if(this._canvasStyle={width:e.Helpers.Css(l,"width"),height:e.Helpers.Css(l,"height"),position:c.position,top:c.top,bottom:c.bottom,left:c.left,right:c.right,padding:c.padding,paddingBottom:c.paddingBottom,paddingLeft:c.paddingLeft,paddingTop:c.paddingTop,paddingRight:c.paddingRight,margin:c.margin,marginBottom:c.marginBottom,marginLeft:c.marginLeft,marginTop:c.marginTop,marginRight:c.marginRight},this._parentElement){this._c2diwrapper=e.Helpers.CreateDiv("insp-wrapper",this._parentElement),this._c2diwrapper.style.width="100%",this._c2diwrapper.style.height="100%",this._c2diwrapper.style.paddingLeft="5px";var u=e.Helpers.CreateDiv("insp-right-panel",this._c2diwrapper);u.style.width="100%",u.style.height="100%",this._buildInspector(u)}else{this._c2diwrapper=e.Helpers.CreateDiv("insp-wrapper");for(var h in this._canvasStyle)this._c2diwrapper.style[h]=this._canvasStyle[h];var d=parseFloat(c.width.substr(0,c.width.length-2))||0,_=parseFloat(c.height.substr(0,c.height.length-2))||0;if("absolute"===c.position||"relative"===c.position){var v=parseFloat(c.left.substr(0,c.left.length-2))||0;d+v>=t.WINDOW.innerWidth&&(this._c2diwrapper.style.maxWidth=d-v+"px")}var f=this._getRelativeParent(l),b=f.clientWidth,g=f.clientHeight,m=d/b*100,C=_/g*100;this._c2diwrapper.style.width=m+"%",this._c2diwrapper.style.height=C+"%",l.style.position="static",l.style.width="100%",l.style.height="100%",l.style.paddingBottom="0",l.style.paddingLeft="0",l.style.paddingTop="0",l.style.paddingRight="0",l.style.margin="0",l.style.marginBottom="0",l.style.marginLeft="0",l.style.marginTop="0",l.style.marginRight="0",p.replaceChild(this._c2diwrapper,l),this._c2diwrapper.appendChild(l);var u=e.Helpers.CreateDiv("insp-right-panel",this._c2diwrapper);this._parentElement||Split([l,u],{direction:"horizontal",sizes:[75,25],onDrag:function(){e.Helpers.SEND_EVENT("resize"),o._tabbar&&o._tabbar.updateWidth()}}),this._buildInspector(u)}e.Helpers.SEND_EVENT("resize"),this._tabbar.updateWidth()}if(e.Helpers.IsBrowserEdge()||this.refresh(),s)for(var y=s.backgroundColor||"#242424",T=s.backgroundColorLighter||"#2c2c2c",E=s.backgroundColorLighter2||"#383838",P=s.backgroundColorLighter3||"#454545",O=s.color||"#ccc",L=s.colorTop||"#f29766",S=s.colorBot||"#5db0d7",N=t.DOCUMENT.querySelectorAll("style"),B=0;B0&&t.push(new e.BoundingBox(this)),t.push(new e.Info(this)),t},n.prototype.setVisible=function(e){this._obj.setEnabled(e),this._obj.isVisible=e},n.prototype.isVisible=function(){return this._obj.isEnabled()&&this._obj.isVisible},n.prototype.isBoxVisible=function(){return this._obj.showBoundingBox},n.prototype.setBoxVisible=function(e){return this._obj.showBoundingBox=e},n.prototype.debug=function(e){0==this._axis.length&&this._drawAxis();for(var t=0,n=this._axis;t0){for(var i=new e.TreeItem(t,new e.Canvas2DAdapter(n)),a=0,s=n.children;a0){var s=new e.TreeItem(t,new e.MeshAdapter(n));i.push(s);for(var o=0,l=a;o=r._tabs.length)&&(i=0,console.warn("")),r._tabs[i].active(!0);for(var a=0,s=r._tabs;a0&&t>e;){var n=this._visibleTabs.pop();this._invisibleTabs.push(n),this._div.removeChild(n.toHtml()),t=this.getPixelWidth()+75}if(this._invisibleTabs.length>0&&t+750&&!this._div.contains(this._moreTabsIcon)&&this._div.appendChild(this._moreTabsIcon)},n})(e.BasicElement);e.TabBar=t})(INSPECTOR||(INSPECTOR={}));var INSPECTOR;!(function(e){var t=(function(){function t(t,n,i,r){var a=this;this._inspector=i,this._elem=e.Inspector.DOCUMENT.createElement("i"),this._elem.className="tool fa "+t,n.appendChild(this._elem),this._elem.addEventListener("click",(function(e){a.action()})),new e.Tooltip(this._elem,r)}return t.prototype.toHtml=function(){return this._elem},t.prototype.getPixelWidth=function(){var t=e.Inspector.WINDOW.getComputedStyle(this._elem),n=parseFloat(t.marginLeft.substr(0,t.marginLeft.length-2))||0,i=parseFloat(t.marginRight.substr(0,t.marginRight.length-2))||0;return(this._elem.clientWidth||0)+n+i},t.prototype._updateIcon=function(e){this._elem.className="tool fa "+e},t})();e.AbstractTool=t})(INSPECTOR||(INSPECTOR={}));var INSPECTOR;!(function(e){var t=(function(t){function n(e,n){var i=t.call(this,"fa-pause",e,n,"Pause the automatic update of properties")||this;return i._isPause=!1,i}return __extends(n,t),n.prototype.action=function(){this._isPause?(e.Scheduler.getInstance().pause=!1,this._updateIcon("fa-pause")):(e.Scheduler.getInstance().pause=!0,this._updateIcon("fa-play")),this._isPause=!this._isPause},n})(e.AbstractTool);e.PauseScheduleTool=t})(INSPECTOR||(INSPECTOR={}));var INSPECTOR;!(function(e){var t=(function(e){function t(t,n){var i=e.call(this,"fa-mouse-pointer",t,n,"Select a mesh in the scene")||this;return i._isActive=!1,i._pickHandler=i._pickMesh.bind(i),i}return __extends(t,e),t.prototype.action=function(){this._isActive?this._deactivate():(this.toHtml().classList.add("active"),this._inspector.scene.getEngine().getRenderingCanvas().addEventListener("click",this._pickHandler),this._isActive=!0)},t.prototype._deactivate=function(){this.toHtml().classList.remove("active"),this._inspector.scene.getEngine().getRenderingCanvas().removeEventListener("click",this._pickHandler),this._isActive=!1},t.prototype._pickMesh=function(e){var t=this._updatePointerPosition(e),n=this._inspector.scene.pick(t.x,t.y,(function(e){return!0}));n.pickedMesh&&(console.log(n.pickedMesh.name),this._inspector.displayObjectDetails(n.pickedMesh)),this._deactivate()},t.prototype._updatePointerPosition=function(e){var t=this._inspector.scene.getEngine().getRenderingCanvasClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},t})(e.AbstractTool);e.PickTool=t})(INSPECTOR||(INSPECTOR={}));var INSPECTOR;!(function(e){var t=(function(e){function t(t,n){return e.call(this,"fa-external-link",t,n,"Open the inspector in a popup")||this}return __extends(t,e),t.prototype.action=function(){this._inspector.openPopup()},t})(e.AbstractTool);e.PopupTool=t})(INSPECTOR||(INSPECTOR={}));var INSPECTOR;!(function(e){var t=(function(e){function t(t,n){return e.call(this,"fa-refresh",t,n,"Refresh the current tab")||this}return __extends(t,e),t.prototype.action=function(){this._inspector.refresh()},t})(e.AbstractTool);e.RefreshTool=t})(INSPECTOR||(INSPECTOR={}));var INSPECTOR;!(function(e){var t=(function(t){function n(e,n){var i=t.call(this,"fa-tags",e,n,"Display mesh names on the canvas")||this;return i._isDisplayed=!1,i._canvas=null,i._labelInitialized=!1,i._scene=null,i._canvas2DLoaded=!1,i._newMeshObserver=null,i._removedMeshObserver=null,i._newLightObserver=null,i._removedLightObserver=null,i._newCameraObserver=null,i._removedCameraObserver=null,i._scene=n.scene,i}return __extends(n,t),n.prototype.dispose=function(){this._newMeshObserver&&(this._scene.onNewMeshAddedObservable.remove(this._newMeshObserver),this._scene.onMeshRemovedObservable.remove(this._removedMeshObserver),this._scene.onNewLightAddedObservable.remove(this._newLightObserver),this._scene.onLightRemovedObservable.remove(this._removedLightObserver),this._scene.onNewCameraAddedObservable.remove(this._newCameraObserver),this._scene.onCameraRemovedObservable.remove(this._removedCameraObserver),this._newMeshObserver=this._newLightObserver=this._newCameraObserver=this._removedMeshObserver=this._removedLightObserver=this._removedCameraObserver=null),this._canvas.dispose(),this._canvas=null},n.prototype._checkC2DLoaded=function(){return!0===this._canvas2DLoaded||(BABYLON.Canvas2D&&(this._canvas2DLoaded=!0),this._canvas2DLoaded)},n.prototype._initializeLabels=function(){var e=this;if(!this._labelInitialized&&this._checkC2DLoaded()){this._canvas=new BABYLON.ScreenSpaceCanvas2D(this._scene,{id:"###Label Canvas###"});for(var t=0,n=this._scene.meshes;t0){for(var e=0,t=this.children;e0){for(var e=0,t=this.children;e0&&(this._div.classList.contains("folded")||this._div.classList.contains("unfolded")||this._div.classList.add("folded")),this.fold()},n.prototype._addEvent=function(){var e=this;this._div.addEventListener("click",(function(t){e._tab.select(e),e._isFolded()?e.unfold():e.fold(),t.stopPropagation()})),this._div.addEventListener("mouseover",(function(t){e._tab.highlightNode(e),t.stopPropagation()})),this._div.addEventListener("mouseout",(function(t){e._tab.highlightNode()}))},n.prototype.highlight=function(e){if(!e)for(var t=0,n=this.children;t