UNPKG

babylonjs-gui

Version:

Babylon.js GUI module =====================

1 lines 636 kB
!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:()=>De});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:()=>Zt,CylinderPanel:()=>Bt,DisplayGrid:()=>rt,Ellipse:()=>L,FluentBackplateMaterial:()=>Dt,FluentButtonMaterial:()=>Qt,FluentMaterial:()=>Ot,FluentMaterialDefines:()=>St,FocusableButton:()=>N,FrameGraphGUITask:()=>dt,GUI3DManager:()=>Ee,GizmoHandle:()=>Xt,Grid:()=>D,HandMenu:()=>wt,HandleMaterial:()=>Yt,HandleState:()=>jt,HolographicBackplate:()=>kt,HolographicButton:()=>Lt,HolographicSlate:()=>Jt,Image:()=>O,ImageBasedSlider:()=>nt,ImageScrollBar:()=>$,InputPassword:()=>z,InputText:()=>F,InputTextArea:()=>A,KeyPropertySet:()=>it,Line:()=>Q,LinearGradient:()=>lt,MRDLBackplateMaterial:()=>fe,MRDLSliderBarMaterial:()=>ae,MRDLSliderThumbMaterial:()=>he,MathTools:()=>P,Matrix2D:()=>x,Measure:()=>v,MeshButton3D:()=>$t,MultiLine:()=>W,MultiLinePoint:()=>V,NearMenu:()=>te,NodeRenderGraphGUIBlock:()=>ft,PlanePanel:()=>ee,RadialGradient:()=>_t,RadioButton:()=>H,RadioGroup:()=>X,Rectangle:()=>T,ScatterPanel:()=>ie,ScrollBar:()=>J,ScrollViewer:()=>tt,SelectionPanel:()=>Z,SelectorGroup:()=>j,SideHandle:()=>Kt,SlateGizmo:()=>qt,Slider:()=>U,Slider3D:()=>pe,SliderGroup:()=>K,SpherePanel:()=>ge,StackPanel:()=>w,StackPanel3D:()=>be,Style:()=>ht,TextBlock:()=>S,TextWrapper:()=>E,TextWrapping:()=>C,ToggleButton:()=>et,TouchButton3D:()=>Vt,TouchHolographicButton:()=>Wt,TouchHolographicButtonV3:()=>Me,TouchHolographicMenu:()=>Rt,TouchMeshButton3D:()=>me,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:()=>Zt,CylinderPanel:()=>Bt,DisplayGrid:()=>rt,Ellipse:()=>L,FluentBackplateMaterial:()=>Dt,FluentButtonMaterial:()=>Qt,FluentMaterial:()=>Ot,FluentMaterialDefines:()=>St,FocusableButton:()=>N,FrameGraphGUITask:()=>dt,GUI3DManager:()=>Ee,GizmoHandle:()=>Xt,Grid:()=>D,HandMenu:()=>wt,HandleMaterial:()=>Yt,HandleState:()=>jt,HolographicBackplate:()=>kt,HolographicButton:()=>Lt,HolographicSlate:()=>Jt,Image:()=>O,ImageBasedSlider:()=>nt,ImageScrollBar:()=>$,InputPassword:()=>z,InputText:()=>F,InputTextArea:()=>A,KeyPropertySet:()=>it,Line:()=>Q,LinearGradient:()=>lt,MRDLBackplateMaterial:()=>fe,MRDLSliderBarMaterial:()=>ae,MRDLSliderThumbMaterial:()=>he,MathTools:()=>P,Matrix2D:()=>x,Measure:()=>v,MeshButton3D:()=>$t,MultiLine:()=>W,MultiLinePoint:()=>V,NearMenu:()=>te,NodeRenderGraphGUIBlock:()=>ft,PlanePanel:()=>ee,RadialGradient:()=>_t,RadioButton:()=>H,RadioGroup:()=>X,Rectangle:()=>T,ScatterPanel:()=>ie,ScrollBar:()=>J,ScrollViewer:()=>tt,SelectionPanel:()=>Z,SelectorGroup:()=>j,SideHandle:()=>Kt,SlateGizmo:()=>qt,Slider:()=>U,Slider3D:()=>pe,SliderGroup:()=>K,SpherePanel:()=>ge,StackPanel:()=>w,StackPanel3D:()=>be,Style:()=>ht,TextBlock:()=>S,TextWrapper:()=>E,TextWrapping:()=>C,ToggleButton:()=>et,TouchButton3D:()=>Vt,TouchHolographicButton:()=>Wt,TouchHolographicButtonV3:()=>Me,TouchHolographicMenu:()=>Rt,TouchMeshButton3D:()=>me,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<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},_.apply(this,arguments)};function h(t,e,i,o){var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var s=t.length-1;s>=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]<r[3])){n.label=s[1];break}if(6===s[0]&&n.label<r[1]){n.label=r[1],r=s;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(s);break}r[2]&&n.ops.pop(),n.trys.pop();continue}s=e.call(t,n)}catch(t){s=[6,t],o=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var d=o(597),f=function(){function t(e,i,o){void 0===i&&(i=t.UNITMODE_PIXEL),void 0===o&&(o=!0),this.negativeValueAllowed=o,this._value=1,this._unit=t.UNITMODE_PIXEL,this.ignoreAdaptiveScaling=!1,this.onChangedObservable=new d.Observable,this._value=e,this._unit=i,this._originalUnit=i}return Object.defineProperty(t.prototype,"isPercentage",{get:function(){return this._unit===t.UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPixel",{get:function(){return this._unit===t.UNITMODE_PIXEL},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"internalValue",{get:function(){return this._value},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){t!==this._value&&(this._value=t,this.onChangedObservable.notifyObservers())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unit",{get:function(){return this._unit},set:function(t){t!==this._unit&&(this._unit=t,this.onChangedObservable.notifyObservers())},enumerable:!1,configurable:!0}),t.prototype.getValueInPixel=function(t,e){return this.isPixel?this.getValue(t):this.getValue(t)*e},t.prototype.updateInPlace=function(e,i){return void 0===i&&(i=t.UNITMODE_PIXEL),this.value===e&&this.unit===i||(this._value=e,this._unit=i,this.onChangedObservable.notifyObservers()),this},t.prototype.getValue=function(e){if(e&&!this.ignoreAdaptiveScaling&&this.unit!==t.UNITMODE_PERCENTAGE){var i=0,o=0;if(e.idealWidth&&(i=Math.ceil(this._value*e.getSize().width/e.idealWidth)),e.idealHeight&&(o=Math.ceil(this._value*e.getSize().height/e.idealHeight)),e.useSmallestIdeal&&e.idealWidth&&e.idealHeight)return window.innerWidth<window.innerHeight?i:o;if(e.idealWidth)return i;if(e.idealHeight)return o}return this._value},t.prototype.toString=function(e,i){switch(this._unit){case t.UNITMODE_PERCENTAGE:var o=100*this.getValue(e);return(i?o.toFixed(i):o)+"%";case t.UNITMODE_PIXEL:var r=this.getValue(e);return(i?r.toFixed(i):r)+"px"}return this._unit.toString()},t.prototype.fromString=function(e){var i=t._Regex.exec(e.toString());if(!i||0===i.length)return!1;var o=parseFloat(i[1]),r=this._originalUnit;if(this.negativeValueAllowed||o<0&&(o=0),4===i.length)switch(i[3]){case"px":r=t.UNITMODE_PIXEL;break;case"%":r=t.UNITMODE_PERCENTAGE,o/=100}return(o!==this._value||r!==this._unit)&&(this._value=o,this._unit=r,this.onChangedObservable.notifyObservers(),!0)},Object.defineProperty(t,"UNITMODE_PERCENTAGE",{get:function(){return t._UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(t,"UNITMODE_PIXEL",{get:function(){return t._UNITMODE_PIXEL},enumerable:!1,configurable:!0}),t._Regex=/(^-?\d*(\.\d+)?)(%|px)?/,t._UNITMODE_PERCENTAGE=0,t._UNITMODE_PIXEL=1,t}(),p=[new d.Vector2(0,0),new d.Vector2(0,0),new d.Vector2(0,0),new d.Vector2(0,0)],g=[new d.Vector2(0,0),new d.Vector2(0,0),new d.Vector2(0,0),new d.Vector2(0,0)],b=new d.Vector2(0,0),m=new d.Vector2(0,0),v=function(){function t(t,e,i,o){this.left=t,this.top=e,this.width=i,this.height=o}return t.prototype.copyFrom=function(t){this.left=t.left,this.top=t.top,this.width=t.width,this.height=t.height},t.prototype.copyFromFloats=function(t,e,i,o){this.left=t,this.top=e,this.width=i,this.height=o},t.CombineToRef=function(t,e,i){var o=Math.min(t.left,e.left),r=Math.min(t.top,e.top),n=Math.max(t.left+t.width,e.left+e.width),a=Math.max(t.top+t.height,e.top+e.height);i.left=o,i.top=r,i.width=n-o,i.height=a-r},t.prototype.addAndTransformToRef=function(t,e,i,o,r,n){var a=this.left+e,s=this.top+i,l=this.width+o,_=this.height+r;p[0].copyFromFloats(a,s),p[1].copyFromFloats(a+l,s),p[2].copyFromFloats(a+l,s+_),p[3].copyFromFloats(a,s+_),b.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE),m.copyFromFloats(0,0);for(var h=0;h<4;h++)t.transformCoordinates(p[h].x,p[h].y,g[h]),b.x=Math.floor(Math.min(b.x,g[h].x)),b.y=Math.floor(Math.min(b.y,g[h].y)),m.x=Math.ceil(Math.max(m.x,g[h].x)),m.y=Math.ceil(Math.max(m.y,g[h].y));n.left=b.x,n.top=b.y,n.width=m.x-b.x,n.height=m.y-b.y},t.prototype.transformToRef=function(t,e){this.addAndTransformToRef(t,0,0,0,0,e)},t.prototype.isEqualsTo=function(t){return this.left===t.left&&this.top===t.top&&this.width===t.width&&this.height===t.height},t.Empty=function(){return new t(0,0,0,0)},t}(),y=function(t){function e(e,i){void 0===i&&(i=0);var o=t.call(this,e.x,e.y)||this;return o.buttonIndex=i,o}return l(e,t),e}(d.Vector2),x=function(){function t(t,e,i,o,r,n){this.m=new Float32Array(6),this.fromValues(t,e,i,o,r,n)}return t.prototype.fromValues=function(t,e,i,o,r,n){return this.m[0]=t,this.m[1]=e,this.m[2]=i,this.m[3]=o,this.m[4]=r,this.m[5]=n,this},t.prototype.determinant=function(){return this.m[0]*this.m[3]-this.m[1]*this.m[2]},t.prototype.invertToRef=function(t){var e=this.m[0],i=this.m[1],o=this.m[2],r=this.m[3],n=this.m[4],a=this.m[5],s=this.determinant();if(s<d.Epsilon*d.Epsilon)return t.m[0]=0,t.m[1]=0,t.m[2]=0,t.m[3]=0,t.m[4]=0,t.m[5]=0,this;var l=1/s,_=o*a-r*n,h=i*n-e*a;return t.m[0]=r*l,t.m[1]=-i*l,t.m[2]=-o*l,t.m[3]=e*l,t.m[4]=_*l,t.m[5]=h*l,this},t.prototype.multiplyToRef=function(t,e){var i=this.m[0],o=this.m[1],r=this.m[2],n=this.m[3],a=this.m[4],s=this.m[5],l=t.m[0],_=t.m[1],h=t.m[2],c=t.m[3],u=t.m[4],d=t.m[5];return e.m[0]=i*l+o*h,e.m[1]=i*_+o*c,e.m[2]=r*l+n*h,e.m[3]=r*_+n*c,e.m[4]=a*l+s*h+u,e.m[5]=a*_+s*c+d,this},t.prototype.transformCoordinates=function(t,e,i){return i.x=t*this.m[0]+e*this.m[2]+this.m[4],i.y=t*this.m[1]+e*this.m[3]+this.m[5],this},t.Identity=function(){return new t(1,0,0,1,0,0)},t.IdentityToRef=function(t){t.m[0]=1,t.m[1]=0,t.m[2]=0,t.m[3]=1,t.m[4]=0,t.m[5]=0},t.TranslationToRef=function(t,e,i){i.fromValues(1,0,0,1,t,e)},t.ScalingToRef=function(t,e,i){i.fromValues(t,0,0,e,0,0)},t.RotationToRef=function(t,e){var i=Math.sin(t),o=Math.cos(t);e.fromValues(o,i,-i,o,0,0)},t.ComposeToRef=function(e,i,o,r,n,a,s){t.TranslationToRef(e,i,t._TempPreTranslationMatrix),t.ScalingToRef(r,n,t._TempScalingMatrix),t.RotationToRef(o,t._TempRotationMatrix),t.TranslationToRef(-e,-i,t._TempPostTranslationMatrix),t._TempPreTranslationMatrix.multiplyToRef(t._TempScalingMatrix,t._TempCompose0),t._TempCompose0.multiplyToRef(t._TempRotationMatrix,t._TempCompose1),a?(t._TempCompose1.multiplyToRef(t._TempPostTranslationMatrix,t._TempCompose2),t._TempCompose2.multiplyToRef(a,s)):t._TempCompose1.multiplyToRef(t._TempPostTranslationMatrix,s)},t._TempPreTranslationMatrix=t.Identity(),t._TempPostTranslationMatrix=t.Identity(),t._TempRotationMatrix=t.Identity(),t._TempScalingMatrix=t.Identity(),t._TempCompose0=t.Identity(),t._TempCompose1=t.Identity(),t._TempCompose2=t.Identity(),t}(),P=function(){function t(){}return t.Round=function(e,i){return void 0===i&&(i=t.DefaultRoundingPrecision),Math.round(e*i)/i},t.DefaultRoundingPrecision=100,t}(),I=function(){function t(e){this.name=e,this._alpha=1,this._alphaSet=!1,this._zIndex=0,this._currentMeasure=v.Empty(),this._tempPaddingMeasure=v.Empty(),this._fontFamily="",this._fontStyle="",this._fontWeight="",this._fontSize=new f(18,f.UNITMODE_PIXEL,!1),this._width=new f(1,f.UNITMODE_PERCENTAGE,!1),this._height=new f(1,f.UNITMODE_PERCENTAGE,!1),this._color="",this._style=null,this._horizontalAlignment=t.HORIZONTAL_ALIGNMENT_CENTER,this._verticalAlignment=t.VERTICAL_ALIGNMENT_CENTER,this._isDirty=!0,this._wasDirty=!1,this._tempParentMeasure=v.Empty(),this._prevCurrentMeasureTransformedIntoGlobalSpace=v.Empty(),this._cachedParentMeasure=v.Empty(),this._descendantsOnlyPadding=!1,this._paddingLeft=new f(0),this._paddingRight=new f(0),this._paddingTop=new f(0),this._paddingBottom=new f(0),this._left=new f(0),this._top=new f(0),this._scaleX=1,this._scaleY=1,this._rotation=0,this._transformCenterX=.5,this._transformCenterY=.5,this._transformMatrix=x.Identity(),this._invertTransformMatrix=x.Identity(),this._transformedPosition=d.Vector2.Zero(),this._isMatrixDirty=!0,this._isVisible=!0,this._isHighlighted=!1,this._highlightColor="#4affff",this._highlightLineWidth=2,this._fontSet=!1,this._dummyVector2=d.Vector2.Zero(),this._downCount=0,this._enterCount=-1,this._doNotRender=!1,this._downPointerIds={},this._evaluatedMeasure=new v(0,0,0,0),this._evaluatedParentMeasure=new v(0,0,0,0),this._isEnabled=!0,this._disabledColor="#9a9a9a",this._disabledColorItem="#6a6a6a",this._isReadOnly=!1,this._gradient=null,this._rebuildLayout=!1,this.onEnabledStateChangedObservable=new d.Observable,this._customData={},this._isClipped=!1,this._automaticSize=!1,this.metadata=null,this.isHitTestVisible=!0,this.isPointerBlocker=!1,this.isFocusInvisible=!1,this._clipChildren=!0,this._clipContent=!0,this.useBitmapCache=!1,this._shadowOffsetX=0,this._shadowOffsetY=0,this._shadowBlur=0,this._previousShadowBlur=0,this._shadowColor="black",this.hoverCursor="",this._linkOffsetX=new f(0),this._linkOffsetY=new f(0),this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new d.Observable,this.onWheelObservable=new d.Observable,this.onPointerMoveObservable=new d.Observable,this.onPointerOutObservable=new d.Observable,this.onPointerDownObservable=new d.Observable,this.onPointerUpObservable=new d.Observable,this.onPointerClickObservable=new d.Observable,this.onEnterPressedObservable=new d.Observable,this.onPointerEnterObservable=new d.Observable,this.onDirtyObservable=new d.Observable,this.onBeforeDrawObservable=new d.Observable,this.onAfterDrawObservable=new d.Observable,this.onDisposeObservable=new d.Observable,this.onIsVisibleChangedObservable=new d.Observable,this.isSerializable=!0,this._fixedRatio=0,this._fixedRatioMasterIsWidth=!0,this.animations=null,this._focusedColor=null,this.tabIndex=-1,this._isFocused=!1,this._unfocusedColor=null,this.onFocusObservable=new d.Observable,this.onBlurObservable=new d.Observable,this.onKeyboardEventProcessedObservable=new d.Observable,this._tmpMeasureA=new v(0,0,0,0)}return Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this._isReadOnly},set:function(t){this._isReadOnly=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transformedMeasure",{get:function(){return this._evaluatedMeasure},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipChildren",{get:function(){return this._clipChildren},set:function(t){this._clipChildren=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipContent",{get:function(){return this._clipContent},set:function(t){this._clipContent=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowOffsetX",{get:function(){return this._shadowOffsetX},set:function(t){this._shadowOffsetX!==t&&(this._shadowOffsetX=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowOffsetY",{get:function(){return this._shadowOffsetY},set:function(t){this._shadowOffsetY!==t&&(this._shadowOffsetY=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowBlur",{get:function(){return this._shadowBlur},set:function(t){this._shadowBlur!==t&&(this._previousShadowBlur=this._shadowBlur,this._shadowBlur=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowColor",{get:function(){return this._shadowColor},set:function(t){this._shadowColor!==t&&(this._shadowColor=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeName",{get:function(){return this._getTypeName()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return this._getTypeName()},Object.defineProperty(t.prototype,"accessibilityTag",{get:function(){return this._accessibilityTag},set:function(t){this._accessibilityTag=t,this.onAccessibilityTagChangedObservable.notifyObservers(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"host",{get:function(){return this._host},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontOffset",{get:function(){return this._fontOffset},set:function(t){this._fontOffset=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alphaSet=!0,this._alpha=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightLineWidth",{get:function(){return this._highlightLineWidth},set:function(t){this._highlightLineWidth!==t&&(this._highlightLineWidth=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isHighlighted",{get:function(){return this._isHighlighted},set:function(t){this._isHighlighted!==t&&(this._isHighlighted=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightColor",{get:function(){return this._highlightColor},set:function(t){this._highlightColor!==t&&(this._highlightColor=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleX",{get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleY",{get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transformCenterY",{get:function(){return this._transformCenterY},set:function(t){this._transformCenterY!==t&&(this._transformCenterY=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transformCenterX",{get:function(){return this._transformCenterX},set:function(t){this._transformCenterX!==t&&(this._transformCenterX=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalAlignment",{get:function(){return this._horizontalAlignment},set:function(t){this._horizontalAlignment!==t&&(this._horizontalAlignment=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalAlignment",{get:function(){return this._verticalAlignment},set:function(t){this._verticalAlignment!==t&&(this._verticalAlignment=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fixedRatio",{get:function(){return this._fixedRatio},set:function(t){this._fixedRatio!==t&&(this._fixedRatio=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fixedRatioMasterIsWidth",{get:function(){return this._fixedRatioMasterIsWidth},set:function(t){this._fixedRatioMasterIsWidth!==t&&(this._fixedRatioMasterIsWidth=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(t){this._fixedRatioMasterIsWidth=!0,this._width.toString(this._host)!==t&&this._width.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"widthInPixels",{get:function(){return this._width.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this._fixedRatioMasterIsWidth=!0,this.width=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(t){this._fixedRatioMasterIsWidth=!1,this._height.toString(this._host)!==t&&this._height.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"heightInPixels",{get:function(){return this._height.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this._fixedRatioMasterIsWidth=!1,this.height=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this._fontFamily!==t&&(this._fontFamily=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._style},set:function(t){var e=this;this._style&&(this._style.onChangedObservable.remove(this._styleObserver),this._styleObserver=null),this._style=t,this._style&&(this._styleObserver=this._style.onChangedObservable.add((function(){e._markAsDirty(),e._resetFontCache()}))),this._markAsDirty(),this._resetFontCache()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFontSizeInPercentage",{get:function(){return this._fontSize.isPercentage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSizeInPixels",{get:function(){var t=this._style?this._style._fontSize:this._fontSize;return t.isPixel?t.getValue(this._host):t.getValueInPixel(this._host,this._tempParentMeasure.height||this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.fontSize=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize.toString(this._host)},set:function(t){this._fontSize.toString(this._host)!==t&&this._fontSize.fromString(t)&&(this._markAsDirty(),this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){this._color!==t&&(this._color=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradient",{get:function(){return this._gradient},set:function(t){this._gradient!==t&&(this._gradient=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this.zIndex!==t&&(this._zIndex=t,this.parent&&this.parent._reOrderControl(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"notRenderable",{get:function(){return this._doNotRender},set:function(t){this._doNotRender!==t&&(this._doNotRender=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!==t&&(this._isVisible=t,this._markAsDirty(!0),this.onIsVisibleChangedObservable.notifyObservers(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkedMesh",{get:function(){return this._linkedMesh},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"descendantsOnlyPadding",{get:function(){return this._descendantsOnlyPadding},set:function(t){this._descendantsOnlyPadding!==t&&(this._descendantsOnlyPadding=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingLeft",{get:function(){return this._paddingLeft.toString(this._host)},set:function(t){this._paddingLeft.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingLeftInPixels",{get:function(){return this._paddingLeft.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.paddingLeft=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_paddingLeftInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingLeftInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingRight",{get:function(){return this._paddingRight.toString(this._host)},set:function(t){this._paddingRight.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingRightInPixels",{get:function(){return this._paddingRight.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.paddingRight=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_paddingRightInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingRightInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingTop",{get:function(){return this._paddingTop.toString(this._host)},set:function(t){this._paddingTop.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingTopInPixels",{get:function(){return this._paddingTop.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.paddingTop=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_paddingTopInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingTopInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingBottom",{get:function(){return this._paddingBottom.toString(this._host)},set:function(t){this._paddingBottom.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddingBottomInPixels",{get:function(){return this._paddingBottom.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.paddingBottom=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_paddingBottomInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingBottomInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left.toString(this._host)},set:function(t){this._left.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftInPixels",{get:function(){return this._left.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.left=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this._top.toString(this._host)},set:function(t){this._top.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topInPixels",{get:function(){return this._top.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.top=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkOffsetX",{get:function(){return this._linkOffsetX.toString(this._host)},set:function(t){this._linkOffsetX.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkOffsetXInPixels",{get:function(){return this._linkOffsetX.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.linkOffsetX=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkOffsetY",{get:function(){return this._linkOffsetY.toString(this._host)},set:function(t){this._linkOffsetY.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkOffsetYInPixels",{get:function(){return this._linkOffsetY.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.linkOffsetY=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerX",{get:function(){return this._currentMeasure.left+this._currentMeasure.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerY",{get:function(){return this._currentMeasure.top+this._currentMeasure.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(t){var e=this;if(this._isEnabled!==t){this._isEnabled=t,this._markAsDirty();var i=function(t){if(t.host){for(var o in t.host._lastControlOver)t===e.host._lastControlOver[o]&&(t._onPointerOut(t,null,!0),delete t.host._lastControlOver[o]);void 0!==t.children&&t.children.forEach(i)}};i(this),this.onEnabledStateChangedObservable.notifyObservers(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabledColor",{get:function(){return this._disabledColor},set:function(t){this._disabledColor!==t&&(this._disabledColor=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabledColorItem",{get:function(){return this._disabledColorItem},set:function(t){this._disabledColorItem!==t&&(this._disabledColorItem=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"focusedColor",{get:function(){return this._focusedColor},set:function(t){this._focusedColor=t},enumerable:!1,configurable:!0}),t.prototype.onBlur=function(){this._isFocused&&(this._isFocused=!1,this.focusedColor&&null!=this._unfocusedColor&&(this.color=this._unfocusedColor),this.onBlurObservable.notifyObservers(this))},t.prototype.onFocus=function(){this._isFocused=!0,this.focusedColor&&(this._unfocusedColor=this.color,this.color=this.focusedColor),this.onFocusObservable.notifyObservers(this)},t.prototype.keepsFocusWith=function(){return null},t.prototype.focus=function(){this._host.moveFocusToControl(this)},t.prototype.blur=function(){this._host.focusedControl=null},t.prototype.processKeyboard=function(t){"Enter"===t.key&&this.onEnterPressedObservable.notifyObservers(this),this.onKeyboardEventProcessedObservable.notifyObservers(t,-1,this)},t.prototype._getTypeName=function(){return"Control"},t.prototype.getAscendantOfClass=function(t){return this.parent?this.parent.getClassName()===t?this.parent:this.parent.getAscendantOfClass(t):null},t.prototype.markAsDirty=function(t){void 0===t&&(t=!1),this._markAsDirty(t)},t.prototype.markAllAsDirty=function(){this._markAllAsDirty()},t.prototype._resetFontCache=function(){this._fontSet=!0,this._markAsDirty()},t.prototype.isAscendant=function(t){return!!this.parent&&(this.parent===t||this.parent.isAscendant(t))},t.prototype.getLocalCoordinates=function(t){var e=d.Vector2.Zero();return this.getLocalCoordinatesToRef(t,e),e},t.prototype.getLocalCoordinatesToRef=function(t,e){return e.x=t.x-this._currentMeasure.left,e.y=t.y-this._currentMeasure.top,this},t.prototype.getParentLocalCoordinates=function(t){var e=d.Vector2.Zero();return e.x=t.x-this._cachedParentMeasure.left,e.y=t.y-this._cachedParentMeasure.top,e},t.prototype.moveToVector3=function(e,i){if(this._host&&this.parent===this._host._rootContainer){this.horizontalAlignment=t.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=t.VERTICAL_ALIGNMENT_TOP;var o=this._host._getGlobalViewport(),r=d.Vector3.Project(e,d.Matrix.IdentityReadOnly,i.getTransformMatrix(),o);this._moveToProjectedPosition(r),r.z<0||r.z>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.width<this._evaluatedParentMeasure.left)return void(this._isClipped=!0);if(this._evaluatedMeasure.top>this._evaluatedParentMeasure.top+this._evaluatedParentMeasure.height)return void(this._isClipped=!0);if(this._evaluatedMeasure.top+this._evaluatedMeasure.height<this._evaluatedParentMeasure.top)return void(this._isClipped=!0)}this._isClipped=!1},t.prototype._measure=function(){this._width.isPixel?this._currentMeasure.width=this._width.getValue(this._host):this._currentMeasure.width*=this._width.getValue(this._host),this._height.isPixel?this._currentMeasure.height=this._height.getValue(this._host):this._currentMeasure.height*=this._height.getValue(this._host),0!==this._fixedRatio&&(this._fixedRatioMasterIsWidth?this._currentMeasure.height=this._currentMeasure.width*this._fixedRatio:this._currentMeasure.width=this._currentMeasure.height*this._fixedRatio)},t.prototype._computeAlignment=function(e,i){var o=this._currentMeasure.width,r=this._currentMeasure.height,n=e.width,a=e.height,s=0,l=0;switch(this.horizontalAlignment){case t.HORIZONTAL_ALIGNMENT_LEFT:s=0;break;case t.HORIZONTAL_ALIGNMENT_RIGHT:s=n-o;break;case t.HORIZONTAL_ALIGNMENT_CENTER:s=(n-o)/2}switch(this.verticalAlignment){case t.VERTICAL_ALIGNMENT_TOP:l=0;break;case t.VERTICAL_ALIGNMENT_BOTTOM:l=a-r;break;case t.VERTICAL_ALIGNMENT_CENTER:l=(a-r)/2}this.descendantsOnlyPadding||(this._paddingLeft.isPixel?(this._currentMeasure.left+=this._paddingLeft.getValue(this._host),this._currentMeasure.width-=this._paddingLeft.getValue(this._host)):(this._currentMeasure.left+=n*this._paddingLeft.getValue(this._host),this._currentMeasure.width-=n*this._paddingLeft.getValue(this._host)),this._paddingRight.isPixel?this._currentMeasure.width-=this._paddingRight.getValue(this._host):this._currentMeasure.width-=n*this._paddingRight.getValue(this._host),this._paddingTop.isPixel?(this._currentMeasure.top+=this._paddingTop.getValue(this._host),this._currentMeasure.height-=this._paddingTop.getValue(this._host)):(this._currentMeasure.top+=a*this._paddingTop.getValue(this._host),this._currentMeasure.height-=a*this._paddingTop.getValue(this._host)),this._paddingBottom.isPixel?this._currentMeasure.height-=this._paddingBottom.getValue(this._host):this._currentMeasure.height-=a*this._paddingBottom.getValue(this._host)),this._left.isPixel?this._currentMeasure.left+=this._left.getValue(this._host):this._currentMeasure.left+=n*this._left.getValue(this._host),this._top.isPixel?this._currentMeasure.top+=this._top.getValue(this._host):this._currentMeasure.top+=a*this._top.getValue(this._host),this._currentMeasure.left+=s,this._currentMeasure.top+=l},t.prototype._preMeasure=function(t,e){},t.prototype._postMeasure=function(t,e){},t.prototype._additionalProcessing=function(t,e){},t.prototype._clipForChildren=function(t){},t.prototype._clip=function(e,i){if(e.beginPath(),t._ClipMeasure.copyFrom(this._currentMeasure),i){i.transformToRef(this._invertTransformMatrix,this._tmpMeasureA);var o=new v(0,0,0,0);o.left=Math.max(this._tmpMeasureA.left,this._currentMeasure.left),o.top=Math.max(this._tmpMeasureA.top,this._currentMeasure.top),o.width=Math.min(this._tmpMeasureA.left+this._tmpMeasureA.width,this._currentMeasure.left+this._currentMeasure.width)-o.left,o.height=Math.min(this._tmpMeasureA.top+this._tmpMeasureA.height,this._currentMeasure.top+this._currentMeasure.height)-o.top,t._ClipMeasure.copyFrom(o)}if(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY){var r=this.shadowOffsetX,n=this.shadowOffsetY,a=this.shadowBlur,s=Math.min(Math.min(r,0)-2*a,0),l=Math.max(Math.max(r,0)+2*a,0),_=Math.min(Math.min(n,0)-2*a,0),h=Math.max(Math.max(n,0)+2*a,0);e.rect(t._ClipMeasure.left+s,t._ClipMeasure.top+_,t._ClipMeasure.width+l-s,t._ClipMeasure.height+h-_)}else e.rect(t._ClipMeasure.left,t._ClipMeasure.top,t._ClipMeasure.width,t._ClipMeasure.height);e.clip()},t.prototype._render=function(t,e){return!this.isVisible||this.notRenderable||this._isClipped?(this._isDirty=!1,!1):(this.host._numRenderCalls++,t.save(),this._applyStates(t),this._transform(t),this.clipContent&&this._clip(t,e),this.onBeforeDrawObservable.hasObservers()&&this.onBeforeDrawObservable.notifyObservers(this),this.useBitmapCache&&!this._wasDirty&&this._cacheData?t.putImageData(this._cacheData,this._currentMeasure.left,this._currentMeasure.top):this._draw(t,e),this.useBitmapCache&&this._wasDirty&&(this._cacheData=t.getImageData(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._renderHighlight(t),this.onAfterDrawObservable.hasObservers()&&this.onAfterDrawObservable.notifyObservers(this),t.restore(),!0)},t.prototype._draw=function(t,e){},t.prototype.contains=function(t,e){return this._invertTransformMatrix.transformCoordinates(t,e,this._transformedPosition),t=this._transformedPosition.x,e=this._transformedPosition.y,!(t<this._currentMeasure.left||t>this._currentMeasure.left+this._currentMeasure.width||e<this._currentMeasure.top||e>this._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.onWhe