diff --git a/README.md b/README.md index 94de884..bf3c0ea 100755 --- a/README.md +++ b/README.md @@ -3,26 +3,45 @@ WebGL Forward+ and Clustered Deferred Shading **University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 5** -* (TODO) YOUR NAME HERE -* Tested on: (TODO) **Google Chrome 222.2** on - Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab) +* Raymond Yang + * [LinkedIn](https://www.linkedin.com/in/raymond-yang-b85b19168) + * Tested on: + * 10/31/2021 + * Windows 10 + * NVIDIA GeForce GTX 1080 Ti. + * Submitted on: 10/31/2021 -### Live Online +## Live Online -[](http://TODO.github.io/Project5-WebGL-Forward-Plus-and-Clustered-Deferred) +[Link to Live Version](http://UserRYang.github.io/Project5-WebGL-Forward-Plus-and-Clustered-Deferred) -### Demo Video/GIF +## Demo Video/GIF -[](TODO) +
+
+
+
+
-1?S.length-S.indexOf(".")-1:0}var le=function(x){function NumberController(x,S,w){classCallCheck(this,NumberController);var U=possibleConstructorReturn(this,(NumberController.__proto__||Object.getPrototypeOf(NumberController)).call(this,x,S)),G=w||{};return U.__min=G.min,U.__max=G.max,U.__step=G.step,H.isUndefined(U.__step)?0===U.initialValue?U.__impliedStep=1:U.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(U.initialValue))/Math.LN10))/10:U.__impliedStep=U.__step,U.__precision=numDecimals(U.__impliedStep),U}return inherits(NumberController,x),J(NumberController,[{key:"setValue",value:function setValue(x){var S=x;return void 0!==this.__min&&Sthis.__max&&(S=this.__max),void 0!==this.__step&&S%this.__step!=0&&(S=Math.round(S/this.__step)*this.__step),Q(NumberController.prototype.__proto__||Object.getPrototypeOf(NumberController.prototype),"setValue",this).call(this,S)}},{key:"min",value:function min(x){return this.__min=x,this}},{key:"max",value:function max(x){return this.__max=x,this}},{key:"step",value:function step(x){return this.__step=x,this.__impliedStep=x,this.__precision=numDecimals(x),this}}]),NumberController}(te);var ce=function(x){function NumberControllerBox(x,S,w){classCallCheck(this,NumberControllerBox);var U=possibleConstructorReturn(this,(NumberControllerBox.__proto__||Object.getPrototypeOf(NumberControllerBox)).call(this,x,S,w));U.__truncationSuspended=!1;var G=U,z=void 0;function onFinish(){G.__onFinishChange&&G.__onFinishChange.call(G,G.getValue())}function onMouseDrag(x){var S=z-x.clientY;G.setValue(G.getValue()+S*G.__impliedStep),z=x.clientY}function onMouseUp(){re.unbind(window,"mousemove",onMouseDrag),re.unbind(window,"mouseup",onMouseUp),onFinish()}return U.__input=document.createElement("input"),U.__input.setAttribute("type","text"),re.bind(U.__input,"change",(function onChange(){var x=parseFloat(G.__input.value);H.isNaN(x)||G.setValue(x)})),re.bind(U.__input,"blur",(function onBlur(){onFinish()})),re.bind(U.__input,"mousedown",(function onMouseDown(x){re.bind(window,"mousemove",onMouseDrag),re.bind(window,"mouseup",onMouseUp),z=x.clientY})),re.bind(U.__input,"keydown",(function(x){13===x.keyCode&&(G.__truncationSuspended=!0,this.blur(),G.__truncationSuspended=!1,onFinish())})),U.updateDisplay(),U.domElement.appendChild(U.__input),U}return inherits(NumberControllerBox,x),J(NumberControllerBox,[{key:"updateDisplay",value:function updateDisplay(){return this.__input.value=this.__truncationSuspended?this.getValue():function roundToDecimal(x,S){var w=Math.pow(10,S);return Math.round(x*w)/w}(this.getValue(),this.__precision),Q(NumberControllerBox.prototype.__proto__||Object.getPrototypeOf(NumberControllerBox.prototype),"updateDisplay",this).call(this)}}]),NumberControllerBox}(le);function map(x,S,w,U,G){return U+(x-S)/(w-S)*(G-U)}var ue=function(x){function NumberControllerSlider(x,S,w,U,G){classCallCheck(this,NumberControllerSlider);var H=possibleConstructorReturn(this,(NumberControllerSlider.__proto__||Object.getPrototypeOf(NumberControllerSlider)).call(this,x,S,{min:w,max:U,step:G})),z=H;function onMouseDrag(x){x.preventDefault();var S=z.__background.getBoundingClientRect();return z.setValue(map(x.clientX,S.left,S.right,z.__min,z.__max)),!1}function onMouseUp(){re.unbind(window,"mousemove",onMouseDrag),re.unbind(window,"mouseup",onMouseUp),z.__onFinishChange&&z.__onFinishChange.call(z,z.getValue())}function onTouchMove(x){var S=x.touches[0].clientX,w=z.__background.getBoundingClientRect();z.setValue(map(S,w.left,w.right,z.__min,z.__max))}function onTouchEnd(){re.unbind(window,"touchmove",onTouchMove),re.unbind(window,"touchend",onTouchEnd),z.__onFinishChange&&z.__onFinishChange.call(z,z.getValue())}return H.__background=document.createElement("div"),H.__foreground=document.createElement("div"),re.bind(H.__background,"mousedown",(function onMouseDown(x){document.activeElement.blur(),re.bind(window,"mousemove",onMouseDrag),re.bind(window,"mouseup",onMouseUp),onMouseDrag(x)})),re.bind(H.__background,"touchstart",(function onTouchStart(x){if(1!==x.touches.length)return;re.bind(window,"touchmove",onTouchMove),re.bind(window,"touchend",onTouchEnd),onTouchMove(x)})),re.addClass(H.__background,"slider"),re.addClass(H.__foreground,"slider-fg"),H.updateDisplay(),H.__background.appendChild(H.__foreground),H.domElement.appendChild(H.__background),H}return inherits(NumberControllerSlider,x),J(NumberControllerSlider,[{key:"updateDisplay",value:function updateDisplay(){var x=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*x+"%",Q(NumberControllerSlider.prototype.__proto__||Object.getPrototypeOf(NumberControllerSlider.prototype),"updateDisplay",this).call(this)}}]),NumberControllerSlider}(le),he=function(x){function FunctionController(x,S,w){classCallCheck(this,FunctionController);var U=possibleConstructorReturn(this,(FunctionController.__proto__||Object.getPrototypeOf(FunctionController)).call(this,x,S)),G=U;return U.__button=document.createElement("div"),U.__button.innerHTML=void 0===w?"Fire":w,re.bind(U.__button,"click",(function(x){return x.preventDefault(),G.fire(),!1})),re.addClass(U.__button,"button"),U.domElement.appendChild(U.__button),U}return inherits(FunctionController,x),J(FunctionController,[{key:"fire",value:function fire(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),FunctionController}(te),de=function(x){function ColorController(x,S){classCallCheck(this,ColorController);var w=possibleConstructorReturn(this,(ColorController.__proto__||Object.getPrototypeOf(ColorController)).call(this,x,S));w.__color=new ee(w.getValue()),w.__temp=new ee(0);var U=w;w.domElement=document.createElement("div"),re.makeSelectable(w.domElement,!1),w.__selector=document.createElement("div"),w.__selector.className="selector",w.__saturation_field=document.createElement("div"),w.__saturation_field.className="saturation-field",w.__field_knob=document.createElement("div"),w.__field_knob.className="field-knob",w.__field_knob_border="2px solid ",w.__hue_knob=document.createElement("div"),w.__hue_knob.className="hue-knob",w.__hue_field=document.createElement("div"),w.__hue_field.className="hue-field",w.__input=document.createElement("input"),w.__input.type="text",w.__input_textShadow="0 1px 1px ",re.bind(w.__input,"keydown",(function(x){13===x.keyCode&&onBlur.call(this)})),re.bind(w.__input,"blur",onBlur),re.bind(w.__selector,"mousedown",(function(){re.addClass(this,"drag").bind(window,"mouseup",(function(){re.removeClass(U.__selector,"drag")}))})),re.bind(w.__selector,"touchstart",(function(){re.addClass(this,"drag").bind(window,"touchend",(function(){re.removeClass(U.__selector,"drag")}))}));var G=document.createElement("div");function fieldDown(x){setSV(x),re.bind(window,"mousemove",setSV),re.bind(window,"touchmove",setSV),re.bind(window,"mouseup",fieldUpSV),re.bind(window,"touchend",fieldUpSV)}function fieldDownH(x){setH(x),re.bind(window,"mousemove",setH),re.bind(window,"touchmove",setH),re.bind(window,"mouseup",fieldUpH),re.bind(window,"touchend",fieldUpH)}function fieldUpSV(){re.unbind(window,"mousemove",setSV),re.unbind(window,"touchmove",setSV),re.unbind(window,"mouseup",fieldUpSV),re.unbind(window,"touchend",fieldUpSV),onFinish()}function fieldUpH(){re.unbind(window,"mousemove",setH),re.unbind(window,"touchmove",setH),re.unbind(window,"mouseup",fieldUpH),re.unbind(window,"touchend",fieldUpH),onFinish()}function onBlur(){var x=K(this.value);!1!==x?(U.__color.__state=x,U.setValue(U.__color.toOriginal())):this.value=U.__color.toString()}function onFinish(){U.__onFinishChange&&U.__onFinishChange.call(U,U.__color.toOriginal())}function setSV(x){-1===x.type.indexOf("touch")&&x.preventDefault();var S=U.__saturation_field.getBoundingClientRect(),w=x.touches&&x.touches[0]||x,G=w.clientX,H=w.clientY,z=(G-S.left)/(S.right-S.left),j=1-(H-S.top)/(S.bottom-S.top);return j>1?j=1:j<0&&(j=0),z>1?z=1:z<0&&(z=0),U.__color.v=j,U.__color.s=z,U.setValue(U.__color.toOriginal()),!1}function setH(x){-1===x.type.indexOf("touch")&&x.preventDefault();var S=U.__hue_field.getBoundingClientRect(),w=1-((x.touches&&x.touches[0]||x).clientY-S.top)/(S.bottom-S.top);return w>1?w=1:w<0&&(w=0),U.__color.h=360*w,U.setValue(U.__color.toOriginal()),!1}return H.extend(w.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),H.extend(w.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:w.__field_knob_border+(w.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),H.extend(w.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),H.extend(w.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),H.extend(G.style,{width:"100%",height:"100%",background:"none"}),linearGradient(G,"top","rgba(0,0,0,0)","#000"),H.extend(w.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),function hueGradient(x){x.style.background="",x.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",x.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",x.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",x.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",x.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}(w.__hue_field),H.extend(w.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:w.__input_textShadow+"rgba(0,0,0,0.7)"}),re.bind(w.__saturation_field,"mousedown",fieldDown),re.bind(w.__saturation_field,"touchstart",fieldDown),re.bind(w.__field_knob,"mousedown",fieldDown),re.bind(w.__field_knob,"touchstart",fieldDown),re.bind(w.__hue_field,"mousedown",fieldDownH),re.bind(w.__hue_field,"touchstart",fieldDownH),w.__saturation_field.appendChild(G),w.__selector.appendChild(w.__field_knob),w.__selector.appendChild(w.__saturation_field),w.__selector.appendChild(w.__hue_field),w.__hue_field.appendChild(w.__hue_knob),w.domElement.appendChild(w.__input),w.domElement.appendChild(w.__selector),w.updateDisplay(),w}return inherits(ColorController,x),J(ColorController,[{key:"updateDisplay",value:function updateDisplay(){var x=K(this.getValue());if(!1!==x){var S=!1;H.each(ee.COMPONENTS,(function(w){if(!H.isUndefined(x[w])&&!H.isUndefined(this.__color.__state[w])&&x[w]!==this.__color.__state[w])return S=!0,{}}),this),S&&H.extend(this.__color.__state,x)}H.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var w=this.__color.v<.5||this.__color.s>.5?255:0,U=255-w;H.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+w+","+w+","+w+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,linearGradient(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),H.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+w+","+w+","+w+")",textShadow:this.__input_textShadow+"rgba("+U+","+U+","+U+",.7)"})}}]),ColorController}(te),pe=["-moz-","-o-","-webkit-","-ms-",""];function linearGradient(x,S,w,U){x.style.background="",H.each(pe,(function(G){x.style.cssText+="background: "+G+"linear-gradient("+S+", "+w+" 0%, "+U+" 100%); "}))}var me=function inject(x,S){var w=S||document,U=document.createElement("style");U.type="text/css",U.innerHTML=x;var G=w.getElementsByTagName("head")[0];try{G.appendChild(U)}catch(x){}},fe=' \n\n Here\'s the new load parameter for your',ge=function ControllerFactory(x,S){var w=x[S];return H.isArray(arguments[2])||H.isObject(arguments[2])?new ae(x,S,arguments[2]):H.isNumber(w)?H.isNumber(arguments[2])&&H.isNumber(arguments[3])?H.isNumber(arguments[4])?new ue(x,S,arguments[2],arguments[3],arguments[4]):new ue(x,S,arguments[2],arguments[3]):H.isNumber(arguments[4])?new ce(x,S,{min:arguments[2],max:arguments[3],step:arguments[4]}):new ce(x,S,{min:arguments[2],max:arguments[3]}):H.isString(w)?new se(x,S):H.isFunction(w)?new he(x,S,""):H.isBoolean(w)?new oe(x,S):null};var ve=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function dat_gui_module_requestAnimationFrame(x){setTimeout(x,1e3/60)},_e=function(){function CenteredDiv(){classCallCheck(this,CenteredDiv),this.backgroundElement=document.createElement("div"),H.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),re.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),H.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var x=this;re.bind(this.backgroundElement,"click",(function(){x.hide()}))}return J(CenteredDiv,[{key:"show",value:function show(){var x=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),H.defer((function(){x.backgroundElement.style.opacity=1,x.domElement.style.opacity=1,x.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function hide(){var x=this,hide=function hide(){x.domElement.style.display="none",x.backgroundElement.style.display="none",re.unbind(x.domElement,"webkitTransitionEnd",hide),re.unbind(x.domElement,"transitionend",hide),re.unbind(x.domElement,"oTransitionEnd",hide)};re.bind(this.domElement,"webkitTransitionEnd",hide),re.bind(this.domElement,"transitionend",hide),re.bind(this.domElement,"oTransitionEnd",hide),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function layout(){this.domElement.style.left=window.innerWidth/2-re.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-re.getHeight(this.domElement)/2+"px"}}]),CenteredDiv}(),ye=function ___$insertStyle(x){if(x&&"undefined"!=typeof window){var S=document.createElement("style");return S.setAttribute("type","text/css"),S.innerHTML=x,document.head.appendChild(S),x}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n");me(ye);var be="Default",xe=function(){try{return!!window.localStorage}catch(x){return!1}}(),Ee=void 0,Se=!0,Te=void 0,we=!1,Ce=[],Ae=function GUI(x){var S=this,w=x||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),re.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],w=H.defaults(w,{closeOnTop:!1,autoPlace:!0,width:GUI.DEFAULT_WIDTH}),w=H.defaults(w,{resizable:w.autoPlace,hideable:w.autoPlace}),H.isUndefined(w.load)?w.load={preset:be}:w.preset&&(w.load.preset=w.preset),H.isUndefined(w.parent)&&w.hideable&&Ce.push(this),w.resizable=H.isUndefined(w.parent)&&w.resizable,w.autoPlace&&H.isUndefined(w.scrollable)&&(w.scrollable=!0);var U=xe&&"true"===localStorage.getItem(getLocalStorageHash(this,"isLocal")),G=void 0,z=void 0;if(Object.defineProperties(this,{parent:{get:function get$$1(){return w.parent}},scrollable:{get:function get$$1(){return w.scrollable}},autoPlace:{get:function get$$1(){return w.autoPlace}},closeOnTop:{get:function get$$1(){return w.closeOnTop}},preset:{get:function get$$1(){return S.parent?S.getRoot().preset:w.load.preset},set:function set$$1(x){S.parent?S.getRoot().preset=x:w.load.preset=x,function setPresetSelectIndex(x){for(var S=0;SGUI\'s constructor:\n\n \n\n\n\n Automatically save\n values to\n\nlocalStorageon exit.\n\nThe values saved to\n\nlocalStoragewill\n override those passed todat.GUI\'s constructor. This makes it\n easier to work incrementally, butlocalStorageis fragile,\n and your friends may not see the same values you do.\n\n1){var U=w.__li.nextElementSibling;return w.remove(),_add(x,w.object,w.property,{before:U,factoryArgs:[H.toArray(arguments)]})}if(H.isArray(S)||H.isObject(S)){var G=w.__li.nextElementSibling;return w.remove(),_add(x,w.object,w.property,{before:G,factoryArgs:[S]})}},name:function name(x){return w.__li.firstElementChild.firstElementChild.innerHTML=x,w},listen:function listen(){return w.__gui.listen(w),w},remove:function remove(){return w.__gui.remove(w),w}}),w instanceof ue){var U=new ce(w.object,w.property,{min:w.__min,max:w.__max,step:w.__step});H.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(x){var S=w[x],G=U[x];w[x]=U[x]=function(){var x=Array.prototype.slice.call(arguments);return G.apply(U,x),S.apply(w,x)}})),re.addClass(S,"has-slider"),w.domElement.insertBefore(U.domElement,w.domElement.firstElementChild)}else if(w instanceof ce){var G=function r(S){if(H.isNumber(w.__min)&&H.isNumber(w.__max)){var U=w.__li.firstElementChild.firstElementChild.innerHTML,G=w.__gui.__listening.indexOf(w)>-1;w.remove();var z=_add(x,w.object,w.property,{before:w.__li.nextElementSibling,factoryArgs:[w.__min,w.__max,w.__step]});return z.name(U),G&&z.listen(),z}return S};w.min=H.compose(G,w.min),w.max=H.compose(G,w.max)}else w instanceof oe?(re.bind(S,"click",(function(){re.fakeEvent(w.__checkbox,"click")})),re.bind(w.__checkbox,"click",(function(x){x.stopPropagation()}))):w instanceof he?(re.bind(S,"click",(function(){re.fakeEvent(w.__button,"click")})),re.bind(S,"mouseover",(function(){re.addClass(w.__button,"hover")})),re.bind(S,"mouseout",(function(){re.removeClass(w.__button,"hover")}))):w instanceof de&&(re.addClass(S,"color"),w.updateDisplay=H.compose((function(x){return S.style.borderLeftColor=w.__color.toString(),x}),w.updateDisplay),w.updateDisplay());w.setValue=H.compose((function(S){return x.getRoot().__preset_select&&w.isModified()&&markPresetModified(x.getRoot(),!0),S}),w.setValue)}(x,K,G),x.__controllers.push(G),G}function getLocalStorageHash(x,S){return document.location.href+"."+S}function addPresetOption(x,S,w){var U=document.createElement("option");U.innerHTML=S,U.value=S,x.__preset_select.appendChild(U),w&&(x.__preset_select.selectedIndex=x.__preset_select.length-1)}function showHideExplain(x,S){S.style.display=x.useLocalStorage?"block":"none"}function addSaveMenu(x){var S=x.__save_row=document.createElement("li");re.addClass(x.domElement,"has-save"),x.__ul.insertBefore(S,x.__ul.firstChild),re.addClass(S,"save-row");var w=document.createElement("span");w.innerHTML=" ",re.addClass(w,"button gears");var U=document.createElement("span");U.innerHTML="Save",re.addClass(U,"button"),re.addClass(U,"save");var G=document.createElement("span");G.innerHTML="New",re.addClass(G,"button"),re.addClass(G,"save-as");var z=document.createElement("span");z.innerHTML="Revert",re.addClass(z,"button"),re.addClass(z,"revert");var j=x.__preset_select=document.createElement("select");if(x.load&&x.load.remembered?H.each(x.load.remembered,(function(S,w){addPresetOption(x,w,w===x.preset)})):addPresetOption(x,be,!1),re.bind(j,"change",(function(){for(var S=0;S 0&&(x.preset=this.preset,x.remembered||(x.remembered={}),x.remembered[this.preset]=getCurrentPreset(this)),x.folders={},H.each(this.__folders,(function(S,w){x.folders[w]=S.getSaveObject()})),x},save:function save(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=getCurrentPreset(this),markPresetModified(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function saveAs(x){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=getCurrentPreset(this,!0)),this.load.remembered[x]=getCurrentPreset(this),this.preset=x,addPresetOption(this,x,!0),this.saveToLocalStorageIfPossible()},revert:function revert(x){H.each(this.__controllers,(function(S){this.getRoot().load.remembered?recallSavedValue(x||this.getRoot(),S):S.setValue(S.initialValue),S.__onFinishChange&&S.__onFinishChange.call(S,S.getValue())}),this),H.each(this.__folders,(function(x){x.revert(x)})),x||markPresetModified(this.getRoot(),!1)},listen:function listen(x){var S=0===this.__listening.length;this.__listening.push(x),S&&updateDisplays(this.__listening)},updateDisplay:function updateDisplay(){H.each(this.__controllers,(function(x){x.updateDisplay()})),H.each(this.__folders,(function(x){x.updateDisplay()}))}});const Me={color:{Color:ee,math:Y,interpret:K},controllers:{Controller:te,BooleanController:oe,OptionController:ae,StringController:se,NumberController:le,NumberControllerBox:ce,NumberControllerSlider:ue,FunctionController:he,ColorController:de},dom:{dom:re},gui:{GUI:Ae},GUI:Ae};w(557);var Re=w(792),Le=w.n(Re),Ie=w(212),Pe=w(581),Fe=w.n(Pe),Oe=(w(739),!1),Ne=!1;function abort(x){throw Ne=!0,x}for(var Be=document.getElementById("canvas"),De=Be.getContext("webgl"),ke=De,Ue=ke.getSupportedExtensions(),Ge=["OES_texture_float","OES_texture_float_linear","OES_element_index_uint","WEBGL_depth_texture","WEBGL_draw_buffers"],Ve=0;Ve {"use strict";w.r(S);var U=w(943),G=w(975),H=w(999),z=w.n(H);function compileShader(x,S){var w=U.gl.createShader(S);return U.gl.shaderSource(w,x),U.gl.compileShader(w),U.gl.getShaderParameter(w,U.gl.COMPILE_STATUS)||(console.error(x),(0,U.JG)("shader compiler error:\n"+U.gl.getShaderInfoLog(w))),w}function linkShader(x,S){var w=U.gl.createProgram();return U.gl.attachShader(w,x),U.gl.attachShader(w,S),U.gl.linkProgram(w),U.gl.getProgramParameter(w,U.gl.LINK_STATUS)||(0,U.JG)("shader linker error:\n"+U.gl.getProgramInfoLog(w)),w}function loadShaderProgram(x,S,w){return function addShaderLocations(x,S){if(S&&S.uniforms&&S.uniforms.length)for(var w=0;w 100)){var fe=Math.floor(me/4),ge=Math.floor(me%4);this._clusterTexture.buffer[this._clusterTexture.bufferIndex(pe,0)]=me,this._clusterTexture.buffer[this._clusterTexture.bufferIndex(pe,fe)+ge]=K}}}this._clusterTexture.update()},BaseRenderer}();function _setPrototypeOf(x,S){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(x,S){return x.__proto__=S,x},_setPrototypeOf(x,S)}var se=function(x){function ForwardPlusRenderer(S,w,U){var H;return(H=x.call(this,S,w,U)||this)._lightTexture=new te(Z,8),H._shaderProgram=loadShaderProgram(re(),function forwardPlus_frag_glsl(x){return"\n // TODO: This is pretty much just a clone of forward.frag.glsl.js\n\n #version 100\n precision highp float;\n\n uniform sampler2D u_colmap;\n uniform sampler2D u_normap;\n uniform sampler2D u_lightbuffer;\n\n // TODO: Read this buffer to determine the lights influencing a cluster\n uniform sampler2D u_clusterbuffer;\n\n varying vec3 v_position;\n varying vec3 v_normal;\n varying vec2 v_uv;\n \n uniform mat4 u_viewMatrix;\n uniform int u_width;\n uniform int u_height;\n uniform float u_depth;\n uniform int u_xSlices;\n uniform int u_ySlices;\n uniform int u_zSlices;\n uniform int u_numClusters;\n \n\n vec3 applyNormalMap(vec3 geomnor, vec3 normap) {\n normap = normap * 2.0 - 1.0;\n vec3 up = normalize(vec3(0.001, 1, 0.001));\n vec3 surftan = normalize(cross(geomnor, up));\n vec3 surfbinor = cross(geomnor, surftan);\n return normap.y * surftan + normap.x * surfbinor + normap.z * geomnor;\n }\n\n struct Light {\n vec3 position;\n float radius;\n vec3 color;\n };\n\n float ExtractFloat(sampler2D texture, int textureWidth, int textureHeight, int index, int component) {\n float u = float(index + 1) / float(textureWidth + 1);\n int pixel = component / 4;\n float v = float(pixel + 1) / float(textureHeight + 1);\n vec4 texel = texture2D(texture, vec2(u, v));\n int pixelComponent = component - pixel * 4;\n if (pixelComponent == 0) {\n return texel[0];\n } else if (pixelComponent == 1) {\n return texel[1];\n } else if (pixelComponent == 2) {\n return texel[2];\n } else if (pixelComponent == 3) {\n return texel[3];\n }\n }\n\n Light UnpackLight(int index) {\n Light light;\n float u = float(index + 1) / float("+(x.numLights+1)+");\n vec4 v1 = texture2D(u_lightbuffer, vec2(u, 0.3));\n vec4 v2 = texture2D(u_lightbuffer, vec2(u, 0.6));\n light.position = v1.xyz;\n\n // LOOK: This extracts the 4th float (radius) of the (index)th light in the buffer\n // Note that this is just an example implementation to extract one float.\n // There are more efficient ways if you need adjacent values\n light.radius = ExtractFloat(u_lightbuffer, "+x.numLights+", 2, index, 3);\n\n light.color = v2.rgb;\n return light;\n }\n\n // Cubic approximation of gaussian curve so we falloff to exactly 0 at the light radius\n float cubicGaussian(float h) {\n if (h < 1.0) {\n return 0.25 * pow(2.0 - h, 3.0) - pow(1.0 - h, 3.0);\n } else if (h < 2.0) {\n return 0.25 * pow(2.0 - h, 3.0);\n } else {\n return 0.0;\n }\n }\n\n void main() {\n vec3 albedo = texture2D(u_colmap, v_uv).rgb;\n vec3 normap = texture2D(u_normap, v_uv).xyz;\n vec3 normal = applyNormalMap(v_normal, normap);\n\n vec3 fragColor = vec3(0.0);\n\n int xIdx = int(gl_FragCoord.x / float(u_width) * float(u_xSlices));\n int yIdx = int(gl_FragCoord.y / float(u_height) * float(u_ySlices));\n int zIdx = int((u_viewMatrix * vec4(v_position, 1)).z / u_depth * float(u_zSlices));\n int Idx = xIdx + yIdx * u_xSlices + zIdx * u_xSlices * u_ySlices;\n\n int textureHeight = int(ceil(float("+(x.numLights+1)+") / 4.0));\n int numLights = int(ExtractFloat(u_clusterbuffer, u_numClusters, textureHeight, Idx, 0));\n\n\n for (int i = 0; i < "+x.numLights+"; i++) {\n if (i >= numLights) break; \n int lt = int(ExtractFloat(u_clusterbuffer, u_numClusters, textureHeight, Idx, i + 1));\n Light light = UnpackLight(lt);\n float lightDistance = distance(light.position, v_position);\n vec3 L = (light.position - v_position) / lightDistance;\n\n float lightIntensity = cubicGaussian(2.0 * lightDistance / light.radius);\n float lambertTerm = max(dot(L, normal), 0.0);\n\n fragColor += albedo * lambertTerm * light.color * vec3(lightIntensity);\n }\n\n const vec3 ambientLight = vec3(0.025);\n fragColor += albedo * ambientLight;\n\n gl_FragColor = vec4(fragColor, 1.0);\n }\n "}({numLights:Z}),{uniforms:["u_viewProjectionMatrix","u_colmap","u_normap","u_lightbuffer","u_clusterbuffer","u_viewMatrix","u_width","u_height","u_depth","u_xSlices","u_ySlices","u_zSlices","u_numClusters"],attribs:["a_position","a_normal","a_uv"]}),H._projectionMatrix=G.Ue(),H._viewMatrix=G.Ue(),H._viewProjectionMatrix=G.Ue(),H}return function _inheritsLoose(x,S){x.prototype=Object.create(S.prototype),x.prototype.constructor=x,_setPrototypeOf(x,S)}(ForwardPlusRenderer,x),ForwardPlusRenderer.prototype.render=function render(x,S){x.updateMatrixWorld(),G.U_(this._viewMatrix,x.matrixWorld.elements),G.JG(this._projectionMatrix,x.projectionMatrix.elements),G.Jp(this._viewProjectionMatrix,this._projectionMatrix,this._viewMatrix),this.updateClusters(x,this._viewMatrix,S);for(var w=0;w = numLights) break;\n int lt = int(ExtractFloat(u_clusterbuffer, u_numClusters, textureHeight, Idx, i + 1));\n Light light = UnpackLight(lt);\n float lightDistance = distance(light.position, position);\n vec3 L = (light.position - position) / lightDistance;\n\n float lightIntensity = cubicGaussian(2.0 * lightDistance / light.radius);\n float lambertTerm = max(dot(L, normal), 0.0);\n\n fragColor += albedo * lambertTerm * light.color * vec3(lightIntensity);\n }\n\n const vec3 ambientLight = vec3(0.025);\n fragColor += albedo * ambientLight;\n\n gl_FragColor = vec4(fragColor, 1.0);\n //gl_FragColor = vec4(normalize(normal), 1.0);\n }\n "}({numLights:Z,numGBuffers:3}),{uniforms:["u_gbuffers[0]","u_gbuffers[1]","u_gbuffers[2]","u_lightbuffer","u_clusterbuffer","u_viewMatrix","u_viewProjectionMatrix","u_width","u_height","u_depth","u_xSlices","u_ySlices","u_zSlices","u_numClusters"],attribs:["a_uv"]}),j._projectionMatrix=G.Ue(),j._viewMatrix=G.Ue(),j._viewProjectionMatrix=G.Ue(),j}!function clusteredDeferred_inheritsLoose(x,S){x.prototype=Object.create(S.prototype),x.prototype.constructor=x,clusteredDeferred_setPrototypeOf(x,S)}(ClusteredDeferredRenderer,x);var S=ClusteredDeferredRenderer.prototype;return S.setupDrawBuffers=function setupDrawBuffers(x,S){this._width=x,this._height=S,this._fbo=U.gl.createFramebuffer(),this._depthTex=U.gl.createTexture(),U.gl.bindTexture(U.gl.TEXTURE_2D,this._depthTex),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_MAG_FILTER,U.gl.NEAREST),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_MIN_FILTER,U.gl.NEAREST),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_WRAP_S,U.gl.CLAMP_TO_EDGE),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_WRAP_T,U.gl.CLAMP_TO_EDGE),U.gl.texImage2D(U.gl.TEXTURE_2D,0,U.gl.DEPTH_COMPONENT,x,S,0,U.gl.DEPTH_COMPONENT,U.gl.UNSIGNED_SHORT,null),U.gl.bindTexture(U.gl.TEXTURE_2D,null),U.gl.bindFramebuffer(U.gl.FRAMEBUFFER,this._fbo),U.gl.framebufferTexture2D(U.gl.FRAMEBUFFER,U.gl.DEPTH_ATTACHMENT,U.gl.TEXTURE_2D,this._depthTex,0),this._gbuffers=new Array(3);for(var w=new Array(3),G=0;G<3;G++)w[G]=U.BJ["COLOR_ATTACHMENT"+G+"_WEBGL"],this._gbuffers[G]=U.gl.createTexture(),U.gl.bindTexture(U.gl.TEXTURE_2D,this._gbuffers[G]),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_MAG_FILTER,U.gl.NEAREST),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_MIN_FILTER,U.gl.NEAREST),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_WRAP_S,U.gl.CLAMP_TO_EDGE),U.gl.texParameteri(U.gl.TEXTURE_2D,U.gl.TEXTURE_WRAP_T,U.gl.CLAMP_TO_EDGE),U.gl.texImage2D(U.gl.TEXTURE_2D,0,U.gl.RGBA,x,S,0,U.gl.RGBA,U.gl.FLOAT,null),U.gl.bindTexture(U.gl.TEXTURE_2D,null),U.gl.framebufferTexture2D(U.gl.FRAMEBUFFER,w[G],U.gl.TEXTURE_2D,this._gbuffers[G],0);if(U.gl.checkFramebufferStatus(U.gl.FRAMEBUFFER)!=U.gl.FRAMEBUFFER_COMPLETE)throw"Framebuffer incomplete";U.BJ.drawBuffersWEBGL(w),U.gl.bindFramebuffer(U.gl.FRAMEBUFFER,null)},S.resize=function resize(x,S){this._width=x,this._height=S,U.gl.bindTexture(U.gl.TEXTURE_2D,this._depthTex),U.gl.texImage2D(U.gl.TEXTURE_2D,0,U.gl.DEPTH_COMPONENT,x,S,0,U.gl.DEPTH_COMPONENT,U.gl.UNSIGNED_SHORT,null);for(var w=0;w<3;w++)U.gl.bindTexture(U.gl.TEXTURE_2D,this._gbuffers[w]),U.gl.texImage2D(U.gl.TEXTURE_2D,0,U.gl.RGBA,x,S,0,U.gl.RGBA,U.gl.FLOAT,null);U.gl.bindTexture(U.gl.TEXTURE_2D,null)},S.render=function render(x,S){U.JQ.width==this._width&&U.JQ.height==this._height||this.resize(U.JQ.width,U.JQ.height),x.updateMatrixWorld(),G.U_(this._viewMatrix,x.matrixWorld.elements),G.JG(this._projectionMatrix,x.projectionMatrix.elements),G.Jp(this._viewProjectionMatrix,this._projectionMatrix,this._viewMatrix),U.gl.viewport(0,0,U.JQ.width,U.JQ.height),U.gl.bindFramebuffer(U.gl.FRAMEBUFFER,this._fbo),U.gl.clear(U.gl.COLOR_BUFFER_BIT|U.gl.DEPTH_BUFFER_BIT),U.gl.useProgram(this._progCopy.glShaderProgram),U.gl.uniformMatrix4fv(this._progCopy.u_viewProjectionMatrix,!1,this._viewProjectionMatrix),S.draw(this._progCopy);for(var w=0;w {"use strict";w.d(S,{Ib:()=>U,WT:()=>G});var U=1e-6,G="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var x=0,S=arguments.length;S--;)x+=arguments[S]*arguments[S];return Math.sqrt(x)})},975:(x,S,w)=>{"use strict";w.d(S,{Ue:()=>create,JG:()=>copy,U_:()=>invert,Jp:()=>multiply,bA:()=>scale,yl:()=>fromRotationTranslation});var U=w(685);function create(){var x=new U.WT(16);return U.WT!=Float32Array&&(x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[11]=0,x[12]=0,x[13]=0,x[14]=0),x[0]=1,x[5]=1,x[10]=1,x[15]=1,x}function copy(x,S){return x[0]=S[0],x[1]=S[1],x[2]=S[2],x[3]=S[3],x[4]=S[4],x[5]=S[5],x[6]=S[6],x[7]=S[7],x[8]=S[8],x[9]=S[9],x[10]=S[10],x[11]=S[11],x[12]=S[12],x[13]=S[13],x[14]=S[14],x[15]=S[15],x}function invert(x,S){var w=S[0],U=S[1],G=S[2],H=S[3],z=S[4],j=S[5],X=S[6],K=S[7],q=S[8],Y=S[9],Z=S[10],J=S[11],Q=S[12],ee=S[13],te=S[14],ne=S[15],ie=w*j-U*z,re=w*X-G*z,oe=w*K-H*z,ae=U*X-G*j,se=U*K-H*j,le=G*K-H*X,ce=q*ee-Y*Q,ue=q*te-Z*Q,he=q*ne-J*Q,de=Y*te-Z*ee,pe=Y*ne-J*ee,me=Z*ne-J*te,fe=ie*me-re*pe+oe*de+ae*he-se*ue+le*ce;return fe?(fe=1/fe,x[0]=(j*me-X*pe+K*de)*fe,x[1]=(G*pe-U*me-H*de)*fe,x[2]=(ee*le-te*se+ne*ae)*fe,x[3]=(Z*se-Y*le-J*ae)*fe,x[4]=(X*he-z*me-K*ue)*fe,x[5]=(w*me-G*he+H*ue)*fe,x[6]=(te*oe-Q*le-ne*re)*fe,x[7]=(q*le-Z*oe+J*re)*fe,x[8]=(z*pe-j*he+K*ce)*fe,x[9]=(U*he-w*pe-H*ce)*fe,x[10]=(Q*se-ee*oe+ne*ie)*fe,x[11]=(Y*oe-q*se-J*ie)*fe,x[12]=(j*ue-z*de-X*ce)*fe,x[13]=(w*de-U*ue+G*ce)*fe,x[14]=(ee*re-Q*ae-te*ie)*fe,x[15]=(q*ae-Y*re+Z*ie)*fe,x):null}function multiply(x,S,w){var U=S[0],G=S[1],H=S[2],z=S[3],j=S[4],X=S[5],K=S[6],q=S[7],Y=S[8],Z=S[9],J=S[10],Q=S[11],ee=S[12],te=S[13],ne=S[14],ie=S[15],re=w[0],oe=w[1],ae=w[2],se=w[3];return x[0]=re*U+oe*j+ae*Y+se*ee,x[1]=re*G+oe*X+ae*Z+se*te,x[2]=re*H+oe*K+ae*J+se*ne,x[3]=re*z+oe*q+ae*Q+se*ie,re=w[4],oe=w[5],ae=w[6],se=w[7],x[4]=re*U+oe*j+ae*Y+se*ee,x[5]=re*G+oe*X+ae*Z+se*te,x[6]=re*H+oe*K+ae*J+se*ne,x[7]=re*z+oe*q+ae*Q+se*ie,re=w[8],oe=w[9],ae=w[10],se=w[11],x[8]=re*U+oe*j+ae*Y+se*ee,x[9]=re*G+oe*X+ae*Z+se*te,x[10]=re*H+oe*K+ae*J+se*ne,x[11]=re*z+oe*q+ae*Q+se*ie,re=w[12],oe=w[13],ae=w[14],se=w[15],x[12]=re*U+oe*j+ae*Y+se*ee,x[13]=re*G+oe*X+ae*Z+se*te,x[14]=re*H+oe*K+ae*J+se*ne,x[15]=re*z+oe*q+ae*Q+se*ie,x}function scale(x,S,w){var U=w[0],G=w[1],H=w[2];return x[0]=S[0]*U,x[1]=S[1]*U,x[2]=S[2]*U,x[3]=S[3]*U,x[4]=S[4]*G,x[5]=S[5]*G,x[6]=S[6]*G,x[7]=S[7]*G,x[8]=S[8]*H,x[9]=S[9]*H,x[10]=S[10]*H,x[11]=S[11]*H,x[12]=S[12],x[13]=S[13],x[14]=S[14],x[15]=S[15],x}function fromRotationTranslation(x,S,w){var U=S[0],G=S[1],H=S[2],z=S[3],j=U+U,X=G+G,K=H+H,q=U*j,Y=U*X,Z=U*K,J=G*X,Q=G*K,ee=H*K,te=z*j,ne=z*X,ie=z*K;return x[0]=1-(J+ee),x[1]=Y+ie,x[2]=Z-ne,x[3]=0,x[4]=Y-ie,x[5]=1-(q+ee),x[6]=Q+te,x[7]=0,x[8]=Z+ne,x[9]=Q-te,x[10]=1-(q+J),x[11]=0,x[12]=w[0],x[13]=w[1],x[14]=w[2],x[15]=1,x}},333:(x,S,w)=>{"use strict";w.d(S,{Ue:()=>create,d9:()=>clone,al:()=>fromValues,JG:()=>copy,t8:()=>set,IH:()=>add,bA:()=>scale,kE:()=>length,we:()=>squaredLength,Fv:()=>normalize,AK:()=>dot,t7:()=>lerp,fF:()=>transformMat4,I6:()=>exactEquals,fS:()=>equals,lu:()=>H});var U=w(685);function create(){var x=new U.WT(4);return U.WT!=Float32Array&&(x[0]=0,x[1]=0,x[2]=0,x[3]=0),x}function clone(x){var S=new U.WT(4);return S[0]=x[0],S[1]=x[1],S[2]=x[2],S[3]=x[3],S}function fromValues(x,S,w,G){var H=new U.WT(4);return H[0]=x,H[1]=S,H[2]=w,H[3]=G,H}function copy(x,S){return x[0]=S[0],x[1]=S[1],x[2]=S[2],x[3]=S[3],x}function set(x,S,w,U,G){return x[0]=S,x[1]=w,x[2]=U,x[3]=G,x}function add(x,S,w){return x[0]=S[0]+w[0],x[1]=S[1]+w[1],x[2]=S[2]+w[2],x[3]=S[3]+w[3],x}function scale(x,S,w){return x[0]=S[0]*w,x[1]=S[1]*w,x[2]=S[2]*w,x[3]=S[3]*w,x}function length(x){var S=x[0],w=x[1],U=x[2],G=x[3];return Math.hypot(S,w,U,G)}function squaredLength(x){var S=x[0],w=x[1],U=x[2],G=x[3];return S*S+w*w+U*U+G*G}function normalize(x,S){var w=S[0],U=S[1],G=S[2],H=S[3],z=w*w+U*U+G*G+H*H;return z>0&&(z=1/Math.sqrt(z)),x[0]=w*z,x[1]=U*z,x[2]=G*z,x[3]=H*z,x}function dot(x,S){return x[0]*S[0]+x[1]*S[1]+x[2]*S[2]+x[3]*S[3]}function lerp(x,S,w,U){var G=S[0],H=S[1],z=S[2],j=S[3];return x[0]=G+U*(w[0]-G),x[1]=H+U*(w[1]-H),x[2]=z+U*(w[2]-z),x[3]=j+U*(w[3]-j),x}function transformMat4(x,S,w){var U=S[0],G=S[1],H=S[2],z=S[3];return x[0]=w[0]*U+w[4]*G+w[8]*H+w[12]*z,x[1]=w[1]*U+w[5]*G+w[9]*H+w[13]*z,x[2]=w[2]*U+w[6]*G+w[10]*H+w[14]*z,x[3]=w[3]*U+w[7]*G+w[11]*H+w[15]*z,x}function exactEquals(x,S){return x[0]===S[0]&&x[1]===S[1]&&x[2]===S[2]&&x[3]===S[3]}function equals(x,S){var w=x[0],G=x[1],H=x[2],z=x[3],j=S[0],X=S[1],K=S[2],q=S[3];return Math.abs(w-j)<=U.Ib*Math.max(1,Math.abs(w),Math.abs(j))&&Math.abs(G-X)<=U.Ib*Math.max(1,Math.abs(G),Math.abs(X))&&Math.abs(H-K)<=U.Ib*Math.max(1,Math.abs(H),Math.abs(K))&&Math.abs(z-q)<=U.Ib*Math.max(1,Math.abs(z),Math.abs(q))}var G,H=function subtract(x,S,w){return x[0]=S[0]-w[0],x[1]=S[1]-w[1],x[2]=S[2]-w[2],x[3]=S[3]-w[3],x};G=create()},739:x=>{window,x.exports=function(x){var S={};function n(w){if(S[w])return S[w].exports;var U=S[w]={i:w,l:!1,exports:{}};return x[w].call(U.exports,U,U.exports,n),U.l=!0,U.exports}return n.m=x,n.c=S,n.d=function(x,S,w){n.o(x,S)||Object.defineProperty(x,S,{enumerable:!0,get:w})},n.r=function(x){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})},n.t=function(x,S){if(1&S&&(x=n(x)),8&S)return x;if(4&S&&"object"==typeof x&&x&&x.__esModule)return x;var w=Object.create(null);if(n.r(w),Object.defineProperty(w,"default",{enumerable:!0,value:x}),2&S&&"string"!=typeof x)for(var U in x)n.d(w,U,function(S){return x[S]}.bind(null,U));return w},n.n=function(x){var S=x&&x.__esModule?function(){return x.default}:function(){return x};return n.d(S,"a",S),S},n.o=function(x,S){return Object.prototype.hasOwnProperty.call(x,S)},n.p="/",n(n.s=4)}([function(x,S){x.exports=function(x){return x.webpackPolyfill||(x.deprecate=function(){},x.paths=[],x.children||(x.children=[]),Object.defineProperty(x,"loaded",{enumerable:!0,get:function(){return x.l}}),Object.defineProperty(x,"id",{enumerable:!0,get:function(){return x.i}}),x.webpackPolyfill=1),x}},function(x,S,w){"use strict";var U,r=function(){return void 0===U&&(U=Boolean(window&&document&&document.all&&!window.atob)),U},G=function(){var x={};return function(S){if(void 0===x[S]){var w=document.querySelector(S);if(window.HTMLIFrameElement&&w instanceof window.HTMLIFrameElement)try{w=w.contentDocument.head}catch(x){w=null}x[S]=w}return x[S]}}(),H=[];function a(x){for(var S=-1,w=0;w 1&&c(U,"")>-1&&(w=RegExp(this.source,G.replace.call(a(this),"g","")),G.replace.call(x.slice(U.index),w,(function(){for(var x=1;x U.index&&this.lastIndex--}return U},z||(RegExp.prototype.test=function(x){var S=G.exec.call(this,x);return S&&this.global&&!S[0].length&&this.lastIndex>S.index&&this.lastIndex--,!!S}))})),ace.define("ace/lib/es5-shim",["require","exports","module"],(function(x,S,w){function i(){}Function.prototype.bind||(Function.prototype.bind=function(x){var S=this;if("function"!=typeof S)throw new TypeError("Function.prototype.bind called on incompatible "+S);var w=Y.call(arguments,1),r=function(){if(this instanceof r){var U=S.apply(this,w.concat(Y.call(arguments)));return Object(U)===U?U:this}return S.apply(x,w.concat(Y.call(arguments)))};return S.prototype&&(i.prototype=S.prototype,r.prototype=new i,i.prototype=null),r});var U,G,H,z,j,X=Function.prototype.call,K=Array.prototype,q=Object.prototype,Y=K.slice,Z=X.bind(q.toString),J=X.bind(q.hasOwnProperty);if((j=J(q,"__defineGetter__"))&&(U=X.bind(q.__defineGetter__),G=X.bind(q.__defineSetter__),H=X.bind(q.__lookupGetter__),z=X.bind(q.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(x){var S=new Array(x+2);return S[0]=S[1]=0,S}var x,S=[];if(S.splice.apply(S,e(20)),S.splice.apply(S,e(26)),x=S.length,S.splice(5,0,"XXX"),S.length,x+1==S.length)return!0}()){var Q=Array.prototype.splice;Array.prototype.splice=function(x,S){return arguments.length?Q.apply(this,[void 0===x?0:x,void 0===S?this.length-x:S].concat(Y.call(arguments,2))):[]}}else Array.prototype.splice=function(x,S){var w=this.length;x>0?x>w&&(x=w):null==x?x=0:x<0&&(x=Math.max(w+x,0)),x+S j)for(Z=K;Z--;)this[X+Z]=this[j+Z];if(H&&x===q)this.length=q,this.push.apply(this,G);else for(this.length=q+H,Z=0;Z >>0;if("[object Function]"!=Z(x))throw new TypeError;for(;++G >>0,G=Array(U),H=arguments[1];if("[object Function]"!=Z(x))throw new TypeError(x+" is not a function");for(var z=0;z>>0,H=[],z=arguments[1];if("[object Function]"!=Z(x))throw new TypeError(x+" is not a function");for(var j=0;j >>0,G=arguments[1];if("[object Function]"!=Z(x))throw new TypeError(x+" is not a function");for(var H=0;H>>0,G=arguments[1];if("[object Function]"!=Z(x))throw new TypeError(x+" is not a function");for(var H=0;H>>0;if("[object Function]"!=Z(x))throw new TypeError(x+" is not a function");if(!U&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var G,H=0;if(arguments.length>=2)G=arguments[1];else for(;;){if(H in w){G=w[H++];break}if(++H>=U)throw new TypeError("reduce of empty array with no initial value")}for(;H>>0;if("[object Function]"!=Z(x))throw new TypeError(x+" is not a function");if(!U&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var G,H=U-1;if(arguments.length>=2)G=arguments[1];else for(;;){if(H in w){G=w[H--];break}if(--H<0)throw new TypeError("reduceRight of empty array with no initial value")}do{H in this&&(G=x.call(void 0,G,w[H],H,S))}while(H--);return G}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(x){var S=ie&&"[object String]"==Z(this)?this.split(""):F(this),w=S.length>>>0;if(!w)return-1;var U=0;for(arguments.length>1&&(U=O(arguments[1])),U=U>=0?U:Math.max(0,w+U);U >>0;if(!w)return-1;var U=w-1;for(arguments.length>1&&(U=Math.min(U,O(arguments[1]))),U=U>=0?U:w-Math.abs(U);U>=0;U--)if(U in S&&x===S[U])return U;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(x){return x.__proto__||(x.constructor?x.constructor.prototype:q)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(x,S){if("object"!=typeof x&&"function"!=typeof x||null===x)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+x);if(J(x,S)){var w;if(w={enumerable:!0,configurable:!0},j){var U=x.__proto__;x.__proto__=q;var G=H(x,S),X=z(x,S);if(x.__proto__=U,G||X)return G&&(w.get=G),X&&(w.set=X),w}return w.value=x[S],w}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(x){return Object.keys(x)}),Object.create||(ee=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var x={};for(var S in x)x[S]=null;return x.constructor=x.hasOwnProperty=x.propertyIsEnumerable=x.isPrototypeOf=x.toLocaleString=x.toString=x.valueOf=x.__proto__=null,x},Object.create=function(x,S){var w;if(null===x)w=ee();else{if("object"!=typeof x)throw new TypeError("typeof prototype["+typeof x+"] != 'object'");var i=function(){};i.prototype=x,(w=new i).__proto__=x}return void 0!==S&&Object.defineProperties(w,S),w}),Object.defineProperty){var re=C({}),oe="undefined"==typeof document||C(document.createElement("div"));if(!re||!oe)var ae=Object.defineProperty}Object.defineProperty&&!ae||(Object.defineProperty=function(x,S,w){if("object"!=typeof x&&"function"!=typeof x||null===x)throw new TypeError("Object.defineProperty called on non-object: "+x);if("object"!=typeof w&&"function"!=typeof w||null===w)throw new TypeError("Property description must be an object: "+w);if(ae)try{return ae.call(Object,x,S,w)}catch(x){}if(J(w,"value"))if(j&&(H(x,S)||z(x,S))){var X=x.__proto__;x.__proto__=q,delete x[S],x[S]=w.value,x.__proto__=X}else x[S]=w.value;else{if(!j)throw new TypeError("getters & setters can not be defined on this javascript engine");J(w,"get")&&U(x,S,w.get),J(w,"set")&&G(x,S,w.set)}return x}),Object.defineProperties||(Object.defineProperties=function(x,S){for(var w in S)J(S,w)&&Object.defineProperty(x,w,S[w]);return x}),Object.seal||(Object.seal=function(x){return x}),Object.freeze||(Object.freeze=function(x){return x});try{Object.freeze((function(){}))}catch(x){Object.freeze=(te=Object.freeze,function(x){return"function"==typeof x?x:te(x)})}if(Object.preventExtensions||(Object.preventExtensions=function(x){return x}),Object.isSealed||(Object.isSealed=function(x){return!1}),Object.isFrozen||(Object.isFrozen=function(x){return!1}),Object.isExtensible||(Object.isExtensible=function(x){if(Object(x)===x)throw new TypeError;for(var S="";J(x,S);)S+="?";x[S]=!0;var w=J(x,S);return delete x[S],w}),!Object.keys){var se=!0,le=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ce=le.length;for(var ue in{toString:null})se=!1;Object.keys=function(x){if("object"!=typeof x&&"function"!=typeof x||null===x)throw new TypeError("Object.keys called on a non-object");var S=[];for(var w in x)J(x,w)&&S.push(w);if(se)for(var U=0,G=ce;U 0||-1)*Math.floor(Math.abs(x))),x}var F=function(x){if(null==x)throw new TypeError("can't convert "+x+" to object");return Object(x)}})),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],(function(x,S,w){"use strict";x("./regexp"),x("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})})),ace.define("ace/lib/useragent",["require","exports","module"],(function(x,S,w){"use strict";S.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},S.getOS=function(){return S.isMac?S.OS.MAC:S.isLinux?S.OS.LINUX:S.OS.WINDOWS};var U="object"==typeof navigator?navigator:{},G=(/mac|win|linux/i.exec(U.platform)||["other"])[0].toLowerCase(),H=U.userAgent||"",z=U.appName||"";S.isWin="win"==G,S.isMac="mac"==G,S.isLinux="linux"==G,S.isIE="Microsoft Internet Explorer"==z||z.indexOf("MSAppHost")>=0?parseFloat((H.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((H.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),S.isOldIE=S.isIE&&S.isIE<9,S.isGecko=S.isMozilla=H.match(/ Gecko\/\d+/),S.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),S.isWebKit=parseFloat(H.split("WebKit/")[1])||void 0,S.isChrome=parseFloat(H.split(" Chrome/")[1])||void 0,S.isEdge=parseFloat(H.split(" Edge/")[1])||void 0,S.isAIR=H.indexOf("AdobeAIR")>=0,S.isAndroid=H.indexOf("Android")>=0,S.isChromeOS=H.indexOf(" CrOS ")>=0,S.isIOS=/iPad|iPhone|iPod/.test(H)&&!window.MSStream,S.isIOS&&(S.isMac=!0),S.isMobile=S.isIOS||S.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(x,S,w){"use strict";var U=x("./useragent");if(S.buildDom=function e(x,S,w){if("string"==typeof x&&x){var U=document.createTextNode(x);return S&&S.appendChild(U),U}if(!Array.isArray(x))return x;if("string"!=typeof x[0]||!x[0]){for(var G=[],H=0;H =1.5,"undefined"!=typeof document){var G=document.createElement("div");S.HI_DPI&&void 0!==G.style.transform&&(S.HAS_CSS_TRANSFORMS=!0),U.isEdge||void 0===G.style.animationName||(S.HAS_CSS_ANIMATION=!0),G=null}S.HAS_CSS_TRANSFORMS?S.translate=function(x,S,w){x.style.transform="translate("+Math.round(S)+"px, "+Math.round(w)+"px)"}:S.translate=function(x,S,w){x.style.top=Math.round(w)+"px",x.style.left=Math.round(S)+"px"}})),ace.define("ace/lib/oop",["require","exports","module"],(function(x,S,w){"use strict";S.inherits=function(x,S){x.super_=S,x.prototype=Object.create(S.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}})},S.mixin=function(x,S){for(var w in S)x[w]=S[w];return x},S.implement=function(x,w){S.mixin(x,w)}})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(x,S,w){"use strict";var U=x("./oop"),G=function(){var x,S,w={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(S in w.FUNCTION_KEYS)x=w.FUNCTION_KEYS[S].toLowerCase(),w[x]=parseInt(S,10);for(S in w.PRINTABLE_KEYS)x=w.PRINTABLE_KEYS[S].toLowerCase(),w[x]=parseInt(S,10);return U.mixin(w,w.MODIFIER_KEYS),U.mixin(w,w.PRINTABLE_KEYS),U.mixin(w,w.FUNCTION_KEYS),w.enter=w.return,w.escape=w.esc,w.del=w.delete,w[173]="-",function(){for(var x=["cmd","ctrl","alt","shift"],S=Math.pow(2,x.length);S--;)w.KEY_MODS[S]=x.filter((function(x){return S&w.KEY_MODS[x]})).join("-")+"-"}(),w.KEY_MODS[0]="",w.KEY_MODS[-1]="input-",w}();U.mixin(S,G),S.keyCodeToString=function(x){var S=G[x];return"string"!=typeof S&&(S=String.fromCharCode(x)),S.toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(x,S,w){"use strict";var U=x("./keys"),G=x("./useragent"),H=null,z=0;S.addListener=function(x,S,w){if(x.addEventListener)return x.addEventListener(S,w,!1);if(x.attachEvent){var i=function(){w.call(x,window.event)};w._wrapper=i,x.attachEvent("on"+S,i)}},S.removeListener=function(x,S,w){if(x.removeEventListener)return x.removeEventListener(S,w,!1);x.detachEvent&&x.detachEvent("on"+S,w._wrapper||w)},S.stopEvent=function(x){return S.stopPropagation(x),S.preventDefault(x),!1},S.stopPropagation=function(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0},S.preventDefault=function(x){x.preventDefault?x.preventDefault():x.returnValue=!1},S.getButton=function(x){return"dblclick"==x.type?0:"contextmenu"==x.type||G.isMac&&x.ctrlKey&&!x.altKey&&!x.shiftKey?2:x.preventDefault?x.button:{1:0,2:2,4:1}[x.button]},S.capture=function(x,w,U){function r(x){w&&w(x),U&&U(x),S.removeListener(document,"mousemove",w,!0),S.removeListener(document,"mouseup",r,!0),S.removeListener(document,"dragstart",r,!0)}return S.addListener(document,"mousemove",w,!0),S.addListener(document,"mouseup",r,!0),S.addListener(document,"dragstart",r,!0),r},S.addMouseWheelListener=function(x,w){"onmousewheel"in x?S.addListener(x,"mousewheel",(function(x){void 0!==x.wheelDeltaX?(x.wheelX=-x.wheelDeltaX/8,x.wheelY=-x.wheelDeltaY/8):(x.wheelX=0,x.wheelY=-x.wheelDelta/8),w(x)})):"onwheel"in x?S.addListener(x,"wheel",(function(x){switch(x.deltaMode){case x.DOM_DELTA_PIXEL:x.wheelX=.35*x.deltaX||0,x.wheelY=.35*x.deltaY||0;break;case x.DOM_DELTA_LINE:case x.DOM_DELTA_PAGE:x.wheelX=5*(x.deltaX||0),x.wheelY=5*(x.deltaY||0)}w(x)})):S.addListener(x,"DOMMouseScroll",(function(x){x.axis&&x.axis==x.HORIZONTAL_AXIS?(x.wheelX=5*(x.detail||0),x.wheelY=0):(x.wheelX=0,x.wheelY=5*(x.detail||0)),w(x)}))},S.addMultiMouseDownListener=function(x,w,U,H){var z,j,X,K=0,q={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(x){if(0!==S.getButton(x)?K=0:x.detail>1?++K>4&&(K=1):K=1,G.isIE){var Y=Math.abs(x.clientX-z)>5||Math.abs(x.clientY-j)>5;X&&!Y||(K=1),X&&clearTimeout(X),X=setTimeout((function(){X=null}),w[K-1]||600),1==K&&(z=x.clientX,j=x.clientY)}if(x._clicks=K,U[H]("mousedown",x),K>4)K=0;else if(K>1)return U[H](q[K],x)}function d(x){K=2,X&&clearTimeout(X),X=setTimeout((function(){X=null}),w[K-1]||600),U[H]("mousedown",x),U[H](q[K],x)}Array.isArray(x)||(x=[x]),x.forEach((function(x){S.addListener(x,"mousedown",h),G.isOldIE&&S.addListener(x,"dblclick",d)}))};var j=G.isMac&&G.isOpera&&!("KeyboardEvent"in window)?function(x){return 0|(x.metaKey?1:0)|(x.altKey?2:0)|(x.shiftKey?4:0)|(x.ctrlKey?8:0)}:function(x){return 0|(x.ctrlKey?1:0)|(x.altKey?2:0)|(x.shiftKey?4:0)|(x.metaKey?8:0)};function c(x,S,w){var X=j(S);if(!G.isMac&&H){if(S.getModifierState&&(S.getModifierState("OS")||S.getModifierState("Win"))&&(X|=8),H.altGr){if(3==(3&X))return;H.altGr=0}if(18===w||17===w){var K="location"in S?S.location:S.keyLocation;17===w&&1===K?1==H[w]&&(z=S.timeStamp):18===w&&3===X&&2===K&&S.timeStamp-z<50&&(H.altGr=!0)}}if(w in U.MODIFIER_KEYS&&(w=-1),X||13!==w||3!==(K="location"in S?S.location:S.keyLocation)||(x(S,X,-w),!S.defaultPrevented)){if(G.isChromeOS&&8&X){if(x(S,X,w),S.defaultPrevented)return;X&=-9}return!!(X||w in U.FUNCTION_KEYS||w in U.PRINTABLE_KEYS)&&x(S,X,w)}}function l(){H=Object.create(null)}if(S.getModifierString=function(x){return U.KEY_MODS[j(x)]},S.addCommandKeyListener=function(x,w){var U=S.addListener;if(G.isOldGecko||G.isOpera&&!("KeyboardEvent"in window)){var z=null;U(x,"keydown",(function(x){z=x.keyCode})),U(x,"keypress",(function(x){return c(w,x,z)}))}else{var j=null;U(x,"keydown",(function(x){H[x.keyCode]=(H[x.keyCode]||0)+1;var S=c(w,x,x.keyCode);return j=x.defaultPrevented,S})),U(x,"keypress",(function(x){j&&(x.ctrlKey||x.altKey||x.shiftKey||x.metaKey)&&(S.stopEvent(x),j=null)})),U(x,"keyup",(function(x){H[x.keyCode]=null})),H||(l(),U(window,"focus",l))}},"object"==typeof window&&window.postMessage&&!G.isOldIE){var X=1;S.nextTick=function(x,w){w=w||window;var U="zero-timeout-message-"+X++,r=function(G){G.data==U&&(S.stopPropagation(G),S.removeListener(w,"message",r),x())};S.addListener(w,"message",r),w.postMessage(U,"*")}}S.$idleBlocked=!1,S.onIdle=function(x,w){return setTimeout((function n(){S.$idleBlocked?setTimeout(n,100):x()}),w)},S.$idleBlockId=null,S.blockIdle=function(x){S.$idleBlockId&&clearTimeout(S.$idleBlockId),S.$idleBlocked=!0,S.$idleBlockId=setTimeout((function(){S.$idleBlocked=!1}),x||100)},S.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),S.nextFrame?S.nextFrame=S.nextFrame.bind(window):S.nextFrame=function(x){setTimeout(x,17)}})),ace.define("ace/range",["require","exports","module"],(function(x,S,w){"use strict";var i=function(x,S,w,U){this.start={row:x,column:S},this.end={row:w,column:U}};(function(){this.isEqual=function(x){return this.start.row===x.start.row&&this.end.row===x.end.row&&this.start.column===x.start.column&&this.end.column===x.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(x,S){return 0==this.compare(x,S)},this.compareRange=function(x){var S,w=x.end,U=x.start;return 1==(S=this.compare(w.row,w.column))?1==(S=this.compare(U.row,U.column))?2:0==S?1:0:-1==S?-2:-1==(S=this.compare(U.row,U.column))?-1:1==S?42:0},this.comparePoint=function(x){return this.compare(x.row,x.column)},this.containsRange=function(x){return 0==this.comparePoint(x.start)&&0==this.comparePoint(x.end)},this.intersects=function(x){var S=this.compareRange(x);return-1==S||0==S||1==S},this.isEnd=function(x,S){return this.end.row==x&&this.end.column==S},this.isStart=function(x,S){return this.start.row==x&&this.start.column==S},this.setStart=function(x,S){"object"==typeof x?(this.start.column=x.column,this.start.row=x.row):(this.start.row=x,this.start.column=S)},this.setEnd=function(x,S){"object"==typeof x?(this.end.column=x.column,this.end.row=x.row):(this.end.row=x,this.end.column=S)},this.inside=function(x,S){return 0==this.compare(x,S)&&!this.isEnd(x,S)&&!this.isStart(x,S)},this.insideStart=function(x,S){return 0==this.compare(x,S)&&!this.isEnd(x,S)},this.insideEnd=function(x,S){return 0==this.compare(x,S)&&!this.isStart(x,S)},this.compare=function(x,S){return this.isMultiLine()||x!==this.start.row?x this.end.row?1:this.start.row===x?S>=this.start.column?0:-1:this.end.row===x?S<=this.end.column?0:1:0:S this.end.column?1:0},this.compareStart=function(x,S){return this.start.row==x&&this.start.column==S?-1:this.compare(x,S)},this.compareEnd=function(x,S){return this.end.row==x&&this.end.column==S?1:this.compare(x,S)},this.compareInside=function(x,S){return this.end.row==x&&this.end.column==S?1:this.start.row==x&&this.start.column==S?-1:this.compare(x,S)},this.clipRows=function(x,S){if(this.end.row>S)var w={row:S+1,column:0};else this.end.row S)var U={row:S+1,column:0};else this.start.row 0;)1&S&&(w+=x),(S>>=1)&&(x+=x);return w};var U=/^\s\s*/,G=/\s\s*$/;S.stringTrimLeft=function(x){return x.replace(U,"")},S.stringTrimRight=function(x){return x.replace(G,"")},S.copyObject=function(x){var S={};for(var w in x)S[w]=x[w];return S},S.copyArray=function(x){for(var S=[],w=0,U=x.length;wDate.now()-50)||(U=!1)},cancel:function(){U=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(x,S,w){"use strict";var U=x("../lib/event"),G=x("../lib/useragent"),H=x("../lib/dom"),z=x("../lib/lang"),j=x("../clipboard"),X=G.isChrome<18,K=G.isIE,q=G.isChrome>63,Y=x("../lib/keys"),Z=Y.KEY_MODS,J=G.isIOS,Q=J?/\s/:/\n/;S.TextInput=function(x,S){var w=H.createElement("textarea");w.className="ace_text-input",w.setAttribute("wrap","off"),w.setAttribute("autocorrect","off"),w.setAttribute("autocapitalize","off"),w.setAttribute("spellcheck",!1),w.style.opacity="0",x.insertBefore(w,x.firstChild);var ee=!1,te=!1,ne=!1,ie=!1,re="";G.isMobile||(w.style.fontSize="1px");var oe=!1,ae=!1,se="",le=0,ce=0,ue=0;try{var he=document.activeElement===w}catch(x){}U.addListener(w,"blur",(function(x){ae||(S.onBlur(x),he=!1)})),U.addListener(w,"focus",(function(x){if(!ae){if(he=!0,G.isEdge)try{if(!document.hasFocus())return}catch(x){}S.onFocus(x),G.isEdge?setTimeout(de):de()}})),this.$focusScroll=!1,this.focus=function(){if(re||q||"browser"==this.$focusScroll)return w.focus({preventScroll:!0});var x=w.style.top;w.style.position="fixed",w.style.top="0px";try{var S=0!=w.getBoundingClientRect().top}catch(x){return}var U=[];if(S)for(var G=w.parentElement;G&&1==G.nodeType;)U.push(G),G.setAttribute("ace_nocontext",!0),G=!G.parentElement&&G.getRootNode?G.getRootNode().host:G.parentElement;w.focus({preventScroll:!0}),S&&U.forEach((function(x){x.removeAttribute("ace_nocontext")})),setTimeout((function(){w.style.position="","0px"==w.style.top&&(w.style.top=x)}),0)},this.blur=function(){w.blur()},this.isFocused=function(){return he},S.on("beforeEndOperation",(function(){S.curOp&&"insertstring"==S.curOp.command.name||(ne&&(se=w.value="",k()),de())}));var de=J?function(x){if(he&&(!ee||x)&&!ie){x||(x="");var U="\n ab"+x+"cde fg\n";U!=w.value&&(w.value=se=U);var G=4+(x.length||(S.selection.isEmpty()?0:1));4==le&&ce==G||w.setSelectionRange(4,G),le=4,ce=G}}:function(){if(!ne&&!ie&&(he||me)){ne=!0;var x=S.selection,U=x.getRange(),G=x.cursor.row,H=U.start.column,z=U.end.column,j=S.session.getLine(G);if(U.start.row!=G){var X=S.session.getLine(G-1);H=U.start.row G+1?K.length:z,z+=j.length+1,j=j+"\n"+K}j.length>400&&(H<400&&z<400?j=j.slice(0,400):(j="\n",H=0,z=1));var q=j+"\n\n";if(q!=se&&(w.value=se=q,le=ce=q.length),me&&(le=w.selectionStart,ce=w.selectionEnd),ce!=z||le!=H||w.selectionEnd!=ce)try{w.setSelectionRange(H,z),le=H,ce=z}catch(x){}ne=!1}};he&&S.onFocus();var pe=null;this.setInputHandler=function(x){pe=x},this.getInputHandler=function(){return pe};var me=!1,I=function(x,U){if(me&&(me=!1),te)return de(),x&&S.onPaste(x),te=!1,"";for(var G=w.selectionStart,H=w.selectionEnd,z=le,j=se.length-ce,X=x,K=x.length-G,q=x.length-H,Y=0;z>0&&se[Y]==x[Y];)Y++,z--;for(X=X.slice(Y),Y=1;j>0&&se.length-Y>le-1&&se[se.length-Y]==x[x.length-Y];)Y++,j--;K-=Y-1,q-=Y-1;var Z=X.length-Y+1;return Z<0&&(z=-Z,Z=0),X=X.slice(0,Z),U||X||K||z||j||q?(ie=!0,X&&!z&&!j&&!K&&!q||oe?S.onTextInput(X):S.onTextInput(X,{extendLeft:z,extendRight:j,restoreStart:K,restoreEnd:q}),ie=!1,se=x,le=G,ce=H,ue=q,X):""},O=function(x){if(ne)return $();if(x&&x.inputType){if("historyUndo"==x.inputType)return S.execCommand("undo");if("historyRedo"==x.inputType)return S.execCommand("redo")}var U=w.value,G=I(U,!0);(U.length>500||Q.test(G))&&de()},F=function(x,S,w){var U=x.clipboardData||window.clipboardData;if(U&&!X){var G=K||w?"Text":"text/plain";try{return S?!1!==U.setData(G,S):U.getData(G)}catch(x){if(!w)return F(x,S,!0)}}},M=function(x,G){var H=S.getCopyText();if(!H)return U.preventDefault(x);F(x,H)?(J&&(de(H),ee=H,setTimeout((function(){ee=!1}),10)),G?S.onCut():S.onCopy(),U.preventDefault(x)):(ee=!0,w.value=H,w.select(),setTimeout((function(){ee=!1,de(),G?S.onCut():S.onCopy()})))},N=function(x){M(x,!0)},P=function(x){M(x,!1)},B=function(x){var H=F(x);j.pasteCancelled()||("string"==typeof H?(H&&S.onPaste(H,x),G.isIE&&setTimeout(de),U.preventDefault(x)):(w.value="",te=!0))};U.addCommandKeyListener(w,S.onCommandKey.bind(S)),U.addListener(w,"select",(function(x){ne||(ee?ee=!1:function(x){return 0===x.selectionStart&&x.selectionEnd>=se.length&&x.value===se&&se&&x.selectionEnd!==ce}(w)&&(S.selectAll(),de()))})),U.addListener(w,"input",O),U.addListener(w,"cut",N),U.addListener(w,"copy",P),U.addListener(w,"paste",B),"oncut"in w&&"oncopy"in w&&"onpaste"in w||U.addListener(x,"keydown",(function(x){if((!G.isMac||x.metaKey)&&x.ctrlKey)switch(x.keyCode){case 67:P(x);break;case 86:B(x);break;case 88:N(x)}}));var $=function(){if(ne&&S.onCompositionUpdate&&!S.$readOnly){if(oe)return D();if(ne.useTextareaForIME)S.onCompositionUpdate(w.value);else{var x=w.value;I(x),ne.markerRange&&(ne.context&&(ne.markerRange.start.column=ne.selectionStart=ne.context.compositionStartOffset),ne.markerRange.end.column=ne.markerRange.start.column+ce-ne.selectionStart+ue)}}},k=function(x){S.onCompositionEnd&&!S.$readOnly&&(ne=!1,S.onCompositionEnd(),S.off("mousedown",D),x&&O())};function D(){ae=!0,w.blur(),w.focus(),ae=!1}var fe,ge=z.delayedCall($,50).schedule.bind(null,null);function W(){clearTimeout(fe),fe=setTimeout((function(){re&&(w.style.cssText=re,re=""),S.renderer.$isMousePressed=!1,S.renderer.$keepTextAreaAtCursor&&S.renderer.$moveTextAreaToCursor()}),0)}U.addListener(w,"compositionstart",(function(x){if(!ne&&S.onCompositionStart&&!S.$readOnly&&(ne={},!oe)){setTimeout($,0),S.on("mousedown",D);var U=S.getSelectionRange();U.end.row=U.start.row,U.end.column=U.start.column,ne.markerRange=U,ne.selectionStart=le,S.onCompositionStart(ne),ne.useTextareaForIME?(w.value="",se="",le=0,ce=0):(w.msGetInputContext&&(ne.context=w.msGetInputContext()),w.getInputContext&&(ne.context=w.getInputContext()))}})),U.addListener(w,"compositionupdate",$),U.addListener(w,"keyup",(function(x){27==x.keyCode&&w.value.length ce&&"\n"==se[H]?z=Y.end:U ce&&se.slice(0,H).split("\n").length>2?z=Y.down:H>ce&&" "==se[H-1]?(z=Y.right,j=Z.option):(H>ce||H==ce&&ce!=le&&U==H)&&(z=Y.right),U!==H&&(j|=Z.shift),z){if(!S.onCommandKey({},j,z)&&S.commands){z=Y.keyCodeToString(z);var X=S.commands.findKeyCommand(j,z);X&&S.execCommand(X)}le=U,ce=H,de("")}}};document.addEventListener("selectionchange",o),S.on("destroy",(function(){document.removeEventListener("selectionchange",o)}))}(0,S,w)}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(x,S,w){"use strict";var U=x("../lib/useragent");function r(x){x.$clickSelection=null;var S=x.editor;S.setDefaultHandler("mousedown",this.onMouseDown.bind(x)),S.setDefaultHandler("dblclick",this.onDoubleClick.bind(x)),S.setDefaultHandler("tripleclick",this.onTripleClick.bind(x)),S.setDefaultHandler("quadclick",this.onQuadClick.bind(x)),S.setDefaultHandler("mousewheel",this.onMouseWheel.bind(x)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(S){x[S]=this[S]}),this),x.selectByLines=this.extendSelectionBy.bind(x,"getLineRange"),x.selectByWords=this.extendSelectionBy.bind(x,"getWordRange")}function o(x,S){if(x.start.row==x.end.row)var w=2*S.column-x.start.column-x.end.column;else w=x.start.row!=x.end.row-1||x.start.column||x.end.column?2*S.row-x.start.row-x.end.row:S.column-4;return w<0?{cursor:x.start,anchor:x.end}:{cursor:x.end,anchor:x.start}}(function(){this.onMouseDown=function(x){var S=x.inSelection(),w=x.getDocumentPosition();this.mousedownEvent=x;var G=this.editor,H=x.getButton();return 0!==H?((G.getSelectionRange().isEmpty()||1==H)&&G.selection.moveToPosition(w),void(2==H&&(G.textInput.onContextMenu(x.domEvent),U.isMozilla||x.preventDefault()))):(this.mousedownEvent.time=Date.now(),!S||G.isFocused()||(G.focus(),!this.$focusTimeout||this.$clickSelection||G.inMultiSelectMode)?(this.captureMouse(x),this.startSelect(w,x.domEvent._clicks>1),x.preventDefault()):(this.setState("focusWait"),void this.captureMouse(x)))},this.startSelect=function(x,S){x=x||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var w=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?w.selection.selectToPosition(x):S||w.selection.moveToPosition(x),S||this.select(),w.renderer.scroller.setCapture&&w.renderer.scroller.setCapture(),w.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var x,S=this.editor,w=S.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var U=this.$clickSelection.comparePoint(w);if(-1==U)x=this.$clickSelection.end;else if(1==U)x=this.$clickSelection.start;else{var G=o(this.$clickSelection,w);w=G.cursor,x=G.anchor}S.selection.setSelectionAnchor(x.row,x.column)}S.selection.selectToPosition(w),S.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(x){var S,w=this.editor,U=w.renderer.screenToTextCoordinates(this.x,this.y),G=w.selection[x](U.row,U.column);if(this.$clickSelection){var H=this.$clickSelection.comparePoint(G.start),z=this.$clickSelection.comparePoint(G.end);if(-1==H&&z<=0)S=this.$clickSelection.end,G.end.row==U.row&&G.end.column==U.column||(U=G.start);else if(1==z&&H>=0)S=this.$clickSelection.start,G.start.row==U.row&&G.start.column==U.column||(U=G.end);else if(-1==H&&1==z)U=G.end,S=G.start;else{var j=o(this.$clickSelection,U);U=j.cursor,S=j.anchor}w.selection.setSelectionAnchor(S.row,S.column)}w.selection.selectToPosition(U),w.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var x,S,w,U,G=(x=this.mousedownEvent.x,S=this.mousedownEvent.y,w=this.x,U=this.y,Math.sqrt(Math.pow(w-x,2)+Math.pow(U-S,2))),H=Date.now();(G>0||H-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(x){var S=x.getDocumentPosition(),w=this.editor,U=w.session.getBracketRange(S);U?(U.isEmpty()&&(U.start.column--,U.end.column++),this.setState("select")):(U=w.selection.getWordRange(S.row,S.column),this.setState("selectByWords")),this.$clickSelection=U,this.select()},this.onTripleClick=function(x){var S=x.getDocumentPosition(),w=this.editor;this.setState("selectByLines");var U=w.getSelectionRange();U.isMultiLine()&&U.contains(S.row,S.column)?(this.$clickSelection=w.selection.getLineRange(U.start.row),this.$clickSelection.end=w.selection.getLineRange(U.end.row).end):this.$clickSelection=w.selection.getLineRange(S.row),this.select()},this.onQuadClick=function(x){var S=this.editor;S.selectAll(),this.$clickSelection=S.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(x){if(!x.getAccelKey()){x.getShiftKey()&&x.wheelY&&!x.wheelX&&(x.wheelX=x.wheelY,x.wheelY=0);var S=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var w=this.$lastScroll,U=x.domEvent.timeStamp,G=U-w.t,H=G?x.wheelX/G:w.vx,z=G?x.wheelY/G:w.vy;G<550&&(H=(H+w.vx)/2,z=(z+w.vy)/2);var j=Math.abs(H/z),X=!1;return j>=1&&S.renderer.isScrollableBy(x.wheelX*x.speed,0)&&(X=!0),j<=1&&S.renderer.isScrollableBy(0,x.wheelY*x.speed)&&(X=!0),X?w.allowed=U:U-w.allowed<550&&(Math.abs(H)<=1.5*Math.abs(w.vx)&&Math.abs(z)<=1.5*Math.abs(w.vy)?(X=!0,w.allowed=U):w.allowed=0),w.t=U,w.vx=H,w.vy=z,X?(S.renderer.scrollBy(x.wheelX*x.speed,x.wheelY*x.speed),x.stop()):void 0}}}).call(r.prototype),S.DefaultHandlers=r})),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],(function(x,S,w){"use strict";x("./lib/oop");var U=x("./lib/dom");function r(x){this.isOpen=!1,this.$element=null,this.$parentNode=x}(function(){this.$init=function(){return this.$element=U.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(x){this.getElement().textContent=x},this.setHtml=function(x){this.getElement().innerHTML=x},this.setPosition=function(x,S){this.getElement().style.left=x+"px",this.getElement().style.top=S+"px"},this.setClassName=function(x){U.addCssClass(this.getElement(),x)},this.show=function(x,S,w){null!=x&&this.setText(x),null!=S&&null!=w&&this.setPosition(S,w),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(r.prototype),S.Tooltip=r})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],(function(x,S,w){"use strict";var U=x("../lib/dom"),G=x("../lib/oop"),H=x("../lib/event"),z=x("../tooltip").Tooltip;function a(x){z.call(this,x)}G.inherits(a,z),function(){this.setPosition=function(x,S){var w=window.innerWidth||document.documentElement.clientWidth,U=window.innerHeight||document.documentElement.clientHeight,G=this.getWidth(),H=this.getHeight();(x+=15)+G>w&&(x-=x+G-w),(S+=15)+H>U&&(S-=20+H),z.prototype.setPosition.call(this,x,S)}}.call(a.prototype),S.GutterHandler=function(x){var S,w,G,z=x.editor,j=z.renderer.$gutterLayer,X=new a(z.container);function u(){S&&(S=clearTimeout(S)),G&&(X.hide(),G=null,z._signal("hideGutterTooltip",X),z.removeEventListener("mousewheel",u))}function h(x){X.setPosition(x.x,x.y)}x.editor.setDefaultHandler("guttermousedown",(function(S){if(z.isFocused()&&0==S.getButton()&&"foldWidgets"!=j.getRegion(S)){var w=S.getDocumentPosition().row,U=z.session.selection;if(S.getShiftKey())U.selectTo(w,0);else{if(2==S.domEvent.detail)return z.selectAll(),S.preventDefault();x.$clickSelection=z.selection.getLineRange(w)}return x.setState("selectByLines"),x.captureMouse(S),S.preventDefault()}})),x.editor.setDefaultHandler("guttermousemove",(function(H){var K=H.domEvent.target||H.domEvent.srcElement;if(U.hasCssClass(K,"ace_fold-widget"))return u();G&&x.$tooltipFollowsMouse&&h(H),w=H,S||(S=setTimeout((function(){S=null,w&&!x.isMousePressed?function(){var S=w.getDocumentPosition().row,U=j.$annotations[S];if(!U)return u();if(S==z.session.getLength()){var H=z.renderer.pixelToScreenCoordinates(0,w.y).row,K=w.$pos;if(H>z.session.documentToScreenRow(K.row,K.column))return u()}if(G!=U)if(G=U.text.join("
"),X.setHtml(G),X.show(),z._signal("showGutterTooltip",X),z.on("mousewheel",u),x.$tooltipFollowsMouse)h(w);else{var q=w.domEvent.target.getBoundingClientRect(),Y=X.getElement().style;Y.left=q.right+"px",Y.top=q.bottom+"px"}}():u()}),50))})),H.addListener(z.renderer.$gutter,"mouseout",(function(x){w=null,G&&!S&&(S=setTimeout((function(){S=null,u()}),50))})),z.on("changeSession",u)}})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(x,S,w){"use strict";var U=x("../lib/event"),G=x("../lib/useragent"),H=S.MouseEvent=function(x,S){this.domEvent=x,this.editor=S,this.x=this.clientX=x.clientX,this.y=this.clientY=x.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){U.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){U.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var x=this.editor.getSelectionRange();if(x.isEmpty())this.$inSelection=!1;else{var S=this.getDocumentPosition();this.$inSelection=x.contains(S.row,S.column)}return this.$inSelection},this.getButton=function(){return U.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=G.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(H.prototype)})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(x,S,w){"use strict";var U=x("../lib/dom"),G=x("../lib/event"),H=x("../lib/useragent");function s(x){var S=x.editor,w=U.createElement("img");w.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",H.isOpera&&(w.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(S){x[S]=this[S]}),this),S.addEventListener("mousedown",this.onMouseDown.bind(x));var z,j,X,K,q,Y,Z,J,Q,ee,te,ne=S.container,ie=0;function C(){var x=Y;(function(x,w){var U=Date.now(),G=!w||x.row!=w.row,H=!w||x.column!=w.column;!ee||G||H?(S.moveCursorToPosition(x),ee=U,te={x:j,y:X}):a(te.x,te.y,j,X)>5?ee=null:U-ee>=200&&(S.renderer.scrollCursorIntoView(),ee=null)})(Y=S.renderer.screenToTextCoordinates(j,X),x),function(x,w){var U=Date.now(),G=S.renderer.layerConfig.lineHeight,H=S.renderer.layerConfig.characterWidth,z=S.renderer.scroller.getBoundingClientRect(),K={x:{left:j-z.left,right:z.right-j},y:{top:X-z.top,bottom:z.bottom-X}},q=Math.min(K.x.left,K.x.right),Y=Math.min(K.y.top,K.y.bottom),Z={row:x.row,column:x.column};q/H<=2&&(Z.column+=K.x.left=200&&S.renderer.scrollCursorIntoView(Z):Q=U:Q=null}(Y,x)}function A(){q=S.selection.toOrientedRange(),z=S.session.addMarker(q,"ace_selection",S.getSelectionStyle()),S.clearSelection(),S.isFocused()&&S.renderer.$cursorLayer.setBlinking(!1),clearInterval(K),C(),K=setInterval(C,20),ie=0,G.addListener(document,"mousemove",y)}function R(){clearInterval(K),S.session.removeMarker(z),z=null,S.selection.fromOrientedRange(q),S.isFocused()&&!J&&S.$resetCursorStyle(),q=null,Y=null,ie=0,Q=null,ee=null,G.removeListener(document,"mousemove",y)}this.onDragStart=function(x){if(this.cancelDrag||!ne.draggable){var U=this;return setTimeout((function(){U.startSelect(),U.captureMouse(x)}),0),x.preventDefault()}q=S.getSelectionRange();var G=x.dataTransfer;G.effectAllowed=S.getReadOnly()?"copy":"copyMove",H.isOpera&&(S.container.appendChild(w),w.scrollTop=0),G.setDragImage&&G.setDragImage(w,0,0),H.isOpera&&S.container.removeChild(w),G.clearData(),G.setData("Text",S.session.getTextRange()),J=!0,this.setState("drag")},this.onDragEnd=function(x){if(ne.draggable=!1,J=!1,this.setState(null),!S.getReadOnly()){var w=x.dataTransfer.dropEffect;Z||"move"!=w||S.session.remove(S.getSelectionRange()),S.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(x){if(!S.getReadOnly()&&T(x.dataTransfer))return j=x.clientX,X=x.clientY,z||A(),ie++,x.dataTransfer.dropEffect=Z=b(x),G.preventDefault(x)},this.onDragOver=function(x){if(!S.getReadOnly()&&T(x.dataTransfer))return j=x.clientX,X=x.clientY,z||(A(),ie++),null!==re&&(re=null),x.dataTransfer.dropEffect=Z=b(x),G.preventDefault(x)},this.onDragLeave=function(x){if(--ie<=0&&z)return R(),Z=null,G.preventDefault(x)},this.onDrop=function(x){if(Y){var w=x.dataTransfer;if(J)switch(Z){case"move":q=q.contains(Y.row,Y.column)?{start:Y,end:Y}:S.moveText(q,Y);break;case"copy":q=S.moveText(q,Y,!0)}else{var U=w.getData("Text");q={start:Y,end:S.session.insert(Y,U)},S.focus(),Z=null}return R(),G.preventDefault(x)}},G.addListener(ne,"dragstart",this.onDragStart.bind(x)),G.addListener(ne,"dragend",this.onDragEnd.bind(x)),G.addListener(ne,"dragenter",this.onDragEnter.bind(x)),G.addListener(ne,"dragover",this.onDragOver.bind(x)),G.addListener(ne,"dragleave",this.onDragLeave.bind(x)),G.addListener(ne,"drop",this.onDrop.bind(x));var re=null;function y(){null==re&&(re=setTimeout((function(){null!=re&&z&&R()}),20))}function T(x){var S=x.types;return!S||Array.prototype.some.call(S,(function(x){return"text/plain"==x||"Text"==x}))}function b(x){var S=["copy","copymove","all","uninitialized"],w=H.isMac?x.altKey:x.ctrlKey,U="uninitialized";try{U=x.dataTransfer.effectAllowed.toLowerCase()}catch(x){}var G="none";return w&&S.indexOf(U)>=0?G="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(U)>=0?G="move":S.indexOf(U)>=0&&(G="copy"),G}}function a(x,S,w,U){return Math.sqrt(Math.pow(w-x,2)+Math.pow(U-S,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(x){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var x=this.editor;x.container.draggable=!0,x.renderer.$cursorLayer.setBlinking(!1),x.setStyle("ace_dragging");var S=H.isWin?"default":"move";x.renderer.setCursorStyle(S),this.setState("dragReady")},this.onMouseDrag=function(x){var S=this.editor.container;H.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&S.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(S.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(x){if(this.$dragEnabled){this.mousedownEvent=x;var S=this.editor,w=x.inSelection(),U=x.getButton();if(1===(x.domEvent.detail||1)&&0===U&&w){if(x.editor.inMultiSelectMode&&(x.getAccelKey()||x.getShiftKey()))return;this.mousedownEvent.time=Date.now();var G=x.domEvent.target||x.domEvent.srcElement;"unselectable"in G&&(G.unselectable="on"),S.getDragDelay()?(H.isWebKit&&(this.cancelDrag=!0,S.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(x,this.onMouseDrag.bind(this)),x.defaultPrevented=!0}}}}).call(s.prototype),S.DragdropHandler=s})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],(function(x,S,w){"use strict";var U=x("./mouse_event").MouseEvent,G=x("../lib/dom");S.addTouchListeners=function(x,S){var w,H,z,j,X,K,q,Y,Z,J="scroll",Q=0,ee=0,te=0,ne=0;function _(){var x=window.navigator&&window.navigator.clipboard,w=!1,i=function(U){var H,z,j=U.target.getAttribute("action");if("more"==j||!w)return w=!w,H=S.getCopyText(),z=S.session.getUndoManager().hasUndo(),void Z.replaceChild(G.buildDom(w?["span",!H&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],H&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],H&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],x&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],z&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),Z.firstChild);"paste"==j?x.readText().then((function(x){S.execCommand(j,x)})):j&&("cut"!=j&&"copy"!=j||(x?x.writeText(S.getCopyText()):document.execCommand("copy")),S.execCommand(j)),Z.firstChild.style.display="none",w=!1,"openCommandPallete"!=j&&S.focus()};Z=G.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(x){J="menu",x.stopPropagation(),x.preventDefault(),S.textInput.focus()},ontouchend:function(x){x.stopPropagation(),x.preventDefault(),i(x)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],S.container)}function E(){Z||_();var x=S.selection.cursor,w=S.renderer.textToScreenCoordinates(x.row,x.column),U=S.container.getBoundingClientRect();Z.style.top=w.pageY-U.top-3+"px",Z.style.right="10px",Z.style.display="",Z.firstChild.style.display="none",S.on("input",C)}function C(x){Z&&(Z.style.display="none"),S.off("input",C)}function A(){X=null,clearTimeout(X);var x=S.selection.getRange(),w=x.contains(q.row,q.column);!x.isEmpty()&&w||(S.selection.moveToPosition(q),S.selection.selectWord()),J="wait",E()}x.addEventListener("contextmenu",(function(x){Y&&S.textInput.getElement().focus()})),x.addEventListener("touchstart",(function(x){var G=x.touches;if(X||G.length>1)return clearTimeout(X),X=null,z=-1,void(J="zoom");Y=S.$mouseHandler.isMousePressed=!0;var K=S.renderer.layerConfig.lineHeight,Z=S.renderer.layerConfig.lineHeight,ie=x.timeStamp;j=ie;var re=G[0],oe=re.clientX,ae=re.clientY;Math.abs(w-oe)+Math.abs(H-ae)>K&&(z=-1),w=x.clientX=oe,H=x.clientY=ae,te=ne=0;var se=new U(x,S);if(q=se.getDocumentPosition(),ie-z<500&&1==G.length&&!Q)ee++,x.preventDefault(),x.button=0,function(){X=null,clearTimeout(X),S.selection.moveToPosition(q);var x=ee>=2?S.selection.getLineRange(q.row):S.session.getBracketRange(q);x&&!x.isEmpty()?S.selection.setRange(x):S.selection.selectWord(),J="wait"}();else{ee=0;var le=S.selection.cursor,ce=S.selection.isEmpty()?le:S.selection.anchor,ue=S.renderer.$cursorLayer.getPixelPosition(le,!0),he=S.renderer.$cursorLayer.getPixelPosition(ce,!0),de=S.renderer.scroller.getBoundingClientRect(),L=function(x,S){return(x/=Z)*x+(S=S/K-.75)*S};if(x.clientX me?"cursor":"anchor"),J=me<3.5?"anchor":pe<3.5?"cursor":"scroll",X=setTimeout(A,450)}z=ie})),x.addEventListener("touchend",(function(x){Y=S.$mouseHandler.isMousePressed=!1,K&&clearInterval(K),"zoom"==J?(J="",Q=0):X?(S.selection.moveToPosition(q),Q=0,E()):"scroll"==J?(Q+=60,K=setInterval((function(){Q--<=0&&(clearInterval(K),K=null),Math.abs(te)<.01&&(te=0),Math.abs(ne)<.01&&(ne=0),Q<20&&(te*=.9),Q<20&&(ne*=.9);var x=S.session.getScrollTop();S.renderer.scrollBy(10*te,10*ne),x==S.session.getScrollTop()&&(Q=0)}),10),x.preventDefault(),C()):E(),clearTimeout(X),X=null})),x.addEventListener("touchmove",(function(x){X&&(clearTimeout(X),X=null);var G=x.touches;if(!(G.length>1||"zoom"==J)){var z=G[0],K=w-z.clientX,q=H-z.clientY;if("wait"==J){if(!(K*K+q*q>4))return x.preventDefault();J="cursor"}w=z.clientX,H=z.clientY,x.clientX=z.clientX,x.clientY=z.clientY;var Y=x.timeStamp,Z=Y-j;if(j=Y,"scroll"==J){var Q=new U(x,S);Q.speed=1,Q.wheelX=K,Q.wheelY=q,10*Math.abs(K) 1&&(G=w[w.length-2]);var z=X[S+"Path"];return null==z?z=X.basePath:"/"==U&&(S=U=""),z&&"/"!=z.slice(-1)&&(z+="/"),z+S+U+G+this.get("suffix")},S.setModuleUrl=function(x,S){return X.$moduleUrls[x]=S},S.$loading={},S.loadModule=function(w,U){var G,z;Array.isArray(w)&&(z=w[0],w=w[1]);try{G=x(w)}catch(x){}if(G&&!S.$loading[w])return U&&U(G);if(S.$loading[w]||(S.$loading[w]=[]),S.$loading[w].push(U),!(S.$loading[w].length>1)){var a=function(){x([w],(function(x){S._emit("load.module",{name:w,module:x});var U=S.$loading[w];S.$loading[w]=null,U.forEach((function(S){S&&S(x)}))}))};if(!S.get("packaged"))return a();H.loadScript(S.moduleUrl(w,z),a),l()}};var l=function(){X.basePath||X.workerPath||X.modePath||X.themePath||Object.keys(X.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),l=function(){})};function u(G){if(j&&j.document){X.packaged=G||x.packaged||U.packaged||j.define&&w(3).packaged;for(var H,z={},K="",q=document.currentScript||document._currentScript,Y=(q&&q.ownerDocument||document).getElementsByTagName("script"),Z=0;Z =x){for(H=Y+1;H =x;)H++;for(j=Y,X=H-1;j=S.length||2!=(X=w[G-1])&&3!=X||2!=(K=S[G+1])&&3!=K?4:(H&&(K=3),K==X?K:4);case 10:return 2==(X=G>0?w[G-1]:5)&&G+1 0&&2==w[G-1])return 2;if(H)return 4;for(Y=G+1,q=S.length;Y =1425&&J<=2303||64286==J;if(X=S[Y],Q&&(1==X||7==X))return 1}return G<1||5==(X=S[G-1])?4:w[G-1];case 5:return H=!1,z=!0,U;case 6:return j=!0,4;case 13:case 14:case 16:case 17:case 15:H=!1;case 18:return 4}}function m(x){var S=x.charCodeAt(0),w=S>>8;return 0==w?S>191?0:q[S]:5==w?/[\u0591-\u05f4]/.test(x)?1:0:6==w?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(x)?12:/[\u0660-\u0669\u066b-\u066c]/.test(x)?3:1642==S?11:/[\u06f0-\u06f9]/.test(x)?2:7:32==w&&S<=8287?Y[255&S]:254==w&&S>=65136?7:4}S.L=0,S.R=1,S.EN=2,S.ON_R=3,S.AN=4,S.R_H=5,S.B=6,S.RLE=7,S.DOT="·",S.doBidiReorder=function(x,w,q){if(x.length<2)return{};var Y=x.split(""),Z=new Array(Y.length),J=new Array(Y.length),Q=[];U=q?1:0,function(x,S,w,q){var Y=U?K:X,Z=null,J=null,Q=null,ee=0,te=null,ne=-1,ie=null,re=null,oe=[];if(!q)for(ie=0,q=[];ie0)if(16==te){for(ie=ne;ie -1){for(ie=ne;ie =0&&8==q[ae];ae--)S[ae]=U}}(Y,Q,Y.length,w);for(var ee=0;ee 7&&w[ee]<13||4===w[ee]||18===w[ee])?Q[ee]=S.ON_R:ee>0&&"ل"===Y[ee-1]&&/\u0622|\u0623|\u0625|\u0627/.test(Y[ee])&&(Q[ee-1]=Q[ee]=S.R_H,ee++);for(Y[Y.length-1]===S.DOT&&(Q[Y.length-1]=S.B),""===Y[0]&&(Q[0]=S.RLE),ee=0;ee =0&&(x=this.session.$docRowCache[w])}return x},this.getSplitIndex=function(){var x=0,S=this.session.$screenRowCache;if(S.length)for(var w,U=this.session.$getRowCacheIndex(S,this.currentRow);this.currentRow-x>0&&(w=this.session.$getRowCacheIndex(S,this.currentRow-x-1))===U;)U=w,x++;else x=this.currentRow;return x},this.updateRowLine=function(x,S){void 0===x&&(x=this.getDocumentRow());var w=x===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(x),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var H=this.session.$wrapData[x];H&&(void 0===S&&(S=this.getSplitIndex()),S>0&&H.length?(this.wrapIndent=H.indent,this.wrapOffset=this.wrapIndent*this.charWidths[U.L],this.line=S S?this.session.getOverwrite()?x:x-1:S,G=U.getVisualFromLogicalIdx(w,this.bidiMap),H=this.bidiMap.bidiLevels,z=0;!this.session.getOverwrite()&&x<=S&&H[G]%2!=0&&G++;for(var j=0;j S&&H[G]%2==0&&(z+=this.charWidths[H[G]]),this.wrapIndent&&(z+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(z+=this.rtlLineOffset),z},this.getSelections=function(x,S){var w,U=this.bidiMap,G=U.bidiLevels,H=[],z=0,j=Math.min(x,S)-this.wrapIndent,X=Math.max(x,S)-this.wrapIndent,K=!1,q=!1,Y=0;this.wrapIndent&&(z+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var Z,J=0;J =j&&Z w+H/2;){if(w+=H,U===G.length-1){H=0;break}H=this.charWidths[G[++U]]}return U>0&&G[U-1]%2!=0&&G[U]%2==0?(x 0&&G[U-1]%2==0&&G[U]%2!=0?S=1+(x>w?this.bidiMap.logicalFromVisual[U]:this.bidiMap.logicalFromVisual[U-1]):this.isRtlDir&&U===G.length-1&&0===H&&G[U-1]%2==0||!this.isRtlDir&&0===U&&G[U]%2!=0?S=1+this.bidiMap.logicalFromVisual[U]:(U>0&&G[U-1]%2!=0&&0!==H&&U--,S=this.bidiMap.logicalFromVisual[U]),0===S&&this.isRtlDir&&S++,S+this.wrapIndent}}).call(s.prototype),S.BidiHandler=s})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(x,S,w){"use strict";var U=x("./lib/oop"),G=x("./lib/lang"),H=x("./lib/event_emitter").EventEmitter,z=x("./range").Range,a=function(x){this.session=x,this.doc=x.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var S=this;this.cursor.on("change",(function(x){S.$cursorChanged=!0,S.$silent||S._emit("changeCursor"),S.$isEmpty||S.$silent||S._emit("changeSelection"),S.$keepDesiredColumnOnChange||x.old.column==x.value.column||(S.$desiredColumn=null)})),this.anchor.on("change",(function(){S.$anchorChanged=!0,S.$isEmpty||S.$silent||S._emit("changeSelection")}))};(function(){U.implement(this,H),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(x,S){this.$isEmpty=!1,this.anchor.setPosition(x,S)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var x=this.anchor,S=this.lead;return x.row>S.row||x.row==S.row&&x.column>S.column},this.getRange=function(){var x=this.anchor,S=this.lead;return this.$isEmpty?z.fromPoints(S,S):this.isBackwards()?z.fromPoints(S,x):z.fromPoints(x,S)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(x,S){var w=S?x.end:x.start,U=S?x.start:x.end;this.$setSelection(w.row,w.column,U.row,U.column)},this.$setSelection=function(x,S,w,U){var G=this.$isEmpty,H=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(x,S),this.cursor.setPosition(w,U),this.$isEmpty=!z.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||G!=this.$isEmpty||H)&&this._emit("changeSelection")},this.$moveSelection=function(x){var S=this.lead;this.$isEmpty&&this.setSelectionAnchor(S.row,S.column),x.call(this)},this.selectTo=function(x,S){this.$moveSelection((function(){this.moveCursorTo(x,S)}))},this.selectToPosition=function(x){this.$moveSelection((function(){this.moveCursorToPosition(x)}))},this.moveTo=function(x,S){this.clearSelection(),this.moveCursorTo(x,S)},this.moveToPosition=function(x){this.clearSelection(),this.moveCursorToPosition(x)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(x,S){if(void 0===S){var w=x||this.lead;x=w.row,S=w.column}return this.session.getWordRange(x,S)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var x=this.getCursor(),S=this.session.getAWordRange(x.row,x.column);this.setSelectionRange(S)},this.getLineRange=function(x,S){var w,U="number"==typeof x?x:this.lead.row,G=this.session.getFoldLine(U);return G?(U=G.start.row,w=G.end.row):w=U,!0===S?new z(U,0,w,this.session.getLine(w).length):new z(U,0,w+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(x,S,w){var U=x.column,G=x.column+S;return w<0&&(U=x.column-S,G=x.column),this.session.isTabStop(x)&&this.doc.getLine(x.row).slice(U,G).split(" ").length-1==S},this.moveCursorLeft=function(){var x,S=this.lead.getPosition();if(x=this.session.getFoldAt(S.row,S.column,-1))this.moveCursorTo(x.start.row,x.start.column);else if(0===S.column)S.row>0&&this.moveCursorTo(S.row-1,this.doc.getLine(S.row-1).length);else{var w=this.session.getTabSize();this.wouldMoveIntoSoftTab(S,w,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-w):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var x,S=this.lead.getPosition();if(x=this.session.getFoldAt(S.row,S.column,1))this.moveCursorTo(x.end.row,x.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row 0&&(S.column=U)}}this.moveCursorTo(S.row,S.column)},this.moveCursorFileEnd=function(){var x=this.doc.getLength()-1,S=this.doc.getLine(x).length;this.moveCursorTo(x,S)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var x=this.lead.row,S=this.lead.column,w=this.doc.getLine(x),U=w.substring(S);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var G=this.session.getFoldAt(x,S,1);if(G)this.moveCursorTo(G.end.row,G.end.column);else{if(this.session.nonTokenRe.exec(U)&&(S+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,U=w.substring(S)),S>=w.length)return this.moveCursorTo(x,w.length),this.moveCursorRight(),void(x 0&&this.moveCursorWordLeft());this.session.tokenRe.exec(H)&&(w-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(S,w)}},this.$shortWordEndIndex=function(x){var S,w=0,U=/\s/,G=this.session.tokenRe;if(G.lastIndex=0,this.session.tokenRe.exec(x))w=this.session.tokenRe.lastIndex;else{for(;(S=x[w])&&U.test(S);)w++;if(w<1)for(G.lastIndex=0;(S=x[w])&&!G.test(S);)if(G.lastIndex=0,w++,U.test(S)){if(w>2){w--;break}for(;(S=x[w])&&U.test(S);)w++;if(w>2)break}}return G.lastIndex=0,w},this.moveCursorShortWordRight=function(){var x=this.lead.row,S=this.lead.column,w=this.doc.getLine(x),U=w.substring(S),G=this.session.getFoldAt(x,S,1);if(G)return this.moveCursorTo(G.end.row,G.end.column);if(S==w.length){var H=this.doc.getLength();do{x++,U=this.doc.getLine(x)}while(x 0&&/^\s*$/.test(U));w=U.length,/\s+$/.test(U)||(U="")}var H=G.stringReverse(U),z=this.$shortWordEndIndex(H);return this.moveCursorTo(S,w-z)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(x,S){var w,U=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===S&&(0!==x&&(this.session.$bidiHandler.isBidiRow(U.row,this.lead.row)?(w=this.session.$bidiHandler.getPosLeft(U.column),U.column=Math.round(w/this.session.$bidiHandler.charWidths[0])):w=U.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?U.column=this.$desiredColumn:this.$desiredColumn=U.column);var G=this.session.screenToDocumentPosition(U.row+x,U.column,w);0!==x&&0===S&&G.row===this.lead.row&&G.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[G.row]&&(G.row>0||x>0)&&G.row++,this.moveCursorTo(G.row,G.column+S,0===S)},this.moveCursorToPosition=function(x){this.moveCursorTo(x.row,x.column)},this.moveCursorTo=function(x,S,w){var U=this.session.getFoldAt(x,S,1);U&&(x=U.start.row,S=U.start.column),this.$keepDesiredColumnOnChange=!0;var G=this.session.getLine(x);/[\uDC00-\uDFFF]/.test(G.charAt(S))&&G.charAt(S-1)&&(this.lead.row==x&&this.lead.column==S+1?S-=1:S+=1),this.lead.setPosition(x,S),this.$keepDesiredColumnOnChange=!1,w||(this.$desiredColumn=null)},this.moveCursorToScreen=function(x,S,w){var U=this.session.screenToDocumentPosition(x,S);this.moveCursorTo(U.row,U.column,w)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(x){this.setSelectionRange(x,x.cursor==x.start),this.$desiredColumn=x.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(x){var S=this.getRange();return x?(x.start.column=S.start.column,x.start.row=S.start.row,x.end.column=S.end.column,x.end.row=S.end.row):x=S,x.cursor=this.isBackwards()?x.start:x.end,x.desiredColumn=this.$desiredColumn,x},this.getRangeOfMovements=function(x){var S=this.getCursor();try{x(this);var w=this.getCursor();return z.fromPoints(S,w)}catch(x){return z.fromPoints(S,S)}finally{this.moveCursorToPosition(S)}},this.toJSON=function(){if(this.rangeCount)var x=this.ranges.map((function(x){var S=x.clone();return S.isBackwards=x.cursor==x.start,S}));else(x=this.getRange()).isBackwards=this.isBackwards();return x},this.fromJSON=function(x){if(null==x.start){if(this.rangeList&&x.length>1){this.toSingleRange(x[0]);for(var S=x.length;S--;){var w=z.fromPoints(x[S].start,x[S].end);x[S].isBackwards&&(w.cursor=w.start),this.addRange(w,!0)}return}x=x[0]}this.rangeList&&this.toSingleRange(x),this.setSelectionRange(x,x.isBackwards)},this.isEqual=function(x){if((x.length||this.rangeCount)&&x.length!=this.rangeCount)return!1;if(!x.length||!this.ranges)return this.getRange().isEqual(x);for(var S=this.ranges.length;S--;)if(!this.ranges[S].isEqual(x[S]))return!1;return!0}}).call(a.prototype),S.Selection=a})),ace.define("ace/tokenizer",["require","exports","module","ace/config"],(function(x,S,w){"use strict";var U=x("./config"),G=2e3,o=function(x){for(var S in this.states=x,this.regExps={},this.matchMappings={},this.states){for(var w=this.states[S],U=[],G=0,H=this.matchMappings[S]={defaultToken:"text"},z="g",j=[],X=0;X 1?this.$applyToken:K.token),Y>1&&(/\\\d/.test(K.regex)?q=K.regex.replace(/\\([0-9]+)/g,(function(x,S){return"\\"+(parseInt(S,10)+G+1)})):(Y=1,q=this.removeCapturingGroups(K.regex)),K.splitRegex||"string"==typeof K.token||j.push(K)),H[G]=X,G+=Y,U.push(q),K.onMatch||(K.onMatch=null)}}U.length||(H[0]=0,U.push("$")),j.forEach((function(x){x.splitRegex=this.createSplitterRegexp(x.regex,z)}),this),this.regExps[S]=new RegExp("("+U.join(")|(")+")|($)",z)}};(function(){this.$setMaxTokenCount=function(x){G=0|x},this.$applyToken=function(x){var S=this.splitRegex.exec(x).slice(1),w=this.token.apply(this,S);if("string"==typeof w)return[{type:w,value:x}];for(var U=[],G=0,H=w.length;G q){var ne=x.substring(q,te-ee.length);Z.type==J?Z.value+=ne:(Z.type&&K.push(Z),Z={type:J,value:ne})}for(var ie=0;ie G){for(Y>2*x.length&&this.reportError("infinite loop with in ace tokenizer",{startState:S,line:x});q 1&&w[0]!==U&&w.unshift("#tmp",U),{tokens:K,state:w.length?w:U}},this.reportError=U.reportError}).call(o.prototype),S.Tokenizer=o})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],(function(x,S,w){"use strict";var U=x("../lib/lang"),r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(x,S){if(S)for(var w in x){for(var U=x[w],G=0;G =this.$rowTokens.length;){if(this.$row+=1,x||(x=this.$session.getLength()),this.$row>=x)return this.$row=x-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var x=this.$rowTokens,S=this.$tokenIndex,w=x[S].start;if(void 0!==w)return w;for(w=0;S>0;)w+=x[S-=1].value.length;return w},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var x=this.$rowTokens[this.$tokenIndex],S=this.getCurrentTokenColumn();return new U(this.$row,S,this.$row,S+x.value.length)}}).call(r.prototype),S.TokenIterator=r})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(x,S,w){"use strict";var U,G=x("../../lib/oop"),H=x("../behaviour").Behaviour,z=x("../../token_iterator").TokenIterator,j=x("../../lib/lang"),X=["text","paren.rparen","rparen","paren","punctuation.operator"],K=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],q={},Y={'"':'"',"'":"'"},d=function(x){var S=-1;if(x.multiSelect&&(S=x.selection.index,q.rangeCount!=x.multiSelect.rangeCount&&(q={rangeCount:x.multiSelect.rangeCount})),q[S])return U=q[S];U=q[S]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(x,S,w,U){var G=x.end.row-x.start.row;return{text:w+S+U,selection:[0,x.start.column+1,G,x.end.column+(G?0:1)]}},m=function(x){this.add("braces","insertion",(function(S,w,G,H,z){var X=G.getCursorPosition(),K=H.doc.getLine(X.row);if("{"==z){d(G);var q=G.getSelectionRange(),Y=H.doc.getTextRange(q);if(""!==Y&&"{"!==Y&&G.getWrapBehavioursEnabled())return p(q,Y,"{","}");if(m.isSaneInsertion(G,H))return/[\]\}\)]/.test(K[X.column])||G.inMultiSelectMode||x&&x.braces?(m.recordAutoInsert(G,H,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(G,H,"{"),{text:"{",selection:[1,1]})}else if("}"==z){if(d(G),"}"==K.substring(X.column,X.column+1)&&null!==H.$findOpeningBracket("}",{column:X.column+1,row:X.row})&&m.isAutoInsertedClosing(X,K,z))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==z||"\r\n"==z){d(G);var Z="";if(m.isMaybeInsertedClosing(X,K)&&(Z=j.stringRepeat("}",U.maybeInsertedBrackets),m.clearMaybeInsertedClosing()),"}"===K.substring(X.column,X.column+1)){var J=H.findMatchingBracket({row:X.row,column:X.column+1},"}");if(!J)return null;var Q=this.$getIndent(H.getLine(J.row))}else{if(!Z)return void m.clearMaybeInsertedClosing();Q=this.$getIndent(K)}var ee=Q+H.getTabString();return{text:"\n"+ee+"\n"+Q+Z,selection:[1,ee.length,1,ee.length]}}m.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(x,S,w,G,H){var z=G.doc.getTextRange(H);if(!H.isMultiLine()&&"{"==z){if(d(w),"}"==G.doc.getLine(H.start.row).substring(H.end.column,H.end.column+1))return H.end.column++,H;U.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(x,S,w,U,G){if("("==G){d(w);var H=w.getSelectionRange(),z=U.doc.getTextRange(H);if(""!==z&&w.getWrapBehavioursEnabled())return p(H,z,"(",")");if(m.isSaneInsertion(w,U))return m.recordAutoInsert(w,U,")"),{text:"()",selection:[1,1]}}else if(")"==G){d(w);var j=w.getCursorPosition(),X=U.doc.getLine(j.row);if(")"==X.substring(j.column,j.column+1)&&null!==U.$findOpeningBracket(")",{column:j.column+1,row:j.row})&&m.isAutoInsertedClosing(j,X,G))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(x,S,w,U,G){var H=U.doc.getTextRange(G);if(!G.isMultiLine()&&"("==H&&(d(w),")"==U.doc.getLine(G.start.row).substring(G.start.column+1,G.start.column+2)))return G.end.column++,G})),this.add("brackets","insertion",(function(x,S,w,U,G){if("["==G){d(w);var H=w.getSelectionRange(),z=U.doc.getTextRange(H);if(""!==z&&w.getWrapBehavioursEnabled())return p(H,z,"[","]");if(m.isSaneInsertion(w,U))return m.recordAutoInsert(w,U,"]"),{text:"[]",selection:[1,1]}}else if("]"==G){d(w);var j=w.getCursorPosition(),X=U.doc.getLine(j.row);if("]"==X.substring(j.column,j.column+1)&&null!==U.$findOpeningBracket("]",{column:j.column+1,row:j.row})&&m.isAutoInsertedClosing(j,X,G))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(x,S,w,U,G){var H=U.doc.getTextRange(G);if(!G.isMultiLine()&&"["==H&&(d(w),"]"==U.doc.getLine(G.start.row).substring(G.start.column+1,G.start.column+2)))return G.end.column++,G})),this.add("string_dquotes","insertion",(function(x,S,w,U,G){var H=U.$mode.$quotes||Y;if(1==G.length&&H[G]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(G))return;d(w);var z=G,j=w.getSelectionRange(),X=U.doc.getTextRange(j);if(!(""===X||1==X.length&&H[X])&&w.getWrapBehavioursEnabled())return p(j,X,z,z);if(!X){var K=w.getCursorPosition(),q=U.doc.getLine(K.row),Z=q.substring(K.column-1,K.column),J=q.substring(K.column,K.column+1),Q=U.getTokenAt(K.row,K.column),ee=U.getTokenAt(K.row,K.column+1);if("\\"==Z&&Q&&/escape/.test(Q.type))return null;var te,ne=Q&&/string|escape/.test(Q.type),ie=!ee||/string|escape/.test(ee.type);if(J==z)(te=ne!==ie)&&/string\.end/.test(ee.type)&&(te=!1);else{if(ne&&!ie)return null;if(ne&&ie)return null;var re=U.$mode.tokenRe;re.lastIndex=0;var oe=re.test(Z);re.lastIndex=0;var ae=re.test(Z);if(oe||ae)return null;if(J&&!/[\s;,.})\]\\]/.test(J))return null;var se=q[K.column-2];if(Z==z&&(se==z||re.test(se)))return null;te=!0}return{text:te?z+z:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(x,S,w,U,G){var H=U.$mode.$quotes||Y,z=U.doc.getTextRange(G);if(!G.isMultiLine()&&H.hasOwnProperty(z)&&(d(w),U.doc.getLine(G.start.row).substring(G.start.column+1,G.start.column+2)==z))return G.end.column++,G}))};m.isSaneInsertion=function(x,S){var w=x.getCursorPosition(),U=new z(S,w.row,w.column);if(!this.$matchTokenType(U.getCurrentToken()||"text",X)){if(/[)}\]]/.test(x.session.getLine(w.row)[w.column]))return!0;var G=new z(S,w.row,w.column+1);if(!this.$matchTokenType(G.getCurrentToken()||"text",X))return!1}return U.stepForward(),U.getCurrentTokenRow()!==w.row||this.$matchTokenType(U.getCurrentToken()||"text",K)},m.$matchTokenType=function(x,S){return S.indexOf(x.type||x)>-1},m.recordAutoInsert=function(x,S,w){var G=x.getCursorPosition(),H=S.doc.getLine(G.row);this.isAutoInsertedClosing(G,H,U.autoInsertedLineEnd[0])||(U.autoInsertedBrackets=0),U.autoInsertedRow=G.row,U.autoInsertedLineEnd=w+H.substr(G.column),U.autoInsertedBrackets++},m.recordMaybeInsert=function(x,S,w){var G=x.getCursorPosition(),H=S.doc.getLine(G.row);this.isMaybeInsertedClosing(G,H)||(U.maybeInsertedBrackets=0),U.maybeInsertedRow=G.row,U.maybeInsertedLineStart=H.substr(0,G.column)+w,U.maybeInsertedLineEnd=H.substr(G.column),U.maybeInsertedBrackets++},m.isAutoInsertedClosing=function(x,S,w){return U.autoInsertedBrackets>0&&x.row===U.autoInsertedRow&&w===U.autoInsertedLineEnd[0]&&S.substr(x.column)===U.autoInsertedLineEnd},m.isMaybeInsertedClosing=function(x,S){return U.maybeInsertedBrackets>0&&x.row===U.maybeInsertedRow&&S.substr(x.column)===U.maybeInsertedLineEnd&&S.substr(0,x.column)==U.maybeInsertedLineStart},m.popAutoInsertedClosing=function(){U.autoInsertedLineEnd=U.autoInsertedLineEnd.substr(1),U.autoInsertedBrackets--},m.clearMaybeInsertedClosing=function(){U&&(U.maybeInsertedBrackets=0,U.maybeInsertedRow=-1)},G.inherits(m,H),S.CstyleBehaviour=m})),ace.define("ace/unicode",["require","exports","module"],(function(x,S,w){"use strict";for(var U=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],G=0,H=[],z=0;z 2?U%K!=K-1:U%K==0})}else{if(!this.blockComment)return!1;var J=this.blockComment.start,Q=this.blockComment.end,ee=new RegExp("^(\\s*)(?:"+X.escapeRegExp(J)+")"),te=new RegExp("(?:"+X.escapeRegExp(Q)+")\\s*$"),v=function(x,S){E(x,S)||H&&!/\S/.test(x)||(G.insertInLine({row:S,column:x.length},Q),G.insertInLine({row:S,column:j},J))},_=function(x,S){var w;(w=x.match(te))&&G.removeInLine(S,x.length-w[0].length,x.length),(w=x.match(ee))&&G.removeInLine(S,w[1].length,w[0].length)},E=function(x,w){if(ee.test(x))return!0;for(var U=S.getTokens(w),G=0;G x.length&&(ne=x.length)})),j==1/0&&(j=ne,H=!1,z=!1),q&&j%K!=0&&(j=Math.floor(j/K)*K),C(z?_:v)},this.toggleBlockComment=function(x,S,w,U){var G=this.blockComment;if(G){!G.start&&G[0]&&(G=G[0]);var H,z,j=(ee=new K(S,U.row,U.column)).getCurrentToken(),X=(S.selection,S.selection.toOrientedRange());if(j&&/comment/.test(j.type)){for(var Y,Z;j&&/comment/.test(j.type);){if(-1!=(te=j.value.indexOf(G.start))){var J=ee.getCurrentTokenRow(),Q=ee.getCurrentTokenColumn()+te;Y=new q(J,Q,J,Q+G.start.length);break}j=ee.stepBackward()}var ee;for(j=(ee=new K(S,U.row,U.column)).getCurrentToken();j&&/comment/.test(j.type);){var te;if(-1!=(te=j.value.indexOf(G.end))){J=ee.getCurrentTokenRow(),Q=ee.getCurrentTokenColumn()+te,Z=new q(J,Q,J,Q+G.end.length);break}j=ee.stepForward()}Z&&S.remove(Z),Y&&(S.remove(Y),H=Y.start.row,z=-G.start.length)}else z=G.start.length,H=w.start.row,S.insert(w.end,G.end),S.insert(w.start,G.start);X.start.row==H&&(X.start.column+=z),X.end.row==H&&(X.end.column+=z),S.selection.fromOrientedRange(X)}},this.getNextLineIndent=function(x,S,w){return this.$getIndent(S)},this.checkOutdent=function(x,S,w){return!1},this.autoOutdent=function(x,S,w){},this.$getIndent=function(x){return x.match(/^\s*/)[0]},this.createWorker=function(x){return null},this.createModeDelegates=function(x){for(var S in this.$embeds=[],this.$modes={},x)if(x[S]){var w=x[S],G=w.prototype.$id,H=U.$modes[G];H||(U.$modes[G]=H=new w),U.$modes[S]||(U.$modes[S]=H),this.$embeds.push(S),this.$modes[S]=H}var z=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(S=0;S this.row)){var S=function(x,S,w){var U="insert"==x.action,G=(U?1:-1)*(x.end.row-x.start.row),H=(U?1:-1)*(x.end.column-x.start.column),z=x.start,j=U?z:x.end;return e(S,z,w)?{row:S.row,column:S.column}:e(j,S,!w)?{row:S.row+G,column:S.column+(S.row==j.row?H:0)}:{row:z.row,column:z.column}}(x,{row:this.row,column:this.column},this.$insertRight);this.setPosition(S.row,S.column,!0)}},this.setPosition=function(x,S,w){var U;if(U=w?{row:x,column:S}:this.$clipPositionToDocument(x,S),this.row!=U.row||this.column!=U.column){var G={row:this.row,column:this.column};this.row=U.row,this.column=U.column,this._signal("change",{old:G,value:U})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(x){this.document=x||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(x,S){var w={};return x>=this.document.getLength()?(w.row=Math.max(0,this.document.getLength()-1),w.column=this.document.getLine(w.row).length):x<0?(w.row=0,w.column=0):(w.row=x,w.column=Math.min(this.document.getLine(w.row).length,Math.max(0,S))),S<0&&(w.column=0),w}}).call(H.prototype)})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(x,S,w){"use strict";var U=x("./lib/oop"),G=x("./apply_delta").applyDelta,H=x("./lib/event_emitter").EventEmitter,z=x("./range").Range,j=x("./anchor").Anchor,c=function(x){this.$lines=[""],0===x.length?this.$lines=[""]:Array.isArray(x)?this.insertMergedLines({row:0,column:0},x):this.insert({row:0,column:0},x)};(function(){U.implement(this,H),this.setValue=function(x){var S=this.getLength()-1;this.remove(new z(0,0,S,this.getLine(S).length)),this.insert({row:0,column:0},x)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(x,S){return new j(this,x,S)},0==="aaa".split(/a/).length?this.$split=function(x){return x.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(x){return x.split(/\r\n|\r|\n/)},this.$detectNewLine=function(x){var S=x.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=S?S[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(x){this.$newLineMode!==x&&(this.$newLineMode=x,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(x){return"\r\n"==x||"\r"==x||"\n"==x},this.getLine=function(x){return this.$lines[x]||""},this.getLines=function(x,S){return this.$lines.slice(x,S+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(x){return this.getLinesForRange(x).join(this.getNewLineCharacter())},this.getLinesForRange=function(x){var S;if(x.start.row===x.end.row)S=[this.getLine(x.start.row).substring(x.start.column,x.end.column)];else{(S=this.getLines(x.start.row,x.end.row))[0]=(S[0]||"").substring(x.start.column);var w=S.length-1;x.end.row-x.start.row==w&&(S[w]=S[w].substring(0,x.end.column))}return S},this.insertLines=function(x,S){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(x,S)},this.removeLines=function(x,S){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(x,S)},this.insertNewLine=function(x){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(x,["",""])},this.insert=function(x,S){return this.getLength()<=1&&this.$detectNewLine(S),this.insertMergedLines(x,this.$split(S))},this.insertInLine=function(x,S){var w=this.clippedPos(x.row,x.column),U=this.pos(x.row,x.column+S.length);return this.applyDelta({start:w,end:U,action:"insert",lines:[S]},!0),this.clonePos(U)},this.clippedPos=function(x,S){var w=this.getLength();void 0===x?x=w:x<0?x=0:x>=w&&(x=w-1,S=void 0);var U=this.getLine(x);return null==S&&(S=U.length),{row:x,column:S=Math.min(Math.max(S,0),U.length)}},this.clonePos=function(x){return{row:x.row,column:x.column}},this.pos=function(x,S){return{row:x,column:S}},this.$clipPosition=function(x){var S=this.getLength();return x.row>=S?(x.row=Math.max(0,S-1),x.column=this.getLine(S-1).length):(x.row=Math.max(0,x.row),x.column=Math.min(Math.max(x.column,0),this.getLine(x.row).length)),x},this.insertFullLines=function(x,S){var w=0;(x=Math.min(Math.max(x,0),this.getLength())) 0,U=S =0&&this.applyDelta({start:this.pos(x,this.getLine(x).length),end:this.pos(x+1,0),action:"remove",lines:["",""]})},this.replace=function(x,S){return x instanceof z||(x=z.fromPoints(x.start,x.end)),0===S.length&&x.isEmpty()?x.start:S==this.getTextRange(x)?x.end:(this.remove(x),S?this.insert(x.start,S):x.start)},this.applyDeltas=function(x){for(var S=0;S =0;S--)this.revertDelta(x[S])},this.applyDelta=function(x,S){var w="insert"==x.action;(w?x.lines.length<=1&&!x.lines[0]:!z.comparePoints(x.start,x.end))||(w&&x.lines.length>2e4?this.$splitAndapplyLargeDelta(x,2e4):(G(this.$lines,x,S),this._signal("change",x)))},this.$splitAndapplyLargeDelta=function(x,S){for(var w=x.lines,U=w.length-S+1,G=x.start.row,H=x.start.column,z=0,j=0;z20){w.running=setTimeout(w.$worker,20);break}}w.currentLine=S,-1==U&&(U=S),H<=U&&w.fireUpdateEvent(H,U)}}};(function(){U.implement(this,G),this.setTokenizer=function(x){this.tokenizer=x,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(x){this.doc=x,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(x,S){var w={first:x,last:S};this._signal("update",{data:w})},this.start=function(x){this.currentLine=Math.min(x||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(x){var S=x.start.row,w=x.end.row-S;if(0===w)this.lines[S]=null;else if("remove"==x.action)this.lines.splice(S,w+1,null),this.states.splice(S,w+1,null);else{var U=Array(w+1);U.unshift(S,1),this.lines.splice.apply(this.lines,U),this.states.splice.apply(this.states,U)}this.currentLine=Math.min(S,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(x){return this.lines[x]||this.$tokenizeRow(x)},this.getState=function(x){return this.currentLine==x&&this.$tokenizeRow(x),this.states[x]||"start"},this.$tokenizeRow=function(x){var S=this.doc.getLine(x),w=this.states[x-1],U=this.tokenizer.getLineTokens(S,w,x);return this.states[x]+""!=U.state+""?(this.states[x]=U.state,this.lines[x+1]=null,this.currentLine>x+1&&(this.currentLine=x+1)):this.currentLine==x&&(this.currentLine=x+1),this.lines[x]=U.tokens}}).call(o.prototype),S.BackgroundTokenizer=o})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(x,S,w){"use strict";var U=x("./lib/lang"),G=(x("./lib/oop"),x("./range").Range),o=function(x,S,w){this.setRegexp(x),this.clazz=S,this.type=w||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(x){this.regExp+""!=x+""&&(this.regExp=x,this.cache=[])},this.update=function(x,S,w,H){if(this.regExp)for(var z=H.firstRow,j=H.lastRow,X=z;X<=j;X++){var K=this.cache[X];null==K&&((K=U.getMatchOffsets(w.getLine(X),this.regExp)).length>this.MAX_RANGES&&(K=K.slice(0,this.MAX_RANGES)),K=K.map((function(x){return new G(X,x.offset,X,x.offset+x.length)})),this.cache[X]=K.length?K:"");for(var q=K.length;q--;)S.drawSingleLineMarker(x,K[q].toScreenRange(w),this.clazz,H)}}}).call(o.prototype),S.SearchHighlight=o})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(x,S,w){"use strict";var U=x("../range").Range;function r(x,S){this.foldData=x,Array.isArray(S)?this.folds=S:S=this.folds=[S];var w=S[S.length-1];this.range=new U(S[0].start.row,S[0].start.column,w.end.row,w.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(x){x.setFoldLine(this)}),this)}(function(){this.shiftRow=function(x){this.start.row+=x,this.end.row+=x,this.folds.forEach((function(S){S.start.row+=x,S.end.row+=x}))},this.addFold=function(x){if(x.sameRow){if(x.start.row this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(x),this.folds.sort((function(x,S){return-x.range.compareEnd(S.start.row,S.start.column)})),this.range.compareEnd(x.start.row,x.start.column)>0?(this.end.row=x.end.row,this.end.column=x.end.column):this.range.compareStart(x.end.row,x.end.column)<0&&(this.start.row=x.start.row,this.start.column=x.start.column)}else if(x.start.row==this.end.row)this.folds.push(x),this.end.row=x.end.row,this.end.column=x.end.column;else{if(x.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(x),this.start.row=x.start.row,this.start.column=x.start.column}x.foldLine=this},this.containsRow=function(x){return x>=this.start.row&&x<=this.end.row},this.walk=function(x,S,w){var U,G,H=0,z=this.folds,j=!0;null==S&&(S=this.end.row,w=this.end.column);for(var X=0;X 0)){var X=U(x,z.start);return 0===j?S&&0!==X?-H-2:H:X>0||0===X&&!S?H:-H-1}}return-H-1},this.add=function(x){var S=!x.isEmpty(),w=this.pointIndex(x.start,S);w<0&&(w=-w-1);var U=this.pointIndex(x.end,S,w);return U<0?U=-U-1:U++,this.ranges.splice(w,U-w,x)},this.addList=function(x){for(var S=[],w=x.length;w--;)S.push.apply(S,this.add(x[w]));return S},this.substractPoint=function(x){var S=this.pointIndex(x);if(S>=0)return this.ranges.splice(S,1)},this.merge=function(){for(var x,S=[],w=this.ranges,G=(w=w.sort((function(x,S){return U(x.start,S.start)})))[0],H=1;H =0},this.containsPoint=function(x){return this.pointIndex(x)>=0},this.rangeAtPoint=function(x){var S=this.pointIndex(x);if(S>=0)return this.ranges[S]},this.clipRows=function(x,S){var w=this.ranges;if(w[0].start.row>S||w[w.length-1].start.row =U);z++);if("insert"==x.action){for(var X=G-U,K=-S.column+w.column;z U);z++)if(q.start.row==U&&q.start.column>=S.column&&(q.start.column==S.column&&this.$bias<=0||(q.start.column+=K,q.start.row+=X)),q.end.row==U&&q.end.column>=S.column){if(q.end.column==S.column&&this.$bias<0)continue;q.end.column==S.column&&K>0&&z q.start.column&&q.end.column==H[z+1].start.column&&(q.end.column-=K),q.end.column+=K,q.end.row+=X}}else for(X=U-G,K=S.column-w.column;z G);z++)q.end.row S.column)&&(q.end.column=S.column,q.end.row=S.row):(q.end.column+=K,q.end.row+=X):q.end.row>G&&(q.end.row+=X),q.start.row S.column)&&(q.start.column=S.column,q.start.row=S.row):(q.start.column+=K,q.start.row+=X):q.start.row>G&&(q.start.row+=X);if(0!=X&&z =x)return G;if(G.end.row>x)return null}return null},this.getNextFoldLine=function(x,S){var w=this.$foldData,U=0;for(S&&(U=w.indexOf(S)),-1==U&&(U=0);U =x)return G}return null},this.getFoldedRowCount=function(x,S){for(var w=this.$foldData,U=S-x+1,G=0;G =S){j =x?U-=S-j:U=0);break}z>=x&&(U-=j>=x?z-j:z-x+1)}return U},this.$addFoldLine=function(x){return this.$foldData.push(x),this.$foldData.sort((function(x,S){return x.start.row-S.start.row})),x},this.addFold=function(x,S){var w,U=this.$foldData,z=!1;x instanceof H?w=x:(w=new H(S,x)).collapseChildren=S.collapseChildren,this.$clipRangeToDocument(w.range);var j=w.start.row,X=w.start.column,K=w.end.row,q=w.end.column,Y=this.getFoldAt(j,X,1),Z=this.getFoldAt(K,q,-1);if(Y&&Z==Y)return Y.addSubFold(w);Y&&!Y.range.isStart(j,X)&&this.removeFold(Y),Z&&!Z.range.isEnd(K,q)&&this.removeFold(Z);var J=this.getFoldsInRange(w.range);J.length>0&&(this.removeFolds(J),J.forEach((function(x){w.addSubFold(x)})));for(var Q=0;Q0&&this.foldAll(x.start.row+1,x.end.row,x.collapseChildren-1),x.subFolds=[]},this.expandFolds=function(x){x.forEach((function(x){this.expandFold(x)}),this)},this.unfold=function(x,S){var w,G;if(null==x?(w=new U(0,0,this.getLength(),0),S=!0):w="number"==typeof x?new U(x,0,x,this.getLine(x).length):"row"in x?U.fromPoints(x,x):x,G=this.getFoldsInRangeList(w),S)this.removeFolds(G);else for(var H=G;H.length;)this.expandFolds(H),H=this.getFoldsInRangeList(w);if(G.length)return G},this.isRowFolded=function(x,S){return!!this.getFoldLine(x,S)},this.getRowFoldEnd=function(x,S){var w=this.getFoldLine(x,S);return w?w.end.row:x},this.getRowFoldStart=function(x,S){var w=this.getFoldLine(x,S);return w?w.start.row:x},this.getFoldDisplayLine=function(x,S,w,U,G){null==U&&(U=x.start.row),null==G&&(G=0),null==S&&(S=x.end.row),null==w&&(w=this.getLine(S).length);var H=this.doc,z="";return x.walk((function(x,S,w,j){if(!(Sq)break}while(H&&X.test(H.type));H=G.stepBackward()}else H=G.getCurrentToken();return K.end.row=G.getCurrentTokenRow(),K.end.column=G.getCurrentTokenColumn()+H.value.length-2,K}},this.foldAll=function(x,S,w){null==w&&(w=1e5);var U=this.foldWidgets;if(U){S=S||this.getLength();for(var G=x=x||0;G =x){G=H.end.row;try{var z=this.addFold("...",H);z&&(z.collapseChildren=w)}catch(x){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(x){if(!this.$foldStyles[x])throw new Error("invalid fold style: "+x+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=x){this.$foldStyle=x,"manual"==x&&this.unfold();var S=this.$foldMode;this.$setFolding(null),this.$setFolding(S)}},this.$setFolding=function(x){this.$foldMode!=x&&(this.$foldMode=x,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),x&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=x.getFoldWidget.bind(x,this,this.$foldStyle),this.getFoldWidgetRange=x.getFoldWidgetRange.bind(x,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(x,S){var w=this.foldWidgets;if(!w||S&&w[x])return{};for(var U,G=x-1;G>=0;){var H=w[G];if(null==H&&(H=w[G]=this.getFoldWidget(G)),"start"==H){var z=this.getFoldWidgetRange(G);if(U||(U=z),z&&z.end.row>=x)break}G--}return{range:-1!==G&&z,firstRange:U}},this.onFoldWidgetClick=function(x,S){var w={children:(S=S.domEvent).shiftKey,all:S.ctrlKey||S.metaKey,siblings:S.altKey};if(!this.$toggleFoldWidget(x,w)){var U=S.target||S.srcElement;U&&/ace_fold-widget/.test(U.className)&&(U.className+=" ace_invalid")}},this.$toggleFoldWidget=function(x,S){if(this.getFoldWidget){var w=this.getFoldWidget(x),U=this.getLine(x),G="end"===w?-1:1,H=this.getFoldAt(x,-1===G?0:U.length,G);if(H)return S.children||S.all?this.removeFold(H):this.expandFold(H),H;var z=this.getFoldWidgetRange(x,!0);if(z&&!z.isMultiLine()&&(H=this.getFoldAt(z.start.row,z.start.column,1))&&z.isEqual(H.range))return this.removeFold(H),H;if(S.siblings){var j=this.getParentFoldRangeData(x);if(j.range)var X=j.range.start.row+1,K=j.range.end.row;this.foldAll(X,K,S.all?1e4:0)}else S.children?(K=z?z.end.row:this.getLength(),this.foldAll(x+1,K,S.all?1e4:0)):z&&(S.all&&(z.collapseChildren=1e4),this.addFold("...",z));return z}},this.toggleFoldWidget=function(x){var S=this.selection.getCursor().row;S=this.getRowFoldStart(S);var w=this.$toggleFoldWidget(S,{});if(!w){var U=this.getParentFoldRangeData(S,!0);if(w=U.range||U.firstRange){S=w.start.row;var G=this.getFoldAt(S,this.getLine(S).length,1);G?this.removeFold(G):this.addFold("...",w)}}},this.updateFoldWidgets=function(x){var S=x.start.row,w=x.end.row-S;if(0===w)this.foldWidgets[S]=null;else if("remove"==x.action)this.foldWidgets.splice(S,w+1,null);else{var U=Array(w+1);U.unshift(S,1),this.foldWidgets.splice.apply(this.foldWidgets,U)}},this.tokenizerUpdateFoldWidgets=function(x){var S=x.data;S.first!=S.last&&this.foldWidgets.length>S.first&&this.foldWidgets.splice(S.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(x,S,w){"use strict";var U=x("../token_iterator").TokenIterator,G=x("../range").Range;S.BracketMatch=function(){this.findMatchingBracket=function(x,S){if(0==x.column)return null;var w=S||this.getLine(x.row).charAt(x.column-1);if(""==w)return null;var U=w.match(/([\(\[\{])|([\)\]\}])/);return U?U[1]?this.$findClosingBracket(U[1],x):this.$findOpeningBracket(U[2],x):null},this.getBracketRange=function(x){var S,w=this.getLine(x.row),U=!0,H=w.charAt(x.column-1),z=H&&H.match(/([\(\[\{])|([\)\]\}])/);if(z||(H=w.charAt(x.column),x={row:x.row,column:x.column+1},z=H&&H.match(/([\(\[\{])|([\)\]\}])/),U=!1),!z)return null;if(z[1]){if(!(j=this.$findClosingBracket(z[1],x)))return null;S=G.fromPoints(x,j),U||(S.end.column++,S.start.column--),S.cursor=S.end}else{var j;if(!(j=this.$findOpeningBracket(z[2],x)))return null;S=G.fromPoints(j,x),U||(S.start.column++,S.end.column--),S.cursor=S.start}return S},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(x,S,w){var G=this.$brackets[x],H=1,z=new U(this,S.row,S.column),j=z.getCurrentToken();if(j||(j=z.stepForward()),j){w||(w=new RegExp("(\\.?"+j.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var X=S.column-z.getCurrentTokenColumn()-2,K=j.value;;){for(;X>=0;){var q=K.charAt(X);if(q==G){if(0==(H-=1))return{row:z.getCurrentTokenRow(),column:X+z.getCurrentTokenColumn()}}else q==x&&(H+=1);X-=1}do{j=z.stepBackward()}while(j&&!w.test(j.type));if(null==j)break;X=(K=j.value).length-1}return null}},this.$findClosingBracket=function(x,S,w){var G=this.$brackets[x],H=1,z=new U(this,S.row,S.column),j=z.getCurrentToken();if(j||(j=z.stepForward()),j){w||(w=new RegExp("(\\.?"+j.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var X=S.column-z.getCurrentTokenColumn();;){for(var K=j.value,q=K.length;Xw&&(this.$docRowCache.splice(w,S),this.$screenRowCache.splice(w,S))},this.$getRowCacheIndex=function(x,S){for(var w=0,U=x.length-1;w<=U;){var G=w+U>>1,H=x[G];if(S>H)w=G+1;else{if(!(S=S);H++);return(w=U[H])?(w.index=H,w.start=G-w.value.length,w):null},this.setUndoManager=function(x){if(this.$undoManager=x,this.$informUndoManager&&this.$informUndoManager.cancel(),x){var S=this;x.addSession(this),this.$syncInformUndoManager=function(){S.$informUndoManager.cancel(),S.mergeUndoDeltas=!1},this.$informUndoManager=G.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?G.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(x){this.setOption("useSoftTabs",x)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(x){this.setOption("tabSize",x)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(x){return this.$useSoftTabs&&x.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(x){this.setOption("navigateWithinSoftTabs",x)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(x){this.setOption("overwrite",x)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(x,S){this.$decorations[x]||(this.$decorations[x]=""),this.$decorations[x]+=" "+S,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(x,S){this.$decorations[x]=(this.$decorations[x]||"").replace(" "+S,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(x){this.$breakpoints=[];for(var S=0;S 0&&(U=!!w.charAt(S-1).match(this.tokenRe)),U||(U=!!w.charAt(S).match(this.tokenRe)),U)var G=this.tokenRe;else G=/^\s+$/.test(w.slice(S-1,S+1))?/\s/:this.nonTokenRe;var H=S;if(H>0){do{H--}while(H>=0&&w.charAt(H).match(G));H++}for(var z=S;z x&&(x=S.screenWidth)})),this.lineWidgetWidth=x},this.$computeWidth=function(x){if(this.$modified||x){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var S=this.doc.getAllLines(),w=this.$rowLengthCache,U=0,G=0,H=this.$foldData[G],z=H?H.start.row:1/0,j=S.length,X=0;X z){if((X=H.end.row+1)>=j)break;z=(H=this.$foldData[G++])?H.start.row:1/0}null==w[X]&&(w[X]=this.$getStringScreenWidth(S[X])[0]),w[X]>U&&(U=w[X])}this.screenWidth=U}},this.getLine=function(x){return this.doc.getLine(x)},this.getLines=function(x,S){return this.doc.getLines(x,S)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(x){return this.doc.getTextRange(x||this.selection.getRange())},this.insert=function(x,S){return this.doc.insert(x,S)},this.remove=function(x){return this.doc.remove(x)},this.removeFullLines=function(x,S){return this.doc.removeFullLines(x,S)},this.undoChanges=function(x,S){if(x.length){this.$fromUndo=!0;for(var w=x.length-1;-1!=w;w--){var U=x[w];"insert"==U.action||"remove"==U.action?this.doc.revertDelta(U):U.folds&&this.addFolds(U.folds)}!S&&this.$undoSelect&&(x.selectionBefore?this.selection.fromJSON(x.selectionBefore):this.selection.setRange(this.$getUndoSelection(x,!0))),this.$fromUndo=!1}},this.redoChanges=function(x,S){if(x.length){this.$fromUndo=!0;for(var w=0;w x.end.column&&(H.start.column+=K),H.end.row==x.end.row&&H.end.column>x.end.column&&(H.end.column+=K)),z&&H.start.row>=x.end.row&&(H.start.row+=z,H.end.row+=z)}if(H.end=this.insert(H.start,U),G.length){var j=x.start,X=H.start,K=(z=X.row-j.row,X.column-j.column);this.addFolds(G.map((function(x){return(x=x.clone()).start.row==j.row&&(x.start.column+=K),x.end.row==j.row&&(x.end.column+=K),x.start.row+=z,x.end.row+=z,x})))}return H},this.indentRows=function(x,S,w){w=w.replace(/\t/g,this.getTabString());for(var U=x;U<=S;U++)this.doc.insertInLine({row:U,column:0},w)},this.outdentRows=function(x){for(var S=x.collapseRows(),w=new q(0,0,0,0),U=this.getTabSize(),G=S.start.row;G<=S.end.row;++G){var H=this.getLine(G);w.start.row=G,w.end.row=G;for(var z=0;z0){var G;if((G=this.getRowFoldEnd(S+w))>this.doc.getLength()-1)return 0;U=G-S}else x=this.$clipRowToDocument(x),U=(S=this.$clipRowToDocument(S))-x+1;var H=new q(x,0,S,Number.MAX_VALUE),z=this.getFoldsInRange(H).map((function(x){return(x=x.clone()).start.row+=U,x.end.row+=U,x})),j=0==w?this.doc.getLines(x,S):this.doc.removeFullLines(x,S);return this.doc.insertFullLines(x+U,j),z.length&&this.addFolds(z),U},this.moveLinesUp=function(x,S){return this.$moveLines(x,S,-1)},this.moveLinesDown=function(x,S){return this.$moveLines(x,S,1)},this.duplicateLines=function(x,S){return this.$moveLines(x,S,0)},this.$clipRowToDocument=function(x){return Math.max(0,Math.min(x,this.doc.getLength()-1))},this.$clipColumnToRow=function(x,S){return S<0?0:Math.min(this.doc.getLine(x).length,S)},this.$clipPositionToDocument=function(x,S){if(S=Math.max(0,S),x<0)x=0,S=0;else{var w=this.doc.getLength();x>=w?(x=w-1,S=this.doc.getLine(w-1).length):S=Math.min(this.doc.getLine(x).length,S)}return{row:x,column:S}},this.$clipRangeToDocument=function(x){x.start.row<0?(x.start.row=0,x.start.column=0):x.start.column=this.$clipColumnToRow(x.start.row,x.start.column);var S=this.doc.getLength()-1;return x.end.row>S?(x.end.row=S,x.end.column=this.doc.getLine(S).length):x.end.column=this.$clipColumnToRow(x.end.row,x.end.column),x},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(x){if(x!=this.$useWrapMode){if(this.$useWrapMode=x,this.$modified=!0,this.$resetRowCache(0),x){var S=this.getLength();this.$wrapData=Array(S),this.$updateWrapData(0,S-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(x,S){this.$wrapLimitRange.min===x&&this.$wrapLimitRange.max===S||(this.$wrapLimitRange={min:x,max:S},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(x,S){var w=this.$wrapLimitRange;w.max<0&&(w={min:S,max:S});var U=this.$constrainWrapLimit(x,w.min,w.max);return U!=this.$wrapLimit&&U>1&&(this.$wrapLimit=U,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(x,S,w){return S&&(x=Math.max(S,x)),w&&(x=Math.min(w,x)),x},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(x){this.setWrapLimitRange(x,x)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(x){var S=this.$useWrapMode,w=x.action,U=x.start,G=x.end,H=U.row,z=G.row,j=z-H,X=null;if(this.$updating=!0,0!=j)if("remove"===w){this[S?"$wrapData":"$rowLengthCache"].splice(H,j);var K=this.$foldData;X=this.getFoldsInRange(x),this.removeFolds(X);var q=0;if(ee=this.getFoldLine(G.row)){ee.addRemoveChars(G.row,G.column,U.column-G.column),ee.shiftRow(-j);var Y=this.getFoldLine(H);Y&&Y!==ee&&(Y.merge(ee),ee=Y),q=K.indexOf(ee)+1}for(;q =G.row&&ee.shiftRow(-j);z=H}else{var Z=Array(j);Z.unshift(H,0);var J=S?this.$wrapData:this.$rowLengthCache;if(J.splice.apply(J,Z),K=this.$foldData,q=0,ee=this.getFoldLine(H)){var Q=ee.range.compareInside(U.row,U.column);0==Q?(ee=ee.split(U.row,U.column))&&(ee.shiftRow(j),ee.addRemoveChars(z,0,G.column-U.column)):-1==Q&&(ee.addRemoveChars(H,0,G.column-U.column),ee.shiftRow(j)),q=K.indexOf(ee)+1}for(;q =H&&ee.shiftRow(j)}}else j=Math.abs(x.start.column-x.end.column),"remove"===w&&(X=this.getFoldsInRange(x),this.removeFolds(X),j=-j),(ee=this.getFoldLine(H))&&ee.addRemoveChars(H,U.column,j);return S&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,S?this.$updateWrapData(H,z):this.$updateRowLengthCache(H,z),X},this.$updateRowLengthCache=function(x,S,w){this.$rowLengthCache[x]=null,this.$rowLengthCache[S]=null},this.$updateWrapData=function(w,U){var G,H,z=this.doc.getAllLines(),j=this.getTabSize(),X=this.$wrapData,K=this.$wrapLimit,q=w;for(U=Math.min(U,z.length-1);q<=U;)(H=this.getFoldLine(q,H))?(G=[],H.walk(function(w,U,H,j){var X;if(null!=w){(X=this.$getDisplayTokens(w,G.length))[0]=x;for(var K=1;K =4352&&x<=4447||x>=4515&&x<=4519||x>=4602&&x<=4607||x>=9001&&x<=9002||x>=11904&&x<=11929||x>=11931&&x<=12019||x>=12032&&x<=12245||x>=12272&&x<=12283||x>=12288&&x<=12350||x>=12353&&x<=12438||x>=12441&&x<=12543||x>=12549&&x<=12589||x>=12593&&x<=12686||x>=12688&&x<=12730||x>=12736&&x<=12771||x>=12784&&x<=12830||x>=12832&&x<=12871||x>=12880&&x<=13054||x>=13056&&x<=19903||x>=19968&&x<=42124||x>=42128&&x<=42182||x>=43360&&x<=43388||x>=44032&&x<=55203||x>=55216&&x<=55238||x>=55243&&x<=55291||x>=63744&&x<=64255||x>=65040&&x<=65049||x>=65072&&x<=65106||x>=65108&&x<=65126||x>=65128&&x<=65131||x>=65281&&x<=65376||x>=65504&&x<=65510)}this.$computeWrapSplits=function(w,U,G){if(0==w.length)return[];var H=[],z=w.length,j=0,X=0,K=this.$wrapAsCode,q=this.$indentedSoftWrap,Y=U<=Math.max(2*G,8)||!1===q?0:Math.floor(U/2);function d(x){for(var S=x-j,U=j;U U-Z;){var J=j+U-Z;if(w[J-1]>=10&&w[J]>=10)d(J);else if(w[J]!=x&&w[J]!=S){for(var Q=Math.max(J-(U-(U>>2)),j-1);J>Q&&w[J] Q&&w[J] Q&&9==w[J];)J--}else for(;J>Q&&w[J]<10;)J--;J>Q?d(++J):(2==w[J=j+U]&&J--,d(J-Z))}else{for(;J!=j-1&&w[J]!=x;J--);if(J>j){d(J);continue}for(J=j+U;J 39&&H<48||H>57&&H<64?U.push(9):H>=4352&&n(H)?U.push(1,2):U.push(1)}return U},this.$getStringScreenWidth=function(x,S,w){if(0==S)return[0,0];var U,G;for(null==S&&(S=1/0),w=w||0,G=0;G =4352&&n(U)?w+=2:w+=1,!(w>S));G++);return[w,G]},this.lineWidgets=null,this.getRowLength=function(x){if(this.lineWidgets)var S=this.lineWidgets[x]&&this.lineWidgets[x].rowCount||0;else S=0;return this.$useWrapMode&&this.$wrapData[x]?this.$wrapData[x].length+1+S:1+S},this.getRowLineCount=function(x){return this.$useWrapMode&&this.$wrapData[x]?this.$wrapData[x].length+1:1},this.getRowWrapIndent=function(x){if(this.$useWrapMode){var S=this.screenToDocumentPosition(x,Number.MAX_VALUE),w=this.$wrapData[S.row];return w.length&&w[0] =0){j=K[q],H=this.$docRowCache[q];var Z=x>K[Y-1]}else Z=!Y;for(var J=this.getLength()-1,Q=this.getNextFoldLine(H),ee=Q?Q.start.row:1/0;j<=x&&!(j+(X=this.getRowLength(H))>x||H>=J);)j+=X,++H>ee&&(H=Q.end.row+1,ee=(Q=this.getNextFoldLine(H,Q))?Q.start.row:1/0),Z&&(this.$docRowCache.push(H),this.$screenRowCache.push(j));if(Q&&Q.start.row<=H)U=this.getFoldDisplayLine(Q),H=Q.start.row;else{if(j+X<=x||H>J)return{row:J,column:this.getLine(J).length};U=this.getLine(H),Q=null}var te=0,ne=Math.floor(x-j);if(this.$useWrapMode){var ie=this.$wrapData[H];ie&&(G=ie[ne],ne>0&&ie.length&&(te=ie.indent,z=ie[ne-1]||ie[ie.length-1],U=U.substring(z)))}return void 0!==w&&this.$bidiHandler.isBidiRow(j+ne,H,ne)&&(S=this.$bidiHandler.offsetToCol(w)),z+=this.$getStringScreenWidth(U,S-te)[1],this.$useWrapMode&&z>=G&&(z=G-1),Q?Q.idxToPosition(z):{row:H,column:z}},this.documentToScreenPosition=function(x,S){if(void 0===S)var w=this.$clipPositionToDocument(x.row,x.column);else w=this.$clipPositionToDocument(x,S);x=w.row,S=w.column;var U,G=0,H=null;(U=this.getFoldAt(x,S,1))&&(x=U.start.row,S=U.start.column);var z,j=0,X=this.$docRowCache,K=this.$getRowCacheIndex(X,x),q=X.length;if(q&&K>=0){j=X[K],G=this.$screenRowCache[K];var Y=x>X[q-1]}else Y=!q;for(var Z=this.getNextFoldLine(j),J=Z?Z.start.row:1/0;j =J){if((z=Z.end.row+1)>x)break;J=(Z=this.getNextFoldLine(z,Z))?Z.start.row:1/0}else z=j+1;G+=this.getRowLength(j),j=z,Y&&(this.$docRowCache.push(j),this.$screenRowCache.push(G))}var Q="";Z&&j>=J?(Q=this.getFoldDisplayLine(Z,x,S),H=Z.start.row):(Q=this.getLine(x).substring(0,S),H=x);var ee=0;if(this.$useWrapMode){var te=this.$wrapData[H];if(te){for(var ne=0;Q.length>=te[ne];)G++,ne++;Q=Q.substring(te[ne-1]||0,Q.length),ee=ne>0?te.indent:0}}return{row:G,column:ee+this.$getStringScreenWidth(Q)[0]}},this.documentToScreenColumn=function(x,S){return this.documentToScreenPosition(x,S).column},this.documentToScreenRow=function(x,S){return this.documentToScreenPosition(x,S).row},this.getScreenLength=function(){var x=0,S=null;if(this.$useWrapMode)for(var w=this.$wrapData.length,U=0,G=(j=0,(S=this.$foldData[j++])?S.start.row:1/0);U G&&(U=S.end.row+1,G=(S=this.$foldData[j++])?S.start.row:1/0)}else{x=this.getLength();for(var z=this.$foldData,j=0;j w);H++);return[U,H]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(m.prototype),x("./edit_session/folding").Folding.call(m.prototype),x("./edit_session/bracket_match").BracketMatch.call(m.prototype),z.defineOptions(m.prototype,"session",{wrap:{set:function(x){if(x&&"off"!=x?"free"==x?x=!0:"printMargin"==x?x=-1:"string"==typeof x&&(x=parseInt(x,10)||!1):x=!1,this.$wrap!=x)if(this.$wrap=x,x){var S="number"==typeof x?x:null;this.setWrapLimitRange(S,S),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(x){(x="auto"==x?"text"!=this.$mode.type:"text"!=x)!=this.$wrapAsCode&&(this.$wrapAsCode=x,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(x){this.$useWorker=x,this.$stopWorker(),x&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(x){(x=parseInt(x))>0&&this.$tabSize!==x&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=x,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(x){this.setFoldStyle(x)},handlesSet:!0},overwrite:{set:function(x){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(x){this.doc.setNewLineMode(x)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(x){this.setMode(x)},get:function(){return this.$modeId},handlesSet:!0}}),S.EditSession=m})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(x,S,w){"use strict";var U=x("./lib/lang"),G=x("./lib/oop"),H=x("./range").Range,s=function(){this.$options={}};(function(){this.set=function(x){return G.mixin(this.$options,x),this},this.getOptions=function(){return U.copyObject(this.$options)},this.setOptions=function(x){this.$options=x},this.find=function(x){var S=this.$options,w=this.$matchIterator(x,S);if(!w)return!1;var U=null;return w.forEach((function(x,w,G,z){return U=new H(x,w,G,z),!(w==z&&S.start&&S.start.start&&0!=S.skipCurrent&&U.isEqual(S.start)&&(U=null,1))})),U},this.findAll=function(x){var S=this.$options;if(!S.needle)return[];this.$assembleRegExp(S);var w=S.range,G=w?x.getLines(w.start.row,w.end.row):x.doc.getAllLines(),z=[],j=S.re;if(S.$isMultiLine){var X,K=j.length,q=G.length-K;e:for(var Y=j.offset||0;Y<=q;Y++){for(var Z=0;Z ee||(z.push(X=new H(Y,ee,Y+K-1,te)),K>2&&(Y=Y+K-2))}}else for(var ne=0;ne ae&&z[Z].end.row==w.end.row;)Z--;for(z=z.slice(ne,Z+1),ne=0,Z=z.length;ne =j;w--)if(h(w,Number.MAX_VALUE,x))return;if(0!=S.wrap)for(w=X,j=z.row;w>=j;w--)if(h(w,Number.MAX_VALUE,x))return}};else l=function(x){var w=z.row;if(!h(w,z.column,x)){for(w+=1;w<=X;w++)if(h(w,0,x))return;if(0!=S.wrap)for(w=j,X=z.row;w<=X;w++)if(h(w,0,x))return}};if(S.$isMultiLine)var K=w.length,h=function(S,G,H){var z=U?S-K+1:S;if(!(z<0)){var j=x.getLine(z),X=j.search(w[0]);if(!(!U&&X G))return!!H(z,X,z+K-1,Y)||void 0}}};else h=U?function(S,U,G){var H,z=x.getLine(S),j=[],X=0;for(w.lastIndex=0;H=w.exec(z);){var K=H[0].length;if(X=H.index,!K){if(X>=z.length)break;w.lastIndex=X+=1}if(H.index+K>U)break;j.push(H.index,K)}for(var q=j.length-1;q>=0;q-=2){var Y=j[q-1];if(G(S,Y,S,Y+(K=j[q])))return!0}}:function(S,U,G){var H,z,j=x.getLine(S);for(w.lastIndex=U;z=w.exec(j);){var X=z[0].length;if(G(S,H=z.index,S,H+X))return!0;if(!X&&(w.lastIndex=H+=1,H>=j.length))return!1}};return{forEach:l}}}).call(s.prototype),S.Search=s})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(x,S,w){"use strict";var U=x("../lib/keys"),G=x("../lib/useragent"),H=U.KEY_MODS;function s(x,S){this.platform=S||(G.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(x),this.$singleCommand=!0}function a(x,S){s.call(this,x,S),this.$singleCommand=!1}a.prototype=s.prototype,function(){function e(x){return"object"==typeof x&&x.bindKey&&x.bindKey.position||(x.isDefault?-100:0)}this.addCommand=function(x){this.commands[x.name]&&this.removeCommand(x),this.commands[x.name]=x,x.bindKey&&this._buildKeyHash(x)},this.removeCommand=function(x,S){var w=x&&("string"==typeof x?x:x.name);x=this.commands[w],S||delete this.commands[w];var U=this.commandKeyBinding;for(var G in U){var H=U[G];if(H==x)delete U[G];else if(Array.isArray(H)){var z=H.indexOf(x);-1!=z&&(H.splice(z,1),1==H.length&&(U[G]=H[0]))}}},this.bindKey=function(x,S,w){if("object"==typeof x&&x&&(null==w&&(w=x.position),x=x[this.platform]),x)return"function"==typeof S?this.addCommand({exec:S,bindKey:x,name:S.name||x}):void x.split("|").forEach((function(x){var U="";if(-1!=x.indexOf(" ")){var G=x.split(/\s+/);x=G.pop(),G.forEach((function(x){var S=this.parseKeys(x),w=H[S.hashId]+S.key;U+=(U?" ":"")+w,this._addCommandToBinding(U,"chainKeys")}),this),U+=" "}var z=this.parseKeys(x),j=H[z.hashId]+z.key;this._addCommandToBinding(U+j,S,w)}),this)},this._addCommandToBinding=function(x,S,w){var U,G=this.commandKeyBinding;if(S)if(!G[x]||this.$singleCommand)G[x]=S;else{Array.isArray(G[x])?-1!=(U=G[x].indexOf(S))&&G[x].splice(U,1):G[x]=[G[x]],"number"!=typeof w&&(w=e(S));var H=G[x];for(U=0;U w);U++);H.splice(U,0,S)}else delete G[x]},this.addCommands=function(x){x&&Object.keys(x).forEach((function(S){var w=x[S];if(w){if("string"==typeof w)return this.bindKey(w,S);"function"==typeof w&&(w={exec:w}),"object"==typeof w&&(w.name||(w.name=S),this.addCommand(w))}}),this)},this.removeCommands=function(x){Object.keys(x).forEach((function(S){this.removeCommand(x[S])}),this)},this.bindKeys=function(x){Object.keys(x).forEach((function(S){this.bindKey(S,x[S])}),this)},this._buildKeyHash=function(x){this.bindKey(x.bindKey,x)},this.parseKeys=function(x){var S=x.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(x){return x})),w=S.pop(),G=U[w];if(U.FUNCTION_KEYS[G])w=U.FUNCTION_KEYS[G].toLowerCase();else{if(!S.length)return{key:w,hashId:-1};if(1==S.length&&"shift"==S[0])return{key:w.toUpperCase(),hashId:-1}}for(var H=0,z=S.length;z--;){var j=U.KEY_MODS[S[z]];if(null==j)return"undefined"!=typeof console&&console.error("invalid modifier "+S[z]+" in "+x),!1;H|=j}return{key:w,hashId:H}},this.findKeyCommand=function(x,S){var w=H[x]+S;return this.commandKeyBinding[w]},this.handleKeyboard=function(x,S,w,U){if(!(U<0)){var G=H[S]+w,z=this.commandKeyBinding[G];return x.$keyChain&&(x.$keyChain+=" "+G,z=this.commandKeyBinding[x.$keyChain]||z),!z||"chainKeys"!=z&&"chainKeys"!=z[z.length-1]?(x.$keyChain&&(S&&4!=S||1!=w.length?(-1==S||U>0)&&(x.$keyChain=""):x.$keyChain=x.$keyChain.slice(0,-G.length-1)),{command:z}):(x.$keyChain=x.$keyChain||G,{command:"null"})}},this.getStatusText=function(x,S){return S.$keyChain||""}}.call(s.prototype),S.HashHandler=s,S.MultiHashHandler=a})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(x,S,w){"use strict";var U=x("../lib/oop"),G=x("../keyboard/hash_handler").MultiHashHandler,H=x("../lib/event_emitter").EventEmitter,s=function(x,S){G.call(this,S,x),this.byName=this.commands,this.setDefaultHandler("exec",(function(x){return x.command.exec(x.editor,x.args||{})}))};U.inherits(s,G),function(){U.implement(this,H),this.exec=function(x,S,w){if(Array.isArray(x)){for(var U=x.length;U--;)if(this.exec(x[U],S,w))return!0;return!1}if("string"==typeof x&&(x=this.commands[x]),!x)return!1;if(S&&S.$readOnly&&!x.readOnly)return!1;if(0!=this.$checkCommandState&&x.isAvailable&&!x.isAvailable(S))return!1;var G={editor:S,command:x,args:w};return G.returnValue=this._emit("exec",G),this._signal("afterExec",G),!1!==G.returnValue},this.toggleRecording=function(x){if(!this.$inReplay)return x&&x._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(x){this.macro.push([x.command,x.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(x){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(x);try{this.$inReplay=!0,this.macro.forEach((function(S){"string"==typeof S?this.exec(S,x):this.exec(S[0],x,S[1])}),this)}finally{this.$inReplay=!1}}},this.trimMacro=function(x){return x.map((function(x){return"string"!=typeof x[0]&&(x[0]=x[0].name),x[1]||(x=x[0]),x}))}}.call(s.prototype),S.CommandManager=s})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(x,S,w){"use strict";var U=x("../lib/lang"),G=x("../config"),H=x("../range").Range;function s(x,S){return{win:x,mac:S}}S.commands=[{name:"showSettingsMenu",bindKey:s("Ctrl-,","Command-,"),exec:function(x){G.loadModule("ace/ext/settings_menu",(function(S){S.init(x),x.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",bindKey:s("Alt-E","F4"),exec:function(x){G.loadModule("./ext/error_marker",(function(S){S.showErrorMarker(x,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(x){G.loadModule("./ext/error_marker",(function(S){S.showErrorMarker(x,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(x){x.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(x){x.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(x,S){"number"!=typeof S||isNaN(S)||x.gotoLine(S),x.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(x){x.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(x){x.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:s("F2","F2"),exec:function(x){x.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:s("Alt-F2","Alt-F2"),exec:function(x){x.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(x){x.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(x){x.session.foldAll(),x.session.unfold(x.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(x){x.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(x){x.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(x){x.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(x){x.selection.isEmpty()?x.selection.selectWord():x.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(x){x.selection.isEmpty()?x.selection.selectWord():x.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(x){G.loadModule("ace/ext/searchbox",(function(S){S.Search(x)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(x){x.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(x){x.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(x){x.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(x){x.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(x,S){x.navigateUp(S.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(x){x.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(x){x.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(x){x.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(x,S){x.navigateDown(S.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(x){x.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(x){x.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(x){x.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(x){x.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(x){x.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(x,S){x.navigateLeft(S.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(x){x.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(x){x.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(x){x.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(x){x.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(x){x.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(x,S){x.navigateRight(S.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(x){x.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(x){x.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(x){x.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(x){x.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(x){x.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(x){x.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(x){x.renderer.scrollBy(0,-2*x.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(x){x.renderer.scrollBy(0,2*x.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(x){x.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(x){x.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(x){x.commands.toggleRecording(x)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(x){x.commands.replay(x)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(x){x.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(x){x.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(x){x.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(x){},readOnly:!0},{name:"cut",description:"Cut",exec:function(x){var S=x.$copyWithEmptySelection&&x.selection.isEmpty()?x.selection.getLineRange():x.selection.getRange();x._emit("cut",S),S.isEmpty()||x.session.remove(S),x.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(x,S){x.$handlePaste(S)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(x){x.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(x){x.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(x){x.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(x){x.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(x){x.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(x){x.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(x){x.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(x){G.loadModule("ace/ext/searchbox",(function(S){S.Search(x,!0)}))}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(x){x.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(x){x.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(x){x.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(x){x.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(x){x.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(x){x.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(x){x.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(x){x.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(x){if(!x.selection.isEmpty())return!1;x.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(x){x.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(x){x.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(x){var S=x.selection.getRange();S.start.column=0,x.session.remove(S)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(x){var S=x.selection.getRange();S.end.column=Number.MAX_VALUE,x.session.remove(S)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(x){x.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(x){x.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(x){x.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(x){x.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(x){x.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(x){x.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(x,S){x.insert(S)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(x,S){x.insert(U.stringRepeat(S.text||"",S.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(x){x.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(x){x.transposeLetters()},multiSelectAction:function(x){x.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(x){x.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(x){x.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(x){var S=x.selection.getRange();S.start.column=S.end.column=0,S.end.row++,x.selection.setRange(S,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(x){for(var S=x.selection.isBackwards(),w=S?x.selection.getSelectionLead():x.selection.getSelectionAnchor(),G=S?x.selection.getSelectionAnchor():x.selection.getSelectionLead(),z=x.session.doc.getLine(w.row).length,j=x.session.doc.getTextRange(x.selection.getRange()).replace(/\n\s*/," ").length,X=x.session.doc.getLine(w.row),K=w.row+1;K<=G.row+1;K++){var q=U.stringTrimLeft(U.stringTrimRight(x.session.doc.getLine(K)));0!==q.length&&(q=" "+q),X+=q}G.row+1 0?(x.selection.moveCursorTo(w.row,w.column),x.selection.selectTo(w.row,w.column+j)):(z=x.session.doc.getLine(w.row).length>z?z+1:z,x.selection.moveCursorTo(w.row,z))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(x){var S=x.session.doc.getLength()-1,w=x.session.doc.getLine(S).length,U=x.selection.rangeList.ranges,G=[];U.length<1&&(U=[x.selection.getRange()]);for(var z=0;z =G.lastRow||U.end.row<=G.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==w&&this.renderer.animateScrolling(this.curOp.scrollTop)}var H=this.selection.toJSON();this.curOp.selectionAfter=H,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(H),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(x){if(this.$mergeUndoDeltas){var S=this.prevOp,w=this.$mergeableCommands,U=S.command&&x.command.name==S.command.name;if("insertstring"==x.command.name){var G=x.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),U=U&&this.mergeNextCommand&&(!/\s/.test(G)||/\s/.test(S.args)),this.mergeNextCommand=!0}else U=U&&-1!==w.indexOf(x.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(U=!1),U?this.session.mergeUndoDeltas=!0:-1!==w.indexOf(x.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(x,S){if(x&&"string"==typeof x&&"ace"!=x){this.$keybindingId=x;var w=this;ne.loadModule(["keybinding",x],(function(U){w.$keybindingId==x&&w.keyBinding.setKeyboardHandler(U&&U.handler),S&&S()}))}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(x),S&&S()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(x){if(this.session!=x){this.curOp&&this.endOperation(),this.curOp={};var S=this.session;if(S){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var w=this.session.getSelection();w.off("changeCursor",this.$onCursorChange),w.off("changeSelection",this.$onSelectionChange)}this.session=x,x?(this.$onDocumentChange=this.onDocumentChange.bind(this),x.on("change",this.$onDocumentChange),this.renderer.setSession(x),this.$onChangeMode=this.onChangeMode.bind(this),x.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),x.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),x.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),x.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),x.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),x.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=x.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(x)),this._signal("changeSession",{session:x,oldSession:S}),this.curOp=null,S&&S._signal("changeEditor",{oldEditor:this}),x&&x._signal("changeEditor",{editor:this}),x&&x.bgTokenizer&&x.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(x,S){return this.session.doc.setValue(x),S?1==S?this.navigateFileEnd():-1==S&&this.navigateFileStart():this.selectAll(),x},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(x){this.renderer.onResize(x)},this.setTheme=function(x,S){this.renderer.setTheme(x,S)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(x){this.renderer.setStyle(x)},this.unsetStyle=function(x){this.renderer.unsetStyle(x)},this.getFontSize=function(){return this.getOption("fontSize")||G.computedStyle(this.container).fontSize},this.setFontSize=function(x){this.setOption("fontSize",x)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var x=this;this.$highlightPending=!0,setTimeout((function(){x.$highlightPending=!1;var S=x.session;if(S&&S.bgTokenizer){var w=S.findMatchingBracket(x.getCursorPosition());if(w)var U=new J(w.row,w.column,w.row,w.column+1);else S.$mode.getMatching&&(U=S.$mode.getMatching(x.session));U&&(S.$bracketHighlight=S.addMarker(U,"ace_bracket","text"))}}),50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var x=this;this.$highlightTagPending=!0,setTimeout((function(){x.$highlightTagPending=!1;var S=x.session;if(S&&S.bgTokenizer){var w=x.getCursorPosition(),U=new ie(x.session,w.row,w.column),G=U.getCurrentToken();if(!G||!/\b(?:tag-open|tag-name)/.test(G.type))return S.removeMarker(S.$tagHighlight),void(S.$tagHighlight=null);if(-1==G.type.indexOf("tag-open")||(G=U.stepForward())){var H=G.value,z=0,j=U.stepBackward();if("<"==j.value)do{j=G,(G=U.stepForward())&&G.value===H&&-1!==G.type.indexOf("tag-name")&&("<"===j.value?z++:""===j.value&&z--)}while(G&&z>=0);else{do{G=j,j=U.stepBackward(),G&&G.value===H&&-1!==G.type.indexOf("tag-name")&&("<"===j.value?z++:""===j.value&&z--)}while(j&&z<=0);U.stepForward()}if(!G)return S.removeMarker(S.$tagHighlight),void(S.$tagHighlight=null);var X=U.getCurrentTokenRow(),K=U.getCurrentTokenColumn(),q=new J(X,K,X,K+G.value.length),Y=S.$backMarkers[S.$tagHighlight];S.$tagHighlight&&null!=Y&&0!==q.compareRange(Y.range)&&(S.removeMarker(S.$tagHighlight),S.$tagHighlight=null),S.$tagHighlight||(S.$tagHighlight=S.addMarker(q,"ace_bracket","text"))}}}),50)}},this.focus=function(){var x=this;setTimeout((function(){x.isFocused()||x.textInput.focus()})),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(x){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",x))},this.onBlur=function(x){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",x))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(x){var S=this.session.$useWrapMode,w=x.start.row==x.end.row?x.end.row:1/0;this.renderer.updateLines(x.start.row,w,S),this._signal("change",x),this.$cursorChange(),this.$updateHighlightActiveLine()},this.onTokenizerUpdate=function(x){var S=x.data;this.renderer.updateLines(S.first,S.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var x,S=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(x=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(x=!1),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(x=!1)),S.$highlightLineMarker&&!x)S.removeMarker(S.$highlightLineMarker.id),S.$highlightLineMarker=null;else if(!S.$highlightLineMarker&&x){var w=new J(x.row,x.column,x.row,1/0);w.id=S.addMarker(w,"ace_active-line","screenLine"),S.$highlightLineMarker=w}else x&&(S.$highlightLineMarker.start.row=x.row,S.$highlightLineMarker.end.row=x.row,S.$highlightLineMarker.start.column=x.column,S._signal("changeBackMarker"))},this.onSelectionChange=function(x){var S=this.session;if(S.$selectionMarker&&S.removeMarker(S.$selectionMarker),S.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var w=this.selection.getRange(),U=this.getSelectionStyle();S.$selectionMarker=S.addMarker(w,"ace_selection",U)}var G=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(G),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var x=this.session,S=this.getSelectionRange();if(!S.isEmpty()&&!S.isMultiLine()){var w=S.start.column,U=S.end.column,G=x.getLine(S.start.row),H=G.substring(w,U);if(!(H.length>5e3)&&/[\w\d]/.test(H)){var z=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:H}),j=G.substring(w-1,U+1);if(z.test(j))return z}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(x){this.renderer.updateText(),this._emit("changeMode",x)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var x=this.getSelectedText(),S=this.session.doc.getNewLineCharacter(),w=!1;if(!x&&this.$copyWithEmptySelection){w=!0;for(var U=this.selection.getAllRanges(),G=0;G j.search(/\S|$/)){var X=j.substr(G.column).search(/\S|$/);w.doc.removeInLine(G.row,G.column,G.column+X)}}this.clearSelection();var K=G.column,q=w.getState(G.row),Y=(j=w.getLine(G.row),U.checkOutdent(q,j,x));if(w.insert(G,x),H&&H.selection&&(2==H.selection.length?this.selection.setSelectionRange(new J(G.row,K+H.selection[0],G.row,K+H.selection[1])):this.selection.setSelectionRange(new J(G.row+H.selection[0],H.selection[1],G.row+H.selection[2],H.selection[3]))),w.getDocument().isNewLine(x)){var Z=U.getNextLineIndent(q,j.slice(0,G.column),w.getTabString());w.insert({row:G.row+1,column:0},Z)}Y&&U.autoOutdent(q,w,G.row)},this.onTextInput=function(x,S){if(!S)return this.keyBinding.onTextInput(x);this.startOperation({command:{name:"insertstring"}});var w=this.applyComposition.bind(this,x,S);this.selection.rangeCount?this.forEachSelection(w):w(),this.endOperation()},this.applyComposition=function(x,S){var w;(S.extendLeft||S.extendRight)&&((w=this.selection.getRange()).start.column-=S.extendLeft,w.end.column+=S.extendRight,this.selection.setRange(w),x||w.isEmpty()||this.remove()),!x&&this.selection.isEmpty()||this.insert(x,!0),(S.restoreStart||S.restoreEnd)&&((w=this.selection.getRange()).start.column-=S.restoreStart,w.end.column-=S.restoreEnd,this.selection.setRange(w))},this.onCommandKey=function(x,S,w){return this.keyBinding.onCommandKey(x,S,w)},this.setOverwrite=function(x){this.session.setOverwrite(x)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(x){this.setOption("scrollSpeed",x)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(x){this.setOption("dragDelay",x)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(x){this.setOption("selectionStyle",x)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(x){this.setOption("highlightActiveLine",x)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(x){this.setOption("highlightGutterLine",x)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(x){this.setOption("highlightSelectedWord",x)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(x){this.renderer.setAnimatedScroll(x)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(x){this.renderer.setShowInvisibles(x)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(x){this.renderer.setDisplayIndentGuides(x)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(x){this.renderer.setShowPrintMargin(x)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(x){this.renderer.setPrintMarginColumn(x)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(x){this.setOption("readOnly",x)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(x){this.setOption("behavioursEnabled",x)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(x){this.setOption("wrapBehavioursEnabled",x)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(x){this.setOption("showFoldWidgets",x)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(x){this.setOption("fadeFoldWidgets",x)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(x){this.selection.isEmpty()&&("left"==x?this.selection.selectLeft():this.selection.selectRight());var S=this.getSelectionRange();if(this.getBehavioursEnabled()){var w=this.session,U=w.getState(S.start.row),G=w.getMode().transformAction(U,"deletion",this,w,S);if(0===S.end.column){var H=w.getTextRange(S);if("\n"==H[H.length-1]){var z=w.getLine(S.end.row);/^\s+$/.test(z)&&(S.end.column=z.length)}}G&&(S=G)}this.session.remove(S),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var x=this.getSelectionRange();x.start.column==x.end.column&&x.start.row==x.end.row&&(x.end.column=0,x.end.row++),this.session.remove(x),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var x=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(x)},this.transposeLetters=function(){if(this.selection.isEmpty()){var x=this.getCursorPosition(),S=x.column;if(0!==S){var w,U,G=this.session.getLine(x.row);S S.toLowerCase()?1:0}));var G=new J(0,0,0,0);for(U=x.first;U<=x.last;U++){var H=S.getLine(U);G.start.row=U,G.end.row=U,G.end.column=H.length,S.replace(G,w[U-x.first])}},this.toggleCommentLines=function(){var x=this.session.getState(this.getCursorPosition().row),S=this.$getSelectedRows();this.session.getMode().toggleCommentLines(x,this.session,S.first,S.last)},this.toggleBlockComment=function(){var x=this.getCursorPosition(),S=this.session.getState(x.row),w=this.getSelectionRange();this.session.getMode().toggleBlockComment(S,this.session,w,x)},this.getNumberAt=function(x,S){var w=/[\-]?[0-9]+(?:\.[0-9]+)?/g;w.lastIndex=0;for(var U=this.session.getLine(x);w.lastIndex =S)return{value:G[0],start:G.index,end:G.index+G[0].length}}return null},this.modifyNumber=function(x){var S=this.selection.getCursor().row,w=this.selection.getCursor().column,U=new J(S,w-1,S,w),G=this.session.getTextRange(U);if(!isNaN(parseFloat(G))&&isFinite(G)){var H=this.getNumberAt(S,w);if(H){var z=H.value.indexOf(".")>=0?H.start+H.value.indexOf(".")+1:H.end,j=H.start+H.value.length-z,X=parseFloat(H.value);X*=Math.pow(10,j),z!==H.end&&w=j&&z<=X&&(w=S,K.selection.clearSelection(),K.moveCursorTo(x,j+U),K.selection.selectTo(x,X+U)),j=X}));for(var q,Y=this.$toggleWordPairs,Z=0;Z J+1)break;J=Q.last}for(q--,j=this.session.$moveLines(Z,J,S?0:x),S&&-1==x&&(Y=q+1);Y<=q;)z[Y].moveBy(j,0),Y++;S||(j=0),X+=j}G.fromOrientedRange(G.ranges[0]),G.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(x){return x=(x||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(x.start.row),last:this.session.getRowFoldEnd(x.end.row)}},this.onCompositionStart=function(x){this.renderer.showComposition(x)},this.onCompositionUpdate=function(x){this.renderer.setCompositionText(x)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(x){return x>=this.getFirstVisibleRow()&&x<=this.getLastVisibleRow()},this.isRowFullyVisible=function(x){return x>=this.renderer.getFirstFullyVisibleRow()&&x<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(x,S){var w=this.renderer,U=this.renderer.layerConfig,G=x*Math.floor(U.height/U.lineHeight);!0===S?this.selection.$moveSelection((function(){this.moveCursorBy(G,0)})):!1===S&&(this.selection.moveCursorBy(G,0),this.selection.clearSelection());var H=w.scrollTop;w.scrollBy(0,G*U.lineHeight),null!=S&&w.scrollCursorIntoView(null,.5),w.animateScrolling(H)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(x){this.renderer.scrollToRow(x)},this.scrollToLine=function(x,S,w,U){this.renderer.scrollToLine(x,S,w,U)},this.centerSelection=function(){var x=this.getSelectionRange(),S={row:Math.floor(x.start.row+(x.end.row-x.start.row)/2),column:Math.floor(x.start.column+(x.end.column-x.start.column)/2)};this.renderer.alignCursor(S,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(x,S){this.selection.moveCursorTo(x,S)},this.moveCursorToPosition=function(x){this.selection.moveCursorToPosition(x)},this.jumpToMatching=function(x,S){var w=this.getCursorPosition(),U=new ie(this.session,w.row,w.column),G=U.getCurrentToken(),H=G||U.stepForward();if(H){var z,j,X=!1,K={},q=w.column-H.start,Y={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(H.value.match(/[{}()\[\]]/g)){for(;q =0;--H)this.$tryReplace(w[H],x)&&U++;return this.selection.setSelectionRange(G),U},this.$tryReplace=function(x,S){var w=this.session.getTextRange(x);return null!==(S=this.$search.replace(w,S))?(x.end=this.session.replace(x,S),x):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(x,S,w){S||(S={}),"string"==typeof x||x instanceof RegExp?S.needle=x:"object"==typeof x&&U.mixin(S,x);var G=this.selection.getRange();null==S.needle&&((x=this.session.getTextRange(G)||this.$search.$options.needle)||(G=this.session.getWordRange(G.start.row,G.start.column),x=this.session.getTextRange(G)),this.$search.set({needle:x})),this.$search.set(S),S.start||this.$search.set({start:G});var H=this.$search.find(this.session);return S.preventScroll?H:H?(this.revealRange(H,w),H):(S.backwards?G.start=G.end:G.end=G.start,void this.selection.setRange(G))},this.findNext=function(x,S){this.find({skipCurrent:!0,backwards:!1},x,S)},this.findPrevious=function(x,S){this.find(x,{skipCurrent:!0,backwards:!0},S)},this.revealRange=function(x,S){this.session.unfold(x),this.selection.setSelectionRange(x);var w=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(x.start,x.end,.5),!1!==S&&this.renderer.animateScrolling(w)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(x){if(x){var S,w=this,U=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var G=this.$scrollAnchor;G.style.cssText="position:absolute",this.container.insertBefore(G,this.container.firstChild);var H=this.on("changeSelection",(function(){U=!0})),z=this.renderer.on("beforeRender",(function(){U&&(S=w.renderer.container.getBoundingClientRect())})),j=this.renderer.on("afterRender",(function(){if(U&&S&&(w.isFocused()||w.searchBox&&w.searchBox.isFocused())){var x=w.renderer,H=x.$cursorLayer.$pixelPos,z=x.layerConfig,j=H.top-z.offset;null!=(U=H.top>=0&&j+S.top<0||!(H.top window.innerHeight)&&null)&&(G.style.top=j+"px",G.style.left=H.left+"px",G.style.height=z.lineHeight+"px",G.scrollIntoView(U)),U=S=null}}));this.setAutoScrollEditorIntoView=function(x){x||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",H),this.renderer.off("afterRender",j),this.renderer.off("beforeRender",z))}}},this.$resetCursorStyle=function(){var x=this.$cursorStyle||"ace",S=this.renderer.$cursorLayer;S&&(S.setSmoothBlinking(/smooth/.test(x)),S.isBlinking=!this.$readOnly&&"wide"!=x,G.setCssClass(S.element,"ace_slim-cursors",/slim/.test(x)))},this.prompt=function(x,S,w){var U=this;ne.loadModule("./ext/prompt",(function(G){G.prompt(U,x,S,w)}))}}.call(C.prototype),ne.defineOptions(C.prototype,"editor",{selectionStyle:{set:function(x){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:x})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(x){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(x){this.textInput.setReadOnly(x),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(x){this.textInput.setCopyWithEmptySelection(x)},initialValue:!1},cursorStyle:{set:function(x){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(x){this.setAutoScrollEditorIntoView(x)}},keyboardHandler:{set:function(x){this.setKeyboardHandler(x)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(x){this.session.setValue(x)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(x){this.setSession(x)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(x){this.renderer.$gutterLayer.setShowLineNumbers(x),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),x&&this.$relativeLineNumbers?oe.attach(this):oe.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(x){this.$showLineNumbers&&x?oe.attach(this):oe.detach(this)}},placeholder:{set:function(x){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var x=this.renderer.$composition||this.getValue();if(x&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),G.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!x&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),G.addCssClass(this.container,"ace_hasPlaceholder");var S=G.createElement("div");S.className="ace_placeholder",S.textContent=this.$placeholder||"",this.renderer.placeholderNode=S,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var oe={getText:function(x,S){return(Math.abs(x.selection.lead.row-S)||S+1+(S<9?"·":""))+""},getWidth:function(x,S,w){return Math.max(S.toString().length,(w.lastRow+1).toString().length,2)*w.characterWidth},update:function(x,S){S.renderer.$loop.schedule(S.renderer.CHANGE_GUTTER)},attach:function(x){x.renderer.$gutterLayer.$renderer=this,x.on("changeSelection",this.update),this.update(null,x)},detach:function(x){x.renderer.$gutterLayer.$renderer==this&&(x.renderer.$gutterLayer.$renderer=null),x.off("changeSelection",this.update),this.update(null,x)}};S.Editor=C})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(x,S,w){"use strict";var i=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(x){this.$session=x},this.add=function(x,S,w){this.$fromUndo||x!=this.$lastDelta&&(!1!==S&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),x.id=this.$rev=++this.$maxRev),"remove"!=x.action&&"insert"!=x.action||(this.$lastDelta=x),this.lastDeltas.push(x))},this.addSelection=function(x,S){this.selections.push({value:x,rev:S||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(x,S){null==S&&(S=this.$rev+1);for(var w=this.$undoStack,U=w.length;U--;){var G=w[U][0];if(G.id<=x)break;G.id 0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(x){null==x&&(x=this.$rev),this.mark=x},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(x){return x?a(x):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(i.prototype);var U=x("./range").Range,G=U.comparePoints;function s(x){return{row:x.row,column:x.column}}function a(x){if(x=x||this,Array.isArray(x))return x.map(a).join("\n");var S="";return x.action?(S="insert"==x.action?"+":"-",S+="["+x.lines+"]"):x.value&&(S=Array.isArray(x.value)?x.value.map(c).join("\n"):c(x.value)),x.start&&(S+=c(x)),(x.id||x.rev)&&(S+="\t("+(x.id||x.rev)+")"),S}function c(x){return x.start.row+":"+x.start.column+"=>"+x.end.row+":"+x.end.column}function l(x,S){var w="insert"==x.action,U="insert"==S.action;if(w&&U)if(G(S.start,x.end)>=0)d(S,x,-1);else{if(!(G(S.start,x.start)<=0))return null;d(x,S,1)}else if(w&&!U)if(G(S.start,x.end)>=0)d(S,x,-1);else{if(!(G(S.end,x.start)<=0))return null;d(x,S,-1)}else if(!w&&U)if(G(S.start,x.start)>=0)d(S,x,1);else{if(!(G(S.start,x.start)<=0))return null;d(x,S,1)}else if(!w&&!U)if(G(S.start,x.start)>=0)d(S,x,1);else{if(!(G(S.end,x.start)<=0))return null;d(x,S,-1)}return[S,x]}function u(x,S){for(var w=x.length;w--;)for(var U=0;U=0?d(x,S,-1):(G(x.start,S.start)<=0||d(x,U.fromPoints(S.start,x.start),-1),d(S,x,1));else if(!w&&H)G(S.start,x.end)>=0?d(S,x,-1):(G(S.start,x.start)<=0||d(S,U.fromPoints(x.start,S.start),-1),d(x,S,1));else if(!w&&!H)if(G(S.start,x.end)>=0)d(S,x,-1);else{var z,j;if(!(G(S.end,x.start)<=0))return G(x.start,S.start)<0&&(z=x,x=m(x,S.start)),G(x.end,S.end)>0&&(j=m(x,S.end)),p(S.end,x.start,x.end,-1),j&&!z&&(x.lines=j.lines,x.start=j.start,x.end=j.end,j=x),[S,z,j].filter(Boolean);d(x,S,-1)}return[S,x]}function d(x,S,w){p(x.start,S.start,S.end,w),p(x.end,S.start,S.end,w)}function p(x,S,w,U){x.row==(1==U?S:w).row&&(x.column+=U*(w.column-S.column)),x.row+=U*(w.row-S.row)}function m(x,S){var w=x.lines,U=x.end;x.end=s(S);var G=x.end.row-x.start.row,H=w.splice(G,w.length),z=G?S.column:S.column-x.start.column;return w.push(H[0].substring(0,z)),H[0]=H[0].substr(z),{start:s(S),end:U,lines:H,action:x.action}}function f(x,S){S=function(x){return{start:s(x.start),end:s(x.end),action:x.action,lines:x.lines.slice()}}(S);for(var w=x.length;w--;){for(var U=x[w],G=0;G H&&(X=G.end.row+1,H=(G=S.getNextFoldLine(X,G))?G.start.row:1/0),X>U){for(;this.$lines.getLength()>j+1;)this.$lines.pop();break}(z=this.$lines.get(++j))?z.row=X:(z=this.$lines.createCell(X,x,this.session,l),this.$lines.push(z)),this.$renderCell(z,x,G,X),X++}this._signal("afterRender"),this.$updateGutterWidth(x)},this.$updateGutterWidth=function(x){var S=this.session,w=S.gutterRenderer||this.$renderer,U=S.$firstLineNumber,G=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||S.$useWrapMode)&&(G=S.getLength()+U-1);var H=w?w.getWidth(S,G,x):G.toString().length*x.characterWidth,z=this.$padding||this.$computePadding();(H+=z.left+z.right)===this.gutterWidth||isNaN(H)||(this.gutterWidth=H,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",H))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var x=this.session.selection.getCursor();this.$cursorRow!==x.row&&(this.$cursorRow=x.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var x=this.session.selection.cursor.row;if(this.$cursorRow=x,!this.$cursorCell||this.$cursorCell.row!=x){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var S=this.$lines.cells;this.$cursorCell=null;for(var w=0;w =this.$cursorRow){if(U.row>this.$cursorRow){var G=this.session.getFoldLine(this.$cursorRow);if(!(w>0&&G&&G.start.row==S[w-1].row))break;U=S[w-1]}U.element.className="ace_gutter-active-line "+U.element.className,this.$cursorCell=U;break}}}}},this.scrollLines=function(x){var S=this.config;if(this.config=x,this.$updateCursorRow(),this.$lines.pageChanged(S,x))return this.update(x);this.$lines.moveContainer(x);var w=Math.min(x.lastRow+x.gutterOffset,this.session.getLength()-1),U=this.oldLastRow;if(this.oldLastRow=w,!S||U 0;G--)this.$lines.shift();if(U>w)for(G=this.session.getFoldedRowCount(w+1,U);G>0;G--)this.$lines.pop();x.firstRow U&&this.$lines.push(this.$renderLines(x,U+1,w)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(x)},this.$renderLines=function(x,S,w){for(var U=[],G=S,H=this.session.getNextFoldLine(G),z=H?H.start.row:1/0;G>z&&(G=H.end.row+1,z=(H=this.session.getNextFoldLine(G,H))?H.start.row:1/0),!(G>w);){var j=this.$lines.createCell(G,x,this.session,l);this.$renderCell(j,x,H,G),U.push(j),G++}return U},this.$renderCell=function(x,S,w,G){var H=x.element,z=this.session,j=H.childNodes[0],X=H.childNodes[1],K=z.$firstLineNumber,q=z.$breakpoints,Y=z.$decorations,Z=z.gutterRenderer||this.$renderer,J=this.$showFoldWidgets&&z.foldWidgets,Q=w?w.start.row:Number.MAX_VALUE,ee="ace_gutter-cell ";if(this.$highlightGutterLine&&(G==this.$cursorRow||w&&G =Q&&this.$cursorRow<=w.end.row)&&(ee+="ace_gutter-active-line ",this.$cursorCell!=x&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=x)),q[G]&&(ee+=q[G]),Y[G]&&(ee+=Y[G]),this.$annotations[G]&&(ee+=this.$annotations[G].className),H.className!=ee&&(H.className=ee),J){var te=J[G];null==te&&(te=J[G]=z.getFoldWidget(G))}if(te){ee="ace_fold-widget ace_"+te,"start"==te&&G==Q&&G w.right-S.right?"foldWidgets":void 0}}).call(c.prototype),S.Gutter=c})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(x,S,w){"use strict";var U=x("../range").Range,G=x("../lib/dom"),o=function(x){this.element=G.createElement("div"),this.element.className="ace_layer ace_marker-layer",x.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(x){this.$padding=x},this.setSession=function(x){this.session=x},this.setMarkers=function(x){this.markers=x},this.elt=function(x,S){var w=-1!=this.i&&this.element.childNodes[this.i];w?this.i++:(w=document.createElement("div"),this.element.appendChild(w),this.i=-1),w.style.cssText=S,w.className=x},this.update=function(x){if(x){var S;for(var w in this.config=x,this.i=0,this.markers){var U=this.markers[w];if(U.range){var G=U.range.clipRows(x.firstRow,x.lastRow);if(!G.isEmpty())if(G=G.toScreenRange(this.session),U.renderer){var H=this.$getTop(G.start.row,x),z=this.$padding+G.start.column*x.characterWidth;U.renderer(S,G,z,H,x)}else"fullLine"==U.type?this.drawFullLineMarker(S,G,U.clazz,x):"screenLine"==U.type?this.drawScreenLineMarker(S,G,U.clazz,x):G.isMultiLine()?"text"==U.type?this.drawTextMarker(S,G,U.clazz,x):this.drawMultiLineMarker(S,G,U.clazz,x):this.drawSingleLineMarker(S,G,U.clazz+" ace_start ace_br15",x)}else U.update(S,this,this.session,x)}if(-1!=this.i)for(;this.i Z?4:0)|(K==X?8:0)),G,K==X?0:1,H)},this.drawMultiLineMarker=function(x,S,w,U,G){var H=this.$padding,z=U.lineHeight,j=this.$getTop(S.start.row,U),X=H+S.start.column*U.characterWidth;if(G=G||"",this.session.$bidiHandler.isBidiRow(S.start.row)?((K=S.clone()).end.row=K.start.row,K.end.column=this.session.getLine(K.start.row).length,this.drawBidiSingleLineMarker(x,K,w+" ace_br1 ace_start",U,null,G)):this.elt(w+" ace_br1 ace_start","height:"+z+"px;right:0;top:"+j+"px;left:"+X+"px;"+(G||"")),this.session.$bidiHandler.isBidiRow(S.end.row)){var K;(K=S.clone()).start.row=K.end.row,K.start.column=0,this.drawBidiSingleLineMarker(x,K,w+" ace_br12",U,null,G)}else{j=this.$getTop(S.end.row,U);var q=S.end.column*U.characterWidth;this.elt(w+" ace_br12","height:"+z+"px;width:"+q+"px;top:"+j+"px;left:"+H+"px;"+(G||""))}if(!((z=(S.end.row-S.start.row-1)*U.lineHeight)<=0)){j=this.$getTop(S.start.row+1,U);var Y=(S.start.column?1:0)|(S.end.column?0:8);this.elt(w+(Y?" ace_br"+Y:""),"height:"+z+"px;right:0;top:"+j+"px;left:"+H+"px;"+(G||""))}},this.drawSingleLineMarker=function(x,S,w,U,G,H){if(this.session.$bidiHandler.isBidiRow(S.start.row))return this.drawBidiSingleLineMarker(x,S,w,U,G,H);var z=U.lineHeight,j=(S.end.column+(G||0)-S.start.column)*U.characterWidth,X=this.$getTop(S.start.row,U),K=this.$padding+S.start.column*U.characterWidth;this.elt(w,"height:"+z+"px;width:"+j+"px;top:"+X+"px;left:"+K+"px;"+(H||""))},this.drawBidiSingleLineMarker=function(x,S,w,U,G,H){var z=U.lineHeight,j=this.$getTop(S.start.row,U),X=this.$padding;this.session.$bidiHandler.getSelections(S.start.column,S.end.column).forEach((function(x){this.elt(w,"height:"+z+"px;width:"+x.width+(G||0)+"px;top:"+j+"px;left:"+(X+x.left)+"px;"+(H||""))}),this)},this.drawFullLineMarker=function(x,S,w,U,G){var H=this.$getTop(S.start.row,U),z=U.lineHeight;S.start.row!=S.end.row&&(z+=this.$getTop(S.end.row,U)-H),this.elt(w,"height:"+z+"px;top:"+H+"px;left:0;right:0;"+(G||""))},this.drawScreenLineMarker=function(x,S,w,U,G){var H=this.$getTop(S.start.row,U),z=U.lineHeight;this.elt(w,"height:"+z+"px;top:"+H+"px;left:0;right:0;"+(G||""))}}).call(o.prototype),S.Marker=o})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],(function(x,S,w){"use strict";var U=x("../lib/oop"),G=x("../lib/dom"),H=x("../lib/lang"),z=x("./lines").Lines,j=x("../lib/event_emitter").EventEmitter,c=function(x){this.dom=G,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",x.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new z(this.element)};(function(){U.implement(this,j),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var x=this.session.doc,S="\n"==x.getNewLineCharacter()&&"windows"!=x.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=S)return this.EOL_CHAR=S,!0},this.setPadding=function(x){this.$padding=x,this.element.style.margin="0 "+x+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(x){this.$fontMetrics=x,this.$fontMetrics.on("changeCharacterSize",function(x){this._signal("changeCharacterSize",x)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(x){this.session=x,x&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(x){return this.showInvisibles!=x&&(this.showInvisibles=x,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(x){return this.displayIndentGuides!=x&&(this.displayIndentGuides=x,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var x=this.session.getTabSize();this.tabSize=x;for(var S=this.$tabStrings=[0],w=1;w q&&(j=X.end.row+1,q=(X=this.session.getNextFoldLine(j,X))?X.start.row:1/0),!(j>G);){var Y=H[z++];if(Y){this.dom.removeChildren(Y),this.$renderLine(Y,j,j==q&&X),K&&(Y.style.top=this.$lines.computeLineTop(j,x,this.session)+"px");var Z=x.lineHeight*this.session.getRowLength(j)+"px";Y.style.height!=Z&&(K=!0,Y.style.height=Z)}j++}if(K)for(;z 0;G--)this.$lines.shift();if(S.lastRow>x.lastRow)for(G=this.session.getFoldedRowCount(x.lastRow+1,S.lastRow);G>0;G--)this.$lines.pop();x.firstRow S.lastRow&&this.$lines.push(this.$renderLinesFragment(x,S.lastRow+1,x.lastRow))},this.$renderLinesFragment=function(x,S,w){for(var U=[],H=S,z=this.session.getNextFoldLine(H),j=z?z.start.row:1/0;H>j&&(H=z.end.row+1,j=(z=this.session.getNextFoldLine(H,z))?z.start.row:1/0),!(H>w);){var X=this.$lines.createCell(H,x,this.session),K=X.element;this.dom.removeChildren(K),G.setStyle(K.style,"height",this.$lines.computeLineHeight(H,x,this.session)+"px"),G.setStyle(K.style,"top",this.$lines.computeLineTop(H,x,this.session)+"px"),this.$renderLine(K,H,H==j&&z),this.$useLineGroups()?K.className="ace_line_group":K.className="ace_line",U.push(X),H++}return U},this.update=function(x){this.$lines.moveContainer(x),this.config=x;for(var S=x.firstRow,w=x.lastRow,U=this.$lines;U.getLength();)U.pop();U.push(this.$renderLinesFragment(x,S,w))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(x,S,w,U){for(var G,z=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,j=this.dom.createFragment(this.element),X=0;G=z.exec(U);){var K=G[1],q=G[2],Y=G[3],Z=G[4],J=G[5];if(this.showInvisibles||!q){var Q=X!=G.index?U.slice(X,G.index):"";if(X=G.index+G[0].length,Q&&j.appendChild(this.dom.createTextNode(Q,this.element)),K){var ee=this.session.getScreenTabSize(S+G.index);j.appendChild(this.$tabStrings[ee].cloneNode(!0)),S+=ee-1}else q?this.showInvisibles?((ne=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",ne.textContent=H.stringRepeat(this.SPACE_CHAR,q.length),j.appendChild(ne)):j.appendChild(this.com.createTextNode(q,this.element)):Y?((ne=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",ne.textContent=H.stringRepeat(this.SPACE_CHAR,Y.length),j.appendChild(ne)):Z?(S+=1,(ne=this.dom.createElement("span")).style.width=2*this.config.characterWidth+"px",ne.className=this.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",ne.textContent=this.showInvisibles?this.SPACE_CHAR:Z,j.appendChild(ne)):J&&(S+=1,(ne=this.dom.createElement("span")).style.width=2*this.config.characterWidth+"px",ne.className="ace_cjk",ne.textContent=J,j.appendChild(ne))}}if(j.appendChild(this.dom.createTextNode(X?U.slice(X):U,this.element)),this.$textToken[w.type])x.appendChild(j);else{var te="ace_"+w.type.replace(/\./g," ace_"),ne=this.dom.createElement("span");"fold"==w.type&&(ne.style.width=w.value.length*this.config.characterWidth+"px"),ne.className=te,ne.appendChild(j),x.appendChild(ne)}return S+U.length},this.renderIndentGuide=function(x,S,w){var U=S.search(this.$indentGuideRe);if(U<=0||U>=w)return S;if(" "==S[0]){for(var G=(U-=U%this.tabSize)/this.tabSize,H=0;H =z;)j=this.$renderToken(X,j,q,Y.substring(0,z-U)),Y=Y.substring(z-U),U=z,X=this.$createLineElement(),x.appendChild(X),X.appendChild(this.dom.createTextNode(H.stringRepeat(" ",w.indent),this.element)),j=0,z=w[++G]||Number.MAX_VALUE;0!=Y.length&&(U+=Y.length,j=this.$renderToken(X,j,q,Y))}}w[w.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(X,j,null,"",!0)},this.$renderSimpleLine=function(x,S){var w=0,U=S[0],G=U.value;this.displayIndentGuides&&(G=this.renderIndentGuide(x,G)),G&&(w=this.$renderToken(x,w,U,G));for(var H=1;H this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(x,w,U,G);w=this.$renderToken(x,w,U,G)}},this.$renderOverflowMessage=function(x,S,w,U,G){w&&this.$renderToken(x,S,w,U.slice(0,this.MAX_LINE_LENGTH-S));var H=this.dom.createElement("span");H.className="ace_inline_button ace_keyword ace_toggle_wrap",H.textContent=G?" ":" ",x.appendChild(H)},this.$renderLine=function(x,S,w){if(w||0==w||(w=this.session.getFoldLine(S)),w)var U=this.$getFoldLineTokens(S,w);else U=this.session.getTokens(S);var G=x;if(U.length){var H=this.session.getRowSplitData(S);H&&H.length?(this.$renderWrappedLine(x,U,H),G=x.lastChild):(G=x,this.$useLineGroups()&&(G=this.$createLineElement(),x.appendChild(G)),this.$renderSimpleLine(G,U))}else this.$useLineGroups()&&(G=this.$createLineElement(),x.appendChild(G));if(this.showInvisibles&&G){w&&(S=w.end.row);var z=this.dom.createElement("span");z.className="ace_invisible ace_invisible_eol",z.textContent=S==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,G.appendChild(z)}},this.$getFoldLineTokens=function(x,S){var w=this.session,U=[],G=w.getTokens(x);return S.walk((function(x,S,H,z,j){null!=x?U.push({type:"fold",value:x}):(j&&(G=w.getTokens(S)),G.length&&function(x,S,w){for(var G=0,H=0;H+x[G].value.length w-S&&(z=z.substring(0,w-S)),U.push({type:x[G].type,value:z}),H=S+z.length,G+=1);Hw?U.push({type:x[G].type,value:z.substring(0,w-H)}):U.push(x[G]),H+=z.length,G+=1}}(G,z,H))}),S.end.row,this.session.getLine(S.end.row).length),U},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(c.prototype),S.Text=c})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(x,S,w){"use strict";var U=x("../lib/dom"),r=function(x){this.element=U.createElement("div"),this.element.className="ace_layer ace_cursor-layer",x.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),U.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(x){for(var S=this.cursors,w=S.length;w--;)U.setStyle(S[w].style,"opacity",x?"":"0")},this.$startCssAnimation=function(){for(var x=this.cursors,S=x.length;S--;)x[S].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){U.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){U.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(x){this.$padding=x},this.setSession=function(x){this.session=x},this.setBlinking=function(x){x!=this.isBlinking&&(this.isBlinking=x,this.restartTimer())},this.setBlinkInterval=function(x){x!=this.blinkInterval&&(this.blinkInterval=x,this.restartTimer())},this.setSmoothBlinking=function(x){x!=this.smoothBlinking&&(this.smoothBlinking=x,U.setCssClass(this.element,"ace_smooth-blinking",x),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var x=U.createElement("div");return x.className="ace_cursor",this.element.appendChild(x),this.cursors.push(x),x},this.removeCursor=function(){if(this.cursors.length>1){var x=this.cursors.pop();return x.parentNode.removeChild(x),x}},this.hideCursor=function(){this.isVisible=!1,U.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,U.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var x=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&U.removeCssClass(this.element,"ace_smooth-blinking"),x(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){U.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),U.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var S=function(){this.timeoutId=setTimeout((function(){x(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){x(!0),S()}),this.blinkInterval),S()}else this.$stopCssAnimation()},this.getPixelPosition=function(x,S){if(!this.config||!this.session)return{left:0,top:0};x||(x=this.session.selection.getCursor());var w=this.session.documentToScreenPosition(x);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(w.row,x.row)?this.session.$bidiHandler.getPosLeft(w.column):w.column*this.config.characterWidth),top:(w.row-(S?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(x,S){return x.top>=0&&x.top x.height+x.offset||z.top<0)&&w>1)){var j=this.cursors[G++]||this.addCursor(),X=j.style;this.drawCursor?this.drawCursor(j,z,x,S[w],this.session):this.isCursorInView(z,x)?(U.setStyle(X,"display","block"),U.translate(j,z.left,z.top),U.setStyle(X,"width",Math.round(x.characterWidth)+"px"),U.setStyle(X,"height",x.lineHeight+"px")):U.setStyle(X,"display","none")}}for(;this.cursors.length>G;)this.removeCursor();var K=this.session.getOverwrite();this.$setOverwrite(K),this.$pixelPos=z,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(x){x!=this.overwrite&&(this.overwrite=x,x?U.addCssClass(this.element,"ace_overwrite-cursors"):U.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(r.prototype),S.Cursor=r})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(x,S,w){"use strict";var U=x("./lib/oop"),G=x("./lib/dom"),H=x("./lib/event"),z=x("./lib/event_emitter").EventEmitter,a=function(x){this.element=G.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=G.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),x.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,H.addListener(this.element,"scroll",this.onScroll.bind(this)),H.addListener(this.element,"mousedown",H.preventDefault)};(function(){U.implement(this,z),this.setVisible=function(x){this.element.style.display=x?"":"none",this.isVisible=x,this.coeff=1}}).call(a.prototype);var c=function(x,S){a.call(this,x),this.scrollTop=0,this.scrollHeight=0,S.$scrollbarWidth=this.width=G.scrollbarWidth(x.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};U.inherits(c,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var x=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-x)/(this.coeff-x)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(x){this.element.style.height=x+"px"},this.setInnerHeight=this.setScrollHeight=function(x){this.scrollHeight=x,x>32768?(this.coeff=32768/x,x=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=x+"px"},this.setScrollTop=function(x){this.scrollTop!=x&&(this.skipEvent=!0,this.scrollTop=x,this.element.scrollTop=x*this.coeff)}}.call(c.prototype);var l=function(x,S){a.call(this,x),this.scrollLeft=0,this.height=S.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};U.inherits(l,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(x){this.element.style.width=x+"px"},this.setInnerWidth=function(x){this.inner.style.width=x+"px"},this.setScrollWidth=function(x){this.inner.style.width=x+"px"},this.setScrollLeft=function(x){this.scrollLeft!=x&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=x)}}.call(l.prototype),S.ScrollBar=c,S.ScrollBarV=c,S.ScrollBarH=l,S.VScrollBar=c,S.HScrollBar=l})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(x,S,w){"use strict";var U=x("./lib/event"),r=function(x,S){this.onRender=x,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=S||window;var w=this;this._flush=function(x){w.pending=!1;var S=w.changes;if(S&&(U.blockIdle(100),w.changes=0,w.onRender(S)),w.changes){if(w.$recursionLimit--<0)return;w.schedule()}else w.$recursionLimit=2}};(function(){this.schedule=function(x){this.changes=this.changes|x,this.changes&&!this.pending&&(U.nextFrame(this._flush),this.pending=!0)},this.clear=function(x){var S=this.changes;return this.changes=0,S}}).call(r.prototype),S.RenderLoop=r})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(x,S,w){var U=x("../lib/oop"),G=x("../lib/dom"),H=x("../lib/lang"),z=x("../lib/event"),j=x("../lib/useragent"),X=x("../lib/event_emitter").EventEmitter,K="function"==typeof ResizeObserver,q=200,Y=S.FontMetrics=function(x){this.el=G.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=G.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=G.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),x.appendChild(this.el),this.$measureNode.innerHTML=H.stringRepeat("X",256),this.$characterSize={width:0,height:0},K?this.$addObserver():this.checkForSizeChanges()};(function(){U.implement(this,X),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(x,S){x.width=x.height="auto",x.left=x.top="0px",x.visibility="hidden",x.position="absolute",x.whiteSpace="pre",j.isIE<8?x["font-family"]="inherit":x.font="inherit",x.overflow=S?"hidden":"visible"},this.checkForSizeChanges=function(x){if(void 0===x&&(x=this.$measureSizes()),x&&(this.$characterSize.width!==x.width||this.$characterSize.height!==x.height)){this.$measureNode.style.fontWeight="bold";var S=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=x,this.charSizes=Object.create(null),this.allowBoldFonts=S&&S.width===x.width&&S.height===x.height,this._emit("changeCharacterSize",{data:x})}},this.$addObserver=function(){var x=this;this.$observer=new window.ResizeObserver((function(S){var w=S[0].contentRect;x.checkForSizeChanges({height:w.height,width:w.width/256})})),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var x=this;return this.$pollSizeChangesTimer=z.onIdle((function t(){x.checkForSizeChanges(),z.onIdle(t,500)}),500)},this.setPolling=function(x){x?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(x){var S={height:(x||this.$measureNode).clientHeight,width:(x||this.$measureNode).clientWidth/256};return 0===S.width||0===S.height?null:S},this.$measureCharWidth=function(x){return this.$main.innerHTML=H.stringRepeat(x,256),this.$main.getBoundingClientRect().width/256},this.getCharacterWidth=function(x){var S=this.charSizes[x];return void 0===S&&(S=this.charSizes[x]=this.$measureCharWidth(x)/this.$characterSize.width),S},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(x){return x?(window.getComputedStyle(x).zoom||1)*e(x.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(x,S){return["div",{style:"position: absolute;top:"+x+"px;left:"+S+"px;"}]};this.els=G.buildDom([e(0,0),e(q,0),e(0,q),e(q,q)],this.el)},this.transformCoordinates=function(x,S){function n(x,S,w){var U=x[1]*S[0]-x[0]*S[1];return[(-S[1]*w[0]+S[0]*w[1])/U,(+x[1]*w[0]-x[0]*w[1])/U]}function i(x,S){return[x[0]-S[0],x[1]-S[1]]}function r(x,S){return[x[0]+S[0],x[1]+S[1]]}function o(x,S){return[x*S[0],x*S[1]]}function s(x){var S=x.getBoundingClientRect();return[S.left,S.top]}x&&(x=o(1/this.$getZoom(this.el),x)),this.els||this.$initTransformMeasureNodes();var w=s(this.els[0]),U=s(this.els[1]),G=s(this.els[2]),H=s(this.els[3]),z=n(i(H,U),i(H,G),i(r(U,G),r(H,w))),j=o(1+z[0],i(U,w)),X=o(1+z[1],i(G,w));if(S){var K=S,Y=z[0]*K[0]/q+z[1]*K[1]/q+1,Z=r(o(K[0],j),o(K[1],X));return r(o(1/Y/q,Z),w)}var J=i(x,w),Q=n(i(j,o(z[0],J)),i(X,o(z[1],J)),J);return o(q,Q)}}).call(Y.prototype)})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],(function(x,S,w){"use strict";var U=x("./lib/oop"),G=x("./lib/dom"),H=x("./config"),z=x("./layer/gutter").Gutter,j=x("./layer/marker").Marker,X=x("./layer/text").Text,K=x("./layer/cursor").Cursor,q=x("./scrollbar").HScrollBar,Y=x("./scrollbar").VScrollBar,Z=x("./renderloop").RenderLoop,J=x("./layer/font_metrics").FontMetrics,Q=x("./lib/event_emitter").EventEmitter,ee='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',te=x("./lib/useragent"),ne=te.isIE;G.importCssString(ee,"ace_editor.css");var _=function(x,S){var w=this;this.container=x||G.createElement("div"),G.addCssClass(this.container,"ace_editor"),G.HI_DPI&&G.addCssClass(this.container,"ace_hidpi"),this.setTheme(S),this.$gutter=G.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=G.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=G.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new z(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new j(this.content);var U=this.$textLayer=new X(this.content);this.canvas=U.element,this.$markerFront=new j(this.content),this.$cursorLayer=new K(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new Y(this.container,this),this.scrollBarH=new q(this.container,this),this.scrollBarV.addEventListener("scroll",(function(x){w.$scrollAnimation||w.session.setScrollTop(x.data-w.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(x){w.$scrollAnimation||w.session.setScrollLeft(x.data-w.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new J(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",(function(x){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",x)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!te.isIOS,this.$loop=new Z(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),H.resetOptions(this),H._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,U.implement(this,Q),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),G.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(x){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=x,x&&this.scrollMargin.top&&x.getScrollTop()<=0&&x.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(x),this.$markerBack.setSession(x),this.$markerFront.setSession(x),this.$gutterLayer.setSession(x),this.$textLayer.setSession(x),x&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(x,S,w){if(void 0===S&&(S=1/0),this.$changedLines?(this.$changedLines.firstRow>x&&(this.$changedLines.firstRow=x),this.$changedLines.lastRow this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(x){x?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(x,S,w,U){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=x?1:0;var G=this.container;U||(U=G.clientHeight||G.scrollHeight),w||(w=G.clientWidth||G.scrollWidth);var H=this.$updateCachedSize(x,S,w,U);if(!this.$size.scrollerHeight||!w&&!U)return this.resizing=0;x&&(this.$gutterLayer.$padding=null),x?this.$renderChanges(H|this.$changes,!0):this.$loop.schedule(H|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(x,S,w,U){U-=this.$extraHeight||0;var H=0,z=this.$size,j={width:z.width,height:z.height,scrollerHeight:z.scrollerHeight,scrollerWidth:z.scrollerWidth};if(U&&(x||z.height!=U)&&(z.height=U,H|=this.CHANGE_SIZE,z.scrollerHeight=z.height,this.$horizScroll&&(z.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",H|=this.CHANGE_SCROLL),w&&(x||z.width!=w)){H|=this.CHANGE_SIZE,z.width=w,null==S&&(S=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=S,G.setStyle(this.scrollBarH.element.style,"left",S+"px"),G.setStyle(this.scroller.style,"left",S+this.margin.left+"px"),z.scrollerWidth=Math.max(0,w-S-this.scrollBarV.getWidth()-this.margin.h),G.setStyle(this.$gutter.style,"left",this.margin.left+"px");var X=this.scrollBarV.getWidth()+"px";G.setStyle(this.scrollBarH.element.style,"right",X),G.setStyle(this.scroller.style,"right",X),G.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||x)&&(H|=this.CHANGE_FULL)}return z.$dirty=!w||!U,H&&this._signal("resize",j),H},this.onGutterResize=function(x){var S=this.$showGutter?x:0;S!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,S,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var x=this.$size.scrollerWidth-2*this.$padding,S=Math.floor(x/this.characterWidth);return this.session.adjustWrapLimit(S,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(x){this.setOption("animatedScroll",x)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(x){this.setOption("showInvisibles",x),this.session.$bidiHandler.setShowInvisibles(x)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(x){this.setOption("displayIndentGuides",x)},this.setShowPrintMargin=function(x){this.setOption("showPrintMargin",x)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(x){this.setOption("printMarginColumn",x)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(x){return this.setOption("showGutter",x)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(x){this.setOption("fadeFoldWidgets",x)},this.setHighlightGutterLine=function(x){this.setOption("highlightGutterLine",x)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var x=G.createElement("div");x.className="ace_layer ace_print-margin-layer",this.$printMarginEl=G.createElement("div"),this.$printMarginEl.className="ace_print-margin",x.appendChild(this.$printMarginEl),this.content.insertBefore(x,this.content.firstChild)}var S=this.$printMarginEl.style;S.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",S.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var x=this.textarea.style,S=this.$composition;if(this.$keepTextAreaAtCursor||S){var w=this.$cursorLayer.$pixelPos;if(w){S&&S.markerRange&&(w=this.$cursorLayer.getPixelPosition(S.markerRange.start,!0));var U=this.layerConfig,H=w.top,z=w.left;H-=U.offset;var j=S&&S.useTextareaForIME?this.lineHeight:ne?0:1;if(H<0||H>U.height-j)G.translate(this.textarea,0,0);else{var X=1,K=this.$size.height-j;if(S)if(S.useTextareaForIME){var q=this.textarea.value;X=this.characterWidth*this.session.$getStringScreenWidth(q)[0]}else H+=this.lineHeight+2;else H+=this.lineHeight;(z-=this.scrollLeft)>this.$size.scrollerWidth-X&&(z=this.$size.scrollerWidth-X),z+=this.gutterWidth+this.margin.left,G.setStyle(x,"height",j+"px"),G.setStyle(x,"width",X+"px"),G.translate(this.textarea,Math.min(z,this.$size.scrollerWidth-X),Math.min(H,K))}}}else G.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var x=this.layerConfig,S=x.lastRow;return this.session.documentToScreenRow(S,0)*x.lineHeight-this.session.getScrollTop()>x.height-x.lineHeight?S-1:S},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(x){this.$padding=x,this.$textLayer.setPadding(x),this.$cursorLayer.setPadding(x),this.$markerFront.setPadding(x),this.$markerBack.setPadding(x),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(x,S,w,U){var G=this.scrollMargin;G.top=0|x,G.bottom=0|S,G.right=0|U,G.left=0|w,G.v=G.top+G.bottom,G.h=G.left+G.right,G.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-G.top),this.updateFull()},this.setMargin=function(x,S,w,U){var G=this.margin;G.top=0|x,G.bottom=0|S,G.right=0|U,G.left=0|w,G.v=G.top+G.bottom,G.h=G.left+G.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(x){this.setOption("hScrollBarAlwaysVisible",x)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(x){this.setOption("vScrollBarAlwaysVisible",x)},this.$updateScrollBarV=function(){var x=this.layerConfig.maxHeight,S=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(x-=(S-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>x-S&&(x=this.scrollTop+S,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(x+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(x,S){if(this.$changes&&(x|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(x||S)){if(this.$size.$dirty)return this.$changes|=x,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(x&this.CHANGE_FULL||x&this.CHANGE_SIZE||x&this.CHANGE_TEXT||x&this.CHANGE_LINES||x&this.CHANGE_SCROLL||x&this.CHANGE_H_SCROLL){if(x|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var U=this.scrollTop+(w.firstRow-this.layerConfig.firstRow)*this.lineHeight;U>0&&(this.scrollTop=U,x|=this.CHANGE_SCROLL,x|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),x&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),G.translate(this.content,-this.scrollLeft,-w.offset);var H=w.width+2*this.$padding+"px",z=w.minHeight+"px";G.setStyle(this.content.style,"width",H),G.setStyle(this.content.style,"height",z)}if(x&this.CHANGE_H_SCROLL&&(G.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),x&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(x&this.CHANGE_SCROLL)return this.$changedLines=null,x&this.CHANGE_TEXT||x&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(x&this.CHANGE_GUTTER||x&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),void this._signal("afterRender");x&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w)):x&this.CHANGE_LINES?(this.$updateLines()||x&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w):x&this.CHANGE_TEXT||x&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(w):x&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),x&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),x&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),x&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender")}else this.$changes|=x},this.$autosize=function(){var x=this.session.getScreenLength()*this.lineHeight,S=this.$maxLines*this.lineHeight,w=Math.min(S,Math.max((this.$minLines||1)*this.lineHeight,x))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var U=!(w<=2*this.lineHeight)&&x>S;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||U!=this.$vScroll){U!=this.$vScroll&&(this.$vScroll=U,this.scrollBarV.setVisible(U));var G=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,G,w),this.desiredHeight=w,this._signal("autosize")}},this.$computeLayerConfig=function(){var x=this.session,S=this.$size,w=S.height<=2*this.lineHeight,U=this.session.getScreenLength()*this.lineHeight,G=this.$getLongestLine(),H=!w&&(this.$hScrollBarAlwaysVisible||S.scrollerWidth-G-2*this.$padding<0),z=this.$horizScroll!==H;z&&(this.$horizScroll=H,this.scrollBarH.setVisible(H));var j=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var X=S.scrollerHeight+this.lineHeight,K=!this.$maxLines&&this.$scrollPastEnd?(S.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;U+=K;var q=this.scrollMargin;this.session.setScrollTop(Math.max(-q.top,Math.min(this.scrollTop,U-S.scrollerHeight+q.bottom))),this.session.setScrollLeft(Math.max(-q.left,Math.min(this.scrollLeft,G+2*this.$padding-S.scrollerWidth+q.right)));var Y=!w&&(this.$vScrollBarAlwaysVisible||S.scrollerHeight-U+K<0||this.scrollTop>q.top),Z=j!==Y;Z&&(this.$vScroll=Y,this.scrollBarV.setVisible(Y));var J,Q,ee=this.scrollTop%this.lineHeight,te=Math.ceil(X/this.lineHeight)-1,ne=Math.max(0,Math.round((this.scrollTop-ee)/this.lineHeight)),ie=ne+te,re=this.lineHeight;ne=x.screenToDocumentRow(ne,0);var oe=x.getFoldLine(ne);oe&&(ne=oe.start.row),J=x.documentToScreenRow(ne,0),Q=x.getRowLength(ne)*re,ie=Math.min(x.screenToDocumentRow(ie,0),x.getLength()-1),X=S.scrollerHeight+x.getRowLength(ie)*re+Q,ee=this.scrollTop-J*re;var ae=0;return(this.layerConfig.width!=G||z)&&(ae=this.CHANGE_H_SCROLL),(z||Z)&&(ae|=this.$updateCachedSize(!0,this.gutterWidth,S.width,S.height),this._signal("scrollbarVisibilityChanged"),Z&&(G=this.$getLongestLine())),this.layerConfig={width:G,padding:this.$padding,firstRow:ne,firstRowScreen:J,lastRow:ie,lineHeight:re,characterWidth:this.characterWidth,minHeight:X,maxHeight:U,offset:ee,gutterOffset:re?Math.max(0,Math.ceil((ee+S.height-S.scrollerHeight)/re)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(G-this.$padding),ae},this.$updateLines=function(){if(this.$changedLines){var x=this.$changedLines.firstRow,S=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(x>w.lastRow+1||Sthis.$textLayer.MAX_LINE_LENGTH&&(x=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(x*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(x,S){this.$gutterLayer.addGutterDecoration(x,S)},this.removeGutterDecoration=function(x,S){this.$gutterLayer.removeGutterDecoration(x,S)},this.updateBreakpoints=function(x){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(x){this.$gutterLayer.setAnnotations(x),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(x,S,w){this.scrollCursorIntoView(x,w),this.scrollCursorIntoView(S,w)},this.scrollCursorIntoView=function(x,S,w){if(0!==this.$size.scrollerHeight){var U=this.$cursorLayer.getPixelPosition(x),G=U.left,H=U.top,z=w&&w.top||0,j=w&&w.bottom||0,X=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;X+z>H?(S&&X+z>H+this.lineHeight&&(H-=S*this.$size.scrollerHeight),0===H&&(H=-this.scrollMargin.top),this.session.setScrollTop(H)):X+this.$size.scrollerHeight-j G?(G =1-this.scrollMargin.top||S>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||x<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||x>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(x,S){var w;if(this.$hasCssTransforms){w={top:0,left:0};var U=this.$fontMetrics.transformCoordinates([x,S]);x=U[1]-this.gutterWidth-this.margin.left,S=U[0]}else w=this.scroller.getBoundingClientRect();var G=x+this.scrollLeft-w.left-this.$padding,H=G/this.characterWidth,z=Math.floor((S+this.scrollTop-w.top)/this.lineHeight),j=this.$blockCursor?Math.floor(H):Math.round(H);return{row:z,column:j,side:H-j>0?1:-1,offsetX:G}},this.screenToTextCoordinates=function(x,S){var w;if(this.$hasCssTransforms){w={top:0,left:0};var U=this.$fontMetrics.transformCoordinates([x,S]);x=U[1]-this.gutterWidth-this.margin.left,S=U[0]}else w=this.scroller.getBoundingClientRect();var G=x+this.scrollLeft-w.left-this.$padding,H=G/this.characterWidth,z=this.$blockCursor?Math.floor(H):Math.round(H),j=Math.floor((S+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(j,Math.max(z,0),G)},this.textToScreenCoordinates=function(x,S){var w=this.scroller.getBoundingClientRect(),U=this.session.documentToScreenPosition(x,S),G=this.$padding+(this.session.$bidiHandler.isBidiRow(U.row,x)?this.session.$bidiHandler.getPosLeft(U.column):Math.round(U.column*this.characterWidth)),H=U.row*this.lineHeight;return{pageX:w.left+G-this.scrollLeft,pageY:w.top+H-this.scrollTop}},this.visualizeFocus=function(){G.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){G.removeCssClass(this.container,"ace_focus")},this.showComposition=function(x){this.$composition=x,x.cssText||(x.cssText=this.textarea.style.cssText),x.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(G.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):x.markerId=this.session.addMarker(x.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(x){var S=this.session.selection.cursor;this.addToken(x,"composition_placeholder",S.row,S.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),G.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(x,S,w,U){var G=this.session;G.bgTokenizer.lines[w]=null;var H={type:S,value:x},z=G.getTokens(w);if(null==U)z.push(H);else for(var j=0,X=0;X 50&&x.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:x}))}}).call(c.prototype),S.UIWorkerClient=function(x,S,w){var U=null,G=!1,j=Object.create(H),X=[],K=new c({messageBuffer:X,terminate:function(){},postMessage:function(x){X.push(x),U&&(G?setTimeout(h):h())}});K.setEmitSync=function(x){G=x};var h=function(){var x=X.shift();x.command?U[x.command].apply(U,x.args):x.event&&j._signal(x.event,x.data)};return j.postMessage=function(x){K.onMessage({data:x})},j.callback=function(x,S){this.postMessage({type:"call",id:S,data:x})},j.emit=function(x,S){this.postMessage({type:"event",name:x,data:S})},z.loadModule(["worker",S],(function(x){for(U=new x[w](j);X.length;)h()})),K},S.WorkerClient=c,S.createWorker=a})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(x,S,w){"use strict";var U=x("./range").Range,G=x("./lib/event_emitter").EventEmitter,H=x("./lib/oop"),s=function(x,S,w,U,G,H){var z=this;this.length=S,this.session=x,this.doc=x.getDocument(),this.mainClass=G,this.othersClass=H,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=U,this.$onCursorChange=function(){setTimeout((function(){z.onCursorChange()}))},this.$pos=w;var j=x.getUndoManager().$undoStack||x.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=j.length,this.setup(),x.selection.on("changeCursor",this.$onCursorChange)};(function(){H.implement(this,G),this.setup=function(){var x=this,S=this.doc,w=this.session;this.selectionBefore=w.selection.toJSON(),w.selection.inMultiSelectMode&&w.selection.toSingleRange(),this.pos=S.createAnchor(this.$pos.row,this.$pos.column);var G=this.pos;G.$insertRight=!0,G.detach(),G.markerId=w.addMarker(new U(G.row,G.column,G.row,G.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(w){var U=S.createAnchor(w.row,w.column);U.$insertRight=!0,U.detach(),x.others.push(U)})),w.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var x=this.session,S=this;this.othersActive=!0,this.others.forEach((function(w){w.markerId=x.addMarker(new U(w.row,w.column,w.row,w.column+S.length),S.othersClass,null,!1)}))}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var x=0;x =this.pos.column&&S.start.column<=this.pos.column+this.length+1,H=S.start.column-this.pos.column;if(this.updateAnchors(x),G&&(this.length+=w),G&&!this.session.$fromUndo)if("insert"===x.action)for(var z=this.others.length-1;z>=0;z--){var j={row:(X=this.others[z]).row,column:X.column+H};this.doc.insertMergedLines(j,x.lines)}else if("remove"===x.action)for(z=this.others.length-1;z>=0;z--){var X;j={row:(X=this.others[z]).row,column:X.column+H},this.doc.remove(new U(j.row,j.column,j.row,j.column-w))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(x){this.pos.onChange(x);for(var S=this.others.length;S--;)this.others[S].onChange(x);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var x=this,S=this.session,n=function(w,G){S.removeMarker(w.markerId),w.markerId=S.addMarker(new U(w.row,w.column,w.row,w.column+x.length),G,null,!1)};n(this.pos,this.mainClass);for(var w=this.others.length;w--;)n(this.others[w],this.othersClass)}},this.onCursorChange=function(x){if(!this.$updating&&this.session){var S=this.session.selection.getCursor();S.row===this.pos.row&&S.column>=this.pos.column&&S.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",x)):(this.hideOtherMarkers(),this._emit("cursorLeave",x))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var x=this.session.getUndoManager(),S=(x.$undoStack||x.$undostack).length-this.$undoStackDepth,w=0;w 1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),S||this.fromOrientedRange(x)}},this.toSingleRange=function(x){x=x||this.ranges[0];var S=this.rangeList.removeAll();S.length&&this.$onRemoveRange(S),x&&this.fromOrientedRange(x)},this.substractPoint=function(x){var S=this.rangeList.substractPoint(x);if(S)return this.$onRemoveRange(S),S[0]},this.mergeOverlappingRanges=function(){var x=this.rangeList.merge();x.length&&this.$onRemoveRange(x)},this.$onAddRange=function(x){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(x),this._signal("addRange",{range:x})},this.$onRemoveRange=function(x){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var S=this.rangeList.ranges.pop();x.push(S),this.rangeCount=0}for(var w=x.length;w--;){var U=this.ranges.indexOf(x[w]);this.ranges.splice(U,1)}this._signal("removeRange",{ranges:x}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(S=S||this.ranges[0])&&!S.isEqual(this.getRange())&&this.fromOrientedRange(S)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new U,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var x=this.rangeList.ranges,S=x[x.length-1],w=G.fromPoints(x[0].start,S.end);this.toSingleRange(),this.setSelectionRange(w,S.cursor==S.start)}else{w=this.getRange();var U=this.isBackwards(),H=w.start.row,z=w.end.row;if(H==z){if(U)var j=w.end,X=w.start;else j=w.start,X=w.end;return this.addRange(G.fromPoints(X,X)),void this.addRange(G.fromPoints(j,j))}var K=[],q=this.getLineRange(H,!0);q.start.column=w.start.column,K.push(q);for(var Y=H+1;Y1){var x=this.rangeList.ranges,S=x[x.length-1],w=G.fromPoints(x[0].start,S.end);this.toSingleRange(),this.setSelectionRange(w,S.cursor==S.start)}else{var U=this.session.documentToScreenPosition(this.cursor),H=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(U,H).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(x,S,w){var U=[],H=x.column 0;)ie--;if(ie>0)for(var re=0;U[re].isEmpty();)re++;for(var oe=ie;oe>=re;oe--)U[oe].isEmpty()&&U.splice(oe,1)}return U}}.call(H.prototype);var Z=x("./editor").Editor;function p(x){x.$multiselectOnSessionChange||(x.$onAddRange=x.$onAddRange.bind(x),x.$onRemoveRange=x.$onRemoveRange.bind(x),x.$onMultiSelect=x.$onMultiSelect.bind(x),x.$onSingleSelect=x.$onSingleSelect.bind(x),x.$multiselectOnSessionChange=S.onSessionChange.bind(x),x.$checkMultiselectChange=x.$checkMultiselectChange.bind(x),x.$multiselectOnSessionChange(x),x.on("changeSession",x.$multiselectOnSessionChange),x.on("mousedown",z),x.commands.addCommands(K.defaultCommands),function(x){if(x.textInput){var S=x.textInput.getElement(),w=!1;j.addListener(S,"keydown",(function(S){var U=18==S.keyCode&&!(S.ctrlKey||S.shiftKey||S.metaKey);x.$blockSelectEnabled&&U?w||(x.renderer.setMouseCursor("crosshair"),w=!0):w&&i()})),j.addListener(S,"keyup",i),j.addListener(S,"blur",i)}function i(S){w&&(x.renderer.setMouseCursor(""),w=!1)}}(x))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(x){x.cursor||(x.cursor=x.end);var S=this.getSelectionStyle();return x.marker=this.session.addMarker(x,"ace_selection",S),this.session.$selectionMarkers.push(x),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,x},this.removeSelectionMarker=function(x){if(x.marker){this.session.removeMarker(x.marker);var S=this.session.$selectionMarkers.indexOf(x);-1!=S&&this.session.$selectionMarkers.splice(S,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(x){for(var S=this.session.$selectionMarkers,w=x.length;w--;){var U=x[w];if(U.marker){this.session.removeMarker(U.marker);var G=S.indexOf(U);-1!=G&&S.splice(G,1)}}this.session.selectionMarkerCount=S.length},this.$onAddRange=function(x){this.addSelectionMarker(x.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(x){this.removeSelectionMarkers(x.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(x){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(K.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(x){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(K.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(x){var S=x.command,w=x.editor;if(w.multiSelect){if(S.multiSelectAction)"forEach"==S.multiSelectAction?U=w.forEachSelection(S,x.args):"forEachLine"==S.multiSelectAction?U=w.forEachSelection(S,x.args,!0):"single"==S.multiSelectAction?(w.exitMultiSelectMode(),U=S.exec(w,x.args||{})):U=S.multiSelectAction(w,x.args||{});else{var U=S.exec(w,x.args||{});w.multiSelect.addRange(w.multiSelect.toOrientedRange()),w.multiSelect.mergeOverlappingRanges()}return U}},this.forEachSelection=function(x,S,w){if(!this.inVirtualSelectionMode){var U,G=w&&w.keepOrder,z=1==w||w&&w.$byLines,j=this.session,X=this.selection,K=X.rangeList,q=(G?X:K).ranges;if(!q.length)return x.exec?x.exec(this,S||{}):x(this,S||{});var Y=X._eventRegistry;X._eventRegistry={};var Z=new H(j);this.inVirtualSelectionMode=!0;for(var J=q.length;J--;){if(z)for(;J>0&&q[J].start.row==q[J-1].end.row;)J--;Z.fromOrientedRange(q[J]),Z.index=J,this.selection=j.selection=Z;var Q=x.exec?x.exec(this,S||{}):x(this,S||{});U||void 0===Q||(U=Q),Z.toOrientedRange(q[J])}Z.detach(),this.selection=j.selection=X,this.inVirtualSelectionMode=!1,X._eventRegistry=Y,X.mergeOverlappingRanges(),X.ranges[0]&&X.fromOrientedRange(X.ranges[0]);var ee=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),ee&&ee.from==ee.to&&this.renderer.animateScrolling(ee.from),U}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var x="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var S=this.multiSelect.rangeList.ranges,w=[],U=0;U z&&(z=w.column),U q?x.insert(U,X.stringRepeat(" ",H-q)):x.remove(new G(U.row,U.column,U.row,U.column-H+q)),S.start.column=S.end.column=z,S.start.row=S.end.row=U.row,S.cursor=S.end})),S.fromOrientedRange(w[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var q=this.selection.getRange(),Y=q.start.row,Z=q.end.row,J=Y==Z;if(J){var Q,ee=this.session.getLength();do{Q=this.session.getLine(Z)}while(/[=:]/.test(Q)&&++Z 0);Y<0&&(Y=0),Z>=ee&&(Z=ee-1)}var te=this.session.removeFullLines(Y,Z);te=this.$reAlignText(te,J),this.session.insert({row:Y,column:0},te.join("\n")+"\n"),J||(q.start.column=0,q.end.column=te[te.length-1].length),this.selection.setRange(q)}},this.$reAlignText=function(x,S){var w,U,G,H=!0,z=!0;return x.map((function(x){var S=x.match(/(\s*)(.*?)(\s*)([=:].*)/);return S?null==w?(w=S[1].length,U=S[2].length,G=S[3].length,S):(w+U+G!=S[1].length+S[2].length+S[3].length&&(z=!1),w!=S[1].length&&(H=!1),w>S[1].length&&(w=S[1].length),U S[3].length&&(G=S[3].length),S):[x]})).map(S?l:H?z?function(x){return x[2]?a(w+U-x[2].length)+x[2]+a(G)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}:l:function(x){return x[2]?a(w)+x[2]+a(G)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]});function a(x){return X.stringRepeat(" ",x)}function l(x){return x[2]?a(w)+x[2]+a(U-x[2].length+G)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}}}).call(Z.prototype),S.onSessionChange=function(x){var S=x.session;S&&!S.multiSelect&&(S.$selectionMarkers=[],S.selection.$initRangeList(),S.multiSelect=S.selection),this.multiSelect=S&&S.multiSelect;var w=x.oldSession;w&&(w.multiSelect.off("addRange",this.$onAddRange),w.multiSelect.off("removeRange",this.$onRemoveRange),w.multiSelect.off("multiSelect",this.$onMultiSelect),w.multiSelect.off("singleSelect",this.$onSingleSelect),w.multiSelect.lead.off("change",this.$checkMultiselectChange),w.multiSelect.anchor.off("change",this.$checkMultiselectChange)),S&&(S.multiSelect.on("addRange",this.$onAddRange),S.multiSelect.on("removeRange",this.$onRemoveRange),S.multiSelect.on("multiSelect",this.$onMultiSelect),S.multiSelect.on("singleSelect",this.$onSingleSelect),S.multiSelect.lead.on("change",this.$checkMultiselectChange),S.multiSelect.anchor.on("change",this.$checkMultiselectChange)),S&&this.inMultiSelectMode!=S.selection.inMultiSelectMode&&(S.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},S.MultiSelect=p,x("./config").defineOptions(Z.prototype,"editor",{enableMultiselect:{set:function(x){p(this),x?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",z)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",z))},value:!0},enableBlockSelect:{set:function(x){this.$blockSelectEnabled=x},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(x,S,w){"use strict";var U=x("../../range").Range,G=S.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(x,S,w){var U=x.getLine(w);return this.foldingStartMarker.test(U)?"start":"markbeginend"==S&&this.foldingStopMarker&&this.foldingStopMarker.test(U)?"end":""},this.getFoldWidgetRange=function(x,S,w){return null},this.indentationBlock=function(x,S,w){var G=/\S/,H=x.getLine(S),z=H.search(G);if(-1!=z){for(var j=w||H.length,X=x.getLength(),K=S,q=S;++SK){var J=x.getLine(q).length;return new U(K,j,q,J)}}},this.openingBracketBlock=function(x,S,w,G,H){var z={row:w,column:G+1},j=x.$findClosingBracket(S,z,H);if(j){var X=x.foldWidgets[j.row];return null==X&&(X=x.getFoldWidget(j.row)),"start"==X&&j.row>z.row&&(j.row--,j.column=x.getLine(j.row).length),U.fromPoints(z,j)}},this.closingBracketBlock=function(x,S,w,G,H){var z={row:w,column:G},j=x.$findOpeningBracket(S,z);if(j)return j.column++,z.column--,U.fromPoints(j,z)}}).call(G.prototype)})),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],(function(x,S,w){"use strict";S.isDark=!1,S.cssClass="ace-tm",S.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',S.$id="ace/theme/textmate",x("../lib/dom").importCssString(S.cssText,S.cssClass)})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],(function(x,S,w){"use strict";x("./lib/oop");var U=x("./lib/dom");function r(x){this.session=x,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}x("./range").Range,function(){this.getRowLength=function(x){var S;return S=this.lineWidgets&&this.lineWidgets[x]&&this.lineWidgets[x].rowCount||0,this.$useWrapMode&&this.$wrapData[x]?this.$wrapData[x].length+1+S:1+S},this.$getWidgetScreenLength=function(){var x=0;return this.lineWidgets.forEach((function(S){S&&S.rowCount&&!S.hidden&&(x+=S.rowCount)})),x},this.$onChangeEditor=function(x){this.attach(x.editor)},this.attach=function(x){x&&x.widgetManager&&x.widgetManager!=this&&x.widgetManager.detach(),this.editor!=x&&(this.detach(),this.editor=x,x&&(x.widgetManager=this,x.renderer.on("beforeRender",this.measureWidgets),x.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(x){var S=this.editor;if(S){this.editor=null,S.widgetManager=null,S.renderer.off("beforeRender",this.measureWidgets),S.renderer.off("afterRender",this.renderWidgets);var w=this.session.lineWidgets;w&&w.forEach((function(x){x&&x.el&&x.el.parentNode&&(x._inDocument=!1,x.el.parentNode.removeChild(x.el))}))}},this.updateOnFold=function(x,S){var w=S.lineWidgets;if(w&&x.action){for(var U=x.data,G=U.start.row,H=U.end.row,z="add"==x.action,j=G+1;j 0&&!U[G];)G--;this.firstRow=w.firstRow,this.lastRow=w.lastRow,S.$cursorLayer.config=w;for(var z=G;z<=H;z++){var j=U[z];if(j&&j.el)if(j.hidden)j.el.style.top=-100-(j.pixelHeight||0)+"px";else{j._inDocument||(j._inDocument=!0,S.container.appendChild(j.el));var X=S.$cursorLayer.getPixelPosition({row:z,column:0},!0).top;j.coverLine||(X+=w.lineHeight*this.session.getRowLineCount(j.row)),j.el.style.top=X-w.offset+"px";var K=j.coverGutter?0:S.gutterWidth;j.fixedWidth||(K-=S.scrollLeft),j.el.style.left=K+"px",j.fullWidth&&j.screenWidth&&(j.el.style.minWidth=w.width+2*w.padding+"px"),j.fixedWidth?j.el.style.right=S.scrollBar.getWidth()+"px":j.el.style.right=""}}}}}.call(r.prototype),S.LineWidgets=r})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],(function(x,S,w){"use strict";var U=x("../line_widgets").LineWidgets,G=x("../lib/dom"),H=x("../range").Range;S.showErrorMarker=function(x,S){var w=x.session;w.widgetManager||(w.widgetManager=new U(w),w.widgetManager.attach(x));var z=x.getCursorPosition(),j=z.row,X=w.widgetManager.getWidgetsAtRow(j).filter((function(x){return"errorMarker"==x.type}))[0];X?X.destroy():j-=S;var K,q=function(x,S,w){var U=x.getAnnotations().sort(H.comparePoints);if(U.length){var G=function(x,S,w){for(var U=0,G=x.length-1;U<=G;){var H=U+G>>1,z=w(S,x[H]);if(z>0)U=H+1;else{if(!(z<0))return H;G=H-1}}return-(U+1)}(U,{row:S,column:-1},H.comparePoints);G<0&&(G=-G-1),G>=U.length?G=w>0?0:U.length-1:0===G&&w<0&&(G=U.length-1);var z=U[G];if(z&&w){if(z.row===S){do{z=U[G+=w]}while(z&&z.row===S);if(!z)return U.slice()}var j=[];S=z.row;do{j[w<0?"unshift":"push"](z),z=U[G+=w]}while(z&&z.row==S);return j.length&&j}}}(w,j,S);if(q){var Y=q[0];z.column=(Y.pos&&"number"!=typeof Y.column?Y.pos.sc:Y.column)||0,z.row=Y.row,K=x.renderer.$gutterLayer.$annotations[z.row]}else{if(X)return;K={text:["Looks good!"],className:"ace_ok"}}x.session.unfold(z.row),x.selection.moveToPosition(z);var Z={row:z.row,fixedWidth:!0,coverGutter:!0,el:G.createElement("div"),type:"errorMarker"},J=Z.el.appendChild(G.createElement("div")),Q=Z.el.appendChild(G.createElement("div"));Q.className="error_widget_arrow "+K.className;var ee=x.renderer.$cursorLayer.getPixelPosition(z).left;Q.style.left=ee+x.renderer.gutterWidth-5+"px",Z.el.className="error_widget_wrapper",J.className="error_widget "+K.className,J.innerHTML=K.text.join("
"),J.appendChild(G.createElement("div"));var g=function(x,S,w){if(0===S&&("esc"===w||"return"===w))return Z.destroy(),{command:"null"}};Z.destroy=function(){x.$mouseHandler.isMousePressed||(x.keyBinding.removeKeyboardHandler(g),w.widgetManager.removeLineWidget(Z),x.off("changeSelection",Z.destroy),x.off("changeSession",Z.destroy),x.off("mouseup",Z.destroy),x.off("change",Z.destroy))},x.keyBinding.addKeyboardHandler(g),x.on("changeSelection",Z.destroy),x.on("changeSession",Z.destroy),x.on("mouseup",Z.destroy),x.on("change",Z.destroy),x.session.widgetManager.addLineWidget(Z),Z.el.onmousedown=x.focus.bind(x),x.renderer.scrollCursorIntoView(null,.5,{bottom:Z.el.offsetHeight})},G.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")})),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],(function(x,S,U){"use strict";x("./lib/fixoldbrowsers");var G=x("./lib/dom"),H=x("./lib/event"),z=x("./range").Range,j=x("./editor").Editor,X=x("./edit_session").EditSession,K=x("./undomanager").UndoManager,q=x("./virtual_renderer").VirtualRenderer;x("./worker/worker_client"),x("./keyboard/hash_handler"),x("./placeholder"),x("./multi_select"),x("./mode/folding/fold_mode"),x("./theme/textmate"),x("./ext/error_marker"),S.config=x("./config"),S.require=x,S.define=w(3),S.edit=function(x,w){if("string"==typeof x){var U=x;if(!(x=document.getElementById(U)))throw new Error("ace.edit can't find div #"+U)}if(x&&x.env&&x.env.editor instanceof j)return x.env.editor;var z="";if(x&&/input|textarea/i.test(x.tagName)){var X=x;z=X.value,x=G.createElement("pre"),X.parentNode.replaceChild(x,X)}else x&&(z=x.textContent,x.innerHTML="");var K=S.createEditSession(z),Y=new j(new q(x),K,w),Z={document:K,editor:Y,onResize:Y.resize.bind(Y,null)};return X&&(Z.textarea=X),H.addListener(window,"resize",Z.onResize),Y.on("destroy",(function(){H.removeListener(window,"resize",Z.onResize),Z.editor.container.env=null})),Y.container.env=Y.env=Z,Y},S.createEditSession=function(x,S){var w=new X(x,S);return w.setUndoManager(new K),w},S.Range=z,S.Editor=j,S.EditSession=X,S.UndoManager=K,S.VirtualRenderer=q,S.version=S.config.version})),ace.require(["ace/ace"],(function(S){for(var w in S&&(S.config.init(!0),S.define=ace.define),window.ace||(window.ace=S),S)S.hasOwnProperty(w)&&(window.ace[w]=S[w]);window.ace.default=window.ace,x&&(x.exports=window.ace)})),x.exports=ace}).call(this,w(0)(x))},function(x,S,w){(function(x){ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(x,S,w){"use strict";var U=x("../lib/oop"),G=x("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},o.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};U.inherits(o,G),o.getTagRule=function(x){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},o.getStartRule=function(x){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:x}},o.getEndRule=function(x){return{token:"comment.doc",regex:"\\*\\/",next:x}},S.DocCommentHighlightRules=o})),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],(function(x,S,w){"use strict";var U=x("../lib/oop"),G=x("./doc_comment_highlight_rules").DocCommentHighlightRules,H=x("./text_highlight_rules").TextHighlightRules,z=S.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var x=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),S=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,w="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},G.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+S+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:S},{token:"constant.language.escape",regex:w},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:z},{token:x,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(G,"doc-",[G.getEndRule("start")]),this.normalizeRules()};U.inherits(a,H),S.c_cppHighlightRules=a})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(x,S,w){"use strict";var U=x("../range").Range,r=function(){};(function(){this.checkOutdent=function(x,S){return!!/^\s+$/.test(x)&&/^\s*\}/.test(S)},this.autoOutdent=function(x,S){var w=x.getLine(S).match(/^(\s*\})/);if(!w)return 0;var G=w[1].length,H=x.findMatchingBracket({row:S,column:G});if(!H||H.row==S)return 0;var z=this.$getIndent(x.getLine(H.row));x.replace(new U(S,0,S,G-1),z)},this.$getIndent=function(x){return x.match(/^\s*/)[0]}}).call(r.prototype),S.MatchingBraceOutdent=r})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(x,S,w){"use strict";var U=x("../../lib/oop"),G=x("../../range").Range,H=x("./fold_mode").FoldMode,z=S.FoldMode=function(x){x&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+x.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+x.end)))};U.inherits(z,H),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(x,S,w){var U=x.getLine(w);if(this.singleLineBlockCommentRe.test(U)&&!this.startRegionRe.test(U)&&!this.tripleStarBlockCommentRe.test(U))return"";var G=this._getFoldWidgetBase(x,S,w);return!G&&this.startRegionRe.test(U)?"start":G},this.getFoldWidgetRange=function(x,S,w,U){var G,H=x.getLine(w);if(this.startRegionRe.test(H))return this.getCommentRegionBlock(x,H,w);if(G=H.match(this.foldingStartMarker)){var z=G.index;if(G[1])return this.openingBracketBlock(x,G[1],w,z);var j=x.getCommentFoldRange(w,z+G[0].length,1);return j&&!j.isMultiLine()&&(U?j=this.getSectionRange(x,w):"all"!=S&&(j=null)),j}return"markbegin"!==S&&(G=H.match(this.foldingStopMarker))?(z=G.index+G[0].length,G[1]?this.closingBracketBlock(x,G[1],w,z):x.getCommentFoldRange(w,z,-1)):void 0},this.getSectionRange=function(x,S){for(var w=x.getLine(S),U=w.search(/\S/),H=S,z=w.length,j=S+=1,X=x.getLength();++SK)break;var q=this.getFoldWidgetRange(x,"all",S);if(q){if(q.start.row<=H)break;if(q.isMultiLine())S=q.end.row;else if(U==K)break}j=S}}return new G(H,z,j,x.getLine(j).length)},this.getCommentRegionBlock=function(x,S,w){for(var U=S.search(/\s*$/),H=x.getLength(),z=w,j=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,X=1;++w z)return new G(z,U,w,S.length)}}.call(z.prototype)})),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],(function(x,S,w){"use strict";var U=x("../lib/oop"),G=x("./text").Mode,H=x("./c_cpp_highlight_rules").c_cppHighlightRules,z=x("./matching_brace_outdent").MatchingBraceOutdent,j=(x("../range").Range,x("./behaviour/cstyle").CstyleBehaviour),X=x("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=H,this.$outdent=new z,this.$behaviour=new j,this.foldingRules=new X};U.inherits(l,G),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(x,S,w){var U=this.$getIndent(S),G=this.getTokenizer().getLineTokens(S,x),H=G.tokens,z=G.state;if(H.length&&"comment"==H[H.length-1].type)return U;if("start"==x)(j=S.match(/^.*[\{\(\[]\s*$/))&&(U+=w);else if("doc-start"==x){if("start"==z)return"";var j;(j=S.match(/^\s*(\/?)\*/))&&(j[1]&&(U+=" "),U+="* ")}return U},this.checkOutdent=function(x,S,w){return this.$outdent.checkOutdent(S,w)},this.autoOutdent=function(x,S,w){this.$outdent.autoOutdent(S,w)},this.$id="ace/mode/c_cpp"}.call(l.prototype),S.Mode=l})),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],(function(x,S,w){"use strict";var U=x("../lib/oop"),G=x("./c_cpp_highlight_rules").c_cppHighlightRules,o=function(){var x=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new G).$rules,this.$rules.start.forEach((function(S){"function"==typeof S.token&&(S.token=x)}))};U.inherits(o,G),S.glslHighlightRules=o})),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],(function(x,S,w){"use strict";var U=x("../lib/oop"),G=x("./c_cpp").Mode,H=x("./glsl_highlight_rules").glslHighlightRules,z=x("./matching_brace_outdent").MatchingBraceOutdent,j=(x("../range").Range,x("./behaviour/cstyle").CstyleBehaviour),X=x("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=H,this.$outdent=new z,this.$behaviour=new j,this.foldingRules=new X};U.inherits(l,G),function(){this.$id="ace/mode/glsl"}.call(l.prototype),S.Mode=l})),ace.require(["ace/mode/glsl"],(function(S){x&&(x.exports=S)}))}).call(this,w(0)(x))},function(x,S,w){(function(x){ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],(function(x,S,w){S.isDark=!0,S.cssClass="ace-monokai",S.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",x("../lib/dom").importCssString(S.cssText,S.cssClass)})),ace.require(["ace/theme/monokai"],(function(S){x&&(x.exports=S)}))}).call(this,w(0)(x))},function(x,S,w){var U=w(1),G=w(9);"string"==typeof(G=G.__esModule?G.default:G)&&(G=[[x.i,G,""]]);var H=(U(G,{insert:"html",singleton:!1}),G.locals?G.locals:{});x.exports=H},function(x,S,w){(S=w(2)(!1)).push([x.i,".ace-monokai {\r\n color: #f9f9f9;\r\n font-size: 14px;\r\n}\r\n\r\n.ace-monokai .ace_entity.ace_name.ace_tag,\r\n.ace-monokai .ace_keyword,\r\n.ace-monokai .ace_meta.ace_tag,\r\n.ace-monokai .ace_storage {\r\n color: #F0640D\r\n}\r\n\r\n.ace-monokai .ace_constant.ace_character,\r\n.ace-monokai .ace_constant.ace_other {\r\n color: #5db0d7;\r\n}\r\n\r\n.ace-monokai .ace_marker-layer .ace_selection {\r\n background: #a6e22e\r\n}\r\n\r\n.ace-monokai .ace_marker-layer .ace_bracket {\r\n margin: -1px 0 0 -1px;\r\n border: 1px solid #a6e22e;\r\n}\r\n\r\n.ace-monokai .ace_marker-layer .ace_active-line {\r\n background: #2c2c2c\r\n}\r\n.ace-monokai .ace_gutter-active-line {\r\n background-color: #2c2c2c\r\n}\r\n.ace-monokai .ace_marker-layer .ace_selected-word {\r\n border: 1px solid #a6e22e\r\n}\r\n\r\n.ace-monokai .ace_constant.ace_language {\r\n color: #e6db74\r\n}\r\n.ace-monokai .ace_constant.ace_numeric {\r\n color: #ae81ff\r\n}\r\n\r\n.ace-monokai .ace_gutter {\r\n background: #222;\r\n color: #8F908A;\r\n}",""]),x.exports=S},function(x,S,w){(function(x){ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],(function(x,S,w){"use strict";var U=x("../lib/dom"),G=x("../lib/lang"),H=x("../lib/event"),z='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',j=x("../keyboard/hash_handler").HashHandler,X=x("../lib/keys");U.importCssString(z,"ace_searchbox");var l=function(x,S,w){var G=U.createElement("div");U.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},""],["span",{action:"findNext",class:"ace_searchbtn next"},""],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],G),this.element=G.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(x),U.importCssString(z,"ace_searchbox",x.container)};(function(){this.setEditor=function(x){x.searchBox=this,x.renderer.scroller.appendChild(this.element),this.editor=x},this.setSession=function(x){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(x){this.searchBox=x.querySelector(".ace_search_form"),this.replaceBox=x.querySelector(".ace_replace_form"),this.searchOption=x.querySelector("[action=searchInSelection]"),this.replaceOption=x.querySelector("[action=toggleReplace]"),this.regExpOption=x.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=x.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=x.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=x.querySelector(".ace_search_counter")},this.$init=function(){var x=this.element;this.$initElements(x);var S=this;H.addListener(x,"mousedown",(function(x){setTimeout((function(){S.activeInput.focus()}),0),H.stopPropagation(x)})),H.addListener(x,"click",(function(x){var w=(x.target||x.srcElement).getAttribute("action");w&&S[w]?S[w]():S.$searchBarKb.commands[w]&&S.$searchBarKb.commands[w].exec(S),H.stopPropagation(x)})),H.addCommandKeyListener(x,(function(x,w,U){var G=X.keyCodeToString(U),z=S.$searchBarKb.findKeyCommand(w,G);z&&z.exec&&(z.exec(S),H.stopEvent(x))})),this.$onChange=G.delayedCall((function(){S.find(!1,!1)})),H.addListener(this.searchInput,"input",(function(){S.$onChange.schedule(20)})),H.addListener(this.searchInput,"focus",(function(){S.activeInput=S.searchInput,S.searchInput.value&&S.highlight()})),H.addListener(this.replaceInput,"focus",(function(){S.activeInput=S.replaceInput,S.searchInput.value&&S.highlight()}))},this.$closeSearchBarKb=new j([{bindKey:"Esc",name:"closeSearchBar",exec:function(x){x.searchBox.hide()}}]),this.$searchBarKb=new j,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(x){var S=x.isReplace=!x.isReplace;x.replaceBox.style.display=S?"":"none",x.replaceOption.checked=!1,x.$syncOptions(),x.searchInput.focus()},"Ctrl-H|Command-Option-F":function(x){x.editor.getReadOnly()||(x.replaceOption.checked=!0,x.$syncOptions(),x.replaceInput.focus())},"Ctrl-G|Command-G":function(x){x.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(x){x.findPrev()},esc:function(x){setTimeout((function(){x.hide()}))},Return:function(x){x.activeInput==x.replaceInput&&x.replace(),x.findNext()},"Shift-Return":function(x){x.activeInput==x.replaceInput&&x.replace(),x.findPrev()},"Alt-Return":function(x){x.activeInput==x.replaceInput&&x.replaceAll(),x.findAll()},Tab:function(x){(x.activeInput==x.replaceInput?x.searchInput:x.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(x){x.regExpOption.checked=!x.regExpOption.checked,x.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(x){x.caseSensitiveOption.checked=!x.caseSensitiveOption.checked,x.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(x){x.wholeWordOption.checked=!x.wholeWordOption.checked,x.$syncOptions()}},{name:"toggleReplace",exec:function(x){x.replaceOption.checked=!x.replaceOption.checked,x.$syncOptions()}},{name:"searchInSelection",exec:function(x){x.searchOption.checked=!x.searchRange,x.setSearchRange(x.searchOption.checked&&x.editor.getSelectionRange()),x.$syncOptions()}}]),this.setSearchRange=function(x){this.searchRange=x,x?this.searchRangeMarker=this.editor.session.addMarker(x,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(x){U.setCssClass(this.replaceOption,"checked",this.searchRange),U.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",U.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),U.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),U.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var S=this.editor.getReadOnly();this.replaceOption.style.display=S?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!S?"":"none",this.find(!1,!1,x)},this.highlight=function(x){this.editor.session.highlight(x||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(x,S,w){var G=!this.editor.find(this.searchInput.value,{skipCurrent:x,backwards:S,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:w,range:this.searchRange})&&this.searchInput.value;U.setCssClass(this.searchBox,"ace_nomatch",G),this.editor._emit("findSearchBox",{match:!G}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var x=this.editor,S=x.$search.$options.re,w=0,U=0;if(S){var G=this.searchRange?x.session.getTextRange(this.searchRange):x.getValue(),H=x.session.doc.positionToIndex(x.selection.anchor);this.searchRange&&(H-=x.session.doc.positionToIndex(this.searchRange.start));for(var z,j=S.lastIndex=0;(z=S.exec(G))&&(w++,(j=z.index)<=H&&U++,!(w>999))&&(z[0]||(S.lastIndex=j+=1,!(j>=G.length))););}this.searchCounter.textContent=U+" of "+(w>999?"999+":w)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var x=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;U.setCssClass(this.searchBox,"ace_nomatch",x),this.editor._emit("findSearchBox",{match:!x}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(x,S){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=S,x&&(this.searchInput.value=x),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var x=document.activeElement;return x==this.searchInput||x==this.replaceInput}}).call(l.prototype),S.SearchBox=l,S.Search=function(x,S){(x.searchBox||new l(x)).show(x.session.getTextRange(),S)}})),ace.require(["ace/ext/searchbox"],(function(S){x&&(x.exports=S)}))}).call(this,w(0)(x))},function(x,S,w){var U=w(1),G=w(12);"string"==typeof(G=G.__esModule?G.default:G)&&(G=[[x.i,G,""]]);var H=(U(G,{insert:"html",singleton:!1}),G.locals?G.locals:{});x.exports=H},function(x,S,w){(S=w(2)(!1)).push([x.i,"@import url(https://fonts.googleapis.com/css?family=Montserrat:300,400);"]),S.push([x.i,".captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas, monaco, monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas, monaco, monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:'';position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:'';position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent :hover[commandName=onPlayNextFrameRequested]{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:'';position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:'';position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}\n",""]),x.exports=S},function(x,S,w){var U=w(1),G=w(14);"string"==typeof(G=G.__esModule?G.default:G)&&(G=[[x.i,G,""]]);var H=(U(G,{insert:"html",singleton:!1}),G.locals?G.locals:{});x.exports=H},function(x,S,w){(S=w(2)(!1)).push([x.i,"@import url(https://fonts.googleapis.com/css?family=Montserrat:300,400);"]),S.push([x.i,".resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas, monaco, monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:'Montserrat', sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:white;font-weight:400;border-bottom:2px solid #F0640D}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#F0640D;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#F0640D}@media all and (max-width: 1024px){.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:#464646}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:'Montserrat', sans-serif;font-weight:300;padding:0 20px 0 20px;background:#464646;color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:transparent;display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#F0640D}.resultViewMenuComponent .clearSearch:hover{background:transparent !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0, 25px 0, 25px -25px, 0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:\"\";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#d9d9d9;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#F0640D;border:5px solid #F0640D}.captureListComponent ul li.active span .captureListItemSave:before{background:#F0640D}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#F0640D}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0, 25px 0, 25px -25px, 0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #F0640D}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:#d3d3d3}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:yellow}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:greenyellow}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:greenyellow}.commandListComponent ul li.active{background:#f37628;color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#F0640D}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0, 25px 0, 25px -25px, 0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0, 25px 0, 25px -25px, 0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;right:40%}.sourceCodeMenuComponent{font-family:'Montserrat', sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:white;font-weight:400;border-bottom:2px solid #F0640D}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#F0640D;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#F0640D}.sourceCodeMenuComponent input{border:0;font-family:'Montserrat', sans-serif;font-weight:300;padding:0 20px 0 20px;background:#464646;color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:transparent;display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#F0640D}.sourceCodeMenuComponent .clearSearch:hover{background:transparent !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:0;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#F0640D;padding:1em;margin:.5em 0}\n",""]),x.exports=S},function(x,S,w){"use strict";w.r(S),w.d(S,"EmbeddedFrontend",(function(){return ar})),w.d(S,"Spector",(function(){return sr}));var U,G=function(){function e(){}return e.isBuildableProgram=function(x){return!!x&&!!x[this.rebuildProgramFunctionName]},e.rebuildProgram=function(x,S,w,U,G){this.isBuildableProgram(x)&&x[this.rebuildProgramFunctionName](S,w,U,G)},e.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",e}();!function(x){x[x.noLog=0]="noLog",x[x.error=1]="error",x[x.warning=2]="warning",x[x.info=3]="info"}(U||(U={}));var H,z=function(){function e(){}return e.error=function(x){for(var S=[],w=1;w 0&&console.error(x,S)},e.warn=function(x){for(var S=[],w=1;w 1&&console.warn(x,S)},e.info=function(x){for(var S=[],w=1;w 2&&console.log(x,S)},e.level=U.warning,e}(),j=function(){function e(){this.callbacks=[],this.counter=-1}return e.prototype.add=function(x,S){return this.counter++,S&&(x=x.bind(S)),this.callbacks[this.counter]=x,this.counter},e.prototype.remove=function(x){delete this.callbacks[x]},e.prototype.clear=function(){this.callbacks={}},e.prototype.trigger=function(x){for(var S in this.callbacks)this.callbacks.hasOwnProperty(S)&&this.callbacks[S](x)},e}(),X=function(){function e(){if(window.performance&&window.performance.now)this.nowFunction=this.dateBasedPerformanceNow.bind(this);else{var x=new Date;this.nowFunction=x.getTime.bind(x)}}return e.prototype.dateBasedPerformanceNow=function(){return performance.timing.navigationStart+performance.now()},Object.defineProperty(e,"now",{get:function(){return e.instance.nowFunction()},enumerable:!0,configurable:!0}),e.instance=new e,e}(),K=function(){function e(x){this.options=x}return e.prototype.appendAnalysis=function(x){x.analyses=x.analyses||[];var S=this.getAnalysis(x);x.analyses.push(S)},e.prototype.getAnalysis=function(x){var S={analyserName:this.analyserName};return this.appendToAnalysis(x,S),S},e}(),q=(H=function(x,S){return(H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)},function(x,S){function n(){this.constructor=x}H(x,S),x.prototype=null===S?Object.create(S):(n.prototype=S.prototype,new n)}),Y=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return q(t,x),Object.defineProperty(t.prototype,"analyserName",{get:function(){return t.analyserName},enumerable:!0,configurable:!0}),t.prototype.appendToAnalysis=function(x,S){if(x.commands){for(var w={},U=0,G=x.commands;U -1&&S.draw++}}},t.analyserName="CommandsSummary",t}(K),ee=function(){function e(){}return e.isWebGlConstant=function(x){return null!==ne[x]&&void 0!==ne[x]},e.stringifyWebGlConstant=function(x,S){if(0===x)return this.zeroMeaningByCommand[S]||"0";if(1===x)return this.oneMeaningByCommand[S]||"1";var w=ne[x];return w?w.name:x+""},e.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},e.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},e.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},e.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},e.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},e.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},e.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},e.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},e.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},e.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},e.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},e.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},e.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},e.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},e.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},e.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},e.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},e.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},e.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},e.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},e.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},e.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},e.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},e.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},e.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},e.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},e.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},e.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},e.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},e.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},e.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},e.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},e.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},e.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},e.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},e.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},e.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},e.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},e.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},e.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},e.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},e.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},e.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},e.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},e.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},e.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},e.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},e.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},e.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},e.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},e.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},e.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},e.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},e.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},e.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},e.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},e.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},e.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},e.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},e.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},e.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},e.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},e.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},e.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},e.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},e.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},e.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},e.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},e.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},e.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},e.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},e.RED_BITS={name:"RED_BITS",value:3410,description:" "},e.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},e.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},e.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},e.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},e.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},e.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},e.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},e.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},e.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},e.SAMPLES={name:"SAMPLES",value:32937,description:" "},e.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},e.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},e.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},e.VENDOR={name:"VENDOR",value:7936,description:" "},e.RENDERER={name:"RENDERER",value:7937,description:" "},e.VERSION={name:"VERSION",value:7938,description:" "},e.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},e.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},e.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},e.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},e.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},e.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},e.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},e.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},e.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},e.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},e.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},e.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},e.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},e.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},e.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},e.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},e.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},e.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},e.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},e.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},e.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},e.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},e.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},e.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},e.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},e.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},e.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},e.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},e.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},e.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},e.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},e.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},e.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},e.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},e.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},e.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},e.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},e.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},e.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},e.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},e.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},e.BYTE={name:"BYTE",value:5120,description:" "},e.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},e.SHORT={name:"SHORT",value:5122,description:" "},e.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},e.INT={name:"INT",value:5124,description:" "},e.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},e.FLOAT={name:"FLOAT",value:5126,description:" "},e.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},e.ALPHA={name:"ALPHA",value:6406,description:" "},e.RGB={name:"RGB",value:6407,description:" "},e.RGBA={name:"RGBA",value:6408,description:" "},e.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},e.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},e.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},e.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},e.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},e.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},e.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},e.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},e.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},e.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},e.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},e.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},e.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},e.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},e.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},e.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},e.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},e.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},e.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},e.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},e.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},e.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},e.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},e.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},e.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},e.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},e.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},e.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},e.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},e.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},e.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},e.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},e.KEEP={name:"KEEP",value:7680,description:" "},e.REPLACE={name:"REPLACE",value:7681,description:" "},e.INCR={name:"INCR",value:7682,description:" "},e.DECR={name:"DECR",value:7683,description:" "},e.INVERT={name:"INVERT",value:5386,description:" "},e.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},e.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},e.NEAREST={name:"NEAREST",value:9728,description:" "},e.LINEAR={name:"LINEAR",value:9729,description:" "},e.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},e.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},e.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},e.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},e.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},e.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},e.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},e.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},e.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},e.TEXTURE={name:"TEXTURE",value:5890,description:" "},e.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},e.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},e.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},e.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},e.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},e.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},e.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},e.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},e.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},e.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},e.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},e.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},e.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},e.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},e.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},e.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},e.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},e.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},e.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},e.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},e.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},e.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},e.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},e.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},e.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},e.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},e.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},e.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},e.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},e.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},e.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},e.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},e.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},e.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},e.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},e.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},e.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},e.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},e.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},e.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},e.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},e.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},e.REPEAT={name:"REPEAT",value:10497,description:" "},e.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},e.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},e.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},e.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},e.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},e.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},e.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},e.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},e.BOOL={name:"BOOL",value:35670,description:" "},e.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},e.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},e.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},e.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},e.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},e.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},e.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},e.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},e.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},e.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},e.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},e.LOW_INT={name:"LOW_INT",value:36339,description:" "},e.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},e.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},e.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},e.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},e.RGBA4={name:"RGBA4",value:32854,description:" "},e.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},e.RGB565={name:"RGB565",value:36194,description:" "},e.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},e.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},e.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},e.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},e.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},e.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},e.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},e.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},e.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},e.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},e.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},e.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},e.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},e.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},e.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},e.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},e.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},e.NONE={name:"NONE",value:0,description:" "},e.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},e.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},e.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},e.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},e.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},e.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},e.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},e.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},e.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},e.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},e.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},e.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},e.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},e.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},e.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},e.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},e.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},e.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},e.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},e.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},e.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},e.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},e.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},e.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},e.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},e.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},e.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},e.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},e.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},e.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},e.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},e.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},e.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},e.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},e.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},e.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},e.RED={name:"RED",value:6403,description:" "},e.RGB8={name:"RGB8",value:32849,description:" "},e.RGBA8={name:"RGBA8",value:32856,description:" "},e.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},e.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},e.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},e.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},e.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},e.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},e.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},e.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},e.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},e.SRGB={name:"SRGB",value:35904,description:" "},e.SRGB8={name:"SRGB8",value:35905,description:" "},e.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},e.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},e.RGBA32F={name:"RGBA32F",value:34836,description:" "},e.RGB32F={name:"RGB32F",value:34837,description:" "},e.RGBA16F={name:"RGBA16F",value:34842,description:" "},e.RGB16F={name:"RGB16F",value:34843,description:" "},e.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},e.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},e.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},e.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},e.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},e.RGB32UI={name:"RGB32UI",value:36209,description:" "},e.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},e.RGB16UI={name:"RGB16UI",value:36215,description:" "},e.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},e.RGB8UI={name:"RGB8UI",value:36221,description:" "},e.RGBA32I={name:"RGBA32I",value:36226,description:" "},e.RGB32I={name:"RGB32I",value:36227,description:" "},e.RGBA16I={name:"RGBA16I",value:36232,description:" "},e.RGB16I={name:"RGB16I",value:36233,description:" "},e.RGBA8I={name:"RGBA8I",value:36238,description:" "},e.RGB8I={name:"RGB8I",value:36239,description:" "},e.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},e.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},e.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},e.R8={name:"R8",value:33321,description:" "},e.RG8={name:"RG8",value:33323,description:" "},e.R16F={name:"R16F",value:33325,description:" "},e.R32F={name:"R32F",value:33326,description:" "},e.RG16F={name:"RG16F",value:33327,description:" "},e.RG32F={name:"RG32F",value:33328,description:" "},e.R8I={name:"R8I",value:33329,description:" "},e.R8UI={name:"R8UI",value:33330,description:" "},e.R16I={name:"R16I",value:33331,description:" "},e.R16UI={name:"R16UI",value:33332,description:" "},e.R32I={name:"R32I",value:33333,description:" "},e.R32UI={name:"R32UI",value:33334,description:" "},e.RG8I={name:"RG8I",value:33335,description:" "},e.RG8UI={name:"RG8UI",value:33336,description:" "},e.RG16I={name:"RG16I",value:33337,description:" "},e.RG16UI={name:"RG16UI",value:33338,description:" "},e.RG32I={name:"RG32I",value:33339,description:" "},e.RG32UI={name:"RG32UI",value:33340,description:" "},e.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},e.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},e.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},e.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},e.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},e.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},e.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},e.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},e.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},e.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},e.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},e.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},e.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},e.RG={name:"RG",value:33319,description:" "},e.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},e.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},e.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},e.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},e.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},e.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},e.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},e.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},e.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},e.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},e.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},e.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},e.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},e.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},e.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},e.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},e.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},e.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},e.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},e.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},e.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},e.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},e.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},e.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},e.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},e.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},e.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},e.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},e.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},e.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},e.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},e.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},e.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},e.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},e.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},e.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},e.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},e.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},e.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},e.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},e.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},e.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},e.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},e.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},e.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},e.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},e.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},e.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},e.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},e.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},e.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},e.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},e.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},e.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},e.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},e.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},e.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},e.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},e.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},e.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},e.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},e.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},e.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},e.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},e.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},e.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},e.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},e.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},e.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},e.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},e.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},e.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},e.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},e.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},e.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},e.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},e.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},e.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},e.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},e.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},e.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},e.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},e.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},e.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},e.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},e.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},e.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},e.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},e.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},e.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},e.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},e.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},e.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},e.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},e.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},e.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},e.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},e.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},e.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},e.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},e.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},e.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},e.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},e.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},e.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},e.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},e.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},e.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},e.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},e.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},e.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},e.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},e.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},e.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},e.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},e.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},e.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},e.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},e.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},e.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},e.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},e.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},e.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},e.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},e.SIGNALED={name:"SIGNALED",value:37145,description:" "},e.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},e.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},e.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},e.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},e.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},e.COLOR={name:"COLOR",value:6144,description:" "},e.DEPTH={name:"DEPTH",value:6145,description:" "},e.STENCIL={name:"STENCIL",value:6146,description:" "},e.MIN={name:"MIN",value:32775,description:" "},e.MAX={name:"MAX",value:32776,description:" "},e.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},e.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},e.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},e.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},e.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},e.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},e.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},e.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},e.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},e.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},e.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},e.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},e.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},e.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},e.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},e.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},e.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},e.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},e.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},e.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},e.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},e.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},e.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},e.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},e.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},e.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},e.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},e.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},e.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},e.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},e.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},e.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},e.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},e.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},e.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},e.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},e.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},e.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},e.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},e.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},e.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},e.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},e.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},e.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},e.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"},e}(),te={},ne={};!function(){for(var x in ee)if(ee.hasOwnProperty(x)){var S=ee[x];te[S.name]=S,ne[S.value]=S}}();var ie,re,oe,ae,se,le,ce,ue,he,de,pe,me,fe,ge,ve,_e,ye,be,xe,Ee,Se,Te=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),we=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Te(t,x),Object.defineProperty(t.prototype,"analyserName",{get:function(){return t.analyserName},enumerable:!0,configurable:!0}),t.prototype.appendToAnalysis=function(x,S){if(x.commands){for(var w={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0},U=0,G=x.commands;U =3||"drawArraysInstanced"===H.name&&H.commandArguments.length>=3||"drawArraysInstancedANGLE"===H.name&&H.commandArguments.length>=3?this.appendToPrimitives(w,H.commandArguments[0],H.commandArguments[2]):"drawElements"===H.name&&H.commandArguments.length>=2||"drawElementsInstanced"===H.name&&H.commandArguments.length>=2||"drawElementsInstancedANGLE"===H.name&&H.commandArguments.length>=2?this.appendToPrimitives(w,H.commandArguments[0],H.commandArguments[1]):"drawRangeElements"===H.name&&H.commandArguments.length>=4&&this.appendToPrimitives(w,H.commandArguments[0],H.commandArguments[3])}S.total=w.total,S.triangles=w.totalTriangles,S.triangleStrip=w.totalTriangleStrip,S.triangleFan=w.totalTriangleFan,S.lines=w.totalLines,S.lineStrip=w.totalLineStrip,S.lineLoop=w.totalLineLoop,S.points=w.totalPoints}},t.prototype.appendToPrimitives=function(x,S,w){S===ee.POINTS.value?x.totalPoints+=w:S===ee.LINES.value?x.totalLines+=w:S===ee.LINE_STRIP.value?x.totalLineStrip+=w:S===ee.LINE_LOOP.value?x.totalLineLoop+=w:S===ee.TRIANGLES.value?x.totalTriangles+=w:S===ee.TRIANGLE_STRIP.value?x.totalTriangleStrip+=w:S===ee.TRIANGLE_FAN.value&&(x.totalTriangleFan+=w),x.total+=w},t.analyserName="Primitives",t}(K),Ce=function(){function e(x){this.contextInformation=x,this.analysers=[],this.initAnalysers()}return e.prototype.appendAnalyses=function(x){for(var S in this.analysers)this.analysers.hasOwnProperty(S)&&this.analysers[S].appendAnalysis(x)},e.prototype.initAnalysers=function(){this.analysers.push(new Y(this.contextInformation),new Q(this.contextInformation),new we(this.contextInformation))},e}(),Ae=function(){function e(){}return e.storeOriginFunction=function(x,S){if(x&&x[S]){var w=this.getOriginFunctionName(S);x[w]||(x[w]=x[S])}},e.storePrototypeOriginFunction=function(x,S){if(x&&x.prototype[S]){var w=this.getOriginFunctionName(S);x.prototype[w]||(x.prototype[w]=x.prototype[S])}},e.executePrototypeOriginFunction=function(x,S,w,U){if(x){var G=this.getOriginFunctionName(w);if(S.prototype[G])return x[G]||(x[G]=S.prototype[G]),this.executeFunction(x,G,U)}},e.executeOriginFunction=function(x,S,w){if(x){var U=this.getOriginFunctionName(S);if(x[U])return this.executeFunction(x,U,w)}},e.executeFunction=function(x,S,w){var U=w;if(void 0===U||0===U.length)return x[S]();switch(U.length){case 1:return x[S](U[0]);case 2:return x[S](U[0],U[1]);case 3:return x[S](U[0],U[1],U[2]);case 4:return x[S](U[0],U[1],U[2],U[3]);case 5:return x[S](U[0],U[1],U[2],U[3],U[4]);case 6:return x[S](U[0],U[1],U[2],U[3],U[4],U[5]);case 7:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6]);case 8:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7]);case 9:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8]);case 10:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9]);case 11:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10]);case 12:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11]);case 13:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12]);case 14:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12],U[13]);case 15:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12],U[13],U[14]);case 16:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12],U[13],U[14],U[15]);case 17:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12],U[13],U[14],U[15],U[16]);case 18:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12],U[13],U[14],U[15],U[16],U[17]);case 19:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12],U[13],U[14],U[15],U[16],U[17],U[18]);case 20:return x[S](U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8],U[9],U[10],U[11],U[12],U[13],U[14],U[15],U[16],U[17],U[18],U[19]);default:return x[S].apply(x,U)}},e.getOriginFunctionName=function(x){return this.originFunctionPrefix+x},e.originFunctionPrefix="__SPECTOR_Origin_",e}(),Me=function(){function e(){}return e.getStackTrace=function(x,S){void 0===x&&(x=0),void 0===S&&(S=0);var w=[];try{throw new Error("Errorator.")}catch(x){if(x.stack)for(var U=0,G=(H=x.stack.split("\n")).length;U 0;U++)w.shift();for(U=0;U 0;U++)w.pop()}return w},e}(),Re=function(){function e(){}return e.getWebGlObjectTag=function(x){return x[e.SPECTOROBJECTTAGKEY]},e.attachWebGlObjectTag=function(x,S){S.displayText=e.stringifyWebGlObjectTag(S),x[e.SPECTOROBJECTTAGKEY]=S},e.stringifyWebGlObjectTag=function(x){return x?x.typeName+" - ID: "+x.id:"No tag available."},e.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG",e}(),Le=function(){function e(){this.id=0}return Object.defineProperty(e.prototype,"type",{get:function(){return window[this.typeName]||null},enumerable:!0,configurable:!0}),e.prototype.tagWebGlObject=function(x){if(this.type){var S;if(!x)return S;if(S=Re.getWebGlObjectTag(x))return S;if(x instanceof this.type){var w=this.getNextId();return S={typeName:this.typeName,id:w},Re.attachWebGlObjectTag(x,S),S}return S}},e.prototype.getNextId=function(){return this.id++},e}(),Ie=function(){function e(x){this.options=x}return e.prototype.createCapture=function(x,S,w){var U=Me.getStackTrace(4,1),G=0===x.name.indexOf("uniform")?this.stringifyUniform(x.arguments):this.stringify(x.arguments,x.result),H={id:S,startTime:x.startTime,commandEndTime:x.endTime,endTime:0,name:x.name,commandArguments:x.arguments,result:x.result,stackTrace:U,status:0,marker:w,text:G};this.transformCapture(H);for(var z=0;z50&&(H.commandArguments[z]="Array Length: "+j.length)}if(H.commandArguments){var X=[];for(z=0;z 0&&(w+=": "+this.stringifyArgs(x).join(", ")),S&&(w+=" -> "+this.stringifyResult(S)),w},e.prototype.stringifyUniform=function(x){var S=this.spiedCommandName;if(x&&x.length>0){var w=[];w.push(this.stringifyValue(x[0]));for(var U=1;U -1,U}return Be(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return this.internalSpiedCommandName},enumerable:!0,configurable:!0}),t.prototype.transformCapture=function(x){this.isDeprecated&&(x.status=50)},t}(Ie),Ue=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Ge=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Ue(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(x[0]),S},t.commandName="disableVertexAttribArray",t}(Ie),Ve=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),He=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Ve(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(ee.stringifyWebGlConstant(x[0],"drawArrays")),S.push(x[1]),S.push(x[2]),S},t.commandName="drawArrays",t}(Ie),We=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),$e=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return We(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(ee.stringifyWebGlConstant(x[0],"drawArraysInstanced")),S.push(x[1]),S.push(x[2]),S.push(x[3]),S},t.commandName="drawArraysInstanced",t}(Ie),ze=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),je=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return ze(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(ee.stringifyWebGlConstant(x[0],"drawArraysInstancedANGLE")),S.push(x[1]),S.push(x[2]),S.push(x[3]),S},t.commandName="drawArraysInstancedANGLE",t}(Ie),Xe=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Ke=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Xe(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(ee.stringifyWebGlConstant(x[0],"drawElements")),S.push(x[1]),S.push(ee.stringifyWebGlConstant(x[2],"drawElements")),S.push(x[3]),S},t.commandName="drawElements",t}(Ie),qe=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Ye=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return qe(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(ee.stringifyWebGlConstant(x[0],"drawElementsInstancedANGLE")),S.push(x[1]),S.push(ee.stringifyWebGlConstant(x[2],"drawElementsInstancedANGLE")),S.push(x[3]),S.push(x[4]),S},t.commandName="drawElementsInstancedANGLE",t}(Ie),Ze=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Je=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Ze(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(ee.stringifyWebGlConstant(x[0],"drawElementsInstanced")),S.push(x[1]),S.push(ee.stringifyWebGlConstant(x[2],"drawElementsInstanced")),S.push(x[3]),S.push(x[4]),S},t.commandName="drawElementsInstanced",t}(Ie),Qe=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),et=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Qe(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(ee.stringifyWebGlConstant(x[0],"drawRangeElements")),S.push(x[1]),S.push(x[2]),S.push(x[3]),S.push(ee.stringifyWebGlConstant(x[4],"drawRangeElements")),S.push(x[5]),S},t.commandName="drawRangeElements",t}(Ie),tt=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),nt=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return tt(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyResult=function(x){if(x)return"name: "+x.name+", size: "+x.size+", type: "+x.type},t.commandName="getActiveAttrib",t}(Ie),it=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),rt=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return it(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyResult=function(x){if(x)return"name: "+x.name+", size: "+x.size+", type: "+x.type},t.commandName="getActiveUniform",t}(Ie),ot=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),at=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return ot(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyResult=function(x){return x?"true":"false"},t.commandName="getExtension",t}(Ie),st=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),lt=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return st(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyResult=function(x){if(!x)return"null";var S=Re.getWebGlObjectTag(x);return S?S.displayText:x},t.commandName="getParameter",t}(Ie),ct=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),ut=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return ct(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyResult=function(x){if(x)return"min: "+x.rangeMin+", max: "+x.rangeMax+", precision: "+x.precision},t.commandName="getShaderPrecisionFormat",t}(Ie),ht=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),pt=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return ht(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyResult=function(x){if(x)return"name: "+x.name+", size: "+x.size+", type: "+x.type},t.commandName="getTransformFeedbackVarying",t}(Ie),mt=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),ft=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return mt(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){for(var S=[],w=0;w<4;w++)S.push(x[w].toFixed(0));return S},t.commandName="scissor",t}(Ie),gt=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),vt=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return gt(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(x[0]),S.push(x[1]),S.push(ee.stringifyWebGlConstant(x[2],"vertexAttribPointer")),S.push(x[3]),S.push(x[4]),S.push(x[5]),S},t.commandName="vertexAttribPointer",t}(Ie),_t=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),yt=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return _t(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){for(var S=[],w=0;w<4;w++)S.push(x[w].toFixed(0));return S},t.commandName="viewport",t}(Ie),bt=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),xt=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return bt(t,x),Object.defineProperty(t.prototype,"spiedCommandName",{get:function(){return t.commandName},enumerable:!0,configurable:!0}),t.prototype.stringifyArgs=function(x){var S=[];return S.push(x[0]),S},t.commandName="enableVertexAttribArray",t}(Ie),Et=function(){function e(x){this.spiedCommandName=x.spiedCommandName,this.spiedCommandRunningContext=x.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],Ae.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=x.callback,this.commandOptions={context:x.context,contextVersion:x.contextVersion,extensions:x.extensions,toggleCapture:x.toggleCapture},this.initCustomCommands(),this.initCommand()}return e.prototype.spy=function(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand},e.prototype.unSpy=function(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand},e.prototype.createCapture=function(x,S,w){return this.command.createCapture(x,S,w)},e.prototype.initCommand=function(){e.customCommandsConstructors[this.spiedCommandName]?this.command=e.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new ke(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()},e.prototype.getSpy=function(){var x=this;return function(){var S=X.now,w=Ae.executeOriginFunction(x.spiedCommandRunningContext,x.spiedCommandName,arguments),U=X.now,G={name:x.spiedCommandName,arguments,result:w,startTime:S,endTime:U};return x.callback(x,G),w}},e.prototype.initCustomCommands=function(){var x;e.customCommandsConstructors||(e.customCommandsConstructors=((x={})[Fe.commandName]=function(x){return new Fe(x)},x[Ne.commandName]=function(x){return new Ne(x)},x[Ge.commandName]=function(x){return new Ge(x)},x[He.commandName]=function(x){return new He(x)},x[$e.commandName]=function(x){return new $e(x)},x[je.commandName]=function(x){return new je(x)},x[Ke.commandName]=function(x){return new Ke(x)},x[Je.commandName]=function(x){return new Je(x)},x[Ye.commandName]=function(x){return new Ye(x)},x[et.commandName]=function(x){return new et(x)},x[nt.commandName]=function(x){return new nt(x)},x[rt.commandName]=function(x){return new rt(x)},x[at.commandName]=function(x){return new at(x)},x[lt.commandName]=function(x){return new lt(x)},x[ut.commandName]=function(x){return new ut(x)},x[pt.commandName]=function(x){return new pt(x)},x[ft.commandName]=function(x){return new ft(x)},x[vt.commandName]=function(x){return new vt(x)},x[yt.commandName]=function(x){return new yt(x)},x[xt.commandName]=function(x){return new xt(x)},x))},e}(),St=function(){function e(x){this.options=x,this.context=x.context,this.contextVersion=x.contextVersion,this.extensions=x.extensions,this.toggleCapture=x.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}return Object.defineProperty(e.prototype,"requireStartAndStopStates",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.startCapture=function(x,S,w){return this.quickCapture=S,this.fullCapture=w,this.capturedCommandsByState={},x&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState},e.prototype.stopCapture=function(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState},e.prototype.registerCallbacks=function(x){for(var S in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(S))for(var w=0,U=this.changeCommandsByState[S];w =0)if(x){for(var G=0;G1&&this.parameters.push(this.getWebgl2Parameters());for(var x={},S=1;S<=this.contextVersion&&!(S>this.parameters.length);S++)if(this.parameters[S-1])for(var w=0,U=this.parameters[S-1];w this.parameters.length);x++)for(var S=0,w=this.parameters[x-1];S 0:"stencilFunc"===x.name||"stencilFuncSeparate"===x.name?t.stencilFuncStates.indexOf(x.commandArguments[0])>0:"stencilMask"!==x.name&&"stencilMaskSeparate"!==x.name||t.stencilMaskStates.indexOf(x.commandArguments[0])>0},t.prototype.getConsumeCommands=function(){return Z},t.prototype.isStateEnable=function(x,S){return this.context.isEnabled(ee.STENCIL_TEST.value)},t.stateName="StencilState",t.stencilOpStates=[ee.STENCIL_BACK_FAIL.value,ee.STENCIL_BACK_PASS_DEPTH_FAIL.value,ee.STENCIL_BACK_PASS_DEPTH_PASS.value,ee.STENCIL_FAIL.value,ee.STENCIL_PASS_DEPTH_FAIL.value,ee.STENCIL_PASS_DEPTH_PASS.value],t.stencilFuncStates=[ee.STENCIL_BACK_FUNC.value,ee.STENCIL_BACK_REF.value,ee.STENCIL_BACK_VALUE_MASK.value,ee.STENCIL_FUNC.value,ee.STENCIL_REF.value,ee.STENCIL_VALUE_MASK.value],t.stencilMaskStates=[ee.STENCIL_BACK_WRITEMASK.value,ee.STENCIL_WRITEMASK.value],t}(wt),Zt=function(){function e(){}return e.isSupportedCombination=function(x,S,w){return x=x||ee.UNSIGNED_BYTE.value,((S=S||ee.RGBA.value)===ee.RGB.value||S===ee.RGBA.value)&&(w===ee.RGB.value||w===ee.RGBA.value||w===ee.RGBA8.value||w===ee.RGBA16F.value||w===ee.RGBA32F.value||w===ee.RGB16F.value||w===ee.RGB32F.value||w===ee.R11F_G11F_B10F.value||w===ee.SRGB8.value||w===ee.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(x)},e.readPixels=function(x,S,w,U,G,H){x.getError();var z,j=U*G*4;if(H===ee.UNSIGNED_BYTE.value?z=new Uint8Array(j):(H=ee.FLOAT.value,z=new Float32Array(j)),x.readPixels(S,w,U,G,x.RGBA,H,z),!x.getError()){if(H===ee.UNSIGNED_BYTE.value)return z;for(var X=new Uint8Array(U*G*4),K=0;K 1)for(X=this.context.getParameter(ee.MAX_DRAW_BUFFERS.value),K=0;K 1?this.context.getFramebufferAttachmentParameter(j,w.value,ee.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):ee.UNSIGNED_BYTE.value;X===ee.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(x,S,w,U,G,H,z,j,q,K):X===ee.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(x,S,w,U,G,H,z,j,q,K)}}},t.prototype.readFrameBufferAttachmentFromRenderBuffer=function(x,S,w,U,G,H,z,j,X,K){var q=0,Y=0;if(K.__SPECTOR_Object_CustomData){var Z=K.__SPECTOR_Object_CustomData;if(H=Z.width,z=Z.height,q=Z.samples,Y=Z.internalFormat,!q&&!Zt.isSupportedCombination(X,ee.RGBA.value,Y))return}else H+=U,z+=G;if(U=G=0,q){var J=x,Q=x.createRenderbuffer(),te=x.getParameter(x.RENDERBUFFER_BINDING);x.bindRenderbuffer(x.RENDERBUFFER,Q),x.renderbufferStorage(x.RENDERBUFFER,Y,H,z),x.bindRenderbuffer(x.RENDERBUFFER,te),x.bindFramebuffer(ee.FRAMEBUFFER.value,this.captureFrameBuffer),x.framebufferRenderbuffer(ee.FRAMEBUFFER.value,ee.COLOR_ATTACHMENT0.value,ee.RENDERBUFFER.value,Q);var ne=J.getParameter(J.READ_FRAMEBUFFER_BINDING),ie=J.getParameter(J.DRAW_FRAMEBUFFER_BINDING);J.bindFramebuffer(J.READ_FRAMEBUFFER,S),J.bindFramebuffer(J.DRAW_FRAMEBUFFER,this.captureFrameBuffer),J.blitFramebuffer(0,0,H,z,0,0,H,z,x.COLOR_BUFFER_BIT,x.NEAREST),J.bindFramebuffer(ee.FRAMEBUFFER.value,this.captureFrameBuffer),J.bindFramebuffer(J.READ_FRAMEBUFFER,ne),J.bindFramebuffer(J.DRAW_FRAMEBUFFER,ie),this.context.checkFramebufferStatus(ee.FRAMEBUFFER.value)===ee.FRAMEBUFFER_COMPLETE.value&&this.getCapture(x,w.name,U,G,H,z,0,0,ee.UNSIGNED_BYTE.value),x.bindFramebuffer(ee.FRAMEBUFFER.value,S),x.deleteRenderbuffer(Q)}else x.bindFramebuffer(ee.FRAMEBUFFER.value,this.captureFrameBuffer),x.framebufferRenderbuffer(ee.FRAMEBUFFER.value,ee.COLOR_ATTACHMENT0.value,ee.RENDERBUFFER.value,K),this.context.checkFramebufferStatus(ee.FRAMEBUFFER.value)===ee.FRAMEBUFFER_COMPLETE.value&&this.getCapture(x,w.name,U,G,H,z,0,0,X),x.bindFramebuffer(ee.FRAMEBUFFER.value,S)},t.prototype.readFrameBufferAttachmentFromTexture=function(x,S,w,U,G,H,z,j,X,K){var q=0;this.contextVersion>1&&(q=this.context.getFramebufferAttachmentParameter(j,w.value,ee.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));var Y=this.context.getFramebufferAttachmentParameter(j,w.value,ee.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),Z=this.context.getFramebufferAttachmentParameter(j,w.value,ee.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value),J=(Z>0?ne[Z].name:ee.TEXTURE_2D.name,!1),Q=X;if(K.__SPECTOR_Object_CustomData){var te=K.__SPECTOR_Object_CustomData;if(H=te.width,z=te.height,Q=te.type,J=te.target===ee.TEXTURE_2D_ARRAY.name,!Zt.isSupportedCombination(te.type,te.format,te.internalFormat))return}else H+=U,z+=G;U=G=0,x.bindFramebuffer(ee.FRAMEBUFFER.value,this.captureFrameBuffer),q>0||J?x.framebufferTextureLayer(ee.FRAMEBUFFER.value,ee.COLOR_ATTACHMENT0.value,K,Y,q):x.framebufferTexture2D(ee.FRAMEBUFFER.value,ee.COLOR_ATTACHMENT0.value,Z||ee.TEXTURE_2D.value,K,Y),this.context.checkFramebufferStatus(ee.FRAMEBUFFER.value)===ee.FRAMEBUFFER_COMPLETE.value&&this.getCapture(x,w.name,U,G,H,z,Z,q,Q),x.bindFramebuffer(ee.FRAMEBUFFER.value,S)},t.prototype.getCapture=function(x,S,w,U,G,H,j,X,K){var q={attachmentName:S,src:null,textureCubeMapFace:j?ne[j].name:null,textureLayer:X};if(!this.quickCapture)try{var Y=Zt.readPixels(x,w,U,G,H,K);if(Y){this.workingCanvas.width=G,this.workingCanvas.height=H;var Z=this.workingContext2D.createImageData(Math.ceil(G),Math.ceil(H));if(Z.data.set(Y),this.workingContext2D.putImageData(Z,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{var J=G/H;J<1?(this.captureCanvas.width=t.captureBaseSize*J,this.captureCanvas.height=t.captureBaseSize):J>1?(this.captureCanvas.width=t.captureBaseSize,this.captureCanvas.height=t.captureBaseSize/J):(this.captureCanvas.width=t.captureBaseSize,this.captureCanvas.height=t.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,G,H,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",q.src=this.captureCanvas.toDataURL()}}catch(x){z.warn("Spector can not capture the visual state: "+x)}this.currentState.Attachments.push(q)},t.prototype.analyse=function(x){},t.stateName="VisualState",t.captureBaseSize=256,t}(St),en=function(){function e(x){this.context=x.context,this.captureFrameBuffer=x.context.createFramebuffer(),this.workingCanvas=document.createElement("canvas"),this.workingContext2D=this.workingCanvas.getContext("2d"),this.captureCanvas=document.createElement("canvas"),this.captureContext2D=this.captureCanvas.getContext("2d"),this.captureContext2D.imageSmoothingEnabled=!0,this.captureContext2D.mozImageSmoothingEnabled=!0,this.captureContext2D.oImageSmoothingEnabled=!0,this.captureContext2D.webkitImageSmoothingEnabled=!0,this.captureContext2D.msImageSmoothingEnabled=!0}return e.prototype.appendTextureState=function(x,S,w,U){if(void 0===w&&(w=null),S){var G=S.__SPECTOR_Object_CustomData;G&&(this.fullCapture=U,G.type&&(x.textureType=this.getWebGlConstant(G.type)),G.format&&(x.format=this.getWebGlConstant(G.format)),G.internalFormat&&(x.internalFormat=this.getWebGlConstant(G.internalFormat)),x.width=G.width,x.height=G.height,G.depth&&(x.depth=G.depth),w&&(x.visual=this.getTextureVisualState(w,S,G)))}},e.prototype.getTextureVisualState=function(x,S,w){try{var U=this.context,G={};if(!Zt.isSupportedCombination(w.type,w.format,w.internalFormat))return G;var H=this.context.getParameter(ee.FRAMEBUFFER_BINDING.value);U.bindFramebuffer(ee.FRAMEBUFFER.value,this.captureFrameBuffer);try{var z=w.width,j=w.height;if(x===ee.TEXTURE_3D&&w.depth)for(var X=U,K=0;K 2&&K 2&&K 1?(this.captureCanvas.width=Qt.captureBaseSize,this.captureCanvas.height=Qt.captureBaseSize/X):(this.captureCanvas.width=Qt.captureBaseSize,this.captureCanvas.height=Qt.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,U,G,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",this.captureCanvas.toDataURL()}catch(x){}},e.prototype.getWebGlConstant=function(x){var S=ne[x];return S?S.name:x+""},e.captureBaseSize=64,e.cubeMapFaces=[ee.TEXTURE_CUBE_MAP_POSITIVE_X,ee.TEXTURE_CUBE_MAP_POSITIVE_Y,ee.TEXTURE_CUBE_MAP_POSITIVE_Z,ee.TEXTURE_CUBE_MAP_NEGATIVE_X,ee.TEXTURE_CUBE_MAP_NEGATIVE_Y,ee.TEXTURE_CUBE_MAP_NEGATIVE_Z],e}(),tn=function(){function e(x){this.context=x.context}return e.prototype.getUboValue=function(x,S,w,U){var G=e.uboTypes[U];if(G){var H=new G.arrayBufferView(w*G.lengthMultiplier),z=this.context,j=z.getIndexedParameter(ee.UNIFORM_BUFFER_BINDING.value,x);if(j){var X=z.getIndexedParameter(ee.UNIFORM_BUFFER_START.value,x),K=z.getParameter(ee.UNIFORM_BUFFER_BINDING.value);try{z.bindBuffer(ee.UNIFORM_BUFFER.value,j),z.getBufferSubData(ee.UNIFORM_BUFFER.value,X+S,H)}catch(x){return}K&&z.bindBuffer(ee.UNIFORM_BUFFER.value,K)}return Array.prototype.slice.call(H)}},e.uboTypes=((ie={})[ee.BOOL.value]={arrayBufferView:Uint8Array,lengthMultiplier:1},ie[ee.BOOL_VEC2.value]={arrayBufferView:Uint8Array,lengthMultiplier:2},ie[ee.BOOL_VEC3.value]={arrayBufferView:Uint8Array,lengthMultiplier:3},ie[ee.BOOL_VEC4.value]={arrayBufferView:Uint8Array,lengthMultiplier:4},ie[ee.INT.value]={arrayBufferView:Int32Array,lengthMultiplier:1},ie[ee.INT_VEC2.value]={arrayBufferView:Int32Array,lengthMultiplier:2},ie[ee.INT_VEC3.value]={arrayBufferView:Int32Array,lengthMultiplier:3},ie[ee.INT_VEC4.value]={arrayBufferView:Int32Array,lengthMultiplier:4},ie[ee.UNSIGNED_INT.value]={arrayBufferView:Uint32Array,lengthMultiplier:1},ie[ee.UNSIGNED_INT_VEC2.value]={arrayBufferView:Uint32Array,lengthMultiplier:2},ie[ee.UNSIGNED_INT_VEC3.value]={arrayBufferView:Uint32Array,lengthMultiplier:3},ie[ee.UNSIGNED_INT_VEC4.value]={arrayBufferView:Uint32Array,lengthMultiplier:4},ie[ee.FLOAT.value]={arrayBufferView:Float32Array,lengthMultiplier:1},ie[ee.FLOAT_VEC2.value]={arrayBufferView:Float32Array,lengthMultiplier:2},ie[ee.FLOAT_VEC3.value]={arrayBufferView:Float32Array,lengthMultiplier:3},ie[ee.FLOAT_VEC4.value]={arrayBufferView:Float32Array,lengthMultiplier:4},ie[ee.FLOAT_MAT2.value]={arrayBufferView:Float32Array,lengthMultiplier:4},ie[ee.FLOAT_MAT2x3.value]={arrayBufferView:Float32Array,lengthMultiplier:6},ie[ee.FLOAT_MAT2x4.value]={arrayBufferView:Float32Array,lengthMultiplier:8},ie[ee.FLOAT_MAT3.value]={arrayBufferView:Float32Array,lengthMultiplier:9},ie[ee.FLOAT_MAT3x2.value]={arrayBufferView:Float32Array,lengthMultiplier:6},ie[ee.FLOAT_MAT3x4.value]={arrayBufferView:Float32Array,lengthMultiplier:12},ie[ee.FLOAT_MAT4.value]={arrayBufferView:Float32Array,lengthMultiplier:16},ie[ee.FLOAT_MAT4x2.value]={arrayBufferView:Float32Array,lengthMultiplier:8},ie[ee.FLOAT_MAT4x3.value]={arrayBufferView:Float32Array,lengthMultiplier:12},ie[ee.SAMPLER_2D.value]={arrayBufferView:Uint8Array,lengthMultiplier:1},ie[ee.SAMPLER_CUBE.value]={arrayBufferView:Uint8Array,lengthMultiplier:1},ie),e}(),nn=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),rn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLBuffer"},enumerable:!0,configurable:!0}),t}(Le),on=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLFramebuffer"},enumerable:!0,configurable:!0}),t}(Le),an=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLProgram"},enumerable:!0,configurable:!0}),t.saveInGlobalStore=function(x){var S=Re.getWebGlObjectTag(x);S&&(this.store[S.id]=x)},t.getFromGlobalStore=function(x){return this.store[x]},t.updateInGlobalStore=function(x,S){if(S){var w=this.getFromGlobalStore(x);if(w){var U=Re.getWebGlObjectTag(w);U&&(Re.attachWebGlObjectTag(S,U),this.store[U.id]=S)}}},t.store={},t}(Le),sn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLQuery"},enumerable:!0,configurable:!0}),t}(Le),ln=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLRenderbuffer"},enumerable:!0,configurable:!0}),t}(Le),cn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLSampler"},enumerable:!0,configurable:!0}),t}(Le),hn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLShader"},enumerable:!0,configurable:!0}),t}(Le),dn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLSync"},enumerable:!0,configurable:!0}),t}(Le),pn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLTexture"},enumerable:!0,configurable:!0}),t}(Le),mn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLTransformFeedback"},enumerable:!0,configurable:!0}),t}(Le),gn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLUniformLocation"},enumerable:!0,configurable:!0}),t}(Le),vn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return nn(t,x),Object.defineProperty(t.prototype,"typeName",{get:function(){return"WebGLVertexArrayObject"},enumerable:!0,configurable:!0}),t}(Le),bn=function(){function e(){}return e.getProgramData=function(x,S){for(var w={LINK_STATUS:x.getProgramParameter(S,ee.LINK_STATUS.value),VALIDATE_STATUS:x.getProgramParameter(S,ee.VALIDATE_STATUS.value)},U=x.getAttachedShaders(S),G=new Array(2),H=0,z=0,j=U;z =0){var U=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);U&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(U))}var H=this.context.getProgramParameter(S,ee.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(var z=0;z 1){var Y=this.context.getProgramParameter(S,ee.ACTIVE_UNIFORM_BLOCKS.value);for(this.currentState.uniformBlocks=[],z=0;z 1){var G=this.context;for(S.colorAttachments=[],w=G.getParameter(ee.MAX_DRAW_BUFFERS.value),U=0;U 1&&(U.alphaSize=this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),U.blueSize=this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),U.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),U.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),U.depthSize=this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),U.greenSize=this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),U.redSize=this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),U.stencilSize=this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),w===ee.TEXTURE.value&&(U.textureLayer=this.context.getFramebufferAttachmentParameter(S,x,ee.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),U}},t.prototype.readAttributeFromContext=function(x,S){var w=this.context.getActiveAttrib(x,S),U=this.context.getAttribLocation(x,w.name);if(-1===U)return{name:w.name,size:w.size,type:this.getWebGlConstant(w.type),location:-1};var G=this.context.getVertexAttrib(U,ee.CURRENT_VERTEX_ATTRIB.value),H=this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),z={name:w.name,size:w.size,type:this.getWebGlConstant(w.type),location:U,offsetPointer:this.context.getVertexAttribOffset(U,ee.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(H),enabled:this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(G)};return this.extensions[ee.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?z.divisor=this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(z.integer=this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_INTEGER.value),z.divisor=this.context.getVertexAttrib(U,ee.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(z,H),z},t.prototype.readUniformFromContext=function(x,S){var w=this.context.getActiveUniform(x,S),U=this.context.getUniformLocation(x,w.name);if(U){if(w.size>1&&w.name&&w.name.indexOf("[0]")===w.name.length-3){for(var G=[],H=0;H 1){U.baseLevel=this.context.getTexParameter(S.value,ee.TEXTURE_BASE_LEVEL.value),U.immutable=this.context.getTexParameter(S.value,ee.TEXTURE_IMMUTABLE_FORMAT.value),U.immutableLevels=this.context.getTexParameter(S.value,ee.TEXTURE_IMMUTABLE_LEVELS.value),U.maxLevel=this.context.getTexParameter(S.value,ee.TEXTURE_MAX_LEVEL.value);var G=this.context.getParameter(ee.SAMPLER_BINDING.value);if(G){U.sampler=this.getSpectorData(G);var H=this.context;U.samplerMaxLod=H.getSamplerParameter(G,ee.TEXTURE_MAX_LOD.value),U.samplerMinLod=H.getSamplerParameter(G,ee.TEXTURE_MIN_LOD.value),U.samplerCompareFunc=this.getWebGlConstant(H.getSamplerParameter(G,ee.TEXTURE_COMPARE_FUNC.value)),U.samplerCompareMode=this.getWebGlConstant(H.getSamplerParameter(G,ee.TEXTURE_COMPARE_MODE.value)),U.samplerWrapS=this.getWebGlConstant(H.getSamplerParameter(G,ee.TEXTURE_WRAP_S.value)),U.samplerWrapT=this.getWebGlConstant(H.getSamplerParameter(G,ee.TEXTURE_WRAP_T.value)),U.samplerWrapR=this.getWebGlConstant(H.getSamplerParameter(G,ee.TEXTURE_WRAP_R.value)),U.samplerMagFilter=this.getWebGlConstant(H.getSamplerParameter(G,ee.TEXTURE_MAG_FILTER.value)),U.samplerMinFilter=this.getWebGlConstant(H.getSamplerParameter(G,ee.TEXTURE_MIN_FILTER.value))}else U.maxLod=this.context.getTexParameter(S.value,ee.TEXTURE_MAX_LOD.value),U.minLod=this.context.getTexParameter(S.value,ee.TEXTURE_MIN_LOD.value),U.compareFunc=this.getWebGlConstant(this.context.getTexParameter(S.value,ee.TEXTURE_COMPARE_FUNC.value)),U.compareMode=this.getWebGlConstant(this.context.getTexParameter(S.value,ee.TEXTURE_COMPARE_MODE.value)),U.wrapR=this.getWebGlConstant(this.context.getTexParameter(S.value,ee.TEXTURE_WRAP_R.value))}var z=this.getTextureStorage(S);if(z){var j=this.quickCapture?null:S;this.drawCallTextureInputState.appendTextureState(U,z,j,this.fullCapture)}return this.context.activeTexture(w),U},t.prototype.getTextureStorage=function(x){return x===ee.TEXTURE_2D?this.context.getParameter(ee.TEXTURE_BINDING_2D.value):x===ee.TEXTURE_CUBE_MAP?this.context.getParameter(ee.TEXTURE_BINDING_CUBE_MAP.value):x===ee.TEXTURE_3D?this.context.getParameter(ee.TEXTURE_BINDING_3D.value):x===ee.TEXTURE_2D_ARRAY?this.context.getParameter(ee.TEXTURE_BINDING_2D_ARRAY.value):void 0},t.prototype.readUniformsFromContextIntoState=function(x,S,w,U){for(var G=this.context,H=G.getActiveUniforms(x,S,ee.UNIFORM_TYPE.value),z=G.getActiveUniforms(x,S,ee.UNIFORM_SIZE.value),j=G.getActiveUniforms(x,S,ee.UNIFORM_BLOCK_INDEX.value),X=G.getActiveUniforms(x,S,ee.UNIFORM_OFFSET.value),K=G.getActiveUniforms(x,S,ee.UNIFORM_ARRAY_STRIDE.value),q=G.getActiveUniforms(x,S,ee.UNIFORM_MATRIX_STRIDE.value),Y=G.getActiveUniforms(x,S,ee.UNIFORM_IS_ROW_MAJOR.value),Z=0;Z -1&&(J.blockName=G.getActiveUniformBlockName(x,J.blockIndice)),J.offset=X[Z],J.arrayStride=K[Z],J.matrixStride=q[Z],J.rowMajor=Y[Z],J.blockIndice>-1){var Q=U[j[Z]].bindingPoint;J.value=this.drawCallUboInputState.getUboValue(Q,J.offset,J.size,H[Z])}}},t.prototype.readTransformFeedbackFromContext=function(x,S){var w=this.context,U=w.getTransformFeedbackVarying(x,S),G=w.getIndexedParameter(ee.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,S),H={name:U.name,size:U.size,type:this.getWebGlConstant(U.type),buffer:this.getSpectorData(G),bufferSize:w.getIndexedParameter(ee.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,S),bufferStart:w.getIndexedParameter(ee.TRANSFORM_FEEDBACK_BUFFER_START.value,S)};return this.appendBufferCustomData(H,G),H},t.prototype.readUniformBlockFromContext=function(x,S){var w=this.context,U=w.getActiveUniformBlockParameter(x,S,ee.UNIFORM_BLOCK_BINDING.value),G=w.getIndexedParameter(ee.UNIFORM_BUFFER_BINDING.value,U),H={name:w.getActiveUniformBlockName(x,S),bindingPoint:U,size:w.getActiveUniformBlockParameter(x,S,ee.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:w.getActiveUniformBlockParameter(x,S,ee.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:w.getActiveUniformBlockParameter(x,S,ee.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:w.getActiveUniformBlockParameter(x,S,ee.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(G)};return this.appendBufferCustomData(H,G),H},t.prototype.appendBufferCustomData=function(x,S){if(S){var w=S.__SPECTOR_Object_CustomData;w&&(w.usage&&(x.bufferUsage=this.getWebGlConstant(w.usage)),x.bufferLength=w.length,w.offset&&(x.bufferOffset=w.offset),w.sourceLength&&(x.bufferSourceLength=w.sourceLength))}},t.prototype.getWebGlConstant=function(x){var S=ne[x];return S?S.name:x},t.stateName="DrawCall",t.samplerTypes=((re={})[ee.SAMPLER_2D.value]=ee.TEXTURE_2D,re[ee.SAMPLER_CUBE.value]=ee.TEXTURE_CUBE_MAP,re[ee.SAMPLER_3D.value]=ee.TEXTURE_3D,re[ee.SAMPLER_2D_SHADOW.value]=ee.TEXTURE_2D,re[ee.SAMPLER_2D_ARRAY.value]=ee.TEXTURE_2D_ARRAY,re[ee.SAMPLER_2D_ARRAY_SHADOW.value]=ee.TEXTURE_2D_ARRAY,re[ee.SAMPLER_CUBE_SHADOW.value]=ee.TEXTURE_CUBE_MAP,re[ee.INT_SAMPLER_2D.value]=ee.TEXTURE_2D,re[ee.INT_SAMPLER_3D.value]=ee.TEXTURE_3D,re[ee.INT_SAMPLER_CUBE.value]=ee.TEXTURE_CUBE_MAP,re[ee.INT_SAMPLER_2D_ARRAY.value]=ee.TEXTURE_2D_ARRAY,re[ee.UNSIGNED_INT_SAMPLER_2D.value]=ee.TEXTURE_2D,re[ee.UNSIGNED_INT_SAMPLER_3D.value]=ee.TEXTURE_3D,re[ee.UNSIGNED_INT_SAMPLER_CUBE.value]=ee.TEXTURE_CUBE_MAP,re[ee.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]=ee.TEXTURE_2D_ARRAY,re),t}(St),Sn=function(){function e(x){this.contextInformation=x,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}return e.prototype.startCapture=function(x,S,w){for(var U=0,G=this.stateTrackers;U =4?{target:x,length:w,usage:S.arguments[2],offset:S.arguments[3],sourceLength:S.arguments[1]?S.arguments[1].length:-1}:3===S.arguments.length?{target:x,length:w,usage:S.arguments[2]}:void 0},t.prototype.getLength=function(x){var S=-1,w=0;return 5===x.arguments.length&&(S=x.arguments[4],w=x.arguments[3]),S<=0&&(S="number"==typeof x.arguments[1]?x.arguments[1]:x.arguments[1]&&(x.arguments[1].byteLength||x.arguments[1].length)||0),S-w},t}(Tn),An=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Mn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return An(t,x),Object.defineProperty(t.prototype,"objectName",{get:function(){return"Renderbuffer"},enumerable:!0,configurable:!0}),t.prototype.getCreateCommandNames=function(){return["createRenderbuffer"]},t.prototype.getUpdateCommandNames=function(){return["renderbufferStorage","renderbufferStorageMultisample"]},t.prototype.getDeleteCommandNames=function(){return["deleteRenderbuffer"]},t.prototype.getBoundInstance=function(x){var S=this.options.context;if(x===ee.RENDERBUFFER.value)return S.getParameter(ee.RENDERBUFFER_BINDING.value)},t.prototype.delete=function(x){var S=x.__SPECTOR_Object_CustomData;return S?S.length:0},t.prototype.update=function(x,S,w){var U=this.getCustomData(x,S);if(!U)return 0;var G=w.__SPECTOR_Object_CustomData?w.__SPECTOR_Object_CustomData.length:0;return U.length=U.width*U.height*this.getByteSizeForInternalFormat(U.internalFormat),w.__SPECTOR_Object_CustomData=U,U.length-G},t.prototype.getCustomData=function(x,S){return 4===x.arguments.length?{target:S,internalFormat:x.arguments[1],width:x.arguments[2],height:x.arguments[3],length:0,samples:0}:{target:S,internalFormat:x.arguments[2],width:x.arguments[3],height:x.arguments[4],length:0,samples:x.arguments[1]}},t}(Tn),Rn=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),In=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Rn(t,x),Object.defineProperty(t.prototype,"objectName",{get:function(){return"Texture2d"},enumerable:!0,configurable:!0}),t.prototype.getCreateCommandNames=function(){return["createTexture"]},t.prototype.getUpdateCommandNames=function(){return["texImage2D","compressedTexImage2D","texStorage2D"]},t.prototype.getDeleteCommandNames=function(){return["deleteTexture"]},t.prototype.getBoundInstance=function(x){var S=this.options.context;return x===ee.TEXTURE_2D.value?S.getParameter(ee.TEXTURE_BINDING_2D.value):x===ee.TEXTURE_CUBE_MAP_POSITIVE_X.value||x===ee.TEXTURE_CUBE_MAP_POSITIVE_Y.value||x===ee.TEXTURE_CUBE_MAP_POSITIVE_Z.value||x===ee.TEXTURE_CUBE_MAP_NEGATIVE_X.value||x===ee.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||x===ee.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?S.getParameter(ee.TEXTURE_BINDING_CUBE_MAP.value):void 0},t.prototype.delete=function(x){var S=x.__SPECTOR_Object_CustomData;return S?S.target===ee.TEXTURE_2D_ARRAY.name||S.target===ee.TEXTURE_3D.name?0:S.length:0},t.prototype.update=function(x,S,w){if(x.arguments.length>=2&&0!==x.arguments[1])return 0;var U=this.getCustomData(x,S,w);if(!U)return 0;var G=w.__SPECTOR_Object_CustomData?w.__SPECTOR_Object_CustomData.length:0;if(U.isCompressed){if(x.arguments.length>=7){var H=x.arguments[6];U.length="number"==typeof H?H:null==H?void 0:H.byteLength}}else{var z="TEXTURE_2D"===S?1:6,j=U.internalFormat;j===ee.RGBA.value&&(U.type===ee.FLOAT.value&&(j=ee.RGBA32F.value),U.type===ee.HALF_FLOAT_OES.value&&(j=ee.RGBA16F.value)),U.length=U.width*U.height*z*this.getByteSizeForInternalFormat(j)}return U.length=0|U.length,w.__SPECTOR_Object_CustomData=U,U.length-G},t.prototype.getCustomData=function(x,S,w){return"texImage2D"===x.name?this.getTexImage2DCustomData(x,S,w):"compressedTexImage2D"===x.name?this.getCompressedTexImage2DCustomData(x,S,w):"texStorage2D"===x.name?this.getTexStorage2DCustomData(x,S,w):void 0},t.prototype.getTexStorage2DCustomData=function(x,S,w){var U;return 5===x.arguments.length&&(U={target:S,internalFormat:x.arguments[2],width:x.arguments[3],height:x.arguments[4],length:0,isCompressed:!1}),U},t.prototype.getCompressedTexImage2DCustomData=function(x,S,w){var U;if(0===x.arguments[1])return x.arguments.length>=7&&(U={target:S,internalFormat:x.arguments[2],width:x.arguments[3],height:x.arguments[4],length:0,isCompressed:!0}),U},t.prototype.getTexImage2DCustomData=function(x,S,w){var U;if(0===x.arguments[1])return x.arguments.length>=8?U={target:S,internalFormat:x.arguments[2],width:x.arguments[3],height:x.arguments[4],format:x.arguments[6],type:x.arguments[7],length:0,isCompressed:!1}:6===x.arguments.length&&(U={target:S,internalFormat:x.arguments[2],width:x.arguments[5].width,height:x.arguments[5].height,format:x.arguments[3],type:x.arguments[4],length:0,isCompressed:!1}),U},t}(Tn),Fn=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),On=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Fn(t,x),Object.defineProperty(t.prototype,"objectName",{get:function(){return"Texture3d"},enumerable:!0,configurable:!0}),t.prototype.getCreateCommandNames=function(){return["createTexture"]},t.prototype.getUpdateCommandNames=function(){return["texImage3D","compressedTexImage3D","texStorage3D"]},t.prototype.getDeleteCommandNames=function(){return["deleteTexture"]},t.prototype.getBoundInstance=function(x){var S=this.options.context;return x===ee.TEXTURE_2D_ARRAY.value?S.getParameter(ee.TEXTURE_BINDING_2D_ARRAY.value):x===ee.TEXTURE_3D.value?S.getParameter(ee.TEXTURE_BINDING_3D.value):void 0},t.prototype.delete=function(x){var S=x.__SPECTOR_Object_CustomData;return S?S.target!==ee.TEXTURE_2D_ARRAY.name&&S.target!==ee.TEXTURE_3D.name?0:S.length:0},t.prototype.update=function(x,S,w){if(x.arguments.length>=2&&0!==x.arguments[1])return 0;var U=this.getCustomData(x,S,w);if(!U)return 0;var G=w.__SPECTOR_Object_CustomData?w.__SPECTOR_Object_CustomData.length:0;if(U.isCompressed){if(x.arguments.length>=7){var H=x.arguments[6];U.length="number"==typeof H?H:null==H?void 0:H.byteLength}}else U.length=U.width*U.height*U.depth*this.getByteSizeForInternalFormat(U.internalFormat);return U.length=0|U.length,w.__SPECTOR_Object_CustomData=U,U.length-G},t.prototype.getCustomData=function(x,S,w){return"texImage3D"===x.name?this.getTexImage3DCustomData(x,S,w):"compressedTexImage3D"===x.name?this.getCompressedTexImage3DCustomData(x,S,w):"texStorage3D"===x.name?this.getTexStorage3DCustomData(x,S,w):void 0},t.prototype.getTexStorage3DCustomData=function(x,S,w){var U;return 6===x.arguments.length&&(U={target:S,internalFormat:x.arguments[2],width:x.arguments[3],height:x.arguments[4],depth:x.arguments[5],length:0,isCompressed:!1}),U},t.prototype.getCompressedTexImage3DCustomData=function(x,S,w){var U;if(0===x.arguments[1])return x.arguments.length>=8&&(U={target:S,internalFormat:x.arguments[2],width:x.arguments[3],height:x.arguments[4],depth:x.arguments[5],length:0,isCompressed:!0}),U},t.prototype.getTexImage3DCustomData=function(x,S,w){var U;if(0===x.arguments[1])return x.arguments.length>=9&&(U={target:S,internalFormat:x.arguments[2],width:x.arguments[3],height:x.arguments[4],depth:x.arguments[5],format:x.arguments[7],type:x.arguments[8],length:0,isCompressed:!1}),U},t}(Tn),Nn=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Bn=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Nn(t,x),Object.defineProperty(t.prototype,"objectName",{get:function(){return"Program"},enumerable:!0,configurable:!0}),t.prototype.getCreateCommandNames=function(){return["createProgram"]},t.prototype.getUpdateCommandNames=function(){return["linkProgram"]},t.prototype.getDeleteCommandNames=function(){return["deleteProgram"]},t.prototype.getBoundInstance=function(x){return x},t.prototype.delete=function(x){var S=x.__SPECTOR_Object_CustomData;return S?S.length:0},t.prototype.update=function(x,S,w){if(x.arguments.length>=1&&!x.arguments[0])return 0;var U=this.getCustomData(w);if(!U)return 0;var G=w.__SPECTOR_Object_CustomData?w.__SPECTOR_Object_CustomData.length:0;return w.__SPECTOR_Object_CustomData=U,U.length-G},t.prototype.getCustomData=function(x){var S=this.options.context;return bn.getProgramData(S,x)},t}(Tn),Dn=function(){function e(x){this.contextInformation=x,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}return e.prototype.recordCommand=function(x){var S=this.onCommandCallbacks[x.name];if(S)for(var w=0,U=S;w 0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}},e.prototype.spyContext=function(x){var S=[];for(var w in x)w&&S.push(w);for(var U=0;U -1&&(z[0]=S.getCallback(S,G,U?function(){w[x](G)}:null)),Ae.executeOriginFunction(w,x,z)}},e.prototype.getCallback=function(x,S,w){return void 0===w&&(w=null),function(){var U=X.now;if(x.lastFrame=++x.lastFrame%x.speedRatio,x.willPlayNextFrame||x.speedRatio&&!x.lastFrame){x.onFrameStart.trigger(x);try{S.apply(x.spiedWindow,arguments)}catch(S){x.onError.trigger(S)}x.lastSixtyFramesCurrentIndex=(x.lastSixtyFramesCurrentIndex+1)%e.fpsWindowSize,x.lastSixtyFramesDuration[x.lastSixtyFramesCurrentIndex]=U-x.lastSixtyFramesPreviousStart,x.onFrameEnd.trigger(x),x.willPlayNextFrame=!1}else w&&w();x.lastSixtyFramesPreviousStart=U}},e.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],e.setTimerFunctions=["setTimeout","setInterval"],e.setTimerCommonValues=[0,15,16,33,32,40],e.fpsWindowSize=60,e}(),Zn=function(){function e(x){this.canvas=x,this.onContextRequested=new j,this.init()}return e.prototype.init=function(){var x=this,t=function(){var S=this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,w=x.canvas?Ae.executeOriginFunction(this,"getContext",arguments):Ae.executePrototypeOriginFunction(this,S,"getContext",arguments);if(arguments.length>0&&"2d"===arguments[0])return w;if(w){var U=Array.prototype.slice.call(arguments),G="webgl2"===U[0]||"experimental-webgl2"===U[0]?2:1;x.onContextRequested.trigger({context:w,contextVersion:G})}return w};this.canvas?(Ae.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):(Ae.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t,"undefined"!=typeof OffscreenCanvas&&(Ae.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))},e}(),Jn=(w(11),function(){function e(x,S){this.placeHolder=x,this.stateStore=S}return e.prototype.compose=function(x){var S=this.stateStore.getStatesToProcess(),w=!1;for(var U in S)if(S.hasOwnProperty(U)){var G=S[U],H=this.stateStore.getLastOperation(G),z=this.stateStore.getComponentInstance(G),j=this.stateStore.getData(G);z.render(j,G,H),w=!0}if(w){var X=this.stateStore.getLastOperation(x);this.composeInContainer(this.placeHolder,Number.MAX_VALUE,x,X)}},e.prototype.composeChildren=function(x,S){if(S)for(var w=this.stateStore.getChildrenIds(x),U=0,G=0;G 0},e.prototype.add=function(x,S){var w=this.getNewId();return this.pendingOperation[w]=w,this.store[w]={data:x,id:w,parent:null,children:[],componentInstance:S,lastOperation:20},w},e.prototype.update=function(x,S){this.store[x],this.pendingOperation[x]=x,this.store[x].data=S,this.store[x].lastOperation=40},e.prototype.addChild=function(x,S,w){var U=this.store[x],G=this.add(S,w);this.pendingOperation[G]=G;var H=this.store[G];return H.parent=U,U.children.push(H),G},e.prototype.insertChildAt=function(x,S,w,U){var G=this.store[x],H=this.add(w,U);this.pendingOperation[H]=H;var z=this.store[H];return z.parent=G,S>=G.children.length?G.children.push(z):S>=0?G.children.splice(S,0,z):G.children.unshift(z),H},e.prototype.removeChildById=function(x,S){for(var w=this.store[x],U=w.children.length-1;U>=0;U--)if(w.children[U].id===S){this.removeChildAt(x,U);break}},e.prototype.removeChildAt=function(x,S){var w,U=this.store[x];S>U.children.length-1?(w=U.children[U.children.length-1],U.children[U.children.length-1].parent=null,U.children.splice(U.children.length-1,1)):S>=0?(w=U.children[S],U.children[S].parent=null,U.children.splice(S,1)):(w=U.children[0],U.children[0].parent=null,U.children.splice(0,1)),w.parent=null,this.remove(w.id)},e.prototype.remove=function(x){var S=this.store[x];S.parent?(this.store[S.parent.id],this.removeChildById(S.parent.id,x)):(this.removeChildren(x),this.store[x].lastOperation=50,this.pendingOperation[x]=x)},e.prototype.removeChildren=function(x){for(var S=this.store[x];S.children.length;)this.remove(S.children[0].id)},e.prototype.getStatesToProcess=function(){return this.pendingOperation},e.prototype.flushPendingOperations=function(){for(var x in this.pendingOperation)this.pendingOperation[x]&&(50===this.store[x].lastOperation?delete this.store[x]:this.store[x].lastOperation=0);this.pendingOperation={}},e.prototype.getNewId=function(){return++this.idGenerator},e}(),ni=function(){function e(x){this.component=x}return e.prototype.render=function(x,S,w){0!==w&&(50!==w?this.domNode=this.component.render(x,S):this.removeNode())},e.prototype.composeInContainer=function(x,S,w){if(50===w)return this.removeNode(),null;var U=this.cachedCurrentChildrenContainer;if(0===w)return U;var G=this.domNode,H=G.getAttribute("childrencontainer")?G:G.querySelector("[childrenContainer]");if(H&&U)for(var z=U.children;z.length>0;)H.appendChild(z[0]);if(this.cachedCurrentChildrenContainer=H,S>=x.children.length)x.appendChild(G),this.cachedCurrentDomNode&&40===w&&(this.cachedCurrentDomNode.remove?this.cachedCurrentDomNode.remove():this.cachedCurrentDomNode.parentNode&&this.cachedCurrentDomNode.parentNode.removeChild(this.cachedCurrentDomNode));else{var j=x.children[S];x.insertBefore(G,j),40===w&&x.removeChild(j)}return this.cachedCurrentDomNode=this.domNode,H},e.prototype.removeNode=function(){this.domNode&&this.domNode.parentElement&&(this.domNode.remove?this.domNode.remove():this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode)),this.cachedCurrentDomNode&&this.cachedCurrentDomNode.parentElement&&(this.cachedCurrentDomNode.remove?this.cachedCurrentDomNode.remove():this.cachedCurrentDomNode.parentNode&&this.cachedCurrentDomNode.parentNode.removeChild(this.cachedCurrentDomNode))},e.idGenerator=0,e}(),ii=function(){function e(x){this.stateStore=new ei,this.compositor=new Jn(x,this.stateStore),this.willRender=!1,this.rootStateId=-1}return e.prototype.addRootState=function(x,S,w){void 0===w&&(w=!1);var U=new ni(S),G=this.stateStore.add(x,U);return this.rootStateId=G,this.setForRender(w),G},e.prototype.addChildState=function(x,S,w,U){void 0===U&&(U=!1);var G=this.insertChildState(x,S,Number.MAX_VALUE,w);return this.setForRender(U),G},e.prototype.insertChildState=function(x,S,w,U,G){void 0===G&&(G=!1);var H=new ni(U),z=this.stateStore.insertChildAt(x,w,S,H);return this.setForRender(G),z},e.prototype.updateState=function(x,S,w){void 0===w&&(w=!1),this.stateStore.update(x,S),this.setForRender(w)},e.prototype.removeState=function(x,S){void 0===S&&(S=!1),this.stateStore.remove(x),this.setForRender(S)},e.prototype.removeChildrenStates=function(x,S){void 0===S&&(S=!1),this.stateStore.removeChildren(x),this.setForRender(S)},e.prototype.getState=function(x){return this.stateStore.getData(x)},e.prototype.getGenericState=function(x){return this.getState(x)},e.prototype.getChildrenState=function(x){var S=this;return this.stateStore.getChildrenIds(x).map((function(w){return S.stateStore.getData(x)}))},e.prototype.getChildrenGenericState=function(x){return this.getChildrenState(x)},e.prototype.hasChildren=function(x){return this.stateStore.hasChildren(x)},e.prototype.updateAllChildrenState=function(x,S){for(var w=0,U=this.stateStore.getChildrenIds(x);w 0&&"$"===U[U.length-1]?U=U.slice(0,-1):x=S.htmlEscape(x),H+=U,H+=x})),H+=G[G.length-1]},e.prototype.htmlEscape=function(x){return null==x||0===x.length?x:(this.dummyTextGeneratorElement.innerText=x,this.dummyTextGeneratorElement.innerHTML)},e}()),ai=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),un=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},li=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return ai(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(oe||(oe=un([' \n"],['\n\n\n ',"\n\n\n"])),x?"active":"",x.logVisible?"active":"",x.logLevel===U.error?"error":"",x.logText);return this.renderElementFromTemplate(w,x,S)},t}(oi),ci=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),ui=function(x){function t(){var S=x.call(this)||this;return S.onCanvasSelected=S.createEvent("onCanvasSelected"),S}return ci(t,x),t.prototype.render=function(x,S){var w=document.createElement("li"),U=document.createElement("span");return U.innerText="Id: "+x.id+" - Size: "+x.width+"*"+x.height,w.appendChild(U),this.mapEventListener(w,"click","onCanvasSelected",x,S),w},t}(oi),di=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),fn=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},pi=function(x){function t(){var S=x.call(this)||this;return S.onCaptureRequested=S.createEvent("onCaptureRequested"),S.onPlayRequested=S.createEvent("onPlayRequested"),S.onPauseRequested=S.createEvent("onPauseRequested"),S.onPlayNextFrameRequested=S.createEvent("onPlayNextFrameRequested"),S}return di(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(ae||(ae=fn(['\n\n\n\n ',"\n\n\n"],['\n\n\n $',"\n\n"])),x?'\n\n $',"\n\n':'\n\n\n');return this.renderElementFromTemplate(w,x,S)},t}(oi),fi=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),_n=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},gi=function(x){function t(){var S=x.call(this)||this;return S.onCanvasSelection=S.createEvent("onCanvasSelection"),S}return fi(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(se||(se=_n(['\n\n \n ','\n \n'],['\n\n
\n \n ','\n \n'])),x.currentCanvasInformation?x.currentCanvasInformation.id+" ("+x.currentCanvasInformation.width+"*"+x.currentCanvasInformation.height+")":"Choose Canvas...",x.showList?"display:block;visibility:visible":"display:none;visibility:hidden");return this.renderElementFromTemplate(w,x,S)},t}(oi),_i=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),yi=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return _i(t,x),t.prototype.render=function(x,S){var w=document.createElement("span");return w.className="fpsCounterComponent",w.innerText=x.toFixed(2)+" Fps",w},t}(oi),bi=function(){function e(x){var S=this;void 0===x&&(x={}),this.options=x,this.rootPlaceHolder=x.rootPlaceHolder||document.body,this.mvx=new ii(this.rootPlaceHolder),this.isTrackingCanvas=!1,this.onCanvasSelected=new j,this.onCaptureRequested=new j,this.onPauseRequested=new j,this.onPlayRequested=new j,this.onPlayNextFrameRequested=new j,this.captureMenuComponent=new li,this.canvasListComponent=new gi,this.canvasListItemComponent=new ui,this.actionsComponent=new pi,this.fpsCounterComponent=new yi,this.rootStateId=this.mvx.addRootState({visible:!0,logLevel:U.info,logText:e.SelectCanvasHelpText,logVisible:!this.options.hideLog},this.captureMenuComponent),this.canvasListStateId=this.mvx.addChildState(this.rootStateId,{currentCanvasInformation:null,showList:!1},this.canvasListComponent),this.actionsStateId=this.mvx.addChildState(this.rootStateId,!0,this.actionsComponent),this.fpsStateId=this.mvx.addChildState(this.rootStateId,0,this.fpsCounterComponent),this.actionsComponent.onCaptureRequested.add((function(){var x=S.getSelectedCanvasInformation();x&&S.updateMenuStateLog(U.info,e.PleaseWaitHelpText,!0),setTimeout((function(){S.onCaptureRequested.trigger(x)}),200)})),this.actionsComponent.onPauseRequested.add((function(){S.onPauseRequested.trigger(S.getSelectedCanvasInformation()),S.mvx.updateState(S.actionsStateId,!1)})),this.actionsComponent.onPlayRequested.add((function(){S.onPlayRequested.trigger(S.getSelectedCanvasInformation()),S.mvx.updateState(S.actionsStateId,!0)})),this.actionsComponent.onPlayNextFrameRequested.add((function(){S.onPlayNextFrameRequested.trigger(S.getSelectedCanvasInformation())})),this.canvasListComponent.onCanvasSelection.add((function(x){S.mvx.updateState(S.canvasListStateId,{currentCanvasInformation:null,showList:!x.state.showList}),S.updateMenuStateLog(U.info,e.SelectCanvasHelpText),S.onCanvasSelected.trigger(null),S.isTrackingCanvas&&S.trackPageCanvases(),x.state.showList?S.showMenuStateLog():S.hideMenuStateLog()})),this.canvasListItemComponent.onCanvasSelected.add((function(x){S.mvx.updateState(S.canvasListStateId,{currentCanvasInformation:x.state,showList:!1}),S.onCanvasSelected.trigger(x.state),S.updateMenuStateLog(U.info,e.ActionsHelpText),S.showMenuStateLog()}))}return e.prototype.getSelectedCanvasInformation=function(){return this.mvx.getGenericState(this.canvasListStateId).currentCanvasInformation},e.prototype.trackPageCanvases=function(){if(this.isTrackingCanvas=!0,document.body){var x=document.body.querySelectorAll("canvas");this.updateCanvasesList(x)}},e.prototype.updateCanvasesList=function(x){this.updateCanvasesListInformationInternal(x,(function(x){return{id:x.id,width:x.width,height:x.height,ref:x}}))},e.prototype.updateCanvasesListInformation=function(x){this.updateCanvasesListInformationInternal(x,(function(x){return{id:x.id,width:x.width,height:x.height,ref:x.ref}}))},e.prototype.display=function(){this.updateMenuStateVisibility(!0)},e.prototype.hide=function(){this.updateMenuStateVisibility(!1)},e.prototype.captureComplete=function(x){x?this.updateMenuStateLog(U.error,x):this.updateMenuStateLog(U.info,e.ActionsHelpText)},e.prototype.setFPS=function(x){this.mvx.updateState(this.fpsStateId,x)},e.prototype.updateCanvasesListInformationInternal=function(x,S){this.mvx.removeChildrenStates(this.canvasListStateId);for(var w=[],G=0;G\n
\n \n Drag files here to open a previously saved capture.\n\n\n '],['\n
\n'])),x?"active":""),G=this.renderElementFromTemplate(U,x,S),H=G.querySelector(".openCaptureFile");return H.addEventListener("dragenter",(function(x){return w.drag(x),!1}),!1),H.addEventListener("dragover",(function(x){return w.drag(x),!1}),!1),H.addEventListener("drop",(function(x){w.drop(x)}),!1),G},t.prototype.drag=function(x){x.stopPropagation(),x.preventDefault()},t.prototype.drop=function(x){x.stopPropagation(),x.preventDefault(),this.loadFiles(x)},t.prototype.loadFiles=function(x){var S=this,w=null;if(x&&x.dataTransfer&&x.dataTransfer.files&&(w=x.dataTransfer.files),x&&x.target&&x.target.files&&(w=x.target.files),w&&w.length>0)for(var i=function(x){var U=w[x].name.toLowerCase().split(".").pop();if(w[x].type,"json"===U){var G=w[x],H=new FileReader;H.onerror=function(x){z.error("Error while reading file: "+G.name+x)},H.onload=function(x){try{var w=JSON.parse(x.target.result);S.onCaptureLoaded.trigger(w)}catch(x){z.error("Error while reading file: "+G.name+x)}},H.readAsText(G)}},U=0;U\n Drag files here to open a previously saved capture.\n\n\n
\n \n '],['\n
\n'])));return this.renderElementFromTemplate(w,x,S)},t}(oi),Ai=function(){function e(){}return e.scrollIntoView=function(x){for(var S=x.getBoundingClientRect(),w=x.parentElement;w&&w.clientHeight===w.offsetHeight;)w=w.parentElement;if(w){var U=w.getBoundingClientRect();S.top\n
U.bottom&&x.scrollIntoView(!1)}},e}(),Mi=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Ri=function(x){function t(){var S=x.call(this)||this;return S.onVisualStateSelected=S.createEvent("onVisualStateSelected"),S}return Mi(t,x),t.prototype.render=function(x,S){var w=document.createElement("li");if(x.active&&(w.className="active",setTimeout((function(){Ai.scrollIntoView(w)}),1)),x.VisualState.Attachments)for(var U=0,G=x.VisualState.Attachments;U 1){var j=document.createElement("span");j.innerText=H.attachmentName,w.appendChild(j)}if(H.textureLayer){var X=document.createElement("span");X.innerText="Layer: "+H.textureLayer,w.appendChild(X)}if(H.textureCubeMapFace){var K=document.createElement("span");K.innerText=H.textureCubeMapFace,w.appendChild(K)}}}else{var q=document.createElement("span");q.innerText=x.VisualState.FrameBufferStatus,w.appendChild(q)}var Y=document.createElement("span");return Y.innerText=x.VisualState.FrameBuffer?"Frame buffer: "+x.VisualState.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer",w.appendChild(Y),this.mapEventListener(w,"click","onVisualStateSelected",x,S),w},t}(oi),Li=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Pn=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},Ii=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Li(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(ue||(ue=Pn(['\n \n'],['\n\n
\n'])));return this.renderElementFromTemplate(w,x,S)},t}(oi),Pi=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Fi=function(x){function t(){var S=x.call(this)||this;return S.onCommandSelected=S.createEvent("onCommandSelected"),S.onVertexSelected=S.createEvent("onVertexSelected"),S.onFragmentSelected=S.createEvent("onFragmentSelected"),S}return Pi(t,x),t.prototype.render=function(x,S){var w=document.createElement("li"),U="unknown";switch(x.capture.status){case 50:U="deprecated";break;case 10:U="unused";break;case 20:U="disabled";break;case 30:U="redundant";break;case 40:U="valid"}if(x.capture.VisualState&&(w.className=" drawCall"),x.active&&(w.className=" active",setTimeout((function(){Ai.scrollIntoView(w)}),1)),x.capture.marker){var G=document.createElement("span");G.className=U+" marker important",G.innerText=x.capture.marker+" ",G.style.fontWeight="1000",w.appendChild(G)}var H=document.createElement("span"),z=x.capture.text;if(z=z.replace(x.capture.name,''+x.capture.name+""),H.innerHTML=z,w.appendChild(H),x.capture.VisualState&&"clear"!==x.capture.name)try{var j=x.capture.DrawCall.shaders[0],X=x.capture.DrawCall.shaders[1],K=document.createElement("a");K.innerText=j.name,K.href="#",w.appendChild(K),this.mapEventListener(K,"click","onVertexSelected",x,S);var q=document.createElement("a");q.innerText=X.name,q.href="#",w.appendChild(q),this.mapEventListener(q,"click","onFragmentSelected",x,S)}catch(x){}return this.mapEventListener(w,"click","onCommandSelected",x,S),w},t}(oi),Oi=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Un=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},Ni=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Oi(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(he||(he=Un(['\n\n
\n'],['\n\n'])));return this.renderElementFromTemplate(w,x,S)},t}(oi),Bi=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Vn=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},Di=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Bi(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(de||(de=Vn(['\n\n'],['\n\n'])));return this.renderElementFromTemplate(w,x,S)},t}(oi),ki=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),jn=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},Ui=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return ki(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(pe||(pe=jn(['\n\n'],['\n','\n\n
\n'])),x?x.replace(/([A-Z])/g," $1").trim():"");return this.renderElementFromTemplate(w,x,S)},t}(oi),Gi=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Yn=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},Vi=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Gi(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(me||(me=Yn(['\n','\n\n
',': '," "],['\n ',': '," "])),x.key,x.value);return this.renderElementFromTemplate(w,x,S)},t}(oi),Hi=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Qn=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},Wi=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Hi(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(fe||(fe=Qn(['\n "],['\n ',"
"])),x.value,x.key);return this.renderElementFromTemplate(w,x,S)},t}(oi),$i=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),ti=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},zi=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return $i(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(ge||(ge=ti(['\n ',"
',': \n ',' (Open help page)\n \n '],['\n ',': \n ',' (Open help page)\n \n '])),x.key,x.value,x.help);return this.renderElementFromTemplate(w,x,S)},t}(oi),ji=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),Xi=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return ji(t,x),t.prototype.render=function(x,S){var w=document.createElement("div");if(w.className="jsonVisualStateItemComponent",x.Attachments)for(var U=0,G=x.Attachments;U 1){var j=document.createElement("span");j.innerText=H.attachmentName,w.appendChild(j)}}}else{var X=document.createElement("span");X.innerText=x.FrameBufferStatus,w.appendChild(X)}var K=document.createElement("span");return K.innerText=x.FrameBuffer?x.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer",w.appendChild(K),w},t}(oi),Ki=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),si=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},qi=function(x){function t(){var S=x.call(this)||this;return S.onCapturesClicked=S.createEvent("onCapturesClicked"),S.onCommandsClicked=S.createEvent("onCommandsClicked"),S.onInformationClicked=S.createEvent("onInformationClicked"),S.onInitStateClicked=S.createEvent("onInitStateClicked"),S.onEndStateClicked=S.createEvent("onEndStateClicked"),S.onCloseClicked=S.createEvent("onCloseClicked"),S.onSearchTextChanged=S.createEvent("onSearchTextChanged"),S.onSearchTextCleared=S.createEvent("onSearchTextCleared"),S}return Ki(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(ve||(ve=si([' \n
'],['- Menu
\n\n- \n \n X\n
\n- Captures
\n- Information
\n- Init State
\n- \n \n Commands','\n \n
\n- End State
\n- Close
\n\n
'])),x.searchText,0===x.status?"active":"",10===x.status?"active":"",20===x.status?"active":"",40===x.status?"active":"",x.commandCount>0?" ("+x.commandCount+")":"",30===x.status?"active":""),U=this.renderElementFromTemplate(w,x,S),G=U.querySelector(".resultViewMenuOpen"),H=U.querySelectorAll("li:not(.resultViewMenuSmall)");return G.addEventListener("click",(function(x){if("true"===G.getAttribute("open")){G.setAttribute("open","false");for(var S=0;S- Menu
\n\n- \n \n X\n
\n- Captures
\n- Information
\n- Init State
\n- \n \n Commands','\n \n
\n- End State
\n- Close
\n',x,S)},t}(oi),Ji=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),hi=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},Qi=function(x){function t(){return null!==x&&x.apply(this,arguments)||this}return Ji(t,x),t.prototype.render=function(x,S){var w=this.htmlTemplate(_e||(_e=hi(['\n \n'],['\n\n'])),x?"active":"");return this.renderElementFromTemplate(w,x,S)},t}(oi),er=function(){var e=function(x,S){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(x,S)};return function(x,S){function i(){this.constructor=x}e(x,S),x.prototype=null===S?Object.create(S):(i.prototype=S.prototype,new i)}}(),mi=function(x,S){return Object.defineProperty?Object.defineProperty(x,"raw",{value:S}):x.raw=S,x},tr=function(x){function t(){var S=x.call(this)||this;return S.onTranslatedVertexSourceClicked=S.createEvent("onTranslatedVertexSourceClicked"),S.onTranslatedFragmentSourceClicked=S.createEvent("onTranslatedFragmentSourceClicked"),S.onVertexSourceClicked=S.createEvent("onVertexSourceClicked"),S.onFragmentSourceClicked=S.createEvent("onFragmentSourceClicked"),S.onSourceCodeCloseClicked=S.createEvent("onSourceCodeCloseClicked"),S.onSourceCodeChanged=S.createEvent("onSourceCodeChanged"),S}return er(t,x),t.prototype.showError=function(x){if(this.editor){var S=[];if(x=x||"")for(var w=/^.*ERROR:\W([0-9]+):([0-9]+):(.*)$/gm,U=w.exec(x);null!=U;)S.push({row:+U[2]-1,column:U[1],text:U[3]||"Error",type:"error"}),U=w.exec(x);this.editor.getSession().setAnnotations(S)}},t.prototype.render=function(x,S){var w,U=this,G=x.fragment?x.sourceFragment:x.sourceVertex;w=x.translated?x.fragment?x.translatedSourceFragment:x.translatedSourceVertex:G?this._indentIfdef(this._beautify(G)):"";var H=this.htmlTemplate(Ee||(Ee=mi(['\n "],['\n "])),x.translatedSourceVertex?this.htmlTemplate(ye||(ye=mi(['Translated Vertex '],['Translated Vertex '])),!x.fragment&&x.translated?"active":""):"",x.translatedSourceFragment?this.htmlTemplate(be||(be=mi(['Translated Fragment '],['Translated Fragment '])),x.fragment&&x.translated?"active":""):"",x.fragment||x.translated?"":"active",x.fragment&&!x.translated?"active":"",this.htmlTemplate(xe||(xe=mi(['',""],['',""])),w)),z=this.renderElementFromTemplate(H.replace(/
/g,"\n"),x,S);this.editor=ace.edit(z.querySelector(".sourceCodeComponent")),this.editor.setTheme("ace/theme/monokai"),this.editor.getSession().setMode("ace/mode/glsl"),this.editor.setShowPrintMargin(!1);var j=-1;return this.editor.setReadOnly(!x.editable&&!x.translated),this.editor.getSession().on("change",(function(w){-1!==j&&clearTimeout(j),j=setTimeout((function(){U._triggerCompilation(U.editor,x,z,S)}),1500)})),z},t.prototype._triggerCompilation=function(x,S,w,U){S.fragment?S.sourceFragment=x.getValue():S.sourceVertex=x.getValue(),this.triggerEvent("onSourceCodeChanged",w,S,U)},t.prototype._beautify=function(x,S){void 0===S&&(S=0),x=x.trim(),x=this._adaptComments(x);for(var w,U=this._getBracket(x),G=U.firstIteration,H=U.lastIteration,z="",j=0;j<\s]*=)\s*/g,(function(x){return" "+x.trim()+" "}))).replace(/\s*(,)\s*/g,(function(x){return x.trim()+" "}))).replace(/\n[ \t]+/g,"\n")).replace(/\n/g,"\n"+z)).replace(/\s+$/g,"")).replace(/\n+$/g,"");else{var X=x.substr(0,G),K=x.substr(H+1,x.length),q=x.substr(G+1,H-G-1).trim(),Y=this._beautify(q,S+1);w=(w=(w=this._beautify(X,S)+" {\n"+Y+"\n"+z+"}\n"+this._beautify(K,S)).replace(/\s*\n+\s*;/g,";")).replace(/#endif[\t \f\v]*{/g,"\n {")}return(w=(w=w.replace(t.semicolonReplacementKeyRegex,";")).replace(t.openCurlyReplacementKeyRegex,"{")).replace(t.closeCurlyReplacementKeyRegex,"}")},t.prototype._adaptComments=function(x){for(var S=!1,w=!1,U=0;U-1&&0===H?this._getBracket(x,w+1):{firstIteration:w,lastIteration:H}},t.prototype._indentIfdef=function(x){for(var S=0,w=x.split("\n"),U=0;U '],['\n '])),x?"informationColumnLeftComponent":"informationColumnRightComponent");return this.renderElementFromTemplate(w,x,S)},t}(oi),rr=function(){function e(){}return e.getMDNLink=function(x){var S=e.WebGL2Functions[x];if(S)return e.WebGL2RootUrl+S;var w=e.WebGLFunctions[x];return w?e.WebGLRootUrl+w:e.WebGLRootUrl+x},e.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",e.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",e.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},e.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},e}(),or=function(){function e(x){var S=this;void 0===x&&(x=null),this.rootPlaceHolder=x,this.onSourceCodeChanged=new j,this.rootPlaceHolder=this.rootPlaceHolder||document.body,this.mvx=new ii(this.rootPlaceHolder),this.searchText="",this.currentCommandId=-1,this.visible=!1,this.commandCount=0,this.commandListStateId=-1,this.commandDetailStateId=-1,this.currentCaptureStateId=-1,this.currentCommandStateId=-1,this.currentVisualStateId=-1,this.visualStateListStateId=-1,this.initVisualStateId=-1,this.sourceCodeComponentStateId=-1,this.captureListComponent=new Ei,this.captureListItemComponent=new Ti,this.visualStateListComponent=new Ci,this.visualStateListItemComponent=new Ri,this.commandListComponent=new Ii,this.commandListItemComponent=new Fi,this.commandDetailComponent=new Ni,this.jsonContentComponent=new Di,this.jsonGroupComponent=new Ui,this.jsonItemComponent=new Vi,this.jsonImageItemComponent=new Wi,this.jsonHelpItemComponent=new zi,this.jsonVisualStateItemComponent=new Xi,this.resultViewMenuComponent=new qi,this.resultViewContentComponent=new Zi,this.resultViewComponent=new Qi,this.sourceCodeComponent=new tr,this.informationColumnComponent=new ir,this.rootStateId=this.mvx.addRootState(null,this.resultViewComponent),this.menuStateId=this.mvx.addChildState(this.rootStateId,null,this.resultViewMenuComponent),this.contentStateId=this.mvx.addChildState(this.rootStateId,null,this.resultViewContentComponent),this.captureListStateId=this.mvx.addChildState(this.rootStateId,!1,this.captureListComponent),this.initKeyboardEvents(),this.initMenuComponent(),this.captureListComponent.onCaptureLoaded.add((function(x){S.addCapture(x)})),this.captureListItemComponent.onCaptureSelected.add((function(x){S.selectCapture(x.stateId)})),this.captureListItemComponent.onSaveRequested.add((function(x){S.saveCapture(x.state.capture)})),this.visualStateListItemComponent.onVisualStateSelected.add((function(x){S.selectVisualState(x.stateId)})),this.commandListItemComponent.onCommandSelected.add((function(x){S.selectCommand(x.stateId)})),this.commandListItemComponent.onVertexSelected.add((function(x){S.selectCommand(x.stateId),S.openShader(!1)})),this.commandListItemComponent.onFragmentSelected.add((function(x){S.selectCommand(x.stateId),S.openShader(!0)})),this.sourceCodeComponent.onSourceCodeCloseClicked.add((function(){S.displayCurrentCapture()})),this.sourceCodeComponent.onTranslatedVertexSourceClicked.add((function(x){var w=S.mvx.getGenericState(S.sourceCodeComponentStateId);w.fragment=!1,w.translated=!0,S.mvx.updateState(S.sourceCodeComponentStateId,w)})),this.sourceCodeComponent.onTranslatedFragmentSourceClicked.add((function(x){var w=S.mvx.getGenericState(S.sourceCodeComponentStateId);w.fragment=!0,w.translated=!0,S.mvx.updateState(S.sourceCodeComponentStateId,w)})),this.sourceCodeComponent.onVertexSourceClicked.add((function(x){var w=S.mvx.getGenericState(S.sourceCodeComponentStateId);w.fragment=!1,w.translated=!1,S.mvx.updateState(S.sourceCodeComponentStateId,w)})),this.sourceCodeComponent.onFragmentSourceClicked.add((function(x){var w=S.mvx.getGenericState(S.sourceCodeComponentStateId);w.fragment=!0,w.translated=!1,S.mvx.updateState(S.sourceCodeComponentStateId,w)})),this.sourceCodeComponent.onSourceCodeChanged.add((function(x){S.onSourceCodeChanged.trigger({programId:x.state.programId,sourceFragment:x.state.sourceFragment,sourceVertex:x.state.sourceVertex,translatedSourceFragment:x.state.translatedSourceFragment,translatedSourceVertex:x.state.translatedSourceVertex})})),this.updateViewState()}return e.prototype.saveCapture=function(x){var S=JSON.stringify(x,null,4),w=new Blob([S],{type:"octet/stream"}),U="capture "+new Date(x.startTime).toTimeString().split(" ")[0]+".json";if(navigator.msSaveBlob)navigator.msSaveBlob(w,U);else{var G=document.createElement("a"),H=window.URL.createObjectURL(w);G.setAttribute("href",H),G.setAttribute("download",U),G.click()}},e.prototype.selectCapture=function(x){this.currentCommandId=-1,this.currentCaptureStateId=x,this.displayCurrentCapture()},e.prototype.selectCommand=function(x){this.currentCommandStateId=x,this.currentVisualStateId=this.displayCurrentCommand(),this.displayCurrentVisualState()},e.prototype.selectVisualState=function(x){this.currentVisualStateId=x,this.currentCommandStateId=this.displayCurrentVisualState(),this.displayCurrentCommand()},e.prototype.display=function(){this.visible=!0,this.updateViewState()},e.prototype.hide=function(){this.visible=!1,this.updateViewState()},e.prototype.addCapture=function(x){var S=this.mvx.insertChildState(this.captureListStateId,{capture:x,active:!1},0,this.captureListItemComponent);return this.selectCapture(S),S},e.prototype.showSourceCodeError=function(x){this.sourceCodeComponent.showError(x)},e.prototype.initKeyboardEvents=function(){var x=this;this.rootPlaceHolder.addEventListener("keydown",(function(S){40===x.mvx.getGenericState(x.menuStateId).status&&(38===S.keyCode?(S.preventDefault(),S.stopPropagation(),x.selectPreviousCommand()):40===S.keyCode?(S.preventDefault(),S.stopPropagation(),x.selectNextCommand()):33===S.keyCode?(S.preventDefault(),S.stopPropagation(),x.selectPreviousVisualState()):34===S.keyCode&&(S.preventDefault(),S.stopPropagation(),x.selectNextVisualState()))}))},e.prototype.openShader=function(x){this.mvx.removeChildrenStates(this.contentStateId);var S=this.mvx.getGenericState(this.currentCommandStateId);this.sourceCodeComponentStateId=this.mvx.addChildState(this.contentStateId,{programId:S.capture.DrawCall.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:S.capture.DrawCall.shaders[0].name,nameFragment:S.capture.DrawCall.shaders[1].name,sourceVertex:S.capture.DrawCall.shaders[0].source,sourceFragment:S.capture.DrawCall.shaders[1].source,translatedSourceVertex:S.capture.DrawCall.shaders[0].translatedSource,translatedSourceFragment:S.capture.DrawCall.shaders[1].translatedSource,fragment:x,translated:!1,editable:S.capture.DrawCall.programStatus.RECOMPILABLE},this.sourceCodeComponent),this.commandDetailStateId=this.mvx.addChildState(this.contentStateId,null,this.commandDetailComponent),this.displayCurrentCommandDetail(S)},e.prototype.selectPreviousCommand=function(){var x=this.mvx.getGenericState(this.currentCommandStateId);x.previousCommandStateId<0||this.selectCommand(x.previousCommandStateId)},e.prototype.selectNextCommand=function(){var x=this.mvx.getGenericState(this.currentCommandStateId);x.nextCommandStateId<0||this.selectCommand(x.nextCommandStateId)},e.prototype.selectPreviousVisualState=function(){var x=this.mvx.getGenericState(this.currentVisualStateId);x.previousVisualStateId<0||this.selectVisualState(x.previousVisualStateId)},e.prototype.selectNextVisualState=function(){var x=this.mvx.getGenericState(this.currentVisualStateId);x.nextVisualStateId<0||this.selectVisualState(x.nextVisualStateId)},e.prototype.initMenuComponent=function(){var x=this;this.mvx.updateState(this.menuStateId,{status:0,searchText:this.searchText,commandCount:0}),this.resultViewMenuComponent.onCloseClicked.add((function(S){x.hide()})),this.resultViewMenuComponent.onCapturesClicked.add((function(S){x.displayCaptures()})),this.resultViewMenuComponent.onCommandsClicked.add((function(S){x.displayCurrentCapture()})),this.resultViewMenuComponent.onInformationClicked.add((function(S){x.displayInformation()})),this.resultViewMenuComponent.onInitStateClicked.add((function(S){x.displayInitState()})),this.resultViewMenuComponent.onEndStateClicked.add((function(S){x.displayEndState()})),this.resultViewMenuComponent.onSearchTextChanged.add((function(S){x.search(S.sender.value)})),this.resultViewMenuComponent.onSearchTextCleared.add((function(S){x.mvx.updateState(x.menuStateId,{status:S.state.status,searchText:"",commandCount:S.state.commandCount}),x.search("")}))},e.prototype.onCaptureRelatedAction=function(x){var S=this.mvx.getGenericState(this.currentCaptureStateId);return this.commandCount=S.capture.commands.length,this.mvx.removeChildrenStates(this.contentStateId),this.mvx.updateState(this.menuStateId,{status:x,searchText:this.searchText,commandCount:this.commandCount}),this.mvx.getGenericState(this.captureListStateId)&&this.mvx.updateState(this.captureListStateId,!1),S.capture},e.prototype.displayCaptures=function(){this.mvx.updateState(this.menuStateId,{status:0,searchText:this.searchText,commandCount:this.commandCount}),this.mvx.updateState(this.captureListStateId,!0)},e.prototype.displayInformation=function(){var x=this.onCaptureRelatedAction(10),S=this.mvx.addChildState(this.contentStateId,!0,this.informationColumnComponent),w=this.mvx.addChildState(this.contentStateId,!1,this.informationColumnComponent),U=this.mvx.addChildState(S,null,this.jsonContentComponent);this.displayJSONGroup(U,"Canvas",x.canvas),this.displayJSONGroup(U,"Context",x.context);for(var G=this.mvx.addChildState(w,null,this.jsonContentComponent),H=0,z=x.analyses;H 2&&-1===x.indexOf(this.searchText.toLowerCase()))},e.prototype.search=function(x){switch(this.searchText=x,this.mvx.getGenericState(this.menuStateId).status){case 0:case 40:this.displayCurrentCapture();break;case 30:this.displayEndState();break;case 10:this.displayInformation();break;case 20:this.displayInitState()}this.searchText=""},e}(),ar={CaptureMenu:bi,ResultView:or},sr=function(){function e(){this.noFrameTimeout=-1,this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.timeSpy=new qn,this.onCaptureStarted=new j,this.onCapture=new j,this.onError=new j,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this)}return e.getFirstAvailable3dContext=function(x){return this.tryGetContextFromHelperField(x)||this.tryGetContextFromCanvas(x,"webgl")||this.tryGetContextFromCanvas(x,"experimental-webgl")||this.tryGetContextFromCanvas(x,"webgl2")||this.tryGetContextFromCanvas(x,"experimental-webgl2")},e.tryGetContextFromHelperField=function(x){var S=x instanceof HTMLCanvasElement?x.getAttribute("__spector_context_type"):x.__spector_context_type;if(S)return this.tryGetContextFromCanvas(x,S)},e.tryGetContextFromCanvas=function(x,S){var w;try{w=x.getContext(S)}catch(x){}return w},e.prototype.displayUI=function(x){var S=this;void 0===x&&(x=!1),this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add((function(x){x&&S.captureCanvas(x.ref)}),this),setInterval((function(){S.captureMenu.setFPS(S.getFps())}),1e3),x||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add((function(x){S.resultView.display(),S.resultView.addCapture(x)})))},e.prototype.getResultUI=function(){var x=this;return this.resultView||(this.resultView=new or,this.resultView.onSourceCodeChanged.add((function(S){x.rebuildProgramFromProgramId(S.programId,S.sourceVertex,S.sourceFragment,(function(w){x.referenceNewProgram(S.programId,w),x.resultView.showSourceCodeError(null)}),(function(S){x.resultView.showSourceCodeError(S)}))}))),this.resultView},e.prototype.getCaptureUI=function(){return this.captureMenu||(this.captureMenu=new bi),this.captureMenu},e.prototype.rebuildProgramFromProgramId=function(x,S,w,U,G){var H=an.getFromGlobalStore(x);this.rebuildProgram(H,S,w,U,G)},e.prototype.rebuildProgram=function(x,S,w,U,H){G.rebuildProgram(x,S,w,U,H)},e.prototype.referenceNewProgram=function(x,S){an.updateInGlobalStore(x,S)},e.prototype.pause=function(){this.timeSpy.changeSpeedRatio(0)},e.prototype.play=function(){this.timeSpy.changeSpeedRatio(1)},e.prototype.playNextFrame=function(){this.timeSpy.playNextFrame()},e.prototype.drawOnlyEveryXFrame=function(x){this.timeSpy.changeSpeedRatio(x)},e.prototype.getFps=function(){return this.timeSpy.getFps()},e.prototype.spyCanvases=function(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new Zn,this.canvasSpy.onContextRequested.add(this.spyContext,this))},e.prototype.spyCanvas=function(x){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new Zn(x),this.canvasSpy.onContextRequested.add(this.spyContext,this))},e.prototype.getAvailableContexts=function(){return this.getAvailableContexts()},e.prototype.captureCanvas=function(x,S,w,U){void 0===S&&(S=0),void 0===w&&(w=!1),void 0===U&&(U=!1);var G=this.getAvailableContextSpyByCanvas(x);if(G)this.captureContextSpy(G,S,w,U);else{var H=e.getFirstAvailable3dContext(x);H?this.captureContext(H,S,w,U):z.error("No webgl context available on the chosen canvas.")}},e.prototype.captureContext=function(x,S,w,U){void 0===S&&(S=0),void 0===w&&(w=!1),void 0===U&&(U=!1);var G=this.getAvailableContextSpyByCanvas(x.canvas);G||((G=x.getIndexedParameter?new Kn({context:x,version:2,recordAlways:!1}):new Kn({context:x,version:1,recordAlways:!1})).onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:G.context.canvas,contextSpy:G})),G&&this.captureContextSpy(G,S,w,U)},e.prototype.captureContextSpy=function(x,S,w,U){var G=this;void 0===S&&(S=0),void 0===w&&(w=!1),void 0===U&&(U=!1),this.quickCapture=w,this.fullCapture=U,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=x,this.capturingContext.setMarker(this.marker),(S=Math.min(S,5e3))>0?this.captureCommands(S):this.captureFrames(1),this.noFrameTimeout=setTimeout((function(){S>0?G.stopCapture():G.capturingContext&&G.retry>1?G.onErrorInternal("No frames with gl commands detected. Try moving the camera."):G.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")}),1e4))},e.prototype.captureNextFrame=function(x,S,w){void 0===S&&(S=!1),void 0===w&&(w=!1),x instanceof HTMLCanvasElement||self.OffscreenCanvas&&x instanceof OffscreenCanvas?this.captureCanvas(x,0,S,w):this.captureContext(x,0,S,w)},e.prototype.startCapture=function(x,S,w,U){void 0===w&&(w=!1),void 0===U&&(U=!1),x instanceof HTMLCanvasElement||self.OffscreenCanvas&&x instanceof OffscreenCanvas?this.captureCanvas(x,S,w,U):this.captureContext(x,S,w,U)},e.prototype.stopCapture=function(){if(this.capturingContext){var x=this.capturingContext.stopCapture();if(x.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(x),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,x;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}},e.prototype.setMarker=function(x){this.marker=x,this.capturingContext&&this.capturingContext.setMarker(x)},e.prototype.clearMarker=function(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()},e.prototype.captureFrames=function(x){this.captureNextFrames=x,this.captureNextCommands=0,this.playNextFrame()},e.prototype.captureCommands=function(x){this.captureNextFrames=0,this.captureNextCommands=x,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(x,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)},e.prototype.spyContext=function(x){var S=this.getAvailableContextSpyByCanvas(x.context.canvas);S||((S=new Kn({context:x.context,version:x.contextVersion,recordAlways:!0})).onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:S.context.canvas,contextSpy:S})),S.spy()},e.prototype.getAvailableContextSpyByCanvas=function(x){for(var S=0,w=this.contexts;S 0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)},e.prototype.onFrameEnd=function(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()},e.prototype.triggerCapture=function(x){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(x)},e.prototype.onErrorInternal=function(x){if(z.error(x),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw x;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(x),this.onError.trigger(x)},e}()}])},792:function(x){x.exports=function(){"use strict";var c=function(){var x=0,S=document.createElement("div");function e(x){return S.appendChild(x.dom),x}function t(w){for(var U=0;U {var U=w(212);U.OrbitControls=function(x,S){var w,G,H,z,j;void 0===S&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),S===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=x,this.domElement=S,this.enabled=!0,this.target=new U.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:U.MOUSE.ROTATE,MIDDLE:U.MOUSE.DOLLY,RIGHT:U.MOUSE.PAN},this.touches={ONE:U.TOUCH.ROTATE,TWO:U.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return ee.phi},this.getAzimuthalAngle=function(){return ee.theta},this.saveState=function(){X.target0.copy(X.target),X.position0.copy(X.object.position),X.zoom0=X.object.zoom},this.reset=function(){X.target.copy(X.target0),X.object.position.copy(X.position0),X.object.zoom=X.zoom0,X.object.updateProjectionMatrix(),X.dispatchEvent(K),X.update(),J=Z.NONE},this.update=(w=new U.Vector3,G=(new U.Quaternion).setFromUnitVectors(x.up,new U.Vector3(0,1,0)),H=G.clone().inverse(),z=new U.Vector3,j=new U.Quaternion,function update(){var x=X.object.position;return w.copy(x).sub(X.target),w.applyQuaternion(G),ee.setFromVector3(w),X.autoRotate&&J===Z.NONE&&rotateLeft(function getAutoRotationAngle(){return 2*Math.PI/60/60*X.autoRotateSpeed}()),X.enableDamping?(ee.theta+=te.theta*X.dampingFactor,ee.phi+=te.phi*X.dampingFactor):(ee.theta+=te.theta,ee.phi+=te.phi),ee.theta=Math.max(X.minAzimuthAngle,Math.min(X.maxAzimuthAngle,ee.theta)),ee.phi=Math.max(X.minPolarAngle,Math.min(X.maxPolarAngle,ee.phi)),ee.makeSafe(),ee.radius*=ne,ee.radius=Math.max(X.minDistance,Math.min(X.maxDistance,ee.radius)),!0===X.enableDamping?X.target.addScaledVector(ie,X.dampingFactor):X.target.add(ie),w.setFromSpherical(ee),w.applyQuaternion(H),x.copy(X.target).add(w),X.object.lookAt(X.target),!0===X.enableDamping?(te.theta*=1-X.dampingFactor,te.phi*=1-X.dampingFactor,ie.multiplyScalar(1-X.dampingFactor)):(te.set(0,0,0),ie.set(0,0,0)),ne=1,!!(re||z.distanceToSquared(X.object.position)>Q||8*(1-j.dot(X.object.quaternion))>Q)&&(X.dispatchEvent(K),z.copy(X.object.position),j.copy(X.object.quaternion),re=!1,!0)}),this.dispose=function(){X.domElement.removeEventListener("contextmenu",onContextMenu,!1),X.domElement.removeEventListener("mousedown",onMouseDown,!1),X.domElement.removeEventListener("wheel",onMouseWheel,!1),X.domElement.removeEventListener("touchstart",onTouchStart,!1),X.domElement.removeEventListener("touchend",onTouchEnd,!1),X.domElement.removeEventListener("touchmove",onTouchMove,!1),document.removeEventListener("mousemove",onMouseMove,!1),document.removeEventListener("mouseup",onMouseUp,!1),X.domElement.removeEventListener("keydown",onKeyDown,!1)};var X=this,K={type:"change"},q={type:"start"},Y={type:"end"},Z={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},J=Z.NONE,Q=1e-6,ee=new U.Spherical,te=new U.Spherical,ne=1,ie=new U.Vector3,re=!1,oe=new U.Vector2,ae=new U.Vector2,se=new U.Vector2,le=new U.Vector2,ce=new U.Vector2,ue=new U.Vector2,he=new U.Vector2,de=new U.Vector2,pe=new U.Vector2;function getZoomScale(){return Math.pow(.95,X.zoomSpeed)}function rotateLeft(x){te.theta-=x}function rotateUp(x){te.phi-=x}var me,fe=(me=new U.Vector3,function panLeft(x,S){me.setFromMatrixColumn(S,0),me.multiplyScalar(-x),ie.add(me)}),ge=function(){var x=new U.Vector3;return function panUp(S,w){!0===X.screenSpacePanning?x.setFromMatrixColumn(w,1):(x.setFromMatrixColumn(w,0),x.crossVectors(X.object.up,x)),x.multiplyScalar(S),ie.add(x)}}(),ve=function(){var x=new U.Vector3;return function pan(S,w){var U=X.domElement;if(X.object.isPerspectiveCamera){var G=X.object.position;x.copy(G).sub(X.target);var H=x.length();H*=Math.tan(X.object.fov/2*Math.PI/180),fe(2*S*H/U.clientHeight,X.object.matrix),ge(2*w*H/U.clientHeight,X.object.matrix)}else X.object.isOrthographicCamera?(fe(S*(X.object.right-X.object.left)/X.object.zoom/U.clientWidth,X.object.matrix),ge(w*(X.object.top-X.object.bottom)/X.object.zoom/U.clientHeight,X.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),X.enablePan=!1)}}();function dollyIn(x){X.object.isPerspectiveCamera?ne/=x:X.object.isOrthographicCamera?(X.object.zoom=Math.max(X.minZoom,Math.min(X.maxZoom,X.object.zoom*x)),X.object.updateProjectionMatrix(),re=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),X.enableZoom=!1)}function dollyOut(x){X.object.isPerspectiveCamera?ne*=x:X.object.isOrthographicCamera?(X.object.zoom=Math.max(X.minZoom,Math.min(X.maxZoom,X.object.zoom/x)),X.object.updateProjectionMatrix(),re=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),X.enableZoom=!1)}function handleMouseDownRotate(x){oe.set(x.clientX,x.clientY)}function handleMouseDownPan(x){le.set(x.clientX,x.clientY)}function handleTouchStartRotate(x){if(1==x.touches.length)oe.set(x.touches[0].pageX,x.touches[0].pageY);else{var S=.5*(x.touches[0].pageX+x.touches[1].pageX),w=.5*(x.touches[0].pageY+x.touches[1].pageY);oe.set(S,w)}}function handleTouchStartPan(x){if(1==x.touches.length)le.set(x.touches[0].pageX,x.touches[0].pageY);else{var S=.5*(x.touches[0].pageX+x.touches[1].pageX),w=.5*(x.touches[0].pageY+x.touches[1].pageY);le.set(S,w)}}function handleTouchStartDolly(x){var S=x.touches[0].pageX-x.touches[1].pageX,w=x.touches[0].pageY-x.touches[1].pageY,U=Math.sqrt(S*S+w*w);he.set(0,U)}function handleTouchMoveRotate(x){if(1==x.touches.length)ae.set(x.touches[0].pageX,x.touches[0].pageY);else{var S=.5*(x.touches[0].pageX+x.touches[1].pageX),w=.5*(x.touches[0].pageY+x.touches[1].pageY);ae.set(S,w)}se.subVectors(ae,oe).multiplyScalar(X.rotateSpeed);var U=X.domElement;rotateLeft(2*Math.PI*se.x/U.clientHeight),rotateUp(2*Math.PI*se.y/U.clientHeight),oe.copy(ae)}function handleTouchMovePan(x){if(1==x.touches.length)ce.set(x.touches[0].pageX,x.touches[0].pageY);else{var S=.5*(x.touches[0].pageX+x.touches[1].pageX),w=.5*(x.touches[0].pageY+x.touches[1].pageY);ce.set(S,w)}ue.subVectors(ce,le).multiplyScalar(X.panSpeed),ve(ue.x,ue.y),le.copy(ce)}function handleTouchMoveDolly(x){var S=x.touches[0].pageX-x.touches[1].pageX,w=x.touches[0].pageY-x.touches[1].pageY,U=Math.sqrt(S*S+w*w);de.set(0,U),pe.set(0,Math.pow(de.y/he.y,X.zoomSpeed)),dollyIn(pe.y),he.copy(de)}function onMouseDown(x){if(!1!==X.enabled){switch(x.preventDefault(),X.domElement.focus?X.domElement.focus():window.focus(),x.button){case 0:switch(X.mouseButtons.LEFT){case U.MOUSE.ROTATE:if(x.ctrlKey||x.metaKey||x.shiftKey){if(!1===X.enablePan)return;handleMouseDownPan(x),J=Z.PAN}else{if(!1===X.enableRotate)return;handleMouseDownRotate(x),J=Z.ROTATE}break;case U.MOUSE.PAN:if(x.ctrlKey||x.metaKey||x.shiftKey){if(!1===X.enableRotate)return;handleMouseDownRotate(x),J=Z.ROTATE}else{if(!1===X.enablePan)return;handleMouseDownPan(x),J=Z.PAN}break;default:J=Z.NONE}break;case 1:if(X.mouseButtons.MIDDLE===U.MOUSE.DOLLY){if(!1===X.enableZoom)return;!function handleMouseDownDolly(x){he.set(x.clientX,x.clientY)}(x),J=Z.DOLLY}else J=Z.NONE;break;case 2:switch(X.mouseButtons.RIGHT){case U.MOUSE.ROTATE:if(!1===X.enableRotate)return;handleMouseDownRotate(x),J=Z.ROTATE;break;case U.MOUSE.PAN:if(!1===X.enablePan)return;handleMouseDownPan(x),J=Z.PAN;break;default:J=Z.NONE}}J!==Z.NONE&&(document.addEventListener("mousemove",onMouseMove,!1),document.addEventListener("mouseup",onMouseUp,!1),X.dispatchEvent(q))}}function onMouseMove(x){if(!1!==X.enabled)switch(x.preventDefault(),J){case Z.ROTATE:if(!1===X.enableRotate)return;!function handleMouseMoveRotate(x){ae.set(x.clientX,x.clientY),se.subVectors(ae,oe).multiplyScalar(X.rotateSpeed);var S=X.domElement;rotateLeft(2*Math.PI*se.x/S.clientHeight),rotateUp(2*Math.PI*se.y/S.clientHeight),oe.copy(ae),X.update()}(x);break;case Z.DOLLY:if(!1===X.enableZoom)return;!function handleMouseMoveDolly(x){de.set(x.clientX,x.clientY),pe.subVectors(de,he),pe.y>0?dollyIn(getZoomScale()):pe.y<0&&dollyOut(getZoomScale()),he.copy(de),X.update()}(x);break;case Z.PAN:if(!1===X.enablePan)return;!function handleMouseMovePan(x){ce.set(x.clientX,x.clientY),ue.subVectors(ce,le).multiplyScalar(X.panSpeed),ve(ue.x,ue.y),le.copy(ce),X.update()}(x)}}function onMouseUp(x){!1!==X.enabled&&(document.removeEventListener("mousemove",onMouseMove,!1),document.removeEventListener("mouseup",onMouseUp,!1),X.dispatchEvent(Y),J=Z.NONE)}function onMouseWheel(x){!1===X.enabled||!1===X.enableZoom||J!==Z.NONE&&J!==Z.ROTATE||(x.preventDefault(),x.stopPropagation(),X.dispatchEvent(q),function handleMouseWheel(x){x.deltaY<0?dollyOut(getZoomScale()):x.deltaY>0&&dollyIn(getZoomScale()),X.update()}(x),X.dispatchEvent(Y))}function onKeyDown(x){!1!==X.enabled&&!1!==X.enableKeys&&!1!==X.enablePan&&function handleKeyDown(x){var S=!1;switch(x.keyCode){case X.keys.UP:ve(0,X.keyPanSpeed),S=!0;break;case X.keys.BOTTOM:ve(0,-X.keyPanSpeed),S=!0;break;case X.keys.LEFT:ve(X.keyPanSpeed,0),S=!0;break;case X.keys.RIGHT:ve(-X.keyPanSpeed,0),S=!0}S&&(x.preventDefault(),X.update())}(x)}function onTouchStart(x){if(!1!==X.enabled){switch(x.preventDefault(),x.touches.length){case 1:switch(X.touches.ONE){case U.TOUCH.ROTATE:if(!1===X.enableRotate)return;handleTouchStartRotate(x),J=Z.TOUCH_ROTATE;break;case U.TOUCH.PAN:if(!1===X.enablePan)return;handleTouchStartPan(x),J=Z.TOUCH_PAN;break;default:J=Z.NONE}break;case 2:switch(X.touches.TWO){case U.TOUCH.DOLLY_PAN:if(!1===X.enableZoom&&!1===X.enablePan)return;!function handleTouchStartDollyPan(x){X.enableZoom&&handleTouchStartDolly(x),X.enablePan&&handleTouchStartPan(x)}(x),J=Z.TOUCH_DOLLY_PAN;break;case U.TOUCH.DOLLY_ROTATE:if(!1===X.enableZoom&&!1===X.enableRotate)return;!function handleTouchStartDollyRotate(x){X.enableZoom&&handleTouchStartDolly(x),X.enableRotate&&handleTouchStartRotate(x)}(x),J=Z.TOUCH_DOLLY_ROTATE;break;default:J=Z.NONE}break;default:J=Z.NONE}J!==Z.NONE&&X.dispatchEvent(q)}}function onTouchMove(x){if(!1!==X.enabled)switch(x.preventDefault(),x.stopPropagation(),J){case Z.TOUCH_ROTATE:if(!1===X.enableRotate)return;handleTouchMoveRotate(x),X.update();break;case Z.TOUCH_PAN:if(!1===X.enablePan)return;handleTouchMovePan(x),X.update();break;case Z.TOUCH_DOLLY_PAN:if(!1===X.enableZoom&&!1===X.enablePan)return;!function handleTouchMoveDollyPan(x){X.enableZoom&&handleTouchMoveDolly(x),X.enablePan&&handleTouchMovePan(x)}(x),X.update();break;case Z.TOUCH_DOLLY_ROTATE:if(!1===X.enableZoom&&!1===X.enableRotate)return;!function handleTouchMoveDollyRotate(x){X.enableZoom&&handleTouchMoveDolly(x),X.enableRotate&&handleTouchMoveRotate(x)}(x),X.update();break;default:J=Z.NONE}}function onTouchEnd(x){!1!==X.enabled&&(X.dispatchEvent(Y),J=Z.NONE)}function onContextMenu(x){!1!==X.enabled&&x.preventDefault()}X.domElement.addEventListener("contextmenu",onContextMenu,!1),X.domElement.addEventListener("mousedown",onMouseDown,!1),X.domElement.addEventListener("wheel",onMouseWheel,!1),X.domElement.addEventListener("touchstart",onTouchStart,!1),X.domElement.addEventListener("touchend",onTouchEnd,!1),X.domElement.addEventListener("touchmove",onTouchMove,!1),X.domElement.addEventListener("keydown",onKeyDown,!1),-1===X.domElement.tabIndex&&(X.domElement.tabIndex=0),this.update()},U.OrbitControls.prototype=Object.create(U.EventDispatcher.prototype),U.OrbitControls.prototype.constructor=U.OrbitControls,U.MapControls=function(x,S){U.OrbitControls.call(this,x,S),this.mouseButtons.LEFT=U.MOUSE.PAN,this.mouseButtons.RIGHT=U.MOUSE.ROTATE,this.touches.ONE=U.TOUCH.PAN,this.touches.TWO=U.TOUCH.DOLLY_ROTATE},U.MapControls.prototype=Object.create(U.EventDispatcher.prototype),U.MapControls.prototype.constructor=U.MapControls,x.exports=S.default=U.OrbitControls},212:(x,S,w)=>{"use strict";w.r(S),w.d(S,{ACESFilmicToneMapping:()=>Ve,AddEquation:()=>ue,AddOperation:()=>Be,AdditiveAnimationBlendMode:()=>Hn,AdditiveBlending:()=>ae,AlphaFormat:()=>Et,AlwaysDepth:()=>Ae,AlwaysStencilFunc:()=>Ai,AmbientLight:()=>AmbientLight,AmbientLightProbe:()=>AmbientLightProbe,AnimationClip:()=>AnimationClip,AnimationLoader:()=>AnimationLoader,AnimationMixer:()=>AnimationMixer,AnimationObjectGroup:()=>AnimationObjectGroup,AnimationUtils:()=>hs,ArcCurve:()=>ArcCurve,ArrayCamera:()=>ArrayCamera,ArrowHelper:()=>ArrowHelper,Audio:()=>Audio,AudioAnalyser:()=>AudioAnalyser,AudioContext:()=>ws,AudioListener:()=>AudioListener,AudioLoader:()=>AudioLoader,AxesHelper:()=>AxesHelper,AxisHelper:()=>AxisHelper,BackSide:()=>ee,BasicDepthPacking:()=>ri,BasicShadowMap:()=>q,BinaryTextureLoader:()=>BinaryTextureLoader,Bone:()=>Bone,BooleanKeyframeTrack:()=>BooleanKeyframeTrack,BoundingBoxHelper:()=>BoundingBoxHelper,Box2:()=>Box2,Box3:()=>Box3,Box3Helper:()=>Box3Helper,BoxBufferGeometry:()=>BoxGeometry,BoxGeometry:()=>BoxGeometry,BoxHelper:()=>BoxHelper,BufferAttribute:()=>BufferAttribute,BufferGeometry:()=>BufferGeometry,BufferGeometryLoader:()=>BufferGeometryLoader,ByteType:()=>ut,Cache:()=>ds,Camera:()=>Camera,CameraHelper:()=>CameraHelper,CanvasRenderer:()=>CanvasRenderer,CanvasTexture:()=>CanvasTexture,CatmullRomCurve3:()=>CatmullRomCurve3,CineonToneMapping:()=>Ge,CircleBufferGeometry:()=>CircleGeometry,CircleGeometry:()=>CircleGeometry,ClampToEdgeWrapping:()=>Ze,Clock:()=>Clock,Color:()=>Color,ColorKeyframeTrack:()=>ColorKeyframeTrack,CompressedTexture:()=>CompressedTexture,CompressedTextureLoader:()=>CompressedTextureLoader,ConeBufferGeometry:()=>ConeGeometry,ConeGeometry:()=>ConeGeometry,CubeCamera:()=>CubeCamera,CubeReflectionMapping:()=>$e,CubeRefractionMapping:()=>ze,CubeTexture:()=>CubeTexture,CubeTextureLoader:()=>CubeTextureLoader,CubeUVReflectionMapping:()=>Ke,CubeUVRefractionMapping:()=>qe,CubicBezierCurve:()=>CubicBezierCurve,CubicBezierCurve3:()=>CubicBezierCurve3,CubicInterpolant:()=>CubicInterpolant,CullFaceBack:()=>j,CullFaceFront:()=>X,CullFaceFrontBack:()=>K,CullFaceNone:()=>z,Curve:()=>Curve,CurvePath:()=>CurvePath,CustomBlending:()=>ce,CustomToneMapping:()=>He,CylinderBufferGeometry:()=>CylinderGeometry,CylinderGeometry:()=>CylinderGeometry,Cylindrical:()=>Cylindrical,DataTexture:()=>DataTexture,DataTexture2DArray:()=>DataTexture2DArray,DataTexture3D:()=>DataTexture3D,DataTextureLoader:()=>DataTextureLoader,DataUtils:()=>DataUtils,DecrementStencilOp:()=>fi,DecrementWrapStencilOp:()=>_i,DefaultLoadingManager:()=>ps,DepthFormat:()=>Mt,DepthStencilFormat:()=>Rt,DepthTexture:()=>DepthTexture,DirectionalLight:()=>DirectionalLight,DirectionalLightHelper:()=>DirectionalLightHelper,DiscreteInterpolant:()=>DiscreteInterpolant,DodecahedronBufferGeometry:()=>DodecahedronGeometry,DodecahedronGeometry:()=>DodecahedronGeometry,DoubleSide:()=>te,DstAlphaFactor:()=>xe,DstColorFactor:()=>Se,DynamicBufferAttribute:()=>DynamicBufferAttribute,DynamicCopyUsage:()=>Ni,DynamicDrawUsage:()=>Ri,DynamicReadUsage:()=>Pi,EdgesGeometry:()=>EdgesGeometry,EdgesHelper:()=>EdgesHelper,EllipseCurve:()=>EllipseCurve,EqualDepth:()=>Le,EqualStencilFunc:()=>Ei,EquirectangularReflectionMapping:()=>je,EquirectangularRefractionMapping:()=>Xe,Euler:()=>Euler,EventDispatcher:()=>EventDispatcher,ExtrudeBufferGeometry:()=>ExtrudeGeometry,ExtrudeGeometry:()=>ExtrudeGeometry,FaceColors:()=>gl,FileLoader:()=>FileLoader,FlatShading:()=>ne,Float16BufferAttribute:()=>Float16BufferAttribute,Float32Attribute:()=>Float32Attribute,Float32BufferAttribute:()=>Float32BufferAttribute,Float64Attribute:()=>Float64Attribute,Float64BufferAttribute:()=>Float64BufferAttribute,FloatType:()=>gt,Fog:()=>Fog,FogExp2:()=>FogExp2,Font:()=>Font,FontLoader:()=>FontLoader,FrontSide:()=>Q,Frustum:()=>Frustum,GLBufferAttribute:()=>GLBufferAttribute,GLSL1:()=>Di,GLSL3:()=>ki,GammaEncoding:()=>qn,GreaterDepth:()=>Pe,GreaterEqualDepth:()=>Ie,GreaterEqualStencilFunc:()=>Ci,GreaterStencilFunc:()=>Ti,GridHelper:()=>GridHelper,Group:()=>Group,HalfFloatType:()=>vt,HemisphereLight:()=>HemisphereLight,HemisphereLightHelper:()=>HemisphereLightHelper,HemisphereLightProbe:()=>HemisphereLightProbe,IcosahedronBufferGeometry:()=>IcosahedronGeometry,IcosahedronGeometry:()=>IcosahedronGeometry,ImageBitmapLoader:()=>ImageBitmapLoader,ImageLoader:()=>ImageLoader,ImageUtils:()=>ImageUtils,ImmediateRenderObject:()=>ImmediateRenderObject,IncrementStencilOp:()=>pi,IncrementWrapStencilOp:()=>gi,InstancedBufferAttribute:()=>InstancedBufferAttribute,InstancedBufferGeometry:()=>InstancedBufferGeometry,InstancedInterleavedBuffer:()=>InstancedInterleavedBuffer,InstancedMesh:()=>InstancedMesh,Int16Attribute:()=>Int16Attribute,Int16BufferAttribute:()=>Int16BufferAttribute,Int32Attribute:()=>Int32Attribute,Int32BufferAttribute:()=>Int32BufferAttribute,Int8Attribute:()=>Int8Attribute,Int8BufferAttribute:()=>Int8BufferAttribute,IntType:()=>mt,InterleavedBuffer:()=>InterleavedBuffer,InterleavedBufferAttribute:()=>InterleavedBufferAttribute,Interpolant:()=>Interpolant,InterpolateDiscrete:()=>Fn,InterpolateLinear:()=>On,InterpolateSmooth:()=>Nn,InvertStencilOp:()=>yi,JSONLoader:()=>JSONLoader,KeepStencilOp:()=>ui,KeyframeTrack:()=>KeyframeTrack,LOD:()=>LOD,LatheBufferGeometry:()=>LatheGeometry,LatheGeometry:()=>LatheGeometry,Layers:()=>Layers,LensFlare:()=>LensFlare,LessDepth:()=>Me,LessEqualDepth:()=>Re,LessEqualStencilFunc:()=>Si,LessStencilFunc:()=>xi,Light:()=>Light,LightProbe:()=>LightProbe,Line:()=>Line,Line3:()=>Line3,LineBasicMaterial:()=>LineBasicMaterial,LineCurve:()=>LineCurve,LineCurve3:()=>LineCurve3,LineDashedMaterial:()=>LineDashedMaterial,LineLoop:()=>LineLoop,LinePieces:()=>ml,LineSegments:()=>LineSegments,LineStrip:()=>pl,LinearEncoding:()=>Xn,LinearFilter:()=>rt,LinearInterpolant:()=>LinearInterpolant,LinearMipMapLinearFilter:()=>lt,LinearMipMapNearestFilter:()=>at,LinearMipmapLinearFilter:()=>st,LinearMipmapNearestFilter:()=>ot,LinearToneMapping:()=>ke,Loader:()=>Loader,LoaderUtils:()=>LoaderUtils,LoadingManager:()=>LoadingManager,LogLuvEncoding:()=>Jn,LoopOnce:()=>Mn,LoopPingPong:()=>In,LoopRepeat:()=>Rn,LuminanceAlphaFormat:()=>Ct,LuminanceFormat:()=>wt,MOUSE:()=>G,Material:()=>Material,MaterialLoader:()=>MaterialLoader,Math:()=>$i,MathUtils:()=>$i,Matrix3:()=>Matrix3,Matrix4:()=>Matrix4,MaxEquation:()=>me,Mesh:()=>Mesh,MeshBasicMaterial:()=>MeshBasicMaterial,MeshDepthMaterial:()=>MeshDepthMaterial,MeshDistanceMaterial:()=>MeshDistanceMaterial,MeshFaceMaterial:()=>MeshFaceMaterial,MeshLambertMaterial:()=>MeshLambertMaterial,MeshMatcapMaterial:()=>MeshMatcapMaterial,MeshNormalMaterial:()=>MeshNormalMaterial,MeshPhongMaterial:()=>MeshPhongMaterial,MeshPhysicalMaterial:()=>MeshPhysicalMaterial,MeshStandardMaterial:()=>MeshStandardMaterial,MeshToonMaterial:()=>MeshToonMaterial,MinEquation:()=>pe,MirroredRepeatWrapping:()=>Je,MixOperation:()=>Ne,MultiMaterial:()=>MultiMaterial,MultiplyBlending:()=>le,MultiplyOperation:()=>Oe,NearestFilter:()=>Qe,NearestMipMapLinearFilter:()=>it,NearestMipMapNearestFilter:()=>tt,NearestMipmapLinearFilter:()=>nt,NearestMipmapNearestFilter:()=>et,NeverDepth:()=>Ce,NeverStencilFunc:()=>bi,NoBlending:()=>re,NoColors:()=>fl,NoToneMapping:()=>De,NormalAnimationBlendMode:()=>Gn,NormalBlending:()=>oe,NotEqualDepth:()=>Fe,NotEqualStencilFunc:()=>wi,NumberKeyframeTrack:()=>NumberKeyframeTrack,Object3D:()=>Object3D,ObjectLoader:()=>ObjectLoader,ObjectSpaceNormalMap:()=>li,OctahedronBufferGeometry:()=>OctahedronGeometry,OctahedronGeometry:()=>OctahedronGeometry,OneFactor:()=>ge,OneMinusDstAlphaFactor:()=>Ee,OneMinusDstColorFactor:()=>Te,OneMinusSrcAlphaFactor:()=>be,OneMinusSrcColorFactor:()=>_e,OrthographicCamera:()=>OrthographicCamera,PCFShadowMap:()=>Y,PCFSoftShadowMap:()=>Z,PMREMGenerator:()=>PMREMGenerator,ParametricGeometry:()=>ParametricGeometry,Particle:()=>Particle,ParticleBasicMaterial:()=>ParticleBasicMaterial,ParticleSystem:()=>ParticleSystem,ParticleSystemMaterial:()=>ParticleSystemMaterial,Path:()=>Path,PerspectiveCamera:()=>PerspectiveCamera,Plane:()=>Plane,PlaneBufferGeometry:()=>PlaneGeometry,PlaneGeometry:()=>PlaneGeometry,PlaneHelper:()=>PlaneHelper,PointCloud:()=>PointCloud,PointCloudMaterial:()=>PointCloudMaterial,PointLight:()=>PointLight,PointLightHelper:()=>PointLightHelper,Points:()=>Points,PointsMaterial:()=>PointsMaterial,PolarGridHelper:()=>PolarGridHelper,PolyhedronBufferGeometry:()=>PolyhedronGeometry,PolyhedronGeometry:()=>PolyhedronGeometry,PositionalAudio:()=>PositionalAudio,PropertyBinding:()=>PropertyBinding,PropertyMixer:()=>PropertyMixer,QuadraticBezierCurve:()=>QuadraticBezierCurve,QuadraticBezierCurve3:()=>QuadraticBezierCurve3,Quaternion:()=>Quaternion,QuaternionKeyframeTrack:()=>QuaternionKeyframeTrack,QuaternionLinearInterpolant:()=>QuaternionLinearInterpolant,REVISION:()=>U,RGBADepthPacking:()=>oi,RGBAFormat:()=>Tt,RGBAIntegerFormat:()=>Bt,RGBA_ASTC_10x10_Format:()=>an,RGBA_ASTC_10x5_Format:()=>nn,RGBA_ASTC_10x6_Format:()=>rn,RGBA_ASTC_10x8_Format:()=>on,RGBA_ASTC_12x10_Format:()=>sn,RGBA_ASTC_12x12_Format:()=>ln,RGBA_ASTC_4x4_Format:()=>Kt,RGBA_ASTC_5x4_Format:()=>qt,RGBA_ASTC_5x5_Format:()=>Yt,RGBA_ASTC_6x5_Format:()=>Zt,RGBA_ASTC_6x6_Format:()=>Jt,RGBA_ASTC_8x5_Format:()=>Qt,RGBA_ASTC_8x6_Format:()=>en,RGBA_ASTC_8x8_Format:()=>tn,RGBA_BPTC_Format:()=>cn,RGBA_ETC2_EAC_Format:()=>Xt,RGBA_PVRTC_2BPPV1_Format:()=>$t,RGBA_PVRTC_4BPPV1_Format:()=>Wt,RGBA_S3TC_DXT1_Format:()=>kt,RGBA_S3TC_DXT3_Format:()=>Ut,RGBA_S3TC_DXT5_Format:()=>Gt,RGBDEncoding:()=>ii,RGBEEncoding:()=>Zn,RGBEFormat:()=>At,RGBFormat:()=>St,RGBIntegerFormat:()=>Nt,RGBM16Encoding:()=>ni,RGBM7Encoding:()=>ei,RGB_ETC1_Format:()=>zt,RGB_ETC2_Format:()=>jt,RGB_PVRTC_2BPPV1_Format:()=>Ht,RGB_PVRTC_4BPPV1_Format:()=>Vt,RGB_S3TC_DXT1_Format:()=>Dt,RGFormat:()=>Pt,RGIntegerFormat:()=>Ft,RawShaderMaterial:()=>RawShaderMaterial,Ray:()=>Ray,Raycaster:()=>Raycaster,RectAreaLight:()=>RectAreaLight,RedFormat:()=>Lt,RedIntegerFormat:()=>It,ReinhardToneMapping:()=>Ue,RepeatWrapping:()=>Ye,ReplaceStencilOp:()=>di,ReverseSubtractEquation:()=>de,RingBufferGeometry:()=>RingGeometry,RingGeometry:()=>RingGeometry,SRGB8_ALPHA8_ASTC_10x10_Format:()=>wn,SRGB8_ALPHA8_ASTC_10x5_Format:()=>En,SRGB8_ALPHA8_ASTC_10x6_Format:()=>Sn,SRGB8_ALPHA8_ASTC_10x8_Format:()=>Tn,SRGB8_ALPHA8_ASTC_12x10_Format:()=>Cn,SRGB8_ALPHA8_ASTC_12x12_Format:()=>An,SRGB8_ALPHA8_ASTC_4x4_Format:()=>hn,SRGB8_ALPHA8_ASTC_5x4_Format:()=>dn,SRGB8_ALPHA8_ASTC_5x5_Format:()=>pn,SRGB8_ALPHA8_ASTC_6x5_Format:()=>mn,SRGB8_ALPHA8_ASTC_6x6_Format:()=>gn,SRGB8_ALPHA8_ASTC_8x5_Format:()=>vn,SRGB8_ALPHA8_ASTC_8x6_Format:()=>bn,SRGB8_ALPHA8_ASTC_8x8_Format:()=>xn,Scene:()=>Scene,SceneUtils:()=>_l,ShaderChunk:()=>Bo,ShaderLib:()=>ko,ShaderMaterial:()=>ShaderMaterial,ShadowMaterial:()=>ShadowMaterial,Shape:()=>Shape,ShapeBufferGeometry:()=>ShapeGeometry,ShapeGeometry:()=>ShapeGeometry,ShapePath:()=>ShapePath,ShapeUtils:()=>ShapeUtils,ShortType:()=>ht,Skeleton:()=>Skeleton,SkeletonHelper:()=>SkeletonHelper,SkinnedMesh:()=>SkinnedMesh,SmoothShading:()=>ie,Sphere:()=>Sphere,SphereBufferGeometry:()=>SphereGeometry,SphereGeometry:()=>SphereGeometry,Spherical:()=>Spherical,SphericalHarmonics3:()=>SphericalHarmonics3,SplineCurve:()=>SplineCurve,SpotLight:()=>SpotLight,SpotLightHelper:()=>SpotLightHelper,Sprite:()=>Sprite,SpriteMaterial:()=>SpriteMaterial,SrcAlphaFactor:()=>ye,SrcAlphaSaturateFactor:()=>we,SrcColorFactor:()=>ve,StaticCopyUsage:()=>Oi,StaticDrawUsage:()=>Mi,StaticReadUsage:()=>Ii,StereoCamera:()=>StereoCamera,StreamCopyUsage:()=>Bi,StreamDrawUsage:()=>Li,StreamReadUsage:()=>Fi,StringKeyframeTrack:()=>StringKeyframeTrack,SubtractEquation:()=>he,SubtractiveBlending:()=>se,TOUCH:()=>H,TangentSpaceNormalMap:()=>ai,TetrahedronBufferGeometry:()=>TetrahedronGeometry,TetrahedronGeometry:()=>TetrahedronGeometry,TextGeometry:()=>TextGeometry,Texture:()=>Texture,TextureLoader:()=>TextureLoader,TorusBufferGeometry:()=>TorusGeometry,TorusGeometry:()=>TorusGeometry,TorusKnotBufferGeometry:()=>TorusKnotGeometry,TorusKnotGeometry:()=>TorusKnotGeometry,Triangle:()=>Triangle,TriangleFanDrawMode:()=>zn,TriangleStripDrawMode:()=>$n,TrianglesDrawMode:()=>Wn,TubeBufferGeometry:()=>TubeGeometry,TubeGeometry:()=>TubeGeometry,UVMapping:()=>We,Uint16Attribute:()=>Uint16Attribute,Uint16BufferAttribute:()=>Uint16BufferAttribute,Uint32Attribute:()=>Uint32Attribute,Uint32BufferAttribute:()=>Uint32BufferAttribute,Uint8Attribute:()=>Uint8Attribute,Uint8BufferAttribute:()=>Uint8BufferAttribute,Uint8ClampedAttribute:()=>Uint8ClampedAttribute,Uint8ClampedBufferAttribute:()=>Uint8ClampedBufferAttribute,Uniform:()=>Uniform,UniformsLib:()=>Do,UniformsUtils:()=>Ro,UnsignedByteType:()=>ct,UnsignedInt248Type:()=>xt,UnsignedIntType:()=>ft,UnsignedShort4444Type:()=>_t,UnsignedShort5551Type:()=>yt,UnsignedShort565Type:()=>bt,UnsignedShortType:()=>pt,VSMShadowMap:()=>J,Vector2:()=>Vector2,Vector3:()=>Vector3,Vector4:()=>Vector4,VectorKeyframeTrack:()=>VectorKeyframeTrack,Vertex:()=>Vertex,VertexColors:()=>vl,VideoTexture:()=>VideoTexture,WebGL1Renderer:()=>WebGL1Renderer,WebGLCubeRenderTarget:()=>WebGLCubeRenderTarget,WebGLMultipleRenderTargets:()=>WebGLMultipleRenderTargets,WebGLMultisampleRenderTarget:()=>WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>WebGLRenderTarget,WebGLRenderTargetCube:()=>WebGLRenderTargetCube,WebGLRenderer:()=>WebGLRenderer,WebGLUtils:()=>WebGLUtils,WireframeGeometry:()=>WireframeGeometry,WireframeHelper:()=>WireframeHelper,WrapAroundEnding:()=>kn,XHRLoader:()=>XHRLoader,ZeroCurvatureEnding:()=>Bn,ZeroFactor:()=>fe,ZeroSlopeEnding:()=>Dn,ZeroStencilOp:()=>ci,sRGBEncoding:()=>Kn});const U="133",G={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},H={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},z=0,j=1,X=2,K=3,q=0,Y=1,Z=2,J=3,Q=0,ee=1,te=2,ne=1,ie=2,re=0,oe=1,ae=2,se=3,le=4,ce=5,ue=100,he=101,de=102,pe=103,me=104,fe=200,ge=201,ve=202,_e=203,ye=204,be=205,xe=206,Ee=207,Se=208,Te=209,we=210,Ce=0,Ae=1,Me=2,Re=3,Le=4,Ie=5,Pe=6,Fe=7,Oe=0,Ne=1,Be=2,De=0,ke=1,Ue=2,Ge=3,Ve=4,He=5,We=300,$e=301,ze=302,je=303,Xe=304,Ke=306,qe=307,Ye=1e3,Ze=1001,Je=1002,Qe=1003,et=1004,tt=1004,nt=1005,it=1005,rt=1006,ot=1007,at=1007,st=1008,lt=1008,ct=1009,ut=1010,ht=1011,pt=1012,mt=1013,ft=1014,gt=1015,vt=1016,_t=1017,yt=1018,bt=1019,xt=1020,Et=1021,St=1022,Tt=1023,wt=1024,Ct=1025,At=Tt,Mt=1026,Rt=1027,Lt=1028,It=1029,Pt=1030,Ft=1031,Nt=1032,Bt=1033,Dt=33776,kt=33777,Ut=33778,Gt=33779,Vt=35840,Ht=35841,Wt=35842,$t=35843,zt=36196,jt=37492,Xt=37496,Kt=37808,qt=37809,Yt=37810,Zt=37811,Jt=37812,Qt=37813,en=37814,tn=37815,nn=37816,rn=37817,on=37818,an=37819,sn=37820,ln=37821,cn=36492,hn=37840,dn=37841,pn=37842,mn=37843,gn=37844,vn=37845,bn=37846,xn=37847,En=37848,Sn=37849,Tn=37850,wn=37851,Cn=37852,An=37853,Mn=2200,Rn=2201,In=2202,Fn=2300,On=2301,Nn=2302,Bn=2400,Dn=2401,kn=2402,Gn=2500,Hn=2501,Wn=0,$n=1,zn=2,Xn=3e3,Kn=3001,qn=3007,Zn=3002,Jn=3003,ei=3004,ni=3005,ii=3006,ri=3200,oi=3201,ai=0,li=1,ci=0,ui=7680,di=7681,pi=7682,fi=7683,gi=34055,_i=34056,yi=5386,bi=512,xi=513,Ei=514,Si=515,Ti=516,wi=517,Ci=518,Ai=519,Mi=35044,Ri=35048,Li=35040,Ii=35045,Pi=35049,Fi=35041,Oi=35046,Ni=35050,Bi=35042,Di="100",ki="300 es";class EventDispatcher{addEventListener(x,S){void 0===this._listeners&&(this._listeners={});const w=this._listeners;void 0===w[x]&&(w[x]=[]),-1===w[x].indexOf(S)&&w[x].push(S)}hasEventListener(x,S){if(void 0===this._listeners)return!1;const w=this._listeners;return void 0!==w[x]&&-1!==w[x].indexOf(S)}removeEventListener(x,S){if(void 0===this._listeners)return;const w=this._listeners[x];if(void 0!==w){const x=w.indexOf(S);-1!==x&&w.splice(x,1)}}dispatchEvent(x){if(void 0===this._listeners)return;const S=this._listeners[x.type];if(void 0!==S){x.target=this;const w=S.slice(0);for(let S=0,U=w.length;S>8&255]+Hi[x>>16&255]+Hi[x>>24&255]+"-"+Hi[255&S]+Hi[S>>8&255]+"-"+Hi[S>>16&15|64]+Hi[S>>24&255]+"-"+Hi[63&w|128]+Hi[w>>8&255]+"-"+Hi[w>>16&255]+Hi[w>>24&255]+Hi[255&U]+Hi[U>>8&255]+Hi[U>>16&255]+Hi[U>>24&255]).toUpperCase()}function clamp(x,S,w){return Math.max(S,Math.min(w,x))}function euclideanModulo(x,S){return(x%S+S)%S}function lerp(x,S,w){return(1-w)*x+w*S}function isPowerOfTwo(x){return 0==(x&x-1)&&0!==x}function ceilPowerOfTwo(x){return Math.pow(2,Math.ceil(Math.log(x)/Math.LN2))}function floorPowerOfTwo(x){return Math.pow(2,Math.floor(Math.log(x)/Math.LN2))}var $i=Object.freeze({__proto__:null,DEG2RAD:Gi,RAD2DEG:Vi,generateUUID,clamp,euclideanModulo,mapLinear:function mapLinear(x,S,w,U,G){return U+(x-S)*(G-U)/(w-S)},inverseLerp:function inverseLerp(x,S,w){return x!==S?(w-x)/(S-x):0},lerp,damp:function damp(x,S,w,U){return lerp(x,S,1-Math.exp(-w*U))},pingpong:function pingpong(x,S=1){return S-Math.abs(euclideanModulo(x,2*S)-S)},smoothstep:function smoothstep(x,S,w){return x<=S?0:x>=w?1:(x=(x-S)/(w-S))*x*(3-2*x)},smootherstep:function smootherstep(x,S,w){return x<=S?0:x>=w?1:(x=(x-S)/(w-S))*x*x*(x*(6*x-15)+10)},randInt:function randInt(x,S){return x+Math.floor(Math.random()*(S-x+1))},randFloat:function randFloat(x,S){return x+Math.random()*(S-x)},randFloatSpread:function randFloatSpread(x){return x*(.5-Math.random())},seededRandom:function seededRandom(x){return void 0!==x&&(Ui=x%2147483647),Ui=16807*Ui%2147483647,(Ui-1)/2147483646},degToRad:function degToRad(x){return x*Gi},radToDeg:function radToDeg(x){return x*Vi},isPowerOfTwo,ceilPowerOfTwo,floorPowerOfTwo,setQuaternionFromProperEuler:function setQuaternionFromProperEuler(x,S,w,U,G){const H=Math.cos,z=Math.sin,j=H(w/2),X=z(w/2),K=H((S+U)/2),q=z((S+U)/2),Y=H((S-U)/2),Z=z((S-U)/2),J=H((U-S)/2),Q=z((U-S)/2);switch(G){case"XYX":x.set(j*q,X*Y,X*Z,j*K);break;case"YZY":x.set(X*Z,j*q,X*Y,j*K);break;case"ZXZ":x.set(X*Y,X*Z,j*q,j*K);break;case"XZX":x.set(j*q,X*Q,X*J,j*K);break;case"YXY":x.set(X*J,j*q,X*Q,j*K);break;case"ZYZ":x.set(X*Q,X*J,j*q,j*K);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+G)}}});class Vector2{constructor(x=0,S=0){this.x=x,this.y=S}get width(){return this.x}set width(x){this.x=x}get height(){return this.y}set height(x){this.y=x}set(x,S){return this.x=x,this.y=S,this}setScalar(x){return this.x=x,this.y=x,this}setX(x){return this.x=x,this}setY(x){return this.y=x,this}setComponent(x,S){switch(x){case 0:this.x=S;break;case 1:this.y=S;break;default:throw new Error("index is out of range: "+x)}return this}getComponent(x){switch(x){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+x)}}clone(){return new this.constructor(this.x,this.y)}copy(x){return this.x=x.x,this.y=x.y,this}add(x,S){return void 0!==S?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(x,S)):(this.x+=x.x,this.y+=x.y,this)}addScalar(x){return this.x+=x,this.y+=x,this}addVectors(x,S){return this.x=x.x+S.x,this.y=x.y+S.y,this}addScaledVector(x,S){return this.x+=x.x*S,this.y+=x.y*S,this}sub(x,S){return void 0!==S?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(x,S)):(this.x-=x.x,this.y-=x.y,this)}subScalar(x){return this.x-=x,this.y-=x,this}subVectors(x,S){return this.x=x.x-S.x,this.y=x.y-S.y,this}multiply(x){return this.x*=x.x,this.y*=x.y,this}multiplyScalar(x){return this.x*=x,this.y*=x,this}divide(x){return this.x/=x.x,this.y/=x.y,this}divideScalar(x){return this.multiplyScalar(1/x)}applyMatrix3(x){const S=this.x,w=this.y,U=x.elements;return this.x=U[0]*S+U[3]*w+U[6],this.y=U[1]*S+U[4]*w+U[7],this}min(x){return this.x=Math.min(this.x,x.x),this.y=Math.min(this.y,x.y),this}max(x){return this.x=Math.max(this.x,x.x),this.y=Math.max(this.y,x.y),this}clamp(x,S){return this.x=Math.max(x.x,Math.min(S.x,this.x)),this.y=Math.max(x.y,Math.min(S.y,this.y)),this}clampScalar(x,S){return this.x=Math.max(x,Math.min(S,this.x)),this.y=Math.max(x,Math.min(S,this.y)),this}clampLength(x,S){const w=this.length();return this.divideScalar(w||1).multiplyScalar(Math.max(x,Math.min(S,w)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(x){return this.x*x.x+this.y*x.y}cross(x){return this.x*x.y-this.y*x.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(x){return Math.sqrt(this.distanceToSquared(x))}distanceToSquared(x){const S=this.x-x.x,w=this.y-x.y;return S*S+w*w}manhattanDistanceTo(x){return Math.abs(this.x-x.x)+Math.abs(this.y-x.y)}setLength(x){return this.normalize().multiplyScalar(x)}lerp(x,S){return this.x+=(x.x-this.x)*S,this.y+=(x.y-this.y)*S,this}lerpVectors(x,S,w){return this.x=x.x+(S.x-x.x)*w,this.y=x.y+(S.y-x.y)*w,this}equals(x){return x.x===this.x&&x.y===this.y}fromArray(x,S=0){return this.x=x[S],this.y=x[S+1],this}toArray(x=[],S=0){return x[S]=this.x,x[S+1]=this.y,x}fromBufferAttribute(x,S,w){return void 0!==w&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=x.getX(S),this.y=x.getY(S),this}rotateAround(x,S){const w=Math.cos(S),U=Math.sin(S),G=this.x-x.x,H=this.y-x.y;return this.x=G*w-H*U+x.x,this.y=G*U+H*w+x.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Vector2.prototype.isVector2=!0;class Matrix3{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(x,S,w,U,G,H,z,j,X){const K=this.elements;return K[0]=x,K[1]=U,K[2]=z,K[3]=S,K[4]=G,K[5]=j,K[6]=w,K[7]=H,K[8]=X,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(x){const S=this.elements,w=x.elements;return S[0]=w[0],S[1]=w[1],S[2]=w[2],S[3]=w[3],S[4]=w[4],S[5]=w[5],S[6]=w[6],S[7]=w[7],S[8]=w[8],this}extractBasis(x,S,w){return x.setFromMatrix3Column(this,0),S.setFromMatrix3Column(this,1),w.setFromMatrix3Column(this,2),this}setFromMatrix4(x){const S=x.elements;return this.set(S[0],S[4],S[8],S[1],S[5],S[9],S[2],S[6],S[10]),this}multiply(x){return this.multiplyMatrices(this,x)}premultiply(x){return this.multiplyMatrices(x,this)}multiplyMatrices(x,S){const w=x.elements,U=S.elements,G=this.elements,H=w[0],z=w[3],j=w[6],X=w[1],K=w[4],q=w[7],Y=w[2],Z=w[5],J=w[8],Q=U[0],ee=U[3],te=U[6],ne=U[1],ie=U[4],re=U[7],oe=U[2],ae=U[5],se=U[8];return G[0]=H*Q+z*ne+j*oe,G[3]=H*ee+z*ie+j*ae,G[6]=H*te+z*re+j*se,G[1]=X*Q+K*ne+q*oe,G[4]=X*ee+K*ie+q*ae,G[7]=X*te+K*re+q*se,G[2]=Y*Q+Z*ne+J*oe,G[5]=Y*ee+Z*ie+J*ae,G[8]=Y*te+Z*re+J*se,this}multiplyScalar(x){const S=this.elements;return S[0]*=x,S[3]*=x,S[6]*=x,S[1]*=x,S[4]*=x,S[7]*=x,S[2]*=x,S[5]*=x,S[8]*=x,this}determinant(){const x=this.elements,S=x[0],w=x[1],U=x[2],G=x[3],H=x[4],z=x[5],j=x[6],X=x[7],K=x[8];return S*H*K-S*z*X-w*G*K+w*z*j+U*G*X-U*H*j}invert(){const x=this.elements,S=x[0],w=x[1],U=x[2],G=x[3],H=x[4],z=x[5],j=x[6],X=x[7],K=x[8],q=K*H-z*X,Y=z*j-K*G,Z=X*G-H*j,J=S*q+w*Y+U*Z;if(0===J)return this.set(0,0,0,0,0,0,0,0,0);const Q=1/J;return x[0]=q*Q,x[1]=(U*X-K*w)*Q,x[2]=(z*w-U*H)*Q,x[3]=Y*Q,x[4]=(K*S-U*j)*Q,x[5]=(U*G-z*S)*Q,x[6]=Z*Q,x[7]=(w*j-X*S)*Q,x[8]=(H*S-w*G)*Q,this}transpose(){let x;const S=this.elements;return x=S[1],S[1]=S[3],S[3]=x,x=S[2],S[2]=S[6],S[6]=x,x=S[5],S[5]=S[7],S[7]=x,this}getNormalMatrix(x){return this.setFromMatrix4(x).invert().transpose()}transposeIntoArray(x){const S=this.elements;return x[0]=S[0],x[1]=S[3],x[2]=S[6],x[3]=S[1],x[4]=S[4],x[5]=S[7],x[6]=S[2],x[7]=S[5],x[8]=S[8],this}setUvTransform(x,S,w,U,G,H,z){const j=Math.cos(G),X=Math.sin(G);return this.set(w*j,w*X,-w*(j*H+X*z)+H+x,-U*X,U*j,-U*(-X*H+j*z)+z+S,0,0,1),this}scale(x,S){const w=this.elements;return w[0]*=x,w[3]*=x,w[6]*=x,w[1]*=S,w[4]*=S,w[7]*=S,this}rotate(x){const S=Math.cos(x),w=Math.sin(x),U=this.elements,G=U[0],H=U[3],z=U[6],j=U[1],X=U[4],K=U[7];return U[0]=S*G+w*j,U[3]=S*H+w*X,U[6]=S*z+w*K,U[1]=-w*G+S*j,U[4]=-w*H+S*X,U[7]=-w*z+S*K,this}translate(x,S){const w=this.elements;return w[0]+=x*w[2],w[3]+=x*w[5],w[6]+=x*w[8],w[1]+=S*w[2],w[4]+=S*w[5],w[7]+=S*w[8],this}equals(x){const S=this.elements,w=x.elements;for(let x=0;x<9;x++)if(S[x]!==w[x])return!1;return!0}fromArray(x,S=0){for(let w=0;w<9;w++)this.elements[w]=x[w+S];return this}toArray(x=[],S=0){const w=this.elements;return x[S]=w[0],x[S+1]=w[1],x[S+2]=w[2],x[S+3]=w[3],x[S+4]=w[4],x[S+5]=w[5],x[S+6]=w[6],x[S+7]=w[7],x[S+8]=w[8],x}clone(){return(new this.constructor).fromArray(this.elements)}}function arrayMax(x){if(0===x.length)return-1/0;let S=x[0];for(let w=1,U=x.length;wS&&(S=x[w]);return S}Matrix3.prototype.isMatrix3=!0;const zi={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function getTypedArray(x,S){return new zi[x](S)}function createElementNS(x){return document.createElementNS("http://www.w3.org/1999/xhtml",x)}let ji;class ImageUtils{static getDataURL(x){if(/^data:/i.test(x.src))return x.src;if("undefined"==typeof HTMLCanvasElement)return x.src;let S;if(x instanceof HTMLCanvasElement)S=x;else{void 0===ji&&(ji=createElementNS("canvas")),ji.width=x.width,ji.height=x.height;const w=ji.getContext("2d");x instanceof ImageData?w.putImageData(x,0,0):w.drawImage(x,0,0,x.width,x.height),S=ji}return S.width>2048||S.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",x),S.toDataURL("image/jpeg",.6)):S.toDataURL("image/png")}}let Xi=0;class Texture extends EventDispatcher{constructor(x=Texture.DEFAULT_IMAGE,S=Texture.DEFAULT_MAPPING,w=Ze,U=Ze,G=rt,H=st,z=Tt,j=ct,X=1,K=Xn){super(),Object.defineProperty(this,"id",{value:Xi++}),this.uuid=generateUUID(),this.name="",this.image=x,this.mipmaps=[],this.mapping=S,this.wrapS=w,this.wrapT=U,this.magFilter=G,this.minFilter=H,this.anisotropy=X,this.format=z,this.internalFormat=null,this.type=j,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=K,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(x){return this.name=x.name,this.image=x.image,this.mipmaps=x.mipmaps.slice(0),this.mapping=x.mapping,this.wrapS=x.wrapS,this.wrapT=x.wrapT,this.magFilter=x.magFilter,this.minFilter=x.minFilter,this.anisotropy=x.anisotropy,this.format=x.format,this.internalFormat=x.internalFormat,this.type=x.type,this.offset.copy(x.offset),this.repeat.copy(x.repeat),this.center.copy(x.center),this.rotation=x.rotation,this.matrixAutoUpdate=x.matrixAutoUpdate,this.matrix.copy(x.matrix),this.generateMipmaps=x.generateMipmaps,this.premultiplyAlpha=x.premultiplyAlpha,this.flipY=x.flipY,this.unpackAlignment=x.unpackAlignment,this.encoding=x.encoding,this}toJSON(x){const S=void 0===x||"string"==typeof x;if(!S&&void 0!==x.textures[this.uuid])return x.textures[this.uuid];const w={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const U=this.image;if(void 0===U.uuid&&(U.uuid=generateUUID()),!S&&void 0===x.images[U.uuid]){let S;if(Array.isArray(U)){S=[];for(let x=0,w=U.length;x 1)switch(this.wrapS){case Ye:x.x=x.x-Math.floor(x.x);break;case Ze:x.x=x.x<0?0:1;break;case Je:1===Math.abs(Math.floor(x.x)%2)?x.x=Math.ceil(x.x)-x.x:x.x=x.x-Math.floor(x.x)}if(x.y<0||x.y>1)switch(this.wrapT){case Ye:x.y=x.y-Math.floor(x.y);break;case Ze:x.y=x.y<0?0:1;break;case Je:1===Math.abs(Math.floor(x.y)%2)?x.y=Math.ceil(x.y)-x.y:x.y=x.y-Math.floor(x.y)}return this.flipY&&(x.y=1-x.y),x}set needsUpdate(x){!0===x&&this.version++}}function serializeImage(x){return"undefined"!=typeof HTMLImageElement&&x instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&x instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&x instanceof ImageBitmap?ImageUtils.getDataURL(x):x.data?{data:Array.prototype.slice.call(x.data),width:x.width,height:x.height,type:x.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Texture.DEFAULT_IMAGE=void 0,Texture.DEFAULT_MAPPING=We,Texture.prototype.isTexture=!0;class Vector4{constructor(x=0,S=0,w=0,U=1){this.x=x,this.y=S,this.z=w,this.w=U}get width(){return this.z}set width(x){this.z=x}get height(){return this.w}set height(x){this.w=x}set(x,S,w,U){return this.x=x,this.y=S,this.z=w,this.w=U,this}setScalar(x){return this.x=x,this.y=x,this.z=x,this.w=x,this}setX(x){return this.x=x,this}setY(x){return this.y=x,this}setZ(x){return this.z=x,this}setW(x){return this.w=x,this}setComponent(x,S){switch(x){case 0:this.x=S;break;case 1:this.y=S;break;case 2:this.z=S;break;case 3:this.w=S;break;default:throw new Error("index is out of range: "+x)}return this}getComponent(x){switch(x){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+x)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(x){return this.x=x.x,this.y=x.y,this.z=x.z,this.w=void 0!==x.w?x.w:1,this}add(x,S){return void 0!==S?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(x,S)):(this.x+=x.x,this.y+=x.y,this.z+=x.z,this.w+=x.w,this)}addScalar(x){return this.x+=x,this.y+=x,this.z+=x,this.w+=x,this}addVectors(x,S){return this.x=x.x+S.x,this.y=x.y+S.y,this.z=x.z+S.z,this.w=x.w+S.w,this}addScaledVector(x,S){return this.x+=x.x*S,this.y+=x.y*S,this.z+=x.z*S,this.w+=x.w*S,this}sub(x,S){return void 0!==S?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(x,S)):(this.x-=x.x,this.y-=x.y,this.z-=x.z,this.w-=x.w,this)}subScalar(x){return this.x-=x,this.y-=x,this.z-=x,this.w-=x,this}subVectors(x,S){return this.x=x.x-S.x,this.y=x.y-S.y,this.z=x.z-S.z,this.w=x.w-S.w,this}multiply(x){return this.x*=x.x,this.y*=x.y,this.z*=x.z,this.w*=x.w,this}multiplyScalar(x){return this.x*=x,this.y*=x,this.z*=x,this.w*=x,this}applyMatrix4(x){const S=this.x,w=this.y,U=this.z,G=this.w,H=x.elements;return this.x=H[0]*S+H[4]*w+H[8]*U+H[12]*G,this.y=H[1]*S+H[5]*w+H[9]*U+H[13]*G,this.z=H[2]*S+H[6]*w+H[10]*U+H[14]*G,this.w=H[3]*S+H[7]*w+H[11]*U+H[15]*G,this}divideScalar(x){return this.multiplyScalar(1/x)}setAxisAngleFromQuaternion(x){this.w=2*Math.acos(x.w);const S=Math.sqrt(1-x.w*x.w);return S<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=x.x/S,this.y=x.y/S,this.z=x.z/S),this}setAxisAngleFromRotationMatrix(x){let S,w,U,G;const H=.01,z=.1,j=x.elements,X=j[0],K=j[4],q=j[8],Y=j[1],Z=j[5],J=j[9],Q=j[2],ee=j[6],te=j[10];if(Math.abs(K-Y) j&&x>ne?x ne?j =0?1:-1,U=1-S*S;if(U>Number.EPSILON){const G=Math.sqrt(U),H=Math.atan2(G,S*w);x=Math.sin(x*H)/G,z=Math.sin(z*H)/G}const G=z*w;if(j=j*x+Y*G,X=X*x+Z*G,K=K*x+J*G,q=q*x+Q*G,x===1-z){const x=1/Math.sqrt(j*j+X*X+K*K+q*q);j*=x,X*=x,K*=x,q*=x}}x[S]=j,x[S+1]=X,x[S+2]=K,x[S+3]=q}static multiplyQuaternionsFlat(x,S,w,U,G,H){const z=w[U],j=w[U+1],X=w[U+2],K=w[U+3],q=G[H],Y=G[H+1],Z=G[H+2],J=G[H+3];return x[S]=z*J+K*q+j*Z-X*Y,x[S+1]=j*J+K*Y+X*q-z*Z,x[S+2]=X*J+K*Z+z*Y-j*q,x[S+3]=K*J-z*q-j*Y-X*Z,x}get x(){return this._x}set x(x){this._x=x,this._onChangeCallback()}get y(){return this._y}set y(x){this._y=x,this._onChangeCallback()}get z(){return this._z}set z(x){this._z=x,this._onChangeCallback()}get w(){return this._w}set w(x){this._w=x,this._onChangeCallback()}set(x,S,w,U){return this._x=x,this._y=S,this._z=w,this._w=U,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(x){return this._x=x.x,this._y=x.y,this._z=x.z,this._w=x.w,this._onChangeCallback(),this}setFromEuler(x,S){if(!x||!x.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const w=x._x,U=x._y,G=x._z,H=x._order,z=Math.cos,j=Math.sin,X=z(w/2),K=z(U/2),q=z(G/2),Y=j(w/2),Z=j(U/2),J=j(G/2);switch(H){case"XYZ":this._x=Y*K*q+X*Z*J,this._y=X*Z*q-Y*K*J,this._z=X*K*J+Y*Z*q,this._w=X*K*q-Y*Z*J;break;case"YXZ":this._x=Y*K*q+X*Z*J,this._y=X*Z*q-Y*K*J,this._z=X*K*J-Y*Z*q,this._w=X*K*q+Y*Z*J;break;case"ZXY":this._x=Y*K*q-X*Z*J,this._y=X*Z*q+Y*K*J,this._z=X*K*J+Y*Z*q,this._w=X*K*q-Y*Z*J;break;case"ZYX":this._x=Y*K*q-X*Z*J,this._y=X*Z*q+Y*K*J,this._z=X*K*J-Y*Z*q,this._w=X*K*q+Y*Z*J;break;case"YZX":this._x=Y*K*q+X*Z*J,this._y=X*Z*q+Y*K*J,this._z=X*K*J-Y*Z*q,this._w=X*K*q-Y*Z*J;break;case"XZY":this._x=Y*K*q-X*Z*J,this._y=X*Z*q-Y*K*J,this._z=X*K*J+Y*Z*q,this._w=X*K*q+Y*Z*J;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+H)}return!1!==S&&this._onChangeCallback(),this}setFromAxisAngle(x,S){const w=S/2,U=Math.sin(w);return this._x=x.x*U,this._y=x.y*U,this._z=x.z*U,this._w=Math.cos(w),this._onChangeCallback(),this}setFromRotationMatrix(x){const S=x.elements,w=S[0],U=S[4],G=S[8],H=S[1],z=S[5],j=S[9],X=S[2],K=S[6],q=S[10],Y=w+z+q;if(Y>0){const x=.5/Math.sqrt(Y+1);this._w=.25/x,this._x=(K-j)*x,this._y=(G-X)*x,this._z=(H-U)*x}else if(w>z&&w>q){const x=2*Math.sqrt(1+w-z-q);this._w=(K-j)/x,this._x=.25*x,this._y=(U+H)/x,this._z=(G+X)/x}else if(z>q){const x=2*Math.sqrt(1+z-w-q);this._w=(G-X)/x,this._x=(U+H)/x,this._y=.25*x,this._z=(j+K)/x}else{const x=2*Math.sqrt(1+q-w-z);this._w=(H-U)/x,this._x=(G+X)/x,this._y=(j+K)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(x,S){let w=x.dot(S)+1;return w Math.abs(x.z)?(this._x=-x.y,this._y=x.x,this._z=0,this._w=w):(this._x=0,this._y=-x.z,this._z=x.y,this._w=w)):(this._x=x.y*S.z-x.z*S.y,this._y=x.z*S.x-x.x*S.z,this._z=x.x*S.y-x.y*S.x,this._w=w),this.normalize()}angleTo(x){return 2*Math.acos(Math.abs(clamp(this.dot(x),-1,1)))}rotateTowards(x,S){const w=this.angleTo(x);if(0===w)return this;const U=Math.min(1,S/w);return this.slerp(x,U),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(x){return this._x*x._x+this._y*x._y+this._z*x._z+this._w*x._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let x=this.length();return 0===x?(this._x=0,this._y=0,this._z=0,this._w=1):(x=1/x,this._x=this._x*x,this._y=this._y*x,this._z=this._z*x,this._w=this._w*x),this._onChangeCallback(),this}multiply(x,S){return void 0!==S?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(x,S)):this.multiplyQuaternions(this,x)}premultiply(x){return this.multiplyQuaternions(x,this)}multiplyQuaternions(x,S){const w=x._x,U=x._y,G=x._z,H=x._w,z=S._x,j=S._y,X=S._z,K=S._w;return this._x=w*K+H*z+U*X-G*j,this._y=U*K+H*j+G*z-w*X,this._z=G*K+H*X+w*j-U*z,this._w=H*K-w*z-U*j-G*X,this._onChangeCallback(),this}slerp(x,S){if(0===S)return this;if(1===S)return this.copy(x);const w=this._x,U=this._y,G=this._z,H=this._w;let z=H*x._w+w*x._x+U*x._y+G*x._z;if(z<0?(this._w=-x._w,this._x=-x._x,this._y=-x._y,this._z=-x._z,z=-z):this.copy(x),z>=1)return this._w=H,this._x=w,this._y=U,this._z=G,this;const j=1-z*z;if(j<=Number.EPSILON){const x=1-S;return this._w=x*H+S*this._w,this._x=x*w+S*this._x,this._y=x*U+S*this._y,this._z=x*G+S*this._z,this.normalize(),this._onChangeCallback(),this}const X=Math.sqrt(j),K=Math.atan2(X,z),q=Math.sin((1-S)*K)/X,Y=Math.sin(S*K)/X;return this._w=H*q+this._w*Y,this._x=w*q+this._x*Y,this._y=U*q+this._y*Y,this._z=G*q+this._z*Y,this._onChangeCallback(),this}slerpQuaternions(x,S,w){this.copy(x).slerp(S,w)}random(){const x=Math.random(),S=Math.sqrt(1-x),w=Math.sqrt(x),U=2*Math.PI*Math.random(),G=2*Math.PI*Math.random();return this.set(S*Math.cos(U),w*Math.sin(G),w*Math.cos(G),S*Math.sin(U))}equals(x){return x._x===this._x&&x._y===this._y&&x._z===this._z&&x._w===this._w}fromArray(x,S=0){return this._x=x[S],this._y=x[S+1],this._z=x[S+2],this._w=x[S+3],this._onChangeCallback(),this}toArray(x=[],S=0){return x[S]=this._x,x[S+1]=this._y,x[S+2]=this._z,x[S+3]=this._w,x}fromBufferAttribute(x,S){return this._x=x.getX(S),this._y=x.getY(S),this._z=x.getZ(S),this._w=x.getW(S),this}_onChange(x){return this._onChangeCallback=x,this}_onChangeCallback(){}}Quaternion.prototype.isQuaternion=!0;class Vector3{constructor(x=0,S=0,w=0){this.x=x,this.y=S,this.z=w}set(x,S,w){return void 0===w&&(w=this.z),this.x=x,this.y=S,this.z=w,this}setScalar(x){return this.x=x,this.y=x,this.z=x,this}setX(x){return this.x=x,this}setY(x){return this.y=x,this}setZ(x){return this.z=x,this}setComponent(x,S){switch(x){case 0:this.x=S;break;case 1:this.y=S;break;case 2:this.z=S;break;default:throw new Error("index is out of range: "+x)}return this}getComponent(x){switch(x){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+x)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(x){return this.x=x.x,this.y=x.y,this.z=x.z,this}add(x,S){return void 0!==S?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(x,S)):(this.x+=x.x,this.y+=x.y,this.z+=x.z,this)}addScalar(x){return this.x+=x,this.y+=x,this.z+=x,this}addVectors(x,S){return this.x=x.x+S.x,this.y=x.y+S.y,this.z=x.z+S.z,this}addScaledVector(x,S){return this.x+=x.x*S,this.y+=x.y*S,this.z+=x.z*S,this}sub(x,S){return void 0!==S?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(x,S)):(this.x-=x.x,this.y-=x.y,this.z-=x.z,this)}subScalar(x){return this.x-=x,this.y-=x,this.z-=x,this}subVectors(x,S){return this.x=x.x-S.x,this.y=x.y-S.y,this.z=x.z-S.z,this}multiply(x,S){return void 0!==S?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(x,S)):(this.x*=x.x,this.y*=x.y,this.z*=x.z,this)}multiplyScalar(x){return this.x*=x,this.y*=x,this.z*=x,this}multiplyVectors(x,S){return this.x=x.x*S.x,this.y=x.y*S.y,this.z=x.z*S.z,this}applyEuler(x){return x&&x.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(qi.setFromEuler(x))}applyAxisAngle(x,S){return this.applyQuaternion(qi.setFromAxisAngle(x,S))}applyMatrix3(x){const S=this.x,w=this.y,U=this.z,G=x.elements;return this.x=G[0]*S+G[3]*w+G[6]*U,this.y=G[1]*S+G[4]*w+G[7]*U,this.z=G[2]*S+G[5]*w+G[8]*U,this}applyNormalMatrix(x){return this.applyMatrix3(x).normalize()}applyMatrix4(x){const S=this.x,w=this.y,U=this.z,G=x.elements,H=1/(G[3]*S+G[7]*w+G[11]*U+G[15]);return this.x=(G[0]*S+G[4]*w+G[8]*U+G[12])*H,this.y=(G[1]*S+G[5]*w+G[9]*U+G[13])*H,this.z=(G[2]*S+G[6]*w+G[10]*U+G[14])*H,this}applyQuaternion(x){const S=this.x,w=this.y,U=this.z,G=x.x,H=x.y,z=x.z,j=x.w,X=j*S+H*U-z*w,K=j*w+z*S-G*U,q=j*U+G*w-H*S,Y=-G*S-H*w-z*U;return this.x=X*j+Y*-G+K*-z-q*-H,this.y=K*j+Y*-H+q*-G-X*-z,this.z=q*j+Y*-z+X*-H-K*-G,this}project(x){return this.applyMatrix4(x.matrixWorldInverse).applyMatrix4(x.projectionMatrix)}unproject(x){return this.applyMatrix4(x.projectionMatrixInverse).applyMatrix4(x.matrixWorld)}transformDirection(x){const S=this.x,w=this.y,U=this.z,G=x.elements;return this.x=G[0]*S+G[4]*w+G[8]*U,this.y=G[1]*S+G[5]*w+G[9]*U,this.z=G[2]*S+G[6]*w+G[10]*U,this.normalize()}divide(x){return this.x/=x.x,this.y/=x.y,this.z/=x.z,this}divideScalar(x){return this.multiplyScalar(1/x)}min(x){return this.x=Math.min(this.x,x.x),this.y=Math.min(this.y,x.y),this.z=Math.min(this.z,x.z),this}max(x){return this.x=Math.max(this.x,x.x),this.y=Math.max(this.y,x.y),this.z=Math.max(this.z,x.z),this}clamp(x,S){return this.x=Math.max(x.x,Math.min(S.x,this.x)),this.y=Math.max(x.y,Math.min(S.y,this.y)),this.z=Math.max(x.z,Math.min(S.z,this.z)),this}clampScalar(x,S){return this.x=Math.max(x,Math.min(S,this.x)),this.y=Math.max(x,Math.min(S,this.y)),this.z=Math.max(x,Math.min(S,this.z)),this}clampLength(x,S){const w=this.length();return this.divideScalar(w||1).multiplyScalar(Math.max(x,Math.min(S,w)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(x){return this.x*x.x+this.y*x.y+this.z*x.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(x){return this.normalize().multiplyScalar(x)}lerp(x,S){return this.x+=(x.x-this.x)*S,this.y+=(x.y-this.y)*S,this.z+=(x.z-this.z)*S,this}lerpVectors(x,S,w){return this.x=x.x+(S.x-x.x)*w,this.y=x.y+(S.y-x.y)*w,this.z=x.z+(S.z-x.z)*w,this}cross(x,S){return void 0!==S?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(x,S)):this.crossVectors(this,x)}crossVectors(x,S){const w=x.x,U=x.y,G=x.z,H=S.x,z=S.y,j=S.z;return this.x=U*j-G*z,this.y=G*H-w*j,this.z=w*z-U*H,this}projectOnVector(x){const S=x.lengthSq();if(0===S)return this.set(0,0,0);const w=x.dot(this)/S;return this.copy(x).multiplyScalar(w)}projectOnPlane(x){return Ki.copy(this).projectOnVector(x),this.sub(Ki)}reflect(x){return this.sub(Ki.copy(x).multiplyScalar(2*this.dot(x)))}angleTo(x){const S=Math.sqrt(this.lengthSq()*x.lengthSq());if(0===S)return Math.PI/2;const w=this.dot(x)/S;return Math.acos(clamp(w,-1,1))}distanceTo(x){return Math.sqrt(this.distanceToSquared(x))}distanceToSquared(x){const S=this.x-x.x,w=this.y-x.y,U=this.z-x.z;return S*S+w*w+U*U}manhattanDistanceTo(x){return Math.abs(this.x-x.x)+Math.abs(this.y-x.y)+Math.abs(this.z-x.z)}setFromSpherical(x){return this.setFromSphericalCoords(x.radius,x.phi,x.theta)}setFromSphericalCoords(x,S,w){const U=Math.sin(S)*x;return this.x=U*Math.sin(w),this.y=Math.cos(S)*x,this.z=U*Math.cos(w),this}setFromCylindrical(x){return this.setFromCylindricalCoords(x.radius,x.theta,x.y)}setFromCylindricalCoords(x,S,w){return this.x=x*Math.sin(S),this.y=w,this.z=x*Math.cos(S),this}setFromMatrixPosition(x){const S=x.elements;return this.x=S[12],this.y=S[13],this.z=S[14],this}setFromMatrixScale(x){const S=this.setFromMatrixColumn(x,0).length(),w=this.setFromMatrixColumn(x,1).length(),U=this.setFromMatrixColumn(x,2).length();return this.x=S,this.y=w,this.z=U,this}setFromMatrixColumn(x,S){return this.fromArray(x.elements,4*S)}setFromMatrix3Column(x,S){return this.fromArray(x.elements,3*S)}equals(x){return x.x===this.x&&x.y===this.y&&x.z===this.z}fromArray(x,S=0){return this.x=x[S],this.y=x[S+1],this.z=x[S+2],this}toArray(x=[],S=0){return x[S]=this.x,x[S+1]=this.y,x[S+2]=this.z,x}fromBufferAttribute(x,S,w){return void 0!==w&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=x.getX(S),this.y=x.getY(S),this.z=x.getZ(S),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const x=2*(Math.random()-.5),S=Math.random()*Math.PI*2,w=Math.sqrt(1-x**2);return this.x=w*Math.cos(S),this.y=w*Math.sin(S),this.z=x,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}Vector3.prototype.isVector3=!0;const Ki=new Vector3,qi=new Quaternion;class Box3{constructor(x=new Vector3(1/0,1/0,1/0),S=new Vector3(-1/0,-1/0,-1/0)){this.min=x,this.max=S}set(x,S){return this.min.copy(x),this.max.copy(S),this}setFromArray(x){let S=1/0,w=1/0,U=1/0,G=-1/0,H=-1/0,z=-1/0;for(let j=0,X=x.length;j G&&(G=X),K>H&&(H=K),q>z&&(z=q)}return this.min.set(S,w,U),this.max.set(G,H,z),this}setFromBufferAttribute(x){let S=1/0,w=1/0,U=1/0,G=-1/0,H=-1/0,z=-1/0;for(let j=0,X=x.count;j G&&(G=X),K>H&&(H=K),q>z&&(z=q)}return this.min.set(S,w,U),this.max.set(G,H,z),this}setFromPoints(x){this.makeEmpty();for(let S=0,w=x.length;S this.max.x||x.y this.max.y||x.z this.max.z)}containsBox(x){return this.min.x<=x.min.x&&x.max.x<=this.max.x&&this.min.y<=x.min.y&&x.max.y<=this.max.y&&this.min.z<=x.min.z&&x.max.z<=this.max.z}getParameter(x,S){return S.set((x.x-this.min.x)/(this.max.x-this.min.x),(x.y-this.min.y)/(this.max.y-this.min.y),(x.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(x){return!(x.max.x this.max.x||x.max.y this.max.y||x.max.z this.max.z)}intersectsSphere(x){return this.clampPoint(x.center,Zi),Zi.distanceToSquared(x.center)<=x.radius*x.radius}intersectsPlane(x){let S,w;return x.normal.x>0?(S=x.normal.x*this.min.x,w=x.normal.x*this.max.x):(S=x.normal.x*this.max.x,w=x.normal.x*this.min.x),x.normal.y>0?(S+=x.normal.y*this.min.y,w+=x.normal.y*this.max.y):(S+=x.normal.y*this.max.y,w+=x.normal.y*this.min.y),x.normal.z>0?(S+=x.normal.z*this.min.z,w+=x.normal.z*this.max.z):(S+=x.normal.z*this.max.z,w+=x.normal.z*this.min.z),S<=-x.constant&&w>=-x.constant}intersectsTriangle(x){if(this.isEmpty())return!1;this.getCenter(or),ar.subVectors(this.max,or),Qi.subVectors(x.a,or),er.subVectors(x.b,or),tr.subVectors(x.c,or),nr.subVectors(er,Qi),ir.subVectors(tr,er),rr.subVectors(Qi,tr);let S=[0,-nr.z,nr.y,0,-ir.z,ir.y,0,-rr.z,rr.y,nr.z,0,-nr.x,ir.z,0,-ir.x,rr.z,0,-rr.x,-nr.y,nr.x,0,-ir.y,ir.x,0,-rr.y,rr.x,0];return!!satForAxes(S,Qi,er,tr,ar)&&(S=[1,0,0,0,1,0,0,0,1],!!satForAxes(S,Qi,er,tr,ar)&&(sr.crossVectors(nr,ir),S=[sr.x,sr.y,sr.z],satForAxes(S,Qi,er,tr,ar)))}clampPoint(x,S){return S.copy(x).clamp(this.min,this.max)}distanceToPoint(x){return Zi.copy(x).clamp(this.min,this.max).sub(x).length()}getBoundingSphere(x){return this.getCenter(x.center),x.radius=.5*this.getSize(Zi).length(),x}intersect(x){return this.min.max(x.min),this.max.min(x.max),this.isEmpty()&&this.makeEmpty(),this}union(x){return this.min.min(x.min),this.max.max(x.max),this}applyMatrix4(x){return this.isEmpty()||(Yi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(x),Yi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(x),Yi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(x),Yi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(x),Yi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(x),Yi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(x),Yi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(x),Yi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(x),this.setFromPoints(Yi)),this}translate(x){return this.min.add(x),this.max.add(x),this}equals(x){return x.min.equals(this.min)&&x.max.equals(this.max)}}Box3.prototype.isBox3=!0;const Yi=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],Zi=new Vector3,Ji=new Box3,Qi=new Vector3,er=new Vector3,tr=new Vector3,nr=new Vector3,ir=new Vector3,rr=new Vector3,or=new Vector3,ar=new Vector3,sr=new Vector3,lr=new Vector3;function satForAxes(x,S,w,U,G){for(let H=0,z=x.length-3;H<=z;H+=3){lr.fromArray(x,H);const z=G.x*Math.abs(lr.x)+G.y*Math.abs(lr.y)+G.z*Math.abs(lr.z),j=S.dot(lr),X=w.dot(lr),K=U.dot(lr);if(Math.max(-Math.max(j,X,K),Math.min(j,X,K))>z)return!1}return!0}const cr=new Box3,ur=new Vector3,hr=new Vector3,dr=new Vector3;class Sphere{constructor(x=new Vector3,S=-1){this.center=x,this.radius=S}set(x,S){return this.center.copy(x),this.radius=S,this}setFromPoints(x,S){const w=this.center;void 0!==S?w.copy(S):cr.setFromPoints(x).getCenter(w);let U=0;for(let S=0,G=x.length;S this.radius*this.radius&&(S.sub(this.center).normalize(),S.multiplyScalar(this.radius).add(this.center)),S}getBoundingBox(x){return this.isEmpty()?(x.makeEmpty(),x):(x.set(this.center,this.center),x.expandByScalar(this.radius),x)}applyMatrix4(x){return this.center.applyMatrix4(x),this.radius=this.radius*x.getMaxScaleOnAxis(),this}translate(x){return this.center.add(x),this}expandByPoint(x){dr.subVectors(x,this.center);const S=dr.lengthSq();if(S>this.radius*this.radius){const x=Math.sqrt(S),w=.5*(x-this.radius);this.center.add(dr.multiplyScalar(w/x)),this.radius+=w}return this}union(x){return hr.subVectors(x.center,this.center).normalize().multiplyScalar(x.radius),this.expandByPoint(ur.copy(x.center).add(hr)),this.expandByPoint(ur.copy(x.center).sub(hr)),this}equals(x){return x.center.equals(this.center)&&x.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const pr=new Vector3,mr=new Vector3,fr=new Vector3,gr=new Vector3,vr=new Vector3,_r=new Vector3,yr=new Vector3;class Ray{constructor(x=new Vector3,S=new Vector3(0,0,-1)){this.origin=x,this.direction=S}set(x,S){return this.origin.copy(x),this.direction.copy(S),this}copy(x){return this.origin.copy(x.origin),this.direction.copy(x.direction),this}at(x,S){return S.copy(this.direction).multiplyScalar(x).add(this.origin)}lookAt(x){return this.direction.copy(x).sub(this.origin).normalize(),this}recast(x){return this.origin.copy(this.at(x,pr)),this}closestPointToPoint(x,S){S.subVectors(x,this.origin);const w=S.dot(this.direction);return w<0?S.copy(this.origin):S.copy(this.direction).multiplyScalar(w).add(this.origin)}distanceToPoint(x){return Math.sqrt(this.distanceSqToPoint(x))}distanceSqToPoint(x){const S=pr.subVectors(x,this.origin).dot(this.direction);return S<0?this.origin.distanceToSquared(x):(pr.copy(this.direction).multiplyScalar(S).add(this.origin),pr.distanceToSquared(x))}distanceSqToSegment(x,S,w,U){mr.copy(x).add(S).multiplyScalar(.5),fr.copy(S).sub(x).normalize(),gr.copy(this.origin).sub(mr);const G=.5*x.distanceTo(S),H=-this.direction.dot(fr),z=gr.dot(this.direction),j=-gr.dot(fr),X=gr.lengthSq(),K=Math.abs(1-H*H);let q,Y,Z,J;if(K>0)if(q=H*j-z,Y=H*z-j,J=G*K,q>=0)if(Y>=-J)if(Y<=J){const x=1/K;q*=x,Y*=x,Z=q*(q+H*Y+2*z)+Y*(H*q+Y+2*j)+X}else Y=G,q=Math.max(0,-(H*Y+z)),Z=-q*q+Y*(Y+2*j)+X;else Y=-G,q=Math.max(0,-(H*Y+z)),Z=-q*q+Y*(Y+2*j)+X;else Y<=-J?(q=Math.max(0,-(-H*G+z)),Y=q>0?-G:Math.min(Math.max(-G,-j),G),Z=-q*q+Y*(Y+2*j)+X):Y<=J?(q=0,Y=Math.min(Math.max(-G,-j),G),Z=Y*(Y+2*j)+X):(q=Math.max(0,-(H*G+z)),Y=q>0?G:Math.min(Math.max(-G,-j),G),Z=-q*q+Y*(Y+2*j)+X);else Y=H>0?-G:G,q=Math.max(0,-(H*Y+z)),Z=-q*q+Y*(Y+2*j)+X;return w&&w.copy(this.direction).multiplyScalar(q).add(this.origin),U&&U.copy(fr).multiplyScalar(Y).add(mr),Z}intersectSphere(x,S){pr.subVectors(x.center,this.origin);const w=pr.dot(this.direction),U=pr.dot(pr)-w*w,G=x.radius*x.radius;if(U>G)return null;const H=Math.sqrt(G-U),z=w-H,j=w+H;return z<0&&j<0?null:z<0?this.at(j,S):this.at(z,S)}intersectsSphere(x){return this.distanceSqToPoint(x.center)<=x.radius*x.radius}distanceToPlane(x){const S=x.normal.dot(this.direction);if(0===S)return 0===x.distanceToPoint(this.origin)?0:null;const w=-(this.origin.dot(x.normal)+x.constant)/S;return w>=0?w:null}intersectPlane(x,S){const w=this.distanceToPlane(x);return null===w?null:this.at(w,S)}intersectsPlane(x){const S=x.distanceToPoint(this.origin);if(0===S)return!0;return x.normal.dot(this.direction)*S<0}intersectBox(x,S){let w,U,G,H,z,j;const X=1/this.direction.x,K=1/this.direction.y,q=1/this.direction.z,Y=this.origin;return X>=0?(w=(x.min.x-Y.x)*X,U=(x.max.x-Y.x)*X):(w=(x.max.x-Y.x)*X,U=(x.min.x-Y.x)*X),K>=0?(G=(x.min.y-Y.y)*K,H=(x.max.y-Y.y)*K):(G=(x.max.y-Y.y)*K,H=(x.min.y-Y.y)*K),w>H||G>U?null:((G>w||w!=w)&&(w=G),(H=0?(z=(x.min.z-Y.z)*q,j=(x.max.z-Y.z)*q):(z=(x.max.z-Y.z)*q,j=(x.min.z-Y.z)*q),w>j||z>U?null:((z>w||w!=w)&&(w=z),(j=0?w:U,S)))}intersectsBox(x){return null!==this.intersectBox(x,pr)}intersectTriangle(x,S,w,U,G){vr.subVectors(S,x),_r.subVectors(w,x),yr.crossVectors(vr,_r);let H,z=this.direction.dot(yr);if(z>0){if(U)return null;H=1}else{if(!(z<0))return null;H=-1,z=-z}gr.subVectors(this.origin,x);const j=H*this.direction.dot(_r.crossVectors(gr,_r));if(j<0)return null;const X=H*this.direction.dot(vr.cross(gr));if(X<0)return null;if(j+X>z)return null;const K=-H*gr.dot(yr);return K<0?null:this.at(K/z,G)}applyMatrix4(x){return this.origin.applyMatrix4(x),this.direction.transformDirection(x),this}equals(x){return x.origin.equals(this.origin)&&x.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(x,S,w,U,G,H,z,j,X,K,q,Y,Z,J,Q,ee){const te=this.elements;return te[0]=x,te[4]=S,te[8]=w,te[12]=U,te[1]=G,te[5]=H,te[9]=z,te[13]=j,te[2]=X,te[6]=K,te[10]=q,te[14]=Y,te[3]=Z,te[7]=J,te[11]=Q,te[15]=ee,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Matrix4).fromArray(this.elements)}copy(x){const S=this.elements,w=x.elements;return S[0]=w[0],S[1]=w[1],S[2]=w[2],S[3]=w[3],S[4]=w[4],S[5]=w[5],S[6]=w[6],S[7]=w[7],S[8]=w[8],S[9]=w[9],S[10]=w[10],S[11]=w[11],S[12]=w[12],S[13]=w[13],S[14]=w[14],S[15]=w[15],this}copyPosition(x){const S=this.elements,w=x.elements;return S[12]=w[12],S[13]=w[13],S[14]=w[14],this}setFromMatrix3(x){const S=x.elements;return this.set(S[0],S[3],S[6],0,S[1],S[4],S[7],0,S[2],S[5],S[8],0,0,0,0,1),this}extractBasis(x,S,w){return x.setFromMatrixColumn(this,0),S.setFromMatrixColumn(this,1),w.setFromMatrixColumn(this,2),this}makeBasis(x,S,w){return this.set(x.x,S.x,w.x,0,x.y,S.y,w.y,0,x.z,S.z,w.z,0,0,0,0,1),this}extractRotation(x){const S=this.elements,w=x.elements,U=1/br.setFromMatrixColumn(x,0).length(),G=1/br.setFromMatrixColumn(x,1).length(),H=1/br.setFromMatrixColumn(x,2).length();return S[0]=w[0]*U,S[1]=w[1]*U,S[2]=w[2]*U,S[3]=0,S[4]=w[4]*G,S[5]=w[5]*G,S[6]=w[6]*G,S[7]=0,S[8]=w[8]*H,S[9]=w[9]*H,S[10]=w[10]*H,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,this}makeRotationFromEuler(x){x&&x.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const S=this.elements,w=x.x,U=x.y,G=x.z,H=Math.cos(w),z=Math.sin(w),j=Math.cos(U),X=Math.sin(U),K=Math.cos(G),q=Math.sin(G);if("XYZ"===x.order){const x=H*K,w=H*q,U=z*K,G=z*q;S[0]=j*K,S[4]=-j*q,S[8]=X,S[1]=w+U*X,S[5]=x-G*X,S[9]=-z*j,S[2]=G-x*X,S[6]=U+w*X,S[10]=H*j}else if("YXZ"===x.order){const x=j*K,w=j*q,U=X*K,G=X*q;S[0]=x+G*z,S[4]=U*z-w,S[8]=H*X,S[1]=H*q,S[5]=H*K,S[9]=-z,S[2]=w*z-U,S[6]=G+x*z,S[10]=H*j}else if("ZXY"===x.order){const x=j*K,w=j*q,U=X*K,G=X*q;S[0]=x-G*z,S[4]=-H*q,S[8]=U+w*z,S[1]=w+U*z,S[5]=H*K,S[9]=G-x*z,S[2]=-H*X,S[6]=z,S[10]=H*j}else if("ZYX"===x.order){const x=H*K,w=H*q,U=z*K,G=z*q;S[0]=j*K,S[4]=U*X-w,S[8]=x*X+G,S[1]=j*q,S[5]=G*X+x,S[9]=w*X-U,S[2]=-X,S[6]=z*j,S[10]=H*j}else if("YZX"===x.order){const x=H*j,w=H*X,U=z*j,G=z*X;S[0]=j*K,S[4]=G-x*q,S[8]=U*q+w,S[1]=q,S[5]=H*K,S[9]=-z*K,S[2]=-X*K,S[6]=w*q+U,S[10]=x-G*q}else if("XZY"===x.order){const x=H*j,w=H*X,U=z*j,G=z*X;S[0]=j*K,S[4]=-q,S[8]=X*K,S[1]=x*q+G,S[5]=H*K,S[9]=w*q-U,S[2]=U*q-w,S[6]=z*K,S[10]=G*q+x}return S[3]=0,S[7]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,this}makeRotationFromQuaternion(x){return this.compose(Er,x,Sr)}lookAt(x,S,w){const U=this.elements;return Cr.subVectors(x,S),0===Cr.lengthSq()&&(Cr.z=1),Cr.normalize(),Tr.crossVectors(w,Cr),0===Tr.lengthSq()&&(1===Math.abs(w.z)?Cr.x+=1e-4:Cr.z+=1e-4,Cr.normalize(),Tr.crossVectors(w,Cr)),Tr.normalize(),wr.crossVectors(Cr,Tr),U[0]=Tr.x,U[4]=wr.x,U[8]=Cr.x,U[1]=Tr.y,U[5]=wr.y,U[9]=Cr.y,U[2]=Tr.z,U[6]=wr.z,U[10]=Cr.z,this}multiply(x,S){return void 0!==S?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(x,S)):this.multiplyMatrices(this,x)}premultiply(x){return this.multiplyMatrices(x,this)}multiplyMatrices(x,S){const w=x.elements,U=S.elements,G=this.elements,H=w[0],z=w[4],j=w[8],X=w[12],K=w[1],q=w[5],Y=w[9],Z=w[13],J=w[2],Q=w[6],ee=w[10],te=w[14],ne=w[3],ie=w[7],re=w[11],oe=w[15],ae=U[0],se=U[4],le=U[8],ce=U[12],ue=U[1],he=U[5],de=U[9],pe=U[13],me=U[2],fe=U[6],ge=U[10],ve=U[14],_e=U[3],ye=U[7],be=U[11],xe=U[15];return G[0]=H*ae+z*ue+j*me+X*_e,G[4]=H*se+z*he+j*fe+X*ye,G[8]=H*le+z*de+j*ge+X*be,G[12]=H*ce+z*pe+j*ve+X*xe,G[1]=K*ae+q*ue+Y*me+Z*_e,G[5]=K*se+q*he+Y*fe+Z*ye,G[9]=K*le+q*de+Y*ge+Z*be,G[13]=K*ce+q*pe+Y*ve+Z*xe,G[2]=J*ae+Q*ue+ee*me+te*_e,G[6]=J*se+Q*he+ee*fe+te*ye,G[10]=J*le+Q*de+ee*ge+te*be,G[14]=J*ce+Q*pe+ee*ve+te*xe,G[3]=ne*ae+ie*ue+re*me+oe*_e,G[7]=ne*se+ie*he+re*fe+oe*ye,G[11]=ne*le+ie*de+re*ge+oe*be,G[15]=ne*ce+ie*pe+re*ve+oe*xe,this}multiplyScalar(x){const S=this.elements;return S[0]*=x,S[4]*=x,S[8]*=x,S[12]*=x,S[1]*=x,S[5]*=x,S[9]*=x,S[13]*=x,S[2]*=x,S[6]*=x,S[10]*=x,S[14]*=x,S[3]*=x,S[7]*=x,S[11]*=x,S[15]*=x,this}determinant(){const x=this.elements,S=x[0],w=x[4],U=x[8],G=x[12],H=x[1],z=x[5],j=x[9],X=x[13],K=x[2],q=x[6],Y=x[10],Z=x[14];return x[3]*(+G*j*q-U*X*q-G*z*Y+w*X*Y+U*z*Z-w*j*Z)+x[7]*(+S*j*Z-S*X*Y+G*H*Y-U*H*Z+U*X*K-G*j*K)+x[11]*(+S*X*q-S*z*Z-G*H*q+w*H*Z+G*z*K-w*X*K)+x[15]*(-U*z*K-S*j*q+S*z*Y+U*H*q-w*H*Y+w*j*K)}transpose(){const x=this.elements;let S;return S=x[1],x[1]=x[4],x[4]=S,S=x[2],x[2]=x[8],x[8]=S,S=x[6],x[6]=x[9],x[9]=S,S=x[3],x[3]=x[12],x[12]=S,S=x[7],x[7]=x[13],x[13]=S,S=x[11],x[11]=x[14],x[14]=S,this}setPosition(x,S,w){const U=this.elements;return x.isVector3?(U[12]=x.x,U[13]=x.y,U[14]=x.z):(U[12]=x,U[13]=S,U[14]=w),this}invert(){const x=this.elements,S=x[0],w=x[1],U=x[2],G=x[3],H=x[4],z=x[5],j=x[6],X=x[7],K=x[8],q=x[9],Y=x[10],Z=x[11],J=x[12],Q=x[13],ee=x[14],te=x[15],ne=q*ee*X-Q*Y*X+Q*j*Z-z*ee*Z-q*j*te+z*Y*te,ie=J*Y*X-K*ee*X-J*j*Z+H*ee*Z+K*j*te-H*Y*te,re=K*Q*X-J*q*X+J*z*Z-H*Q*Z-K*z*te+H*q*te,oe=J*q*j-K*Q*j-J*z*Y+H*Q*Y+K*z*ee-H*q*ee,ae=S*ne+w*ie+U*re+G*oe;if(0===ae)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const se=1/ae;return x[0]=ne*se,x[1]=(Q*Y*G-q*ee*G-Q*U*Z+w*ee*Z+q*U*te-w*Y*te)*se,x[2]=(z*ee*G-Q*j*G+Q*U*X-w*ee*X-z*U*te+w*j*te)*se,x[3]=(q*j*G-z*Y*G-q*U*X+w*Y*X+z*U*Z-w*j*Z)*se,x[4]=ie*se,x[5]=(K*ee*G-J*Y*G+J*U*Z-S*ee*Z-K*U*te+S*Y*te)*se,x[6]=(J*j*G-H*ee*G-J*U*X+S*ee*X+H*U*te-S*j*te)*se,x[7]=(H*Y*G-K*j*G+K*U*X-S*Y*X-H*U*Z+S*j*Z)*se,x[8]=re*se,x[9]=(J*q*G-K*Q*G-J*w*Z+S*Q*Z+K*w*te-S*q*te)*se,x[10]=(H*Q*G-J*z*G+J*w*X-S*Q*X-H*w*te+S*z*te)*se,x[11]=(K*z*G-H*q*G-K*w*X+S*q*X+H*w*Z-S*z*Z)*se,x[12]=oe*se,x[13]=(K*Q*U-J*q*U+J*w*Y-S*Q*Y-K*w*ee+S*q*ee)*se,x[14]=(J*z*U-H*Q*U-J*w*j+S*Q*j+H*w*ee-S*z*ee)*se,x[15]=(H*q*U-K*z*U+K*w*j-S*q*j-H*w*Y+S*z*Y)*se,this}scale(x){const S=this.elements,w=x.x,U=x.y,G=x.z;return S[0]*=w,S[4]*=U,S[8]*=G,S[1]*=w,S[5]*=U,S[9]*=G,S[2]*=w,S[6]*=U,S[10]*=G,S[3]*=w,S[7]*=U,S[11]*=G,this}getMaxScaleOnAxis(){const x=this.elements,S=x[0]*x[0]+x[1]*x[1]+x[2]*x[2],w=x[4]*x[4]+x[5]*x[5]+x[6]*x[6],U=x[8]*x[8]+x[9]*x[9]+x[10]*x[10];return Math.sqrt(Math.max(S,w,U))}makeTranslation(x,S,w){return this.set(1,0,0,x,0,1,0,S,0,0,1,w,0,0,0,1),this}makeRotationX(x){const S=Math.cos(x),w=Math.sin(x);return this.set(1,0,0,0,0,S,-w,0,0,w,S,0,0,0,0,1),this}makeRotationY(x){const S=Math.cos(x),w=Math.sin(x);return this.set(S,0,w,0,0,1,0,0,-w,0,S,0,0,0,0,1),this}makeRotationZ(x){const S=Math.cos(x),w=Math.sin(x);return this.set(S,-w,0,0,w,S,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(x,S){const w=Math.cos(S),U=Math.sin(S),G=1-w,H=x.x,z=x.y,j=x.z,X=G*H,K=G*z;return this.set(X*H+w,X*z-U*j,X*j+U*z,0,X*z+U*j,K*z+w,K*j-U*H,0,X*j-U*z,K*j+U*H,G*j*j+w,0,0,0,0,1),this}makeScale(x,S,w){return this.set(x,0,0,0,0,S,0,0,0,0,w,0,0,0,0,1),this}makeShear(x,S,w,U,G,H){return this.set(1,w,G,0,x,1,H,0,S,U,1,0,0,0,0,1),this}compose(x,S,w){const U=this.elements,G=S._x,H=S._y,z=S._z,j=S._w,X=G+G,K=H+H,q=z+z,Y=G*X,Z=G*K,J=G*q,Q=H*K,ee=H*q,te=z*q,ne=j*X,ie=j*K,re=j*q,oe=w.x,ae=w.y,se=w.z;return U[0]=(1-(Q+te))*oe,U[1]=(Z+re)*oe,U[2]=(J-ie)*oe,U[3]=0,U[4]=(Z-re)*ae,U[5]=(1-(Y+te))*ae,U[6]=(ee+ne)*ae,U[7]=0,U[8]=(J+ie)*se,U[9]=(ee-ne)*se,U[10]=(1-(Y+Q))*se,U[11]=0,U[12]=x.x,U[13]=x.y,U[14]=x.z,U[15]=1,this}decompose(x,S,w){const U=this.elements;let G=br.set(U[0],U[1],U[2]).length();const H=br.set(U[4],U[5],U[6]).length(),z=br.set(U[8],U[9],U[10]).length();this.determinant()<0&&(G=-G),x.x=U[12],x.y=U[13],x.z=U[14],xr.copy(this);const j=1/G,X=1/H,K=1/z;return xr.elements[0]*=j,xr.elements[1]*=j,xr.elements[2]*=j,xr.elements[4]*=X,xr.elements[5]*=X,xr.elements[6]*=X,xr.elements[8]*=K,xr.elements[9]*=K,xr.elements[10]*=K,S.setFromRotationMatrix(xr),w.x=G,w.y=H,w.z=z,this}makePerspective(x,S,w,U,G,H){void 0===H&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const z=this.elements,j=2*G/(S-x),X=2*G/(w-U),K=(S+x)/(S-x),q=(w+U)/(w-U),Y=-(H+G)/(H-G),Z=-2*H*G/(H-G);return z[0]=j,z[4]=0,z[8]=K,z[12]=0,z[1]=0,z[5]=X,z[9]=q,z[13]=0,z[2]=0,z[6]=0,z[10]=Y,z[14]=Z,z[3]=0,z[7]=0,z[11]=-1,z[15]=0,this}makeOrthographic(x,S,w,U,G,H){const z=this.elements,j=1/(S-x),X=1/(w-U),K=1/(H-G),q=(S+x)*j,Y=(w+U)*X,Z=(H+G)*K;return z[0]=2*j,z[4]=0,z[8]=0,z[12]=-q,z[1]=0,z[5]=2*X,z[9]=0,z[13]=-Y,z[2]=0,z[6]=0,z[10]=-2*K,z[14]=-Z,z[3]=0,z[7]=0,z[11]=0,z[15]=1,this}equals(x){const S=this.elements,w=x.elements;for(let x=0;x<16;x++)if(S[x]!==w[x])return!1;return!0}fromArray(x,S=0){for(let w=0;w<16;w++)this.elements[w]=x[w+S];return this}toArray(x=[],S=0){const w=this.elements;return x[S]=w[0],x[S+1]=w[1],x[S+2]=w[2],x[S+3]=w[3],x[S+4]=w[4],x[S+5]=w[5],x[S+6]=w[6],x[S+7]=w[7],x[S+8]=w[8],x[S+9]=w[9],x[S+10]=w[10],x[S+11]=w[11],x[S+12]=w[12],x[S+13]=w[13],x[S+14]=w[14],x[S+15]=w[15],x}}Matrix4.prototype.isMatrix4=!0;const br=new Vector3,xr=new Matrix4,Er=new Vector3(0,0,0),Sr=new Vector3(1,1,1),Tr=new Vector3,wr=new Vector3,Cr=new Vector3,Ar=new Matrix4,Mr=new Quaternion;class Euler{constructor(x=0,S=0,w=0,U=Euler.DefaultOrder){this._x=x,this._y=S,this._z=w,this._order=U}get x(){return this._x}set x(x){this._x=x,this._onChangeCallback()}get y(){return this._y}set y(x){this._y=x,this._onChangeCallback()}get z(){return this._z}set z(x){this._z=x,this._onChangeCallback()}get order(){return this._order}set order(x){this._order=x,this._onChangeCallback()}set(x,S,w,U=this._order){return this._x=x,this._y=S,this._z=w,this._order=U,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(x){return this._x=x._x,this._y=x._y,this._z=x._z,this._order=x._order,this._onChangeCallback(),this}setFromRotationMatrix(x,S=this._order,w=!0){const U=x.elements,G=U[0],H=U[4],z=U[8],j=U[1],X=U[5],K=U[9],q=U[2],Y=U[6],Z=U[10];switch(S){case"XYZ":this._y=Math.asin(clamp(z,-1,1)),Math.abs(z)<.9999999?(this._x=Math.atan2(-K,Z),this._z=Math.atan2(-H,G)):(this._x=Math.atan2(Y,X),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(K,-1,1)),Math.abs(K)<.9999999?(this._y=Math.atan2(z,Z),this._z=Math.atan2(j,X)):(this._y=Math.atan2(-q,G),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(Y,-1,1)),Math.abs(Y)<.9999999?(this._y=Math.atan2(-q,Z),this._z=Math.atan2(-H,X)):(this._y=0,this._z=Math.atan2(j,G));break;case"ZYX":this._y=Math.asin(-clamp(q,-1,1)),Math.abs(q)<.9999999?(this._x=Math.atan2(Y,Z),this._z=Math.atan2(j,G)):(this._x=0,this._z=Math.atan2(-H,X));break;case"YZX":this._z=Math.asin(clamp(j,-1,1)),Math.abs(j)<.9999999?(this._x=Math.atan2(-K,X),this._y=Math.atan2(-q,G)):(this._x=0,this._y=Math.atan2(z,Z));break;case"XZY":this._z=Math.asin(-clamp(H,-1,1)),Math.abs(H)<.9999999?(this._x=Math.atan2(Y,X),this._y=Math.atan2(z,G)):(this._x=Math.atan2(-K,Z),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+S)}return this._order=S,!0===w&&this._onChangeCallback(),this}setFromQuaternion(x,S,w){return Ar.makeRotationFromQuaternion(x),this.setFromRotationMatrix(Ar,S,w)}setFromVector3(x,S=this._order){return this.set(x.x,x.y,x.z,S)}reorder(x){return Mr.setFromEuler(this),this.setFromQuaternion(Mr,x)}equals(x){return x._x===this._x&&x._y===this._y&&x._z===this._z&&x._order===this._order}fromArray(x){return this._x=x[0],this._y=x[1],this._z=x[2],void 0!==x[3]&&(this._order=x[3]),this._onChangeCallback(),this}toArray(x=[],S=0){return x[S]=this._x,x[S+1]=this._y,x[S+2]=this._z,x[S+3]=this._order,x}toVector3(x){return x?x.set(this._x,this._y,this._z):new Vector3(this._x,this._y,this._z)}_onChange(x){return this._onChangeCallback=x,this}_onChangeCallback(){}}Euler.prototype.isEuler=!0,Euler.DefaultOrder="XYZ",Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Layers{constructor(){this.mask=1}set(x){this.mask=1< 1){for(let x=0;x 1){for(let x=0;x 0){U.children=[];for(let S=0;S 0){U.animations=[];for(let S=0;S 0&&(w.geometries=S),U.length>0&&(w.materials=U),G.length>0&&(w.textures=G),H.length>0&&(w.images=H),z.length>0&&(w.shapes=z),j.length>0&&(w.skeletons=j),X.length>0&&(w.animations=X)}return w.object=U,w;function extractFromCache(x){const S=[];for(const w in x){const U=x[w];delete U.metadata,S.push(U)}return S}}clone(x){return(new this.constructor).copy(this,x)}copy(x,S=!0){if(this.name=x.name,this.up.copy(x.up),this.position.copy(x.position),this.rotation.order=x.rotation.order,this.quaternion.copy(x.quaternion),this.scale.copy(x.scale),this.matrix.copy(x.matrix),this.matrixWorld.copy(x.matrixWorld),this.matrixAutoUpdate=x.matrixAutoUpdate,this.matrixWorldNeedsUpdate=x.matrixWorldNeedsUpdate,this.layers.mask=x.layers.mask,this.visible=x.visible,this.castShadow=x.castShadow,this.receiveShadow=x.receiveShadow,this.frustumCulled=x.frustumCulled,this.renderOrder=x.renderOrder,this.userData=JSON.parse(JSON.stringify(x.userData)),!0===S)for(let S=0;S 0?U.multiplyScalar(1/Math.sqrt(G)):U.set(0,0,0)}static getBarycoord(x,S,w,U,G){Hr.subVectors(U,S),Wr.subVectors(w,S),$r.subVectors(x,S);const H=Hr.dot(Hr),z=Hr.dot(Wr),j=Hr.dot($r),X=Wr.dot(Wr),K=Wr.dot($r),q=H*X-z*z;if(0===q)return G.set(-2,-1,-1);const Y=1/q,Z=(X*j-z*K)*Y,J=(H*K-z*j)*Y;return G.set(1-Z-J,J,Z)}static containsPoint(x,S,w,U){return this.getBarycoord(x,S,w,U,zr),zr.x>=0&&zr.y>=0&&zr.x+zr.y<=1}static getUV(x,S,w,U,G,H,z,j){return this.getBarycoord(x,S,w,U,zr),j.set(0,0),j.addScaledVector(G,zr.x),j.addScaledVector(H,zr.y),j.addScaledVector(z,zr.z),j}static isFrontFacing(x,S,w,U){return Hr.subVectors(w,S),Wr.subVectors(x,S),Hr.cross(Wr).dot(U)<0}set(x,S,w){return this.a.copy(x),this.b.copy(S),this.c.copy(w),this}setFromPointsAndIndices(x,S,w,U){return this.a.copy(x[S]),this.b.copy(x[w]),this.c.copy(x[U]),this}setFromAttributeAndIndices(x,S,w,U){return this.a.fromBufferAttribute(x,S),this.b.fromBufferAttribute(x,w),this.c.fromBufferAttribute(x,U),this}clone(){return(new this.constructor).copy(this)}copy(x){return this.a.copy(x.a),this.b.copy(x.b),this.c.copy(x.c),this}getArea(){return Hr.subVectors(this.c,this.b),Wr.subVectors(this.a,this.b),.5*Hr.cross(Wr).length()}getMidpoint(x){return x.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(x){return Triangle.getNormal(this.a,this.b,this.c,x)}getPlane(x){return x.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(x,S){return Triangle.getBarycoord(x,this.a,this.b,this.c,S)}getUV(x,S,w,U,G){return Triangle.getUV(x,this.a,this.b,this.c,S,w,U,G)}containsPoint(x){return Triangle.containsPoint(x,this.a,this.b,this.c)}isFrontFacing(x){return Triangle.isFrontFacing(this.a,this.b,this.c,x)}intersectsBox(x){return x.intersectsTriangle(this)}closestPointToPoint(x,S){const w=this.a,U=this.b,G=this.c;let H,z;jr.subVectors(U,w),Xr.subVectors(G,w),qr.subVectors(x,w);const j=jr.dot(qr),X=Xr.dot(qr);if(j<=0&&X<=0)return S.copy(w);Yr.subVectors(x,U);const K=jr.dot(Yr),q=Xr.dot(Yr);if(K>=0&&q<=K)return S.copy(U);const Y=j*q-K*X;if(Y<=0&&j>=0&&K<=0)return H=j/(j-K),S.copy(w).addScaledVector(jr,H);Zr.subVectors(x,G);const Z=jr.dot(Zr),J=Xr.dot(Zr);if(J>=0&&Z<=J)return S.copy(G);const Q=Z*X-j*J;if(Q<=0&&X>=0&&J<=0)return z=X/(X-J),S.copy(w).addScaledVector(Xr,z);const ee=K*J-Z*q;if(ee<=0&&q-K>=0&&Z-J>=0)return Kr.subVectors(G,U),z=(q-K)/(q-K+(Z-J)),S.copy(U).addScaledVector(Kr,z);const te=1/(ee+Q+Y);return H=Q*te,z=Y*te,S.copy(w).addScaledVector(jr,H).addScaledVector(Xr,z)}equals(x){return x.a.equals(this.a)&&x.b.equals(this.b)&&x.c.equals(this.c)}}let Jr=0;class Material extends EventDispatcher{constructor(){super(),Object.defineProperty(this,"id",{value:Jr++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=oe,this.side=Q,this.vertexColors=!1,this.opacity=1,this.format=Tt,this.transparent=!1,this.blendSrc=ye,this.blendDst=be,this.blendEquation=ue,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Re,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Ai,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ui,this.stencilZFail=ui,this.stencilZPass=ui,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(x){this._alphaTest>0!=x>0&&this.version++,this._alphaTest=x}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(x){if(void 0!==x)for(const S in x){const w=x[S];if(void 0===w){console.warn("THREE.Material: '"+S+"' parameter is undefined.");continue}if("shading"===S){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=w===ne;continue}const U=this[S];void 0!==U?U&&U.isColor?U.set(w):U&&U.isVector3&&w&&w.isVector3?U.copy(w):this[S]=w:console.warn("THREE."+this.type+": '"+S+"' is not a property of this material.")}}toJSON(x){const S=void 0===x||"string"==typeof x;S&&(x={textures:{},images:{}});const w={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function extractFromCache(x){const S=[];for(const w in x){const U=x[w];delete U.metadata,S.push(U)}return S}if(w.uuid=this.uuid,w.type=this.type,""!==this.name&&(w.name=this.name),this.color&&this.color.isColor&&(w.color=this.color.getHex()),void 0!==this.roughness&&(w.roughness=this.roughness),void 0!==this.metalness&&(w.metalness=this.metalness),void 0!==this.sheen&&(w.sheen=this.sheen),this.sheenTint&&this.sheenTint.isColor&&(w.sheenTint=this.sheenTint.getHex()),void 0!==this.sheenRoughness&&(w.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(w.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(w.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(w.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(w.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(w.specularTint=this.specularTint.getHex()),void 0!==this.shininess&&(w.shininess=this.shininess),void 0!==this.clearcoat&&(w.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(w.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(w.clearcoatMap=this.clearcoatMap.toJSON(x).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(w.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(x).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(w.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(x).uuid,w.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(w.map=this.map.toJSON(x).uuid),this.matcap&&this.matcap.isTexture&&(w.matcap=this.matcap.toJSON(x).uuid),this.alphaMap&&this.alphaMap.isTexture&&(w.alphaMap=this.alphaMap.toJSON(x).uuid),this.lightMap&&this.lightMap.isTexture&&(w.lightMap=this.lightMap.toJSON(x).uuid,w.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(w.aoMap=this.aoMap.toJSON(x).uuid,w.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(w.bumpMap=this.bumpMap.toJSON(x).uuid,w.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(w.normalMap=this.normalMap.toJSON(x).uuid,w.normalMapType=this.normalMapType,w.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(w.displacementMap=this.displacementMap.toJSON(x).uuid,w.displacementScale=this.displacementScale,w.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(w.roughnessMap=this.roughnessMap.toJSON(x).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(w.metalnessMap=this.metalnessMap.toJSON(x).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(w.emissiveMap=this.emissiveMap.toJSON(x).uuid),this.specularMap&&this.specularMap.isTexture&&(w.specularMap=this.specularMap.toJSON(x).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(w.specularIntensityMap=this.specularIntensityMap.toJSON(x).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(w.specularTintMap=this.specularTintMap.toJSON(x).uuid),this.envMap&&this.envMap.isTexture&&(w.envMap=this.envMap.toJSON(x).uuid,void 0!==this.combine&&(w.combine=this.combine)),void 0!==this.envMapIntensity&&(w.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(w.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(w.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(w.gradientMap=this.gradientMap.toJSON(x).uuid),void 0!==this.transmission&&(w.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(w.transmissionMap=this.transmissionMap.toJSON(x).uuid),void 0!==this.thickness&&(w.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(w.thicknessMap=this.thicknessMap.toJSON(x).uuid),void 0!==this.attenuationDistance&&(w.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationTint&&(w.attenuationTint=this.attenuationTint.getHex()),void 0!==this.size&&(w.size=this.size),null!==this.shadowSide&&(w.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(w.sizeAttenuation=this.sizeAttenuation),this.blending!==oe&&(w.blending=this.blending),this.side!==Q&&(w.side=this.side),this.vertexColors&&(w.vertexColors=!0),this.opacity<1&&(w.opacity=this.opacity),this.format!==Tt&&(w.format=this.format),!0===this.transparent&&(w.transparent=this.transparent),w.depthFunc=this.depthFunc,w.depthTest=this.depthTest,w.depthWrite=this.depthWrite,w.colorWrite=this.colorWrite,w.stencilWrite=this.stencilWrite,w.stencilWriteMask=this.stencilWriteMask,w.stencilFunc=this.stencilFunc,w.stencilRef=this.stencilRef,w.stencilFuncMask=this.stencilFuncMask,w.stencilFail=this.stencilFail,w.stencilZFail=this.stencilZFail,w.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(w.rotation=this.rotation),!0===this.polygonOffset&&(w.polygonOffset=!0),0!==this.polygonOffsetFactor&&(w.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(w.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(w.linewidth=this.linewidth),void 0!==this.dashSize&&(w.dashSize=this.dashSize),void 0!==this.gapSize&&(w.gapSize=this.gapSize),void 0!==this.scale&&(w.scale=this.scale),!0===this.dithering&&(w.dithering=!0),this.alphaTest>0&&(w.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(w.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(w.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(w.wireframe=this.wireframe),this.wireframeLinewidth>1&&(w.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(w.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(w.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(w.flatShading=this.flatShading),!1===this.visible&&(w.visible=!1),!1===this.toneMapped&&(w.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(w.userData=this.userData),S){const S=extractFromCache(x.textures),U=extractFromCache(x.images);S.length>0&&(w.textures=S),U.length>0&&(w.images=U)}return w}clone(){return(new this.constructor).copy(this)}copy(x){this.name=x.name,this.fog=x.fog,this.blending=x.blending,this.side=x.side,this.vertexColors=x.vertexColors,this.opacity=x.opacity,this.format=x.format,this.transparent=x.transparent,this.blendSrc=x.blendSrc,this.blendDst=x.blendDst,this.blendEquation=x.blendEquation,this.blendSrcAlpha=x.blendSrcAlpha,this.blendDstAlpha=x.blendDstAlpha,this.blendEquationAlpha=x.blendEquationAlpha,this.depthFunc=x.depthFunc,this.depthTest=x.depthTest,this.depthWrite=x.depthWrite,this.stencilWriteMask=x.stencilWriteMask,this.stencilFunc=x.stencilFunc,this.stencilRef=x.stencilRef,this.stencilFuncMask=x.stencilFuncMask,this.stencilFail=x.stencilFail,this.stencilZFail=x.stencilZFail,this.stencilZPass=x.stencilZPass,this.stencilWrite=x.stencilWrite;const S=x.clippingPlanes;let w=null;if(null!==S){const x=S.length;w=new Array(x);for(let U=0;U!==x;++U)w[U]=S[U].clone()}return this.clippingPlanes=w,this.clipIntersection=x.clipIntersection,this.clipShadows=x.clipShadows,this.shadowSide=x.shadowSide,this.colorWrite=x.colorWrite,this.precision=x.precision,this.polygonOffset=x.polygonOffset,this.polygonOffsetFactor=x.polygonOffsetFactor,this.polygonOffsetUnits=x.polygonOffsetUnits,this.dithering=x.dithering,this.alphaTest=x.alphaTest,this.alphaToCoverage=x.alphaToCoverage,this.premultipliedAlpha=x.premultipliedAlpha,this.visible=x.visible,this.toneMapped=x.toneMapped,this.userData=JSON.parse(JSON.stringify(x.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(x){!0===x&&this.version++}}Material.prototype.isMaterial=!0;const Qr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},eo={h:0,s:0,l:0},to={h:0,s:0,l:0};function hue2rgb(x,S,w){return w<0&&(w+=1),w>1&&(w-=1),w<1/6?x+6*(S-x)*w:w<.5?S:w<2/3?x+6*(S-x)*(2/3-w):x}function SRGBToLinear(x){return x<.04045?.0773993808*x:Math.pow(.9478672986*x+.0521327014,2.4)}function LinearToSRGB(x){return x<.0031308?12.92*x:1.055*Math.pow(x,.41666)-.055}class Color{constructor(x,S,w){return void 0===S&&void 0===w?this.set(x):this.setRGB(x,S,w)}set(x){return x&&x.isColor?this.copy(x):"number"==typeof x?this.setHex(x):"string"==typeof x&&this.setStyle(x),this}setScalar(x){return this.r=x,this.g=x,this.b=x,this}setHex(x){return x=Math.floor(x),this.r=(x>>16&255)/255,this.g=(x>>8&255)/255,this.b=(255&x)/255,this}setRGB(x,S,w){return this.r=x,this.g=S,this.b=w,this}setHSL(x,S,w){if(x=euclideanModulo(x,1),S=clamp(S,0,1),w=clamp(w,0,1),0===S)this.r=this.g=this.b=w;else{const U=w<=.5?w*(1+S):w+S-w*S,G=2*w-U;this.r=hue2rgb(G,U,x+1/3),this.g=hue2rgb(G,U,x),this.b=hue2rgb(G,U,x-1/3)}return this}setStyle(x){function handleAlpha(S){void 0!==S&&parseFloat(S)<1&&console.warn("THREE.Color: Alpha component of "+x+" will be ignored.")}let S;if(S=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(x)){let x;const w=S[1],U=S[2];switch(w){case"rgb":case"rgba":if(x=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(U))return this.r=Math.min(255,parseInt(x[1],10))/255,this.g=Math.min(255,parseInt(x[2],10))/255,this.b=Math.min(255,parseInt(x[3],10))/255,handleAlpha(x[4]),this;if(x=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(U))return this.r=Math.min(100,parseInt(x[1],10))/100,this.g=Math.min(100,parseInt(x[2],10))/100,this.b=Math.min(100,parseInt(x[3],10))/100,handleAlpha(x[4]),this;break;case"hsl":case"hsla":if(x=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(U)){const S=parseFloat(x[1])/360,w=parseInt(x[2],10)/100,U=parseInt(x[3],10)/100;return handleAlpha(x[4]),this.setHSL(S,w,U)}}}else if(S=/^\#([A-Fa-f\d]+)$/.exec(x)){const x=S[1],w=x.length;if(3===w)return this.r=parseInt(x.charAt(0)+x.charAt(0),16)/255,this.g=parseInt(x.charAt(1)+x.charAt(1),16)/255,this.b=parseInt(x.charAt(2)+x.charAt(2),16)/255,this;if(6===w)return this.r=parseInt(x.charAt(0)+x.charAt(1),16)/255,this.g=parseInt(x.charAt(2)+x.charAt(3),16)/255,this.b=parseInt(x.charAt(4)+x.charAt(5),16)/255,this}return x&&x.length>0?this.setColorName(x):this}setColorName(x){const S=Qr[x.toLowerCase()];return void 0!==S?this.setHex(S):console.warn("THREE.Color: Unknown color "+x),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(x){return this.r=x.r,this.g=x.g,this.b=x.b,this}copyGammaToLinear(x,S=2){return this.r=Math.pow(x.r,S),this.g=Math.pow(x.g,S),this.b=Math.pow(x.b,S),this}copyLinearToGamma(x,S=2){const w=S>0?1/S:1;return this.r=Math.pow(x.r,w),this.g=Math.pow(x.g,w),this.b=Math.pow(x.b,w),this}convertGammaToLinear(x){return this.copyGammaToLinear(this,x),this}convertLinearToGamma(x){return this.copyLinearToGamma(this,x),this}copySRGBToLinear(x){return this.r=SRGBToLinear(x.r),this.g=SRGBToLinear(x.g),this.b=SRGBToLinear(x.b),this}copyLinearToSRGB(x){return this.r=LinearToSRGB(x.r),this.g=LinearToSRGB(x.g),this.b=LinearToSRGB(x.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(x){const S=this.r,w=this.g,U=this.b,G=Math.max(S,w,U),H=Math.min(S,w,U);let z,j;const X=(H+G)/2;if(H===G)z=0,j=0;else{const x=G-H;switch(j=X<=.5?x/(G+H):x/(2-G-H),G){case S:z=(w-U)/x+(w65535?Uint32BufferAttribute:Uint16BufferAttribute)(x,1):this.index=x,this}getAttribute(x){return this.attributes[x]}setAttribute(x,S){return this.attributes[x]=S,this}deleteAttribute(x){return delete this.attributes[x],this}hasAttribute(x){return void 0!==this.attributes[x]}addGroup(x,S,w=0){this.groups.push({start:x,count:S,materialIndex:w})}clearGroups(){this.groups=[]}setDrawRange(x,S){this.drawRange.start=x,this.drawRange.count=S}applyMatrix4(x){const S=this.attributes.position;void 0!==S&&(S.applyMatrix4(x),S.needsUpdate=!0);const w=this.attributes.normal;if(void 0!==w){const S=(new Matrix3).getNormalMatrix(x);w.applyNormalMatrix(S),w.needsUpdate=!0}const U=this.attributes.tangent;return void 0!==U&&(U.transformDirection(x),U.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(x){return oo.makeRotationFromQuaternion(x),this.applyMatrix4(oo),this}rotateX(x){return oo.makeRotationX(x),this.applyMatrix4(oo),this}rotateY(x){return oo.makeRotationY(x),this.applyMatrix4(oo),this}rotateZ(x){return oo.makeRotationZ(x),this.applyMatrix4(oo),this}translate(x,S,w){return oo.makeTranslation(x,S,w),this.applyMatrix4(oo),this}scale(x,S,w){return oo.makeScale(x,S,w),this.applyMatrix4(oo),this}lookAt(x){return ao.lookAt(x),ao.updateMatrix(),this.applyMatrix4(ao.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(so).negate(),this.translate(so.x,so.y,so.z),this}setFromPoints(x){const S=[];for(let w=0,U=x.length;w0&&(x.userData=this.userData),void 0!==this.parameters){const S=this.parameters;for(const w in S)void 0!==S[w]&&(x[w]=S[w]);return x}x.data={attributes:{}};const S=this.index;null!==S&&(x.data.index={type:S.array.constructor.name,array:Array.prototype.slice.call(S.array)});const w=this.attributes;for(const S in w){const U=w[S];x.data.attributes[S]=U.toJSON(x.data)}const U={};let G=!1;for(const S in this.morphAttributes){const w=this.morphAttributes[S],H=[];for(let S=0,U=w.length;S0&&(U[S]=H,G=!0)}G&&(x.data.morphAttributes=U,x.data.morphTargetsRelative=this.morphTargetsRelative);const H=this.groups;H.length>0&&(x.data.groups=JSON.parse(JSON.stringify(H)));const z=this.boundingSphere;return null!==z&&(x.data.boundingSphere={center:z.center.toArray(),radius:z.radius}),x}clone(){return(new this.constructor).copy(this)}copy(x){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const S={};this.name=x.name;const w=x.index;null!==w&&this.setIndex(w.clone(S));const U=x.attributes;for(const x in U){const w=U[x];this.setAttribute(x,w.clone(S))}const G=x.morphAttributes;for(const x in G){const w=[],U=G[x];for(let x=0,G=U.length;x 0){const x=S[w[0]];if(void 0!==x){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let S=0,w=x.length;S 0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(x,S){const w=this.geometry,U=this.material,G=this.matrixWorld;if(void 0===U)return;if(null===w.boundingSphere&&w.computeBoundingSphere(),mo.copy(w.boundingSphere),mo.applyMatrix4(G),!1===x.ray.intersectsSphere(mo))return;if(ho.copy(G).invert(),po.copy(x.ray).applyMatrix4(ho),null!==w.boundingBox&&!1===po.intersectsBox(w.boundingBox))return;let H;if(w.isBufferGeometry){const G=w.index,z=w.attributes.position,j=w.morphAttributes.position,X=w.morphTargetsRelative,K=w.attributes.uv,q=w.attributes.uv2,Y=w.groups,Z=w.drawRange;if(null!==G)if(Array.isArray(U))for(let w=0,J=Y.length;w w.far?null:{distance:K,point:Mo.clone(),object:x}}(x,S,w,U,fo,go,vo,Ao);if(J){j&&(To.fromBufferAttribute(j,K),wo.fromBufferAttribute(j,q),Co.fromBufferAttribute(j,Y),J.uv=Triangle.getUV(Ao,fo,go,vo,To,wo,Co,new Vector2)),X&&(To.fromBufferAttribute(X,K),wo.fromBufferAttribute(X,q),Co.fromBufferAttribute(X,Y),J.uv2=Triangle.getUV(Ao,fo,go,vo,To,wo,Co,new Vector2));const x={a:K,b:q,c:Y,normal:new Vector3,materialIndex:0};Triangle.getNormal(fo,go,vo,x.normal),J.face=x}return J}Mesh.prototype.isMesh=!0;class BoxGeometry extends BufferGeometry{constructor(x=1,S=1,w=1,U=1,G=1,H=1){super(),this.type="BoxGeometry",this.parameters={width:x,height:S,depth:w,widthSegments:U,heightSegments:G,depthSegments:H};const z=this;U=Math.floor(U),G=Math.floor(G),H=Math.floor(H);const j=[],X=[],K=[],q=[];let Y=0,Z=0;function buildPlane(x,S,w,U,G,H,J,Q,ee,te,ne){const ie=H/ee,re=J/te,oe=H/2,ae=J/2,se=Q/2,le=ee+1,ce=te+1;let ue=0,he=0;const de=new Vector3;for(let H=0;H 0?1:-1,K.push(de.x,de.y,de.z),q.push(j/ee),q.push(1-H/te),ue+=1}}for(let x=0;x 0&&(S.defines=this.defines),S.vertexShader=this.vertexShader,S.fragmentShader=this.fragmentShader;const w={};for(const x in this.extensions)!0===this.extensions[x]&&(w[x]=!0);return Object.keys(w).length>0&&(S.extensions=w),S}}ShaderMaterial.prototype.isShaderMaterial=!0;class Camera extends Object3D{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4}copy(x,S){return super.copy(x,S),this.matrixWorldInverse.copy(x.matrixWorldInverse),this.projectionMatrix.copy(x.projectionMatrix),this.projectionMatrixInverse.copy(x.projectionMatrixInverse),this}getWorldDirection(x){this.updateWorldMatrix(!0,!1);const S=this.matrixWorld.elements;return x.set(-S[8],-S[9],-S[10]).normalize()}updateMatrixWorld(x){super.updateMatrixWorld(x),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(x,S){super.updateWorldMatrix(x,S),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Camera.prototype.isCamera=!0;class PerspectiveCamera extends Camera{constructor(x=50,S=1,w=.1,U=2e3){super(),this.type="PerspectiveCamera",this.fov=x,this.zoom=1,this.near=w,this.far=U,this.focus=10,this.aspect=S,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(x,S){return super.copy(x,S),this.fov=x.fov,this.zoom=x.zoom,this.near=x.near,this.far=x.far,this.focus=x.focus,this.aspect=x.aspect,this.view=null===x.view?null:Object.assign({},x.view),this.filmGauge=x.filmGauge,this.filmOffset=x.filmOffset,this}setFocalLength(x){const S=.5*this.getFilmHeight()/x;this.fov=2*Vi*Math.atan(S),this.updateProjectionMatrix()}getFocalLength(){const x=Math.tan(.5*Gi*this.fov);return.5*this.getFilmHeight()/x}getEffectiveFOV(){return 2*Vi*Math.atan(Math.tan(.5*Gi*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(x,S,w,U,G,H){this.aspect=x/S,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=x,this.view.fullHeight=S,this.view.offsetX=w,this.view.offsetY=U,this.view.width=G,this.view.height=H,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const x=this.near;let S=x*Math.tan(.5*Gi*this.fov)/this.zoom,w=2*S,U=this.aspect*w,G=-.5*U;const H=this.view;if(null!==this.view&&this.view.enabled){const x=H.fullWidth,z=H.fullHeight;G+=H.offsetX*U/x,S-=H.offsetY*w/z,U*=H.width/x,w*=H.height/z}const z=this.filmOffset;0!==z&&(G+=x*z/this.getFilmWidth()),this.projectionMatrix.makePerspective(G,G+U,S,S-w,x,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(x){const S=super.toJSON(x);return S.object.fov=this.fov,S.object.zoom=this.zoom,S.object.near=this.near,S.object.far=this.far,S.object.focus=this.focus,S.object.aspect=this.aspect,null!==this.view&&(S.object.view=Object.assign({},this.view)),S.object.filmGauge=this.filmGauge,S.object.filmOffset=this.filmOffset,S}}PerspectiveCamera.prototype.isPerspectiveCamera=!0;const Lo=90;class CubeCamera extends Object3D{constructor(x,S,w){if(super(),this.type="CubeCamera",!0!==w.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=w;const U=new PerspectiveCamera(Lo,1,x,S);U.layers=this.layers,U.up.set(0,-1,0),U.lookAt(new Vector3(1,0,0)),this.add(U);const G=new PerspectiveCamera(Lo,1,x,S);G.layers=this.layers,G.up.set(0,-1,0),G.lookAt(new Vector3(-1,0,0)),this.add(G);const H=new PerspectiveCamera(Lo,1,x,S);H.layers=this.layers,H.up.set(0,0,1),H.lookAt(new Vector3(0,1,0)),this.add(H);const z=new PerspectiveCamera(Lo,1,x,S);z.layers=this.layers,z.up.set(0,0,-1),z.lookAt(new Vector3(0,-1,0)),this.add(z);const j=new PerspectiveCamera(Lo,1,x,S);j.layers=this.layers,j.up.set(0,-1,0),j.lookAt(new Vector3(0,0,1)),this.add(j);const X=new PerspectiveCamera(Lo,1,x,S);X.layers=this.layers,X.up.set(0,-1,0),X.lookAt(new Vector3(0,0,-1)),this.add(X)}update(x,S){null===this.parent&&this.updateMatrixWorld();const w=this.renderTarget,[U,G,H,z,j,X]=this.children,K=x.xr.enabled,q=x.getRenderTarget();x.xr.enabled=!1;const Y=w.texture.generateMipmaps;w.texture.generateMipmaps=!1,x.setRenderTarget(w,0),x.render(S,U),x.setRenderTarget(w,1),x.render(S,G),x.setRenderTarget(w,2),x.render(S,H),x.setRenderTarget(w,3),x.render(S,z),x.setRenderTarget(w,4),x.render(S,j),w.texture.generateMipmaps=Y,x.setRenderTarget(w,5),x.render(S,X),x.setRenderTarget(q),x.xr.enabled=K}}class CubeTexture extends Texture{constructor(x,S,w,U,G,H,z,j,X,K){super(x=void 0!==x?x:[],S=void 0!==S?S:$e,w,U,G,H,z,j,X,K),this.flipY=!1}get images(){return this.image}set images(x){this.image=x}}CubeTexture.prototype.isCubeTexture=!0;class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(x,S,w){Number.isInteger(S)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),S=w),super(x,x,S),S=S||{},this.texture=new CubeTexture(void 0,S.mapping,S.wrapS,S.wrapT,S.magFilter,S.minFilter,S.format,S.type,S.anisotropy,S.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==S.generateMipmaps&&S.generateMipmaps,this.texture.minFilter=void 0!==S.minFilter?S.minFilter:rt,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(x,S){this.texture.type=S.type,this.texture.format=Tt,this.texture.encoding=S.encoding,this.texture.generateMipmaps=S.generateMipmaps,this.texture.minFilter=S.minFilter,this.texture.magFilter=S.magFilter;const w={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},U=new BoxGeometry(5,5,5),G=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(w.uniforms),vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,side:ee,blending:re});G.uniforms.tEquirect.value=S;const H=new Mesh(U,G),z=S.minFilter;S.minFilter===st&&(S.minFilter=rt);return new CubeCamera(1,10,this).update(x,H),S.minFilter=z,H.geometry.dispose(),H.material.dispose(),this}clear(x,S,w,U){const G=x.getRenderTarget();for(let G=0;G<6;G++)x.setRenderTarget(this,G),x.clear(S,w,U);x.setRenderTarget(G)}}WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget=!0;const Io=new Vector3,Po=new Vector3,Fo=new Matrix3;class Plane{constructor(x=new Vector3(1,0,0),S=0){this.normal=x,this.constant=S}set(x,S){return this.normal.copy(x),this.constant=S,this}setComponents(x,S,w,U){return this.normal.set(x,S,w),this.constant=U,this}setFromNormalAndCoplanarPoint(x,S){return this.normal.copy(x),this.constant=-S.dot(this.normal),this}setFromCoplanarPoints(x,S,w){const U=Io.subVectors(w,S).cross(Po.subVectors(x,S)).normalize();return this.setFromNormalAndCoplanarPoint(U,x),this}copy(x){return this.normal.copy(x.normal),this.constant=x.constant,this}normalize(){const x=1/this.normal.length();return this.normal.multiplyScalar(x),this.constant*=x,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(x){return this.normal.dot(x)+this.constant}distanceToSphere(x){return this.distanceToPoint(x.center)-x.radius}projectPoint(x,S){return S.copy(this.normal).multiplyScalar(-this.distanceToPoint(x)).add(x)}intersectLine(x,S){const w=x.delta(Io),U=this.normal.dot(w);if(0===U)return 0===this.distanceToPoint(x.start)?S.copy(x.start):null;const G=-(x.start.dot(this.normal)+this.constant)/U;return G<0||G>1?null:S.copy(w).multiplyScalar(G).add(x.start)}intersectsLine(x){const S=this.distanceToPoint(x.start),w=this.distanceToPoint(x.end);return S<0&&w>0||w<0&&S>0}intersectsBox(x){return x.intersectsPlane(this)}intersectsSphere(x){return x.intersectsPlane(this)}coplanarPoint(x){return x.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(x,S){const w=S||Fo.getNormalMatrix(x),U=this.coplanarPoint(Io).applyMatrix4(x),G=this.normal.applyMatrix3(w).normalize();return this.constant=-U.dot(G),this}translate(x){return this.constant-=x.dot(this.normal),this}equals(x){return x.normal.equals(this.normal)&&x.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Plane.prototype.isPlane=!0;const Oo=new Sphere,No=new Vector3;class Frustum{constructor(x=new Plane,S=new Plane,w=new Plane,U=new Plane,G=new Plane,H=new Plane){this.planes=[x,S,w,U,G,H]}set(x,S,w,U,G,H){const z=this.planes;return z[0].copy(x),z[1].copy(S),z[2].copy(w),z[3].copy(U),z[4].copy(G),z[5].copy(H),this}copy(x){const S=this.planes;for(let w=0;w<6;w++)S[w].copy(x.planes[w]);return this}setFromProjectionMatrix(x){const S=this.planes,w=x.elements,U=w[0],G=w[1],H=w[2],z=w[3],j=w[4],X=w[5],K=w[6],q=w[7],Y=w[8],Z=w[9],J=w[10],Q=w[11],ee=w[12],te=w[13],ne=w[14],ie=w[15];return S[0].setComponents(z-U,q-j,Q-Y,ie-ee).normalize(),S[1].setComponents(z+U,q+j,Q+Y,ie+ee).normalize(),S[2].setComponents(z+G,q+X,Q+Z,ie+te).normalize(),S[3].setComponents(z-G,q-X,Q-Z,ie-te).normalize(),S[4].setComponents(z-H,q-K,Q-J,ie-ne).normalize(),S[5].setComponents(z+H,q+K,Q+J,ie+ne).normalize(),this}intersectsObject(x){const S=x.geometry;return null===S.boundingSphere&&S.computeBoundingSphere(),Oo.copy(S.boundingSphere).applyMatrix4(x.matrixWorld),this.intersectsSphere(Oo)}intersectsSprite(x){return Oo.center.set(0,0,0),Oo.radius=.7071067811865476,Oo.applyMatrix4(x.matrixWorld),this.intersectsSphere(Oo)}intersectsSphere(x){const S=this.planes,w=x.center,U=-x.radius;for(let x=0;x<6;x++){if(S[x].distanceToPoint(w)0?x.max.x:x.min.x,No.y=U.normal.y>0?x.max.y:x.min.y,No.z=U.normal.z>0?x.max.z:x.min.z,U.distanceToPoint(No)<0)return!1}return!0}containsPoint(x){const S=this.planes;for(let w=0;w<6;w++)if(S[w].distanceToPoint(x)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let x=null,S=!1,w=null,U=null;function onAnimationFrame(S,G){w(S,G),U=x.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==S&&null!==w&&(U=x.requestAnimationFrame(onAnimationFrame),S=!0)},stop:function(){x.cancelAnimationFrame(U),S=!1},setAnimationLoop:function(x){w=x},setContext:function(S){x=S}}}function WebGLAttributes(x,S){const w=S.isWebGL2,U=new WeakMap;return{get:function get(x){return x.isInterleavedBufferAttribute&&(x=x.data),U.get(x)},remove:function remove(S){S.isInterleavedBufferAttribute&&(S=S.data);const w=U.get(S);w&&(x.deleteBuffer(w.buffer),U.delete(S))},update:function update(S,G){if(S.isGLBufferAttribute){const x=U.get(S);return void((!x||x.version 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenTint, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenTint * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularTintFactor = specularTint;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARTINTMAP\n\t\t\tspecularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularTintFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenTint = sheenTint;\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenTint;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenTint, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationTint, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationTint;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include