var INSPECTOR;!(function(e){var t=(function(){function t(n,i,r,a){var s=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("http://www.babylonjs.com/babylon.canvas2d.js",(function(){})),i)this.openPopup(!0);else{var o=this._scene.getEngine().getRenderingCanvas(),l=o.parentElement,p=(t.WINDOW.getComputedStyle(l),t.WINDOW.getComputedStyle(o));this._canvasStyle={width:e.Helpers.Css(o,"width"),height:e.Helpers.Css(o,"height"),position:p.position,top:p.top,bottom:p.bottom,left:p.left,right:p.right,padding:p.padding,paddingBottom:p.paddingBottom,paddingLeft:p.paddingLeft,paddingTop:p.paddingTop,paddingRight:p.paddingRight,margin:p.margin,marginBottom:p.marginBottom,marginLeft:p.marginLeft,marginTop:p.marginTop,marginRight:p.marginRight},this._c2diwrapper=e.Helpers.CreateDiv("insp-wrapper");for(var c in this._canvasStyle)this._c2diwrapper.style[c]=this._canvasStyle[c];var u=parseFloat(p.width.substr(0,p.width.length-2))||0,h=parseFloat(p.height.substr(0,p.height.length-2))||0;if("absolute"===p.position||"relative"===p.position){var d=parseFloat(p.left.substr(0,p.left.length-2))||0;u+d>=t.WINDOW.innerWidth&&(this._c2diwrapper.style.maxWidth=u-d+"px")}var _=this._getRelativeParent(o),v=_.clientWidth,f=_.clientHeight,b=u/v*100,g=h/f*100;this._c2diwrapper.style.width=b+"%",this._c2diwrapper.style.height=g+"%",o.style.position="static",o.style.width="100%",o.style.height="100%",o.style.paddingBottom="0",o.style.paddingLeft="0",o.style.paddingTop="0",o.style.paddingRight="0",o.style.margin="0",o.style.marginBottom="0",o.style.marginLeft="0",o.style.marginTop="0",o.style.marginRight="0",l.replaceChild(this._c2diwrapper,o),this._c2diwrapper.appendChild(o);var m=void 0;this._parentElement?(this._c2diwrapper.appendChild(this._parentElement),m=e.Helpers.CreateDiv("insp-right-panel",this._parentElement),m.style.width="100%",m.style.height="100%"):m=e.Helpers.CreateDiv("insp-right-panel",this._c2diwrapper),this._parentElement||Split([o,m],{direction:"horizontal",sizes:[75,25],onDrag:function(){e.Helpers.SEND_EVENT("resize"),s._tabbar&&s._tabbar.updateWidth()}}),this._buildInspector(m),e.Helpers.SEND_EVENT("resize"),this._tabbar.updateWidth()}e.Helpers.IsBrowserEdge()||this.refresh()}return t.prototype._getRelativeParent=function(e,n){if(!e.parentElement)return e;var i=t.WINDOW.getComputedStyle(e);return n?"relative"===i.position||"absolute"===i.position?e:this._getRelativeParent(e.parentElement,!0):"static"==i.position?e.parentElement:this._getRelativeParent(e.parentElement,!0)},t.prototype._buildInspector=function(t){this._tabbar=new e.TabBar(this,this._initialTab),this._topPanel=e.Helpers.CreateDiv("top-panel",t),this._topPanel.appendChild(this._tabbar.toHtml()),this._tabbar.updateWidth(),this._tabPanel=e.Helpers.CreateDiv("tab-panel-content",this._topPanel)},Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"popupMode",{get:function(){return this._popupMode},enumerable:!0,configurable:!0}),t.prototype.filterItem=function(e){this._tabbar.getActiveTab().filter(e)},t.prototype.displayObjectDetails=function(e){this._tabbar.switchMeshTab(e)},t.prototype.refresh=function(){e.Helpers.CleanDiv(this._tabPanel);var t=this._tabbar.getActiveTab();t.update(),this._tabPanel.appendChild(t.getPanel()),e.Helpers.SEND_EVENT("resize")},t.prototype.dispose=function(){if(!this._popupMode){var t=this._scene.getEngine().getRenderingCanvas();for(var n in this._canvasStyle)t.style[n]=this._canvasStyle[n];t.parentElement.parentElement.insertBefore(t,this._c2diwrapper),e.Helpers.CleanDiv(this._c2diwrapper),this._c2diwrapper.remove(),e.Helpers.SEND_EVENT("resize")}},t.prototype.openPopup=function(n){var i=this;if(e.Helpers.IsBrowserEdge())console.warn("Inspector - Popup mode is disabled in Edge, as the popup DOM cannot be updated from the main window for security reasons");else{var r=window.open("","Babylon.js INSPECTOR","toolbar=no,resizable=yes,menubar=no,width=750,height=1000");r.document.title="Babylon.js INSPECTOR";for(var a=t.DOCUMENT.querySelectorAll("style"),s=0;s0){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 this._canvas2DLoaded===!0||(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