aframe-gui
Version:
A-Frame GUI components
1 lines • 198 kB
JavaScript
!function(t){function e(r){if(i[r])return i[r].exports;var o=i[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=23)}([function(t,e,i){"use strict";if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("bevelbox",{schema:{width:{type:"number",default:1},height:{type:"number",default:1},depth:{type:"number",default:1},topLeftRadius:{type:"number",default:1e-5},topRightRadius:{type:"number",default:1e-5},bottomLeftRadius:{type:"number",default:1e-5},bottomRightRadius:{type:"number",default:1e-5},bevelEnabled:{type:"boolean",default:!0},bevelSegments:{type:"number",default:2},steps:{type:"number",default:1},bevelSize:{type:"number",default:.1},bevelOffset:{type:"number",default:0},bevelThickness:{type:"number",default:.1}},multiple:!1,init:function(){var t=this.el,e=this.data,i=e.width,r=e.height,o=-e.width/2,n=-e.height/2,a=new THREE.Shape;a.moveTo(o,n+e.topLeftRadius),a.lineTo(o,n+r-e.topLeftRadius),a.quadraticCurveTo(o,n+r,o+e.topLeftRadius,n+r),a.lineTo(o+i-e.topRightRadius,n+r),a.quadraticCurveTo(o+i,n+r,o+i,n+r-e.topRightRadius),a.lineTo(o+i,n+e.bottomRightRadius),a.quadraticCurveTo(o+i,n,o+i-e.bottomRightRadius,n),a.lineTo(o+e.bottomLeftRadius,n),a.quadraticCurveTo(o,n,o,n+e.bottomLeftRadius);var s=this.extrude(a);t.setObject3D("mesh",s)},extrude:function(t){var e=(this.el,this.data),i={steps:e.steps,depth:e.depth,bevelEnabled:e.bevelEnabled,bevelThickness:e.bevelThickness,bevelSize:e.bevelSize,bevelOffset:e.bevelOffset,bevelSegments:e.bevelSegments},r=new THREE.ExtrudeGeometry(t,i);return new THREE.Mesh(r,new THREE.MeshStandardMaterial({side:THREE.DoubleSide}))},update:function(t){},remove:function(){},pause:function(){},play:function(){}})},function(t,e,i){"use strict";AFRAME.registerComponent("gui-button",{schema:{on:{default:"click"},value:{type:"string",default:""},fontSize:{type:"number",default:.2},fontFamily:{type:"string",default:""},fontColor:{type:"string",default:key_offwhite},borderColor:{type:"string",default:key_offwhite},focusColor:{type:"string",default:key_orange_light},backgroundColor:{type:"string",default:key_grey},hoverColor:{type:"string",default:key_grey_dark},activeColor:{type:"string",default:key_orange},toggle:{type:"boolean",default:!1},toggleState:{type:"boolean",default:!1}},dependencies:["aframe-troika-text"],init:function(){var t=this.data,e=this.el,i=e.getAttribute("gui-item");if(this.guiItem=i,t.fontSize>20){var r=t.fontSize/750;t.fontSize=r}var o=e.getAttribute("gui-interactable");this.guiInteractable=o,e.setAttribute("geometry","primitive: plane; \n height: "+i.height+"; \n width: "+i.width+";\n "),e.setAttribute("material","shader: flat; \n transparent: true; \n opacity: 0.5; \n side:double; \n color:"+t.backgroundColor+";\n ");var n=document.createElement("a-entity");if(i.bevel){var a=1*i.bevelSize,s=i.bevelThickness;n.setAttribute("bevelbox","width: "+(i.width-i.width*a)+"; \n height: "+(i.height-i.height*a)+"; \n depth: "+(i.baseDepth-i.baseDepth*s)+";\n bevelThickness: 0;\n bevelSize: "+i.bevelSize+";\n "),n.setAttribute("position","0 0 0")}else n.setAttribute("geometry","primitive: box; \n width: "+i.width+"; \n height: "+i.height+"; \n depth: "+i.baseDepth+";\n "),n.setAttribute("position","0 0 "+i.baseDepth/2);n.setAttribute("rotation","0 0 0"),n.setAttribute("material","shader: flat; \n opacity: 1; \n side:double; \n color: "+t.borderColor+"\n "),e.appendChild(n),this.buttonContainer=n;var l=document.createElement("a-entity");if(i.bevel){var a=1*i.bevelSize,s=i.bevelThickness;l.setAttribute("bevelbox","width: "+(i.width-i.gap-(i.width-i.gap)*a)+"; \n height: "+(i.height-i.gap-(i.height-i.gap)*a)+"; \n depth: "+(i.depth-i.depth*s)+";\n bevelThickness: "+i.bevelThickness+";\n bevelSize: "+i.bevelSize+";\n "),l.setAttribute("position","0 0 0")}else l.setAttribute("geometry","primitive: box; \n width: "+(i.width-i.gap)+"; \n height: "+(i.height-i.gap)+"; \n depth: "+i.depth+";"),l.setAttribute("position","0 0 "+i.depth/2);l.setAttribute("material","shader: flat; \n opacity: 1; \n side:double; \n color: "+(t.toggleState?t.activeColor:t.backgroundColor)+"\n "),l.setAttribute("rotation","0 0 0"),e.appendChild(l),this.buttonEntity=l,this.setText(t.value),e.addEventListener("mouseenter",function(e){l.removeAttribute("animation__leave"),t.toggle||l.setAttribute("animation__enter","property: material.color; from: "+t.backgroundColor+"; to:"+t.hoverColor+"; dur:200;")}),e.addEventListener("mouseleave",function(e){t.toggle||(l.removeAttribute("animation__click"),l.setAttribute("animation__leave","property: material.color; from: "+t.hoverColor+"; to:"+t.backgroundColor+"; dur:200; easing: easeOutQuad;")),l.removeAttribute("animation__enter")}),e.addEventListener("focus",function(e){n.setAttribute("material","color",""+t.focusColor)}),e.addEventListener("blur",function(e){n.setAttribute("material","color",""+t.borderColor),t.toggle||(l.removeAttribute("animation__click"),l.setAttribute("animation__leave","property: material.color; from: "+t.hoverColor+"; to:"+t.backgroundColor+"; dur:200; easing: easeOutQuad;")),l.removeAttribute("animation__enter")}),e.addEventListener(t.on,function(i){if(t.toggle){var r=e.components["gui-button"];r.setActiveState(!r.data.toggleState)}else l.setAttribute("animation__click","property: material.color; from: "+t.activeColor+"; to:"+t.backgroundColor+"; dur:400; easing: easeOutQuad;");var n=o.clickAction,a=window[n];"function"==typeof a&&a(i)}),e.addEventListener("keyup",function(i){i.isComposing||229===i.keyCode||(13!=i.keyCode&&32!=i.keyCode||e.emit(t.on),i.preventDefault())}),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",t.value)},play:function(){},update:function(t){var e=this.data,i=this.el,r=i.getAttribute("gui-item");if(this.guiItem=r,i.setAttribute("geometry","primitive: plane; \n height: "+r.height+"; \n width: "+r.width+";\n "),i.setAttribute("material","shader: flat; \n transparent: true; \n opacity: 0.5; \n side:double; \n color:"+e.backgroundColor+";\n "),r.bevel){var o=1*r.bevelSize,n=r.bevelThickness;this.buttonContainer.setAttribute("bevelbox","width: "+(r.width-r.width*o)+"; \n height: "+(r.height-r.height*o)+"; \n depth: "+(r.baseDepth-r.baseDepth*n)+";\n bevelThickness: 0;\n bevelSize: "+r.bevelSize+";\n "),this.buttonContainer.setAttribute("position","0 0 0")}else this.buttonContainer.setAttribute("geometry","primitive: box; \n width: "+r.width+"; \n height: "+r.height+"; \n depth: "+r.baseDepth+";\n "),this.buttonContainer.setAttribute("position","0 0 "+r.baseDepth/2);if(this.buttonContainer.setAttribute("material","shader: flat; \n opacity: 1; \n side:double; \n color: "+e.borderColor+"\n "),r.bevel){var o=1*r.bevelSize,n=r.bevelThickness;this.buttonEntity.setAttribute("bevelbox","width: "+(r.width-r.gap-(r.width-r.gap)*o)+"; \n height: "+(r.height-r.gap-(r.height-r.gap)*o)+"; \n depth: "+(r.depth-r.depth*n)+";\n bevelThickness: "+r.bevelThickness+";\n bevelSize: "+r.bevelSize+";\n "),this.buttonEntity.setAttribute("position","0 0 0")}else this.buttonEntity.setAttribute("geometry","primitive: box; \n width: "+(r.width-r.gap)+"; \n height: "+(r.height-r.gap)+"; \n depth: "+r.depth+";\n "),this.buttonEntity.setAttribute("position","0 0 "+r.depth/2);if(this.buttonEntity.setAttribute("material","shader: flat; \n opacity: 1; \n side:double; \n color: "+(e.toggleState?e.activeColor:e.backgroundColor)+"\n "),this.textEntity){console.log("has textEntity: "+this.textEntity);var a=this.textEntity;a.parentNode.removeChild(a),this.setText(this.data.value)}else console.log("no textEntity!")},setActiveState:function(t){this.data.toggleState=t,t?(console.log("active, about to set active color"),this.buttonEntity.setAttribute("material","color",this.data.activeColor)):(console.log("not active, about to set background color"),this.buttonEntity.setAttribute("material","color",this.data.backgroundColor))},setText:function(t){var e=this.data,i=this.el,r=i.getAttribute("gui-item"),o=document.createElement("a-entity");this.textEntity=o,o.setAttribute("troika-text","value: "+t+"; \n align:center; \n anchor:center; \n baseline:center;\n letterSpacing:0;\n color:"+e.fontColor+"; \n font:"+e.fontFamily+";\n fontSize:"+e.fontSize+";\n depthOffset:1;\n maxWidth:"+r.width/1.05+";\n "),o.setAttribute("troika-text-material","shader: flat;"),r.bevel?o.setAttribute("position","0 0 "+(r.depth+r.bevelThickness/2+.05)):o.setAttribute("position","0 0 "+(r.depth/2+.05)),this.buttonEntity.appendChild(o)}}),AFRAME.registerPrimitive("a-gui-button",{defaultComponents:{"gui-interactable":{},"gui-item":{type:"button"},"gui-button":{}},mappings:{onclick:"gui-interactable.clickAction",onhover:"gui-interactable.hoverAction","key-code":"gui-interactable.keyCode",width:"gui-item.width",height:"gui-item.height",depth:"gui-item.depth","base-depth":"gui-item.baseDepth",gap:"gui-item.gap",radius:"gui-item.radius",margin:"gui-item.margin",bevel:"gui-item.bevel","bevel-segments":"gui-item.bevelSegments",steps:"gui-item.steps","bevel-size":"gui-item.bevelSize","bevel-offset":"gui-item.bevelOffset","bevel-thickness":"gui-item.bevelThickness",on:"gui-button.on",value:"gui-button.value","font-size":"gui-button.fontSize","font-family":"gui-button.fontFamily","font-color":"gui-button.fontColor","border-color":"gui-button.borderColor","focus-color":"gui-button.focusColor","background-color":"gui-button.backgroundColor","hover-color":"gui-button.hoverColor","active-color":"gui-button.activeColor",toggle:"gui-button.toggle","toggle-state":"gui-button.toggleState"}})},function(t,e,i){"use strict";AFRAME.registerComponent("gui-circle-loader",{schema:{loaded:{type:"number",default:.5},fontSize:{type:"number",default:.2},fontFamily:{type:"string",default:""},fontColor:{type:"string",default:key_grey},backgroundColor:{type:"string",default:key_offwhite},activeColor:{type:"string",default:key_orange}},init:function(){var t=this.data,e=this.el,i=e.getAttribute("gui-item");if(this.guiItem=i,t.fontSize>20){var r=t.fontSize/750;t.fontSize=r}e.setAttribute("geometry","primitive: plane; height: "+i.height+"; width: "+i.height+";"),e.setAttribute("material","shader: flat; transparent: true; opacity: 1; side:back; color:"+t.backgroundColor+";");var o=document.createElement("a-entity");o.setAttribute("geometry","primitive: cylinder; radius: "+i.height/2+"; height: 0.02;"),o.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.backgroundColor),o.setAttribute("rotation","90 0 0"),o.setAttribute("position","0 0 0.01"),e.appendChild(o);var n=document.createElement("a-ring");n.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.activeColor),n.setAttribute("radius-inner",""+i.height/3),n.setAttribute("radius-outer",""+i.height/2),n.setAttribute("theta-start","90"),n.setAttribute("theta-length",""+-360*t.loaded),n.setAttribute("rotation","0 0 0"),n.setAttribute("position","0 0 0.04"),n.id="loader_ring",e.appendChild(n),this.setText(t.loaded)},play:function(){},update:function(t){this.data,this.el;if(this.textEntity){console.log("has textEntity: "+this.textEntity);var e=this.textEntity;e.parentNode.removeChild(e),this.setText(this.data.loaded)}else console.log("no textEntity!")},setText:function(t){var e=document.createElement("a-entity");this.textEntity=e,e.setAttribute("troika-text","value: "+Math.round(100*t)+"; \n align:center; \n anchor:center; \n baseline:center;\n letterSpacing:0;\n color:"+this.data.fontColor+";\n font:"+this.data.fontFamily+";\n fontSize:"+this.data.fontSize+";\n depthOffset:1;\n maxWidth:"+this.guiItem.width/1.05+";\n "),e.setAttribute("position","0 0 0.05"),this.el.appendChild(e)}}),AFRAME.registerPrimitive("a-gui-circle-loader",{defaultComponents:{"gui-item":{type:"circle-loader"},"gui-circle-loader":{}},mappings:{width:"gui-item.width",height:"gui-item.height",margin:"gui-item.margin",loaded:"gui-circle-loader.loaded","font-size":"gui-circle-loader.fontSize","font-family":"gui-circle-loader.fontFamily","font-color":"gui-circle-loader.fontColor","background-color":"gui-circle-loader.backgroundColor","active-color":"gui-circle-loader.activeColor"}})},function(t,e,i){"use strict";AFRAME.registerComponent("gui-circle-timer",{schema:{countDown:{type:"number",default:10},fontSize:{type:"number",default:.2},fontFamily:{type:"string",default:""},fontColor:{type:"string",default:key_grey},borderColor:{type:"string",default:key_grey},backgroundColor:{type:"string",default:key_offwhite},activeColor:{type:"string",default:key_orange}},init:function(){var t=this.data,e=this.el,i=e.getAttribute("gui-item");this.guiItem=i;var r=e.getAttribute("gui-interactable");if(console.log("in timer callback, guiInteractable: "+JSON.stringify(r)),t.fontSize>20){var o=t.fontSize/750;t.fontSize=o}e.setAttribute("geometry","primitive: plane; height: "+i.height+"; width: "+i.height+";"),e.setAttribute("material","shader: flat; transparent: true; opacity: 1; side:back; color:"+t.backgroundColor+";");var n=document.createElement("a-entity");n.setAttribute("geometry","primitive: cylinder; radius: "+i.height/2+"; height: 0.02;"),n.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.backgroundColor),n.setAttribute("rotation","90 0 0"),n.setAttribute("position","0 0 0.01"),e.appendChild(n);var a=document.createElement("a-ring");a.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.borderColor),a.setAttribute("radius-inner",""+i.height/3),a.setAttribute("radius-outer",""+i.height/2),a.setAttribute("theta-start","-1"),a.setAttribute("theta-length","3"),a.setAttribute("position","0 0 0.04"),e.appendChild(a);var s=document.createElement("a-ring");s.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.borderColor),s.setAttribute("radius-inner",""+i.height/3),s.setAttribute("radius-outer",""+i.height/2),s.setAttribute("theta-start","89"),s.setAttribute("theta-length","3"),s.setAttribute("position","0 0 0.04"),e.appendChild(s);var l=document.createElement("a-ring");l.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.borderColor),l.setAttribute("radius-inner",""+i.height/3),l.setAttribute("radius-outer",""+i.height/2),l.setAttribute("theta-start","179"),l.setAttribute("theta-length","3"),l.setAttribute("position","0 0 0.04"),e.appendChild(l);var u=document.createElement("a-ring");u.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.borderColor),u.setAttribute("radius-inner",""+i.height/3),u.setAttribute("radius-outer",""+i.height/2),u.setAttribute("theta-start","269"),u.setAttribute("theta-length","3"),u.setAttribute("position","0 0 0.04"),e.appendChild(u);var d=document.createElement("a-ring");d.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.activeColor),d.setAttribute("radius-inner",""+i.height/3),d.setAttribute("radius-outer",""+i.height/2),d.setAttribute("theta-start","0"),d.setAttribute("theta-length","0"),d.setAttribute("rotation","0 180 90"),d.setAttribute("position","0 0 0.03"),e.appendChild(d),this.timerRing=d;this.initCount=t.countDown;this.setText(t.countDown)},update:function(t){var e=this.data,i=this.el;if(0!==Object.keys(t).length&&e.countDown!==t.countDown){i.getObject3D("mesh").material.color=e.color;var r=e.countDown,o=this.initCount,n=Math.round(100*(o-r)/o)/100*360;this.timerRing.setAttribute("theta-length",n),this.textEntity.setAttribute("troika-text","value: "+e.countDown+";"),1==r&&console.log("fire callback on the last second")}},setText:function(t){var e=document.createElement("a-entity");this.textEntity=e,e.setAttribute("troika-text","value: "+t+"; \n align:center; \n anchor:center; \n baseline:center;\n letterSpacing:0;\n color:"+this.data.fontColor+";\n font:"+this.data.fontFamily+";\n fontSize:"+this.data.fontSize+";\n depthOffset:1;\n maxWidth:"+this.guiItem.width/1.05+";\n "),e.setAttribute("position","0 0 0.05"),this.el.appendChild(e)},callback:function(){var t=this.el.getAttribute("gui-interactable"),e=t.clickAction;console.log("in timer callback, guiInteractable: "+JSON.stringify(t)),console.log("in button, clickActionFunctionName: "+e);var i=window[e];"function"==typeof i&&i()}}),AFRAME.registerPrimitive("a-gui-circle-timer",{defaultComponents:{"gui-item":{type:"circle-timer"},"gui-circle-timer":{}},mappings:{width:"gui-item.width",height:"gui-item.height",margin:"gui-item.margin","count-down":"gui-circle-timer.countDown","font-size":"gui-circle-timer.fontSize","font-family":"gui-circle-timer.fontFamily","font-color":"gui-circle-timer.fontColor","border-color":"gui-circle-timer.borderColor","background-color":"gui-circle-timer.backgroundColor","active-color":"gui-circle-timer.activeColor",callback:"gui-interactable.clickAction"}})},function(t,e,i){"use strict";AFRAME.registerComponent("gui-cursor",{schema:{color:{type:"string",default:key_white},hoverColor:{type:"string",default:key_white},activeColor:{type:"string",default:key_orange},distance:{type:"number",default:-1},design:{type:"string",default:"dot"}},init:function(){var t=this.cursor=this.el.getAttribute("cursor"),e=this.fuse=t.fuse,i=t.fuseTimeout,r=this.el,o=this.data,n=200,a=i-n;if(AFRAME.utils.entity.setComponentProperty(r,"raycaster.interval","500"),console.log("fuse: "+e+", fuseTimeout: "+i),"dot"==o.design){r.setAttribute("geometry","primitive: ring; radiusInner:0.000001; radiusOuter:0.025"),r.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),r.setAttribute("position","0 0 "+o.distance),r.setAttribute("animation__radiusInnerIn","property: geometry.radiusInner; from: 0.000001; to:0.0225; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__radiusOuterIn","property: geometry.radiusOuter; from: 0.025; to:0.0275; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__colorIn","property: material.color; from: "+o.color+"; to:"+o.hoverColor+"; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__radiusInnerOut","property: geometry.radiusInner; from: 0.0225; to:0.000001; dur:"+n+"; easing:linear; startEvents: leavegui"),r.setAttribute("animation__radiusOuterOut","property: geometry.radiusOuter; from: 0.0275; to:0.025; dur:"+n+"; easing:linear; startEvents: leavegui"),r.setAttribute("animation__colorOut","property: material.color; from: "+o.hoverColor+"; to:"+o.color+"; dur:"+n+"; easing:linear; startEvents: leavegui"),r.setAttribute("animation__scale","property: scale; from: 1 1 1; to:1.25 1.25 1.25; dur:200; easing:easeInQuad; startEvents: click");var s=document.createElement("a-entity");if(s.setAttribute("geometry","primitive: ring; radiusInner:0.0275; radiusOuter:0.03; thetaLength:360"),s.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),s.setAttribute("position","0 0 0"),s.setAttribute("animation__radiusInnerIn","property: geometry.radiusInner; from: 0.0275; to:0.03; dur:"+n+"; easing:linear; startEvents: hovergui"),s.setAttribute("animation__radiusOuterIn","property: geometry.radiusOuter; from: 0.03; to:0.0325; dur:"+n+"; easing:linear; startEvents: hovergui"),s.setAttribute("animation__radiusInnerOut","property: geometry.radiusInner; from: 0.03; to:0.0275; dur:"+n+"; easing:linear; startEvents: leavegui"),s.setAttribute("animation__radiusOuterOut","property: geometry.radiusOuter; from: 0.0325; to:0.03; dur:"+n+"; easing:linear; startEvents: leavegui"),r.appendChild(s),this.cursorShadow=s,e){var l=document.createElement("a-entity");l.setAttribute("geometry","primitive: ring; radiusInner:0.03; radiusOuter:0.0375; thetaLength:0"),l.setAttribute("material","color: "+o.activeColor+"; shader: flat; opacity:1;"),l.setAttribute("position","0 0 0"),l.setAttribute("animation","property: geometry.thetaLength; from: 0; to:360; dur:"+a+"; delay: "+n+"; easing:linear; autoplay:false;"),r.appendChild(l),this.fuseLoader=l}}else if("ring"==o.design){r.setAttribute("geometry","primitive: ring; radiusInner:0.0225; radiusOuter:0.0275"),r.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),r.setAttribute("position","0 0 "+o.distance),r.setAttribute("animation__radiusInnerIn","property: geometry.radiusInner; from: 0.0225; to:0.025; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__radiusOuterIn","property: geometry.radiusOuter; from: 0.0275; to:0.0325; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__colorIn","property: material.color; from: "+o.color+"; to:"+o.hoverColor+"; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__radiusInnerOut","property: geometry.radiusInner; from: 0.025; to:0.0225; dur:"+n+"; easing:linear; startEvents: leavegui"),r.setAttribute("animation__radiusOuterOut","property: geometry.radiusOuter; from: 0.0325; to:0.0275; dur:"+n+"; easing:linear; startEvents: leavegui"),r.setAttribute("animation__colorOut","property: material.color; from: "+o.hoverColor+"; to:"+o.color+"; dur:"+n+"; easing:linear; startEvents: leavegui"),r.setAttribute("animation__scale","property: scale; from: 1 1 1; to:1.25 1.25 1.25; dur:200; easing:easeInQuad; startEvents: click");var s=document.createElement("a-entity");if(s.setAttribute("geometry","primitive: ring; radiusInner:0.03; radiusOuter:0.0325; thetaLength:360"),s.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),s.setAttribute("position","0 0 0"),s.setAttribute("animation__radiusInnerIn","property: geometry.radiusInner; from: 0.03; to:0.0325; dur:"+n+"; easing:linear; startEvents: hovergui"),s.setAttribute("animation__radiusOuterIn","property: geometry.radiusOuter; from: 0.0325; to:0.0375; dur:"+n+"; easing:linear; startEvents: hovergui"),s.setAttribute("animation__radiusInnerOut","property: geometry.radiusInner; from: 0.0325; to:0.03; dur:"+n+"; easing:linear; startEvents: leavegui"),s.setAttribute("animation__radiusOuterOut","property: geometry.radiusOuter; from: 0.0375; to:0.0325; dur:"+n+"; easing:linear; startEvents: leavegui"),r.appendChild(s),this.cursorShadow=s,e){var l=document.createElement("a-entity");l.setAttribute("geometry","primitive: ring; radiusInner:0.035; radiusOuter:0.0425; thetaLength:0"),l.setAttribute("material","color: "+o.activeColor+"; shader: flat; opacity:1;"),l.setAttribute("position","0 0 0"),l.setAttribute("animation","property: geometry.thetaLength; from: 0; to:360; dur:"+a+"; delay: "+n+"; easing:linear; autoplay:false;"),r.appendChild(l),this.fuseLoader=l}}else if("reticle"==o.design){r.setAttribute("geometry","primitive: ring; radiusInner:0.000001; radiusOuter:0.0125; thetaLength:180;"),r.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),r.setAttribute("position","0 0 "+o.distance),r.setAttribute("animation__opacityIn","property: material.opacity; from: 1; to: 0; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__opacityOut","property: material.opacity; from: 0; to: 1; dur:"+n+"; easing:linear; startEvents: leavegui");var u=document.createElement("a-entity");u.setAttribute("geometry","primitive: ring; radiusInner:0.000001; radiusOuter:0.0125; thetaLength:180; thetaStart:180;"),u.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),u.setAttribute("position","0 0 0"),u.setAttribute("animation__opacityIn","property: material.opacity; from: 0.25; to: 0; dur:"+n+"; easing:linear; startEvents: hovergui"),u.setAttribute("animation__opacityOut","property: material.opacity; from: 0; to: 0.25; dur:"+n+"; easing:linear; startEvents: leavegui"),r.appendChild(u),this.cursorCenter=u;var s=document.createElement("a-entity");s.setAttribute("geometry","primitive: ring; radiusInner:0.0125; radiusOuter:0.0145"),s.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),s.setAttribute("position","0 0 0"),s.setAttribute("animation__colorIn","property: material.color; from: #000000; to: "+o.color+"; dur:"+n+"; easing:linear; startEvents: hovergui"),s.setAttribute("animation__opacityIn","property: material.opacity; from: 0.25; to: 1; dur:"+n+"; easing:linear; startEvents: hovergui"),s.setAttribute("animation__colorOut","property: material.color; from: "+o.color+"; to: #000000; dur:"+n+"; easing:linear; startEvents: leavegui"),s.setAttribute("animation__opacityOut","property: material.opacity; from: 1; to: 0.25; dur:"+n+"; easing:linear; startEvents: leavegui"),r.appendChild(s),this.cursorShadow=s;var d=document.createElement("a-entity");d.setAttribute("geometry","primitive: plane; width:0.005; height:0.005;"),d.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),d.setAttribute("position","-0.0325 0.0325 0"),r.appendChild(d),this.cursorShadowTL=d;var c=document.createElement("a-entity");c.setAttribute("geometry","primitive: plane; width:0.005; height:0.005;"),c.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),c.setAttribute("position","-0.0325 -0.0325 0"),r.appendChild(c),this.cursorShadowBL=c;var h=document.createElement("a-entity");h.setAttribute("geometry","primitive: plane; width:0.005; height:0.005;"),h.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),h.setAttribute("position","0.0325 0.0325 0"),r.appendChild(h),this.cursorShadowTR=h;var f=document.createElement("a-entity");f.setAttribute("geometry","primitive: plane; width:0.005; height:0.005;"),f.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),f.setAttribute("position","0.0325 -0.0325 0"),r.appendChild(f),this.cursorShadowBR=f;var p=document.createElement("a-entity");p.setAttribute("geometry","primitive: plane; width:0.015; height:0.0035;"),p.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),p.setAttribute("position","-0.03 0.0375 0"),r.appendChild(p),this.cursorBoundTL=p;var g=document.createElement("a-entity");g.setAttribute("geometry","primitive: plane; width:0.0035; height:0.015;"),g.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),g.setAttribute("position","-0.0375 0.03 0"),r.appendChild(g),this.cursorBoundTL2=g;var m=document.createElement("a-entity");m.setAttribute("geometry","primitive: plane; width:0.015; height:0.0035;"),m.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),m.setAttribute("position","0.03 0.0375 0"),r.appendChild(m),this.cursorBoundTR=m;var v=document.createElement("a-entity");v.setAttribute("geometry","primitive: plane; width:0.0035; height:0.015;"),v.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),v.setAttribute("position","0.0375 0.03 0"),r.appendChild(v),this.cursorBoundTR2=v;var b=document.createElement("a-entity");b.setAttribute("geometry","primitive: plane; width:0.015; height:0.0035;"),b.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),b.setAttribute("position","-0.03 -0.0375 0"),r.appendChild(b),this.cursorBoundBL=b;var y=document.createElement("a-entity");y.setAttribute("geometry","primitive: plane; width:0.0035; height:0.015;"),y.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),y.setAttribute("position","-0.0375 -0.03 0"),r.appendChild(y),this.cursorBoundBL2=y;var A=document.createElement("a-entity");A.setAttribute("geometry","primitive: plane; width:0.015; height:0.0035;"),A.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),A.setAttribute("position","0.03 -0.0375 0"),r.appendChild(A),this.cursorBoundBR=A;var w=document.createElement("a-entity");if(w.setAttribute("geometry","primitive: plane; width:0.0035; height:0.015;"),w.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),w.setAttribute("position","0.0375 -0.03 0"),r.appendChild(w),this.cursorBoundBR2=w,e){var l=document.createElement("a-entity");l.setAttribute("geometry","primitive: plane; width:0.000001; height:0.01;"),l.setAttribute("material","color: "+o.activeColor+"; shader: flat; opacity:1;"),l.setAttribute("position","0 -0.05 0"),l.setAttribute("animation","property: geometry.width; from: 0; to: 0.075; dur:"+a+"; delay:"+n+"; easing:linear; autoplay:false;"),r.appendChild(l),this.fuseLoader=l}}else if("cross"==o.design){r.setAttribute("geometry","primitive: ring; radiusInner:0.035; radiusOuter:0.0375"),r.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),r.setAttribute("position","0 0 "+o.distance),r.setAttribute("animation__radiusInnerIn","property: geometry.radiusInner; from: 0.035; to: 0.0315; dur:"+n+"; easing:linear; startEvents: hovergui"),r.setAttribute("animation__radiusInnerOut","property: geometry.radiusInner; from: 0.0315; to: 0.035; dur:"+n+"; easing:linear; startEvents: leavegui");var s=document.createElement("a-entity");s.setAttribute("geometry","primitive: ring; radiusInner:0.0375; radiusOuter:0.04; thetaLength:360"),s.setAttribute("material","color: #000000; shader: flat; opacity:0.25;"),s.setAttribute("position","0 0 0"),r.appendChild(s),this.cursorShadow=s;var k=document.createElement("a-entity");k.setAttribute("geometry","primitive: plane; width:0.0035; height:0.01875"),k.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),k.setAttribute("position","0 0.028125 0"),k.setAttribute("animation__widthIn","property: geometry.width; from: 0.0035; to: 0.007; dur:"+a+"; easing:linear; startEvents: hovergui"),k.setAttribute("animation__widthOut","property: geometry.width; from: 0.007; to: 0.0035; dur:"+a+"; easing:linear; startEvents: leavegui"),r.appendChild(k),this.cursorVerticalTop=k;var C=document.createElement("a-entity");C.setAttribute("geometry","primitive: plane; width:0.0035; height:0.01875"),C.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),C.setAttribute("position","0 -0.028125 0"),C.setAttribute("animation__widthIn","property: geometry.width; from: 0.0035; to: 0.007; dur:"+a+"; easing:linear; startEvents: hovergui"),C.setAttribute("animation__widthOut","property: geometry.width; from: 0.007; to: 0.0035; dur:"+a+"; easing:linear; startEvents: leavegui"),r.appendChild(C),this.cursorVerticalBottom=C;var x=document.createElement("a-entity");x.setAttribute("geometry","primitive: plane; width:0.01875; height:0.0035"),x.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),x.setAttribute("position","-0.028125 0 0"),x.setAttribute("animation__heightIn","property: geometry.height; from: 0.0035; to: 0.007; dur:"+a+"; easing:linear; startEvents: hovergui"),x.setAttribute("animation__heightOut","property: geometry.height; from: 0.007; to: 0.0035; dur:"+a+"; easing:linear; startEvents: leavegui"),r.appendChild(x),this.cursorHorizontalLeft=x;var S=document.createElement("a-entity");if(S.setAttribute("geometry","primitive: plane; width:0.01875; height:0.0035"),S.setAttribute("material","color: "+o.color+"; shader: flat; opacity:1;"),S.setAttribute("position","0.028125 0 0"),S.setAttribute("animation__heightIn","property: geometry.height; from: 0.0035; to: 0.007; dur:"+a+"; easing:linear; startEvents: hovergui"),S.setAttribute("animation__heightOut","property: geometry.height; from: 0.007; to: 0.0035; dur:"+a+"; easing:linear; startEvents: leavegui"),r.appendChild(S),this.cursorHorizontalRight=S,e){var l=document.createElement("a-entity");l.setAttribute("geometry","primitive: ring; radiusInner:0.0415; radiusOuter:0.0485; thetaLength:0"),l.setAttribute("material","color: "+o.activeColor+"; shader: flat; opacity:1;"),l.setAttribute("position","0 0 0"),l.setAttribute("animation","property: geometry.thetaLength; from: 0; to: 360; dur:"+a+"; delay:"+n+"; easing:linear; autoplay:false;"),r.appendChild(l),this.fuseLoader=l}}r.addEventListener("mouseenter",function(){console.log("in gui-cursor mousenter, el: "+r),r.emit("hovergui"),"dot"==o.design||"ring"==o.design?s.emit("hovergui"):"cross"==o.design?(s.emit("hovergui"),k.emit("hovergui"),C.emit("hovergui"),x.emit("hovergui"),S.emit("hovergui")):"reticle"==o.design&&(centerHoverAniOpacity.emit("hovergui"),cursorHoverAniColor.emit("hovergui"),cursorHoverAniOpacity.emit("hovergui"))}),r.addEventListener("mouseleave",function(){console.log("in gui-cursor mouseleave, el: "+r),r.emit("leavegui"),"dot"==o.design||"ring"==o.design?s.emit("leavegui"):"cross"==o.design?(k.emit("leavegui"),C.emit("leavegui"),x.emit("leavegui"),S.emit("leavegui")):"reticle"==o.design&&(centerHoverAniOpacity.emit("leavegui"),cursorHoverAniColor.emit("leavegui"),cursorHoverAniOpacity.emit("leavegui")),e&&(l.object3D.el.components.animation.animation.pause(),l.object3D.el.components.animation.animation.seek(0)),r.setAttribute("scale","1 1 1")}),e&&r.addEventListener("fusing",function(){l.object3D.el.components.animation.animation.play()}),r.addEventListener("stateremoved",function(t){console.log("evt.detail "+t.detail),"cursor-fusing"===t.detail.state||"cursor-fusing"===t.detail?"dot"==o.design||"ring"==o.design||"cross"==o.design?e&&(l.object3D.el.components.animation.animation.pause(),l.object3D.el.components.animation.animation.seek(0),AFRAME.utils.entity.setComponentProperty(l,"geometry.thetaLength","0")):"reticle"==o.design&&e&&(l.object3D.el.components.animation.animation.pause(),l.object3D.el.components.animation.animation.seek(0),AFRAME.utils.entity.setComponentProperty(l,"geometry.width","0.000001")):"cursor-hovering"!==t.detail.state&&"cursor-hovering"!==t.detail||("dot"==o.design||"ring"==o.design?(AFRAME.utils.entity.setComponentProperty(this,"scale","1 1 1"),e&&AFRAME.utils.entity.setComponentProperty(l,"geometry.thetaLength","0")):"cross"==o.design?e&&AFRAME.utils.entity.setComponentProperty(l,"geometry.thetaLength","0"):"reticle"==o.design&&e&&AFRAME.utils.entity.setComponentProperty(l,"geometry.width","0.000001"))})},update:function(){},tick:function(){},remove:function(){},pause:function(){},play:function(){}}),AFRAME.registerPrimitive("a-gui-cursor",{defaultComponents:{cursor:{},"gui-cursor":{}},mappings:{fuse:"cursor.fuse","fuse-timeout":"cursor.fuseTimeout",color:"gui-cursor.color","hover-color":"gui-cursor.hoverColor","active-color":"gui-cursor.activeColor",distance:"gui-cursor.distance",design:"gui-cursor.design"}})},function(t,e,i){"use strict";var r=function(t,e){new MutationObserver(function(t,i){t.forEach(function(t){console.log(t),t.addedNodes.length&&e(t.target,t.addedNodes)})}).observe(t,{childList:!0})};AFRAME.registerComponent("gui-flex-container",{schema:{flexDirection:{type:"string",default:"row"},justifyContent:{type:"string",default:"flexStart"},alignItems:{type:"string",default:"flexStart"},itemPadding:{type:"number",default:0},opacity:{type:"number",default:0},isTopContainer:{type:"boolean",default:!1},panelColor:{type:"string",default:key_grey},panelRounded:{type:"number",default:.05},styles:{fontFamily:{type:"string",default:"Helvetica"},fontColor:{type:"string",default:key_offwhite},borderColor:{type:"string",default:key_offwhite},backgroundColor:{type:"string",default:key_grey},hoverColor:{type:"string",default:key_grey_dark},activeColor:{type:"string",default:key_orange},handleColor:{type:"string",default:key_offwhite}}},init:function(){console.log("in aframe-gui-component init for: "+this.el.getAttribute("id"));var t=this.el.getAttribute("gui-item");this.data.isTopContainer?this.setBackground():this.el.setAttribute("rounded","height: "+t.height+"; width: "+t.width+"; opacity: "+this.data.opacity+"; color: "+this.data.panelColor+"; radius:"+this.data.panelRounded+"; depthWrite:false; polygonOffset:true; polygonOffsetFactor: 1;"),this.children=this.el.getChildEntities();var e=0,i=0;if("row"==this.data.flexDirection){if("flexStart"==this.data.justifyContent)e=0;else if("center"==this.data.justifyContent||"flexEnd"==this.data.justifyContent){for(var o=0,n=0;n<this.children.length;n++){var a=this.children[n],s=a.getAttribute("gui-item");o=o+s.margin.w+s.width+s.margin.y}"center"==this.data.justifyContent?e=.5*(t.width-o):"flexEnd"==this.data.justifyContent&&(e=t.width-o)}"center"==this.data.alignItems?i=t.height:"flexStart"==this.data.alignItems?i=0:"flexEnd"==this.data.alignItems&&(i=t.height)}else if("column"==this.data.flexDirection){if("flexStart"==this.data.justifyContent)i=0;else if("center"==this.data.justifyContent||"flexEnd"==this.data.justifyContent){for(var l=0,n=0;n<this.children.length;n++){var a=this.children[n],s=a.getAttribute("gui-item");l=l+s.margin.x+s.height+s.margin.z}"center"==this.data.justifyContent?i=.5*(t.height-l):"flexEnd"==this.data.justifyContent&&(i=t.height-l)}"flexStart"==this.data.alignItems?e=0:"center"==this.data.alignItems?e=.5*t.width:"flexEnd"==this.data.alignItems&&(e=0)}for(var n=0;n<this.children.length;n++){var a=this.children[n],u=0,d=0,s=a.getAttribute("gui-item");if(s){"row"==this.data.flexDirection?("center"==this.data.alignItems?d=0:"flexStart"==this.data.alignItems?d=.5*t.height-s.margin.x-s.height:"flexEnd"==this.data.alignItems&&(d=.5*-t.height+s.margin.z+s.height),u=.5*-t.width+e+s.margin.w+.5*s.width,e=e+s.margin.w+s.width+s.margin.y):"column"==this.data.flexDirection&&("center"==this.data.alignItems?u=0:"flexStart"==this.data.alignItems?u=.5*-t.width+s.margin.w+.5*s.width:"flexEnd"==this.data.alignItems&&(u=.5*t.width-s.margin.y-.5*s.width),d=.5*t.height-i- -s.margin.x-.5*s.height,i=i+s.margin.x+s.height+s.margin.z),a.setAttribute("position",u+" "+d+" "+.01),a.setAttribute("geometry","primitive: plane; height: "+s.height+"; width: "+s.width+";");var c=a.components["gui-flex-container"];c&&c.setBackground()}}r(this.el,function(t,e){e[0];e[0].addEventListener("loaded",function(e){t.components["gui-flex-container"].init()})})},update:function(){},tick:function(){},remove:function(){},pause:function(){},play:function(){},getElementSize:function(){},setBackground:function(){if(this.data.opacity>0){console.log("panel position: "+JSON.stringify(this.el.getAttribute("position")));var t=this.el.getAttribute("gui-item"),e=document.createElement("a-entity");e.setAttribute("rounded","height: "+t.height+"; width: "+t.width+"; opacity: "+this.data.opacity+"; color: "+this.data.panelColor+"; radius:"+this.data.panelRounded+"; depthWrite:false; polygonOffset:true; polygonOffsetFactor: 2;"),console.log("about to set panel background color to: : "+this.data.panelColor),e.setAttribute("position",this.el.getAttribute("position").x+" "+this.el.getAttribute("position").y+" "+(this.el.getAttribute("position").z-.0125)),e.setAttribute("rotation",this.el.getAttribute("rotation").x+" "+this.el.getAttribute("rotation").y+" "+this.el.getAttribute("rotation").z),this.el.parentNode.insertBefore(e,this.el)}}}),AFRAME.registerPrimitive("a-gui-flex-container",{defaultComponents:{"gui-item":{type:"flex-container"},"gui-flex-container":{}},mappings:{width:"gui-item.width",height:"gui-item.height",margin:"gui-item.margin","flex-direction":"gui-flex-container.flexDirection","justify-content":"gui-flex-container.justifyContent","align-items":"gui-flex-container.alignItems","item-padding":"gui-flex-container.itemPadding",opacity:"gui-flex-container.opacity","is-top-container":"gui-flex-container.isTopContainer","panel-color":"gui-flex-container.panelColor","panel-rounded":"gui-flex-container.panelRounded","font-family":"gui-flex-container.styles.fontFamily","font-color":"gui-flex-container.styles.fontColor","border-color":"gui-flex-container.styles.borderColor","background-color":"gui-flex-container.styles.backgroundColor","hover-color":"gui-flex-container.styles.hoverColor","active-color":"gui-flex-container.styles.activeColor","handle-color":"gui-flex-container.styles.handleColor"}})},function(t,e,i){"use strict";AFRAME.registerComponent("gui-icon-button",{schema:{on:{default:"click"},toggle:{type:"boolean",default:!1},toggleState:{type:"boolean",default:!1},icon:{type:"string",default:"f0f3"},iconActive:{type:"string",default:""},iconFontSize:{type:"number",default:.4},iconFont:{type:"string",default:"assets/fonts/fa-regular-400.ttf"},fontColor:{type:"string",default:key_offwhite},borderColor:{type:"string",default:key_offwhite},backgroundColor:{type:"string",default:key_grey},hoverColor:{type:"string",default:key_grey_dark},activeColor:{type:"string",default:key_orange}},init:function(){var t=this.data,e=this.el,i=e.getAttribute("gui-item");this.guiItem=i;var r=(this.toggleState=t.toggle,e.getAttribute("gui-interactable"));if(this.guiInteractable=r,t.iconFontSize>20){var o=t.iconFontSize/750;t.iconFontSize=o}e.setAttribute("geometry","primitive: plane; height: "+i.height+"; width: "+i.width+";"),e.setAttribute("material","shader: flat; transparent: true; opacity: 0.0; alphaTest: 0.5; side:double; color:"+t.backgroundColor+";");var n=document.createElement("a-entity");n.setAttribute("geometry","primitive: cylinder; radius: "+i.height/2+"; height: 0.02;"),n.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.borderColor),n.setAttribute("rotation","90 0 0"),n.setAttribute("position","0 0 0.01"),e.appendChild(n);var a=document.createElement("a-entity");a.setAttribute("geometry","primitive: cylinder; radius: "+i.height/2.05+"; height: 0.04;"),a.setAttribute("material","shader: flat; opacity: 1; side:double; color: "+t.backgroundColor),a.setAttribute("rotation","90 0 0"),a.setAttribute("position","0 0 0.02"),e.appendChild(a),this.buttonEntity=a,this.setIcon(t.icon),e.addEventListener("mouseenter",function(e){a.removeAttribute("animation__leave"),t.toggle||a.setAttribute("animation__enter","property: material.color; from: "+t.backgroundColor+"; to:"+t.hoverColor+"; dur:200;")}),e.addEventListener("mouseleave",function(e){t.toggle||(a.removeAttribute("animation__click"),a.setAttribute("animation__leave","property: material.color; from: "+t.hoverColor+"; to:"+t.backgroundColor+"; dur:200; easing: easeOutQuad;")),a.removeAttribute("animation__enter")}),e.addEventListener(t.on,function(i){if(t.toggle){var o=e.components["gui-button"];o.setActiveState(!o.data.toggleState)}else a.setAttribute("animation__click","property: material.color; from: "+t.activeColor+"; to:"+t.backgroundColor+"; dur:400; easing: easeOutQuad;");var n=r.clickAction,s=window[n];"function"==typeof s&&s(i)}),e.setAttribute("role","button")},play:function(){},update:function(t){console.log("In button update, toggle: "+this.toggleState);this.data,this.el;if(this.iconEntity){console.log("has iconEntity: "+this.iconEntity);var e=this.iconEntity;e.parentNode.removeChild(e),this.setIcon(this.data.icon)}else console.log("no iconEntity!")},setActiveState:function(t){this.data.toggleState=t,t?(console.log("active, about to set active color"),this.buttonEntity.setAttribute("material","color",this.data.activeColor)):(console.log("not active, about to set background color"),this.buttonEntity.setAttribute("material","color",this.data.backgroundColor))},setIcon:function(t){var e=parseInt(t,16),i=String.fromCharCode(e),r=document.createElement("a-entity");this.iconEntity=r,r.setAttribute("troika-text","value:"+i+"; \n align:center; \n anchor:center; \n baseline:center;\n lineHeight:"+this.guiItem.height+";\n maxWidth:"+this.guiItem.width+";\n color:"+this.data.fontColor+";\n font:"+this.data.iconFont+";\n fontSize:"+this.data.iconFontSize+";\n depthOffset:1;\n "),r.setAttribute("position","0 0 0.05"),this.el.appendChild(r)}}),AFRAME.registerPrimitive("a-gui-icon-button",{defaultComponents:{"gui-interactable":{},"gui-item":{type:"icon-button"},"gui-icon-button":{}},mappings:{onclick:"gui-interactable.clickAction",onhover:"gui-interactable.hoverAction","key-code":"gui-interactable.keyCode",width:"gui-item.width",height:"gui-item.height",margin:"gui-item.margin",on:"gui-icon-button.on","font-color":"gui-icon-button.fontColor","font-family":"gui-icon-button.fontFamily","border-color":"gui-icon-button.borderColor","background-color":"gui-icon-button.backgroundColor","hover-color":"gui-icon-button.hoverColor","active-color":"gui-icon-button.activeColor",icon:"gui-icon-button.icon","icon-active":"gui-icon-button.iconActive","icon-font":"gui-icon-button.iconFont","icon-font-size":"gui-icon-button.iconFontSize",toggle:"gui-icon-button.toggle","toggle-state":"gui-icon-button.toggleState"}})},function(t,e,i){"use strict";AFRAME.registerComponent("gui-icon-label-button",{schema:{on:{default:"click"},toggle:{type:"boolean",default:!1},toggleState:{type:"boolean",default:!1},icon:{type:"string",default:"f0f3"},iconActive:{type:"string",default:""},iconFontSize:{type:"number",default:.35},iconFont:{type:"string",default:"assets/fonts/fa-regular-400.ttf"},value:{type:"string",default:""},fontSize:{type:"number",default:.2},fontFamily:{type:"string",default:""},fontColo