x_ite 8.11.17 → 8.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +3 -1
  2. package/dist/LICENSE.md +2 -2
  3. package/dist/assets/components/Annotation.js +13 -13
  4. package/dist/assets/components/Annotation.min.js +1 -1
  5. package/dist/assets/components/CADGeometry.js +22 -22
  6. package/dist/assets/components/CADGeometry.min.js +1 -1
  7. package/dist/assets/components/CubeMapTexturing.js +25 -25
  8. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  9. package/dist/assets/components/DIS.js +13 -13
  10. package/dist/assets/components/DIS.min.js +1 -1
  11. package/dist/assets/components/EventUtilities.js +9 -9
  12. package/dist/assets/components/EventUtilities.min.js +1 -1
  13. package/dist/assets/components/Geometry2D.js +19 -19
  14. package/dist/assets/components/Geometry2D.min.js +1 -1
  15. package/dist/assets/components/Geospatial.js +49 -49
  16. package/dist/assets/components/Geospatial.min.js +1 -1
  17. package/dist/assets/components/HAnim.js +23 -23
  18. package/dist/assets/components/HAnim.min.js +1 -1
  19. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  20. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  21. package/dist/assets/components/Layout.js +26 -26
  22. package/dist/assets/components/Layout.min.js +1 -1
  23. package/dist/assets/components/NURBS.js +24 -24
  24. package/dist/assets/components/NURBS.min.js +1 -1
  25. package/dist/assets/components/ParticleSystems.js +24 -24
  26. package/dist/assets/components/ParticleSystems.min.js +1 -1
  27. package/dist/assets/components/Picking.js +18 -18
  28. package/dist/assets/components/Picking.min.js +1 -1
  29. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  30. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  31. package/dist/assets/components/Scripting.js +39 -38
  32. package/dist/assets/components/Scripting.min.js +1 -1
  33. package/dist/assets/components/Text.js +36 -36
  34. package/dist/assets/components/Text.min.js +1 -1
  35. package/dist/assets/components/TextureProjector.js +14 -14
  36. package/dist/assets/components/TextureProjector.min.js +1 -1
  37. package/dist/assets/components/Texturing3D.js +30 -30
  38. package/dist/assets/components/Texturing3D.min.js +1 -1
  39. package/dist/assets/components/VolumeRendering.js +18 -18
  40. package/dist/assets/components/VolumeRendering.min.js +1 -1
  41. package/dist/assets/components/X_ITE.js +9 -9
  42. package/dist/assets/components/X_ITE.min.js +1 -1
  43. package/dist/x_ite.css +1 -1
  44. package/dist/x_ite.js +1274 -464
  45. package/dist/x_ite.min.js +1 -1
  46. package/dist/x_ite.min.mjs +1 -0
  47. package/dist/x_ite.mjs +121582 -0
  48. package/dist/x_ite.zip +0 -0
  49. package/package.json +9 -2
@@ -0,0 +1 @@
1
+ /* X_ITE v8.12.0 */var t={153:function(e,t,i){var n,s,r=i(464);"undefined"!=typeof window&&window,void 0===(s="function"==typeof(n=function(){if("undefined"==typeof window)return null;var e="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),t=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||function(t){return e.setTimeout(t,20)},i=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||function(t){e.clearTimeout(t)};function n(e,t){var i=Object.prototype.toString.call(e),n="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i||"[object Object]"===i||void 0!==r&&e instanceof r||"undefined"!=typeof Elements&&e instanceof Elements,s=0,o=e.length;if(n)for(;s<o;s++)t(e[s]);else t(e)}function s(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}function o(e,t){Object.keys(t).forEach((function(i){e.style[i]=t[i]}))}var a=function(e,r){var l=0;function u(){var e,t,i=[];this.add=function(e){i.push(e)},this.call=function(n){for(e=0,t=i.length;e<t;e++)i[e].call(this,n)},this.remove=function(n){var s=[];for(e=0,t=i.length;e<t;e++)i[e]!==n&&s.push(i[e]);i=s},this.length=function(){return i.length}}function h(e,i){if(e)if(e.resizedAttached)e.resizedAttached.add(i);else{e.resizedAttached=new u,e.resizedAttached.add(i),e.resizeSensor=document.createElement("div"),e.resizeSensor.dir="ltr",e.resizeSensor.className="resize-sensor";var n={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},r={position:"absolute",left:"0px",top:"0px",transition:"0s"};o(e.resizeSensor,n);var a=document.createElement("div");a.className="resize-sensor-expand",o(a,n);var h=document.createElement("div");o(h,r),a.appendChild(h);var d=document.createElement("div");d.className="resize-sensor-shrink",o(d,n);var c=document.createElement("div");o(c,r),o(c,{width:"200%",height:"200%"}),d.appendChild(c),e.resizeSensor.appendChild(a),e.resizeSensor.appendChild(d),e.appendChild(e.resizeSensor);var p=window.getComputedStyle(e),g=p?p.getPropertyValue("position"):null;"absolute"!==g&&"relative"!==g&&"fixed"!==g&&"sticky"!==g&&(e.style.position="relative");var f=!1,m=0,_=s(e),x=0,y=0,w=!0;l=0;var b=function(){var t=e.offsetWidth,i=e.offsetHeight;h.style.width=t+10+"px",h.style.height=i+10+"px",a.scrollLeft=t+10,a.scrollTop=i+10,d.scrollLeft=t+10,d.scrollTop=i+10},S=function(){if(w){if(0===e.offsetWidth&&0===e.offsetHeight)return void(l||(l=t((function(){l=0,S()}))));w=!1}b()};e.resizeSensor.resetSensor=S;var T=function(){m=0,f&&(x=_.width,y=_.height,e.resizedAttached&&e.resizedAttached.call(_))},v=function(){_=s(e),(f=_.width!==x||_.height!==y)&&!m&&(m=t(T)),S()},O=function(e,t,i){e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i)};O(a,"scroll",v),O(d,"scroll",v),l=t((function(){l=0,S()}))}}n(e,(function(e){h(e,r)})),this.detach=function(t){l||(i(l),l=0),a.detach(e,t)},this.reset=function(){e.resizeSensor.resetSensor()}};if(a.reset=function(e){n(e,(function(e){e.resizeSensor.resetSensor()}))},a.detach=function(e,t){n(e,(function(e){e&&(e.resizedAttached&&"function"==typeof t&&(e.resizedAttached.remove(t),e.resizedAttached.length())||e.resizeSensor&&(e.contains(e.resizeSensor)&&e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached))}))},"undefined"!=typeof MutationObserver){var l=new MutationObserver((function(e){for(var t in e)if(e.hasOwnProperty(t))for(var i=e[t].addedNodes,n=0;n<i.length;n++)i[n].resizeSensor&&a.reset(i[n])}));document.addEventListener("DOMContentLoaded",(function(e){l.observe(document.body,{childList:!0,subtree:!0})}))}return a})?n.call(t,i,t,e):n)||(e.exports=s)},734:(e,t,i)=>{!function(e){function t(e){var t,n,s;return this.length?((t=this[0]).ownerDocument?s=t.ownerDocument:t=(s=t).documentElement,null==e?s.exitFullscreen||s.webkitExitFullscreen||s.webkitCancelFullScreen||s.msExitFullscreen||s.mozCancelFullScreen?(e=i(s))&&(s.fullscreenElement||s.webkitFullscreenElement||s.webkitCurrentFullScreenElement||s.msFullscreenElement||s.mozFullScreenElement)||e:null:e?((n=t.requestFullscreen||t.webkitRequestFullscreen||t.webkitRequestFullScreen||t.msRequestFullscreen||t.mozRequestFullScreen)&&n.call(t),this):((n=s.exitFullscreen||s.webkitExitFullscreen||s.webkitCancelFullScreen||s.msExitFullscreen||s.mozCancelFullScreen)&&i(s)&&n.call(s),this)):this}function i(e){return!!(e.fullscreenElement||e.msFullscreenElement||e.webkitIsFullScreen||e.mozFullScreen)}function n(t){e(document).trigger(new e.Event("fullscreenchange"))}function s(t){e(document).trigger(new e.Event("fullscreenerror"))}e.fn.fullScreen=t,e.fn.toggleFullScreen=function(){return t.call(this,!t.call(this))},function(){var t,i,r;(t=document).webkitCancelFullScreen?(i="webkitfullscreenchange",r="webkitfullscreenerror"):t.msExitFullscreen?(i="MSFullscreenChange",r="MSFullscreenError"):t.mozCancelFullScreen?(i="mozfullscreenchange",r="mozfullscreenerror"):(i="fullscreenchange",r="fullscreenerror"),e(document).bind(i,n),e(document).bind(r,s)}()}(i(464))},520:(e,t,i)=>{var n,s,r;s=[i(464)],void 0===(r="function"==typeof(n=function(e){var t,i,n=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],r=Array.prototype.slice;if(e.event.fixHooks)for(var o=n.length;o;)e.event.fixHooks[n[--o]]=e.event.mouseHooks;var a=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=s.length;t;)this.addEventListener(s[--t],l,!1);else this.onmousewheel=l;e.data(this,"mousewheel-line-height",a.getLineHeight(this)),e.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=s.length;t;)this.removeEventListener(s[--t],l,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t),n=i["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(n){var s=n||window.event,o=r.call(arguments,1),l=0,d=0,c=0,p=0,g=0,f=0;if((n=e.event.fix(s)).type="mousewheel","detail"in s&&(c=-1*s.detail),"wheelDelta"in s&&(c=s.wheelDelta),"wheelDeltaY"in s&&(c=s.wheelDeltaY),"wheelDeltaX"in s&&(d=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(d=-1*c,c=0),l=0===c?d:c,"deltaY"in s&&(l=c=-1*s.deltaY),"deltaX"in s&&(d=s.deltaX,0===c&&(l=-1*d)),0!==c||0!==d){if(1===s.deltaMode){var m=e.data(this,"mousewheel-line-height");l*=m,c*=m,d*=m}else if(2===s.deltaMode){var _=e.data(this,"mousewheel-page-height");l*=_,c*=_,d*=_}if(p=Math.max(Math.abs(c),Math.abs(d)),(!i||p<i)&&(i=p,h(s,p)&&(i/=40)),h(s,p)&&(l/=40,d/=40,c/=40),l=Math[l>=1?"floor":"ceil"](l/i),d=Math[d>=1?"floor":"ceil"](d/i),c=Math[c>=1?"floor":"ceil"](c/i),a.settings.normalizeOffset&&this.getBoundingClientRect){var x=this.getBoundingClientRect();g=n.clientX-x.left,f=n.clientY-x.top}return n.deltaX=d,n.deltaY=c,n.deltaFactor=i,n.offsetX=g,n.offsetY=f,n.deltaMode=0,o.unshift(n,l,d,c),t&&clearTimeout(t),t=setTimeout(u,200),(e.event.dispatch||e.event.handle).apply(this,o)}}function u(){i=null}function h(e,t){return a.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})?n.apply(t,s):n)||(e.exports=r)},464:function(e,t){var i,n,s;n="undefined"!=typeof window?window:this,s=function(n,s){var r=[],o=Object.getPrototypeOf,a=r.slice,l=r.flat?function(e){return r.flat.call(e)}:function(e){return r.concat.apply([],e)},u=r.push,h=r.indexOf,d={},c=d.toString,p=d.hasOwnProperty,g=p.toString,f=g.call(Object),m={},_=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},y=n.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,i){var n,s,r=(i=i||y).createElement("script");if(r.text=e,t)for(n in w)(s=t[n]||t.getAttribute&&t.getAttribute(n))&&r.setAttribute(n,s);i.head.appendChild(r).parentNode.removeChild(r)}function S(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[c.call(e)]||"object":typeof e}var T="3.7.1",v=/HTML$/i,O=function(e,t){return new O.fn.init(e,t)};function E(e){var t=!!e&&"length"in e&&e.length,i=S(e);return!_(e)&&!x(e)&&("array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e)}function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}O.fn=O.prototype={jquery:T,constructor:O,length:0,toArray:function(){return a.call(this)},get:function(e){return null==e?a.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=O.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return O.each(this,e)},map:function(e){return this.pushStack(O.map(this,(function(t,i){return e.call(t,i,t)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(O.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(O.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i<t?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:r.sort,splice:r.splice},O.extend=O.fn.extend=function(){var e,t,i,n,s,r,o=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof o&&(u=o,o=arguments[a]||{},a++),"object"==typeof o||_(o)||(o={}),a===l&&(o=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)n=e[t],"__proto__"!==t&&o!==n&&(u&&n&&(O.isPlainObject(n)||(s=Array.isArray(n)))?(i=o[t],r=s&&!Array.isArray(i)?[]:s||O.isPlainObject(i)?i:{},s=!1,o[t]=O.extend(u,r,n)):void 0!==n&&(o[t]=n));return o},O.extend({expando:"jQuery"+(T+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,i;return!(!e||"[object Object]"!==c.call(e)||(t=o(e))&&("function"!=typeof(i=p.call(t,"constructor")&&t.constructor)||g.call(i)!==f))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,i){b(e,{nonce:t&&t.nonce},i)},each:function(e,t){var i,n=0;if(E(e))for(i=e.length;n<i&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e},text:function(e){var t,i="",n=0,s=e.nodeType;if(!s)for(;t=e[n++];)i+=O.text(t);return 1===s||11===s?e.textContent:9===s?e.documentElement.textContent:3===s||4===s?e.nodeValue:i},makeArray:function(e,t){var i=t||[];return null!=e&&(E(Object(e))?O.merge(i,"string"==typeof e?[e]:e):u.call(i,e)),i},inArray:function(e,t,i){return null==t?-1:h.call(t,e,i)},isXMLDoc:function(e){var t=e&&e.namespaceURI,i=e&&(e.ownerDocument||e).documentElement;return!v.test(t||i&&i.nodeName||"HTML")},merge:function(e,t){for(var i=+t.length,n=0,s=e.length;n<i;n++)e[s++]=t[n];return e.length=s,e},grep:function(e,t,i){for(var n=[],s=0,r=e.length,o=!i;s<r;s++)!t(e[s],s)!==o&&n.push(e[s]);return n},map:function(e,t,i){var n,s,r=0,o=[];if(E(e))for(n=e.length;r<n;r++)null!=(s=t(e[r],r,i))&&o.push(s);else for(r in e)null!=(s=t(e[r],r,i))&&o.push(s);return l(o)},guid:1,support:m}),"function"==typeof Symbol&&(O.fn[Symbol.iterator]=r[Symbol.iterator]),O.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){d["[object "+t+"]"]=t.toLowerCase()}));var C=r.pop,F=r.sort,I=r.splice,M="[\\x20\\t\\r\\n\\f]",D=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g");O.contains=function(e,t){var i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(e.contains?e.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))};var P=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function R(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}O.escapeSelector=function(e){return(e+"").replace(P,R)};var A=y,V=u;!function(){var e,t,i,s,o,l,u,d,c,g,f=V,_=O.expando,x=0,y=0,w=ee(),b=ee(),S=ee(),T=ee(),v=function(e,t){return e===t&&(o=!0),0},E="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",R="\\["+M+"*("+P+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+M+"*\\]",L=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),U=new RegExp("^"+M+"*,"+M+"*"),X=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),k=new RegExp(M+"|>"),j=new RegExp(L),z=new RegExp("^"+P+"$"),G={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+E+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,W=/[+~]/,$=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),J=function(e,t){var i="0x"+e.slice(1)-65536;return t||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},K=function(){le()},Z=ce((function(e){return!0===e.disabled&&N(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{f.apply(r=a.call(A.childNodes),A.childNodes),r[A.childNodes.length].nodeType}catch(e){f={apply:function(e,t){V.apply(e,a.call(t))},call:function(e){V.apply(e,a.call(arguments,1))}}}function Q(e,t,i,n){var s,r,o,a,u,h,p,g=t&&t.ownerDocument,x=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==x&&9!==x&&11!==x)return i;if(!n&&(le(t),t=t||l,d)){if(11!==x&&(u=Y.exec(e)))if(s=u[1]){if(9===x){if(!(o=t.getElementById(s)))return i;if(o.id===s)return f.call(i,o),i}else if(g&&(o=g.getElementById(s))&&Q.contains(t,o)&&o.id===s)return f.call(i,o),i}else{if(u[2])return f.apply(i,t.getElementsByTagName(e)),i;if((s=u[3])&&t.getElementsByClassName)return f.apply(i,t.getElementsByClassName(s)),i}if(!(T[e+" "]||c&&c.test(e))){if(p=e,g=t,1===x&&(k.test(e)||X.test(e))){for((g=W.test(e)&&ae(t.parentNode)||t)==t&&m.scope||((a=t.getAttribute("id"))?a=O.escapeSelector(a):t.setAttribute("id",a=_)),r=(h=he(e)).length;r--;)h[r]=(a?"#"+a:":scope")+" "+de(h[r]);p=h.join(",")}try{return f.apply(i,g.querySelectorAll(p)),i}catch(t){T(e,!0)}finally{a===_&&t.removeAttribute("id")}}}return xe(e.replace(D,"$1"),t,i,n)}function ee(){var e=[];return function i(n,s){return e.push(n+" ")>t.cacheLength&&delete i[e.shift()],i[n+" "]=s}}function te(e){return e[_]=!0,e}function ie(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ne(e){return function(t){return N(t,"input")&&t.type===e}}function se(e){return function(t){return(N(t,"input")||N(t,"button"))&&t.type===e}}function re(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Z(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function oe(e){return te((function(t){return t=+t,te((function(i,n){for(var s,r=e([],i.length,t),o=r.length;o--;)i[s=r[o]]&&(i[s]=!(n[s]=i[s]))}))}))}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var i,n=e?e.ownerDocument||e:A;return n!=l&&9===n.nodeType&&n.documentElement?(u=(l=n).documentElement,d=!O.isXMLDoc(l),g=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&A!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",K),m.getById=ie((function(e){return u.appendChild(e).id=O.expando,!l.getElementsByName||!l.getElementsByName(O.expando).length})),m.disconnectedMatch=ie((function(e){return g.call(e,"*")})),m.scope=ie((function(){return l.querySelectorAll(":scope")})),m.cssHas=ie((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),m.getById?(t.filter.ID=function(e){var t=e.replace($,J);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var i=t.getElementById(e);return i?[i]:[]}}):(t.filter.ID=function(e){var t=e.replace($,J);return function(e){var i=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var i,n,s,r=t.getElementById(e);if(r){if((i=r.getAttributeNode("id"))&&i.value===e)return[r];for(s=t.getElementsByName(e),n=0;r=s[n++];)if((i=r.getAttributeNode("id"))&&i.value===e)return[r]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},c=[],ie((function(e){var t;u.appendChild(e).innerHTML="<a id='"+_+"' href='' disabled='disabled'></a><select id='"+_+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||c.push("\\["+M+"*(?:value|"+E+")"),e.querySelectorAll("[id~="+_+"-]").length||c.push("~="),e.querySelectorAll("a#"+_+"+*").length||c.push(".#.+[+~]"),e.querySelectorAll(":checked").length||c.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),u.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&c.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||c.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")")})),m.cssHas||c.push(":has"),c=c.length&&new RegExp(c.join("|")),v=function(e,t){if(e===t)return o=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===i?e===l||e.ownerDocument==A&&Q.contains(A,e)?-1:t===l||t.ownerDocument==A&&Q.contains(A,t)?1:s?h.call(s,e)-h.call(s,t):0:4&i?-1:1)},l):l}for(e in Q.matches=function(e,t){return Q(e,null,null,t)},Q.matchesSelector=function(e,t){if(le(e),d&&!T[t+" "]&&(!c||!c.test(t)))try{var i=g.call(e,t);if(i||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){T(t,!0)}return Q(t,l,null,[e]).length>0},Q.contains=function(e,t){return(e.ownerDocument||e)!=l&&le(e),O.contains(e,t)},Q.attr=function(e,i){(e.ownerDocument||e)!=l&&le(e);var n=t.attrHandle[i.toLowerCase()],s=n&&p.call(t.attrHandle,i.toLowerCase())?n(e,i,!d):void 0;return void 0!==s?s:e.getAttribute(i)},Q.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},O.uniqueSort=function(e){var t,i=[],n=0,r=0;if(o=!m.sortStable,s=!m.sortStable&&a.call(e,0),F.call(e,v),o){for(;t=e[r++];)t===e[r]&&(n=i.push(r));for(;n--;)I.call(e,i[n],1)}return s=null,e},O.fn.uniqueSort=function(){return this.pushStack(O.uniqueSort(a.apply(this)))},t=O.expr={cacheLength:50,createPseudo:te,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,J),e[3]=(e[3]||e[4]||e[5]||"").replace($,J),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Q.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Q.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&j.test(i)&&(t=he(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace($,J).toLowerCase();return"*"===e?function(){return!0}:function(e){return N(e,t)}},CLASS:function(e){var t=w[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&w(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,i){return function(n){var s=Q.attr(n,e);return null==s?"!="===t:!t||(s+="","="===t?s===i:"!="===t?s!==i:"^="===t?i&&0===s.indexOf(i):"*="===t?i&&s.indexOf(i)>-1:"$="===t?i&&s.slice(-i.length)===i:"~="===t?(" "+s.replace(B," ")+" ").indexOf(i)>-1:"|="===t&&(s===i||s.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,i,n,s){var r="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===n&&0===s?function(e){return!!e.parentNode}:function(t,i,l){var u,h,d,c,p,g=r!==o?"nextSibling":"previousSibling",f=t.parentNode,m=a&&t.nodeName.toLowerCase(),y=!l&&!a,w=!1;if(f){if(r){for(;g;){for(d=t;d=d[g];)if(a?N(d,m):1===d.nodeType)return!1;p=g="only"===e&&!p&&"nextSibling"}return!0}if(p=[o?f.firstChild:f.lastChild],o&&y){for(w=(c=(u=(h=f[_]||(f[_]={}))[e]||[])[0]===x&&u[1])&&u[2],d=c&&f.childNodes[c];d=++c&&d&&d[g]||(w=c=0)||p.pop();)if(1===d.nodeType&&++w&&d===t){h[e]=[x,c,w];break}}else if(y&&(w=c=(u=(h=t[_]||(t[_]={}))[e]||[])[0]===x&&u[1]),!1===w)for(;(d=++c&&d&&d[g]||(w=c=0)||p.pop())&&(!(a?N(d,m):1===d.nodeType)||!++w||(y&&((h=d[_]||(d[_]={}))[e]=[x,w]),d!==t)););return(w-=s)===n||w%n==0&&w/n>=0}}},PSEUDO:function(e,i){var n,s=t.pseudos[e]||t.setFilters[e.toLowerCase()]||Q.error("unsupported pseudo: "+e);return s[_]?s(i):s.length>1?(n=[e,e,"",i],t.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,t){for(var n,r=s(e,i),o=r.length;o--;)e[n=h.call(e,r[o])]=!(t[n]=r[o])})):function(e){return s(e,0,n)}):s}},pseudos:{not:te((function(e){var t=[],i=[],n=_e(e.replace(D,"$1"));return n[_]?te((function(e,t,i,s){for(var r,o=n(e,null,s,[]),a=e.length;a--;)(r=o[a])&&(e[a]=!(t[a]=r))})):function(e,s,r){return t[0]=e,n(t,null,r,i),t[0]=null,!i.pop()}})),has:te((function(e){return function(t){return Q(e,t).length>0}})),contains:te((function(e){return e=e.replace($,J),function(t){return(t.textContent||O.text(t)).indexOf(e)>-1}})),lang:te((function(e){return z.test(e||"")||Q.error("unsupported lang: "+e),e=e.replace($,J).toLowerCase(),function(t){var i;do{if(i=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:re(!1),disabled:re(!0),checked:function(e){return N(e,"input")&&!!e.checked||N(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return H.test(e.nodeName)},button:function(e){return N(e,"input")&&"button"===e.type||N(e,"button")},text:function(e){var t;return N(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:oe((function(){return[0]})),last:oe((function(e,t){return[t-1]})),eq:oe((function(e,t,i){return[i<0?i+t:i]})),even:oe((function(e,t){for(var i=0;i<t;i+=2)e.push(i);return e})),odd:oe((function(e,t){for(var i=1;i<t;i+=2)e.push(i);return e})),lt:oe((function(e,t,i){var n;for(n=i<0?i+t:i>t?t:i;--n>=0;)e.push(n);return e})),gt:oe((function(e,t,i){for(var n=i<0?i+t:i;++n<t;)e.push(n);return e}))}},t.pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=ne(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=se(e);function ue(){}function he(e,i){var n,s,r,o,a,l,u,h=b[e+" "];if(h)return i?0:h.slice(0);for(a=e,l=[],u=t.preFilter;a;){for(o in n&&!(s=U.exec(a))||(s&&(a=a.slice(s[0].length)||a),l.push(r=[])),n=!1,(s=X.exec(a))&&(n=s.shift(),r.push({value:n,type:s[0].replace(D," ")}),a=a.slice(n.length)),t.filter)!(s=G[o].exec(a))||u[o]&&!(s=u[o](s))||(n=s.shift(),r.push({value:n,type:o,matches:s}),a=a.slice(n.length));if(!n)break}return i?a.length:a?Q.error(e):b(e,l).slice(0)}function de(e){for(var t=0,i=e.length,n="";t<i;t++)n+=e[t].value;return n}function ce(e,t,i){var n=t.dir,s=t.next,r=s||n,o=i&&"parentNode"===r,a=y++;return t.first?function(t,i,s){for(;t=t[n];)if(1===t.nodeType||o)return e(t,i,s);return!1}:function(t,i,l){var u,h,d=[x,a];if(l){for(;t=t[n];)if((1===t.nodeType||o)&&e(t,i,l))return!0}else for(;t=t[n];)if(1===t.nodeType||o)if(h=t[_]||(t[_]={}),s&&N(t,s))t=t[n]||t;else{if((u=h[r])&&u[0]===x&&u[1]===a)return d[2]=u[2];if(h[r]=d,d[2]=e(t,i,l))return!0}return!1}}function pe(e){return e.length>1?function(t,i,n){for(var s=e.length;s--;)if(!e[s](t,i,n))return!1;return!0}:e[0]}function ge(e,t,i,n,s){for(var r,o=[],a=0,l=e.length,u=null!=t;a<l;a++)(r=e[a])&&(i&&!i(r,n,s)||(o.push(r),u&&t.push(a)));return o}function fe(e,t,i,n,s,r){return n&&!n[_]&&(n=fe(n)),s&&!s[_]&&(s=fe(s,r)),te((function(r,o,a,l){var u,d,c,p,g=[],m=[],_=o.length,x=r||function(e,t,i){for(var n=0,s=t.length;n<s;n++)Q(e,t[n],i);return i}(t||"*",a.nodeType?[a]:a,[]),y=!e||!r&&t?x:ge(x,g,e,a,l);if(i?i(y,p=s||(r?e:_||n)?[]:o,a,l):p=y,n)for(u=ge(p,m),n(u,[],a,l),d=u.length;d--;)(c=u[d])&&(p[m[d]]=!(y[m[d]]=c));if(r){if(s||e){if(s){for(u=[],d=p.length;d--;)(c=p[d])&&u.push(y[d]=c);s(null,p=[],u,l)}for(d=p.length;d--;)(c=p[d])&&(u=s?h.call(r,c):g[d])>-1&&(r[u]=!(o[u]=c))}}else p=ge(p===o?p.splice(_,p.length):p),s?s(null,o,p,l):f.apply(o,p)}))}function me(e){for(var n,s,r,o=e.length,a=t.relative[e[0].type],l=a||t.relative[" "],u=a?1:0,d=ce((function(e){return e===n}),l,!0),c=ce((function(e){return h.call(n,e)>-1}),l,!0),p=[function(e,t,s){var r=!a&&(s||t!=i)||((n=t).nodeType?d(e,t,s):c(e,t,s));return n=null,r}];u<o;u++)if(s=t.relative[e[u].type])p=[ce(pe(p),s)];else{if((s=t.filter[e[u].type].apply(null,e[u].matches))[_]){for(r=++u;r<o&&!t.relative[e[r].type];r++);return fe(u>1&&pe(p),u>1&&de(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(D,"$1"),s,u<r&&me(e.slice(u,r)),r<o&&me(e=e.slice(r)),r<o&&de(e))}p.push(s)}return pe(p)}function _e(e,n){var s,r=[],o=[],a=S[e+" "];if(!a){for(n||(n=he(e)),s=n.length;s--;)(a=me(n[s]))[_]?r.push(a):o.push(a);a=S(e,function(e,n){var s=n.length>0,r=e.length>0,o=function(o,a,u,h,c){var p,g,m,_=0,y="0",w=o&&[],b=[],S=i,T=o||r&&t.find.TAG("*",c),v=x+=null==S?1:Math.random()||.1,E=T.length;for(c&&(i=a==l||a||c);y!==E&&null!=(p=T[y]);y++){if(r&&p){for(g=0,a||p.ownerDocument==l||(le(p),u=!d);m=e[g++];)if(m(p,a||l,u)){f.call(h,p);break}c&&(x=v)}s&&((p=!m&&p)&&_--,o&&w.push(p))}if(_+=y,s&&y!==_){for(g=0;m=n[g++];)m(w,b,a,u);if(o){if(_>0)for(;y--;)w[y]||b[y]||(b[y]=C.call(h));b=ge(b)}f.apply(h,b),c&&!o&&b.length>0&&_+n.length>1&&O.uniqueSort(h)}return c&&(x=v,i=S),w};return s?te(o):o}(o,r)),a.selector=e}return a}function xe(e,i,n,s){var r,o,a,l,u,h="function"==typeof e&&e,c=!s&&he(e=h.selector||e);if(n=n||[],1===c.length){if((o=c[0]=c[0].slice(0)).length>2&&"ID"===(a=o[0]).type&&9===i.nodeType&&d&&t.relative[o[1].type]){if(!(i=(t.find.ID(a.matches[0].replace($,J),i)||[])[0]))return n;h&&(i=i.parentNode),e=e.slice(o.shift().value.length)}for(r=G.needsContext.test(e)?0:o.length;r--&&(a=o[r],!t.relative[l=a.type]);)if((u=t.find[l])&&(s=u(a.matches[0].replace($,J),W.test(o[0].type)&&ae(i.parentNode)||i))){if(o.splice(r,1),!(e=s.length&&de(o)))return f.apply(n,s),n;break}}return(h||_e(e,c))(s,i,!d,n,!i||W.test(e)&&ae(i.parentNode)||i),n}ue.prototype=t.filters=t.pseudos,t.setFilters=new ue,m.sortStable=_.split("").sort(v).join("")===_,le(),m.sortDetached=ie((function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))})),O.find=Q,O.expr[":"]=O.expr.pseudos,O.unique=O.uniqueSort,Q.compile=_e,Q.select=xe,Q.setDocument=le,Q.tokenize=he,Q.escape=O.escapeSelector,Q.getText=O.text,Q.isXML=O.isXMLDoc,Q.selectors=O.expr,Q.support=O.support,Q.uniqueSort=O.uniqueSort}();var L=function(e,t,i){for(var n=[],s=void 0!==i;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(s&&O(e).is(i))break;n.push(e)}return n},B=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},U=O.expr.match.needsContext,X=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function k(e,t,i){return _(t)?O.grep(e,(function(e,n){return!!t.call(e,n,e)!==i})):t.nodeType?O.grep(e,(function(e){return e===t!==i})):"string"!=typeof t?O.grep(e,(function(e){return h.call(t,e)>-1!==i})):O.filter(t,e,i)}O.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?O.find.matchesSelector(n,e)?[n]:[]:O.find.matches(e,O.grep(t,(function(e){return 1===e.nodeType})))},O.fn.extend({find:function(e){var t,i,n=this.length,s=this;if("string"!=typeof e)return this.pushStack(O(e).filter((function(){for(t=0;t<n;t++)if(O.contains(s[t],this))return!0})));for(i=this.pushStack([]),t=0;t<n;t++)O.find(e,s[t],i);return n>1?O.uniqueSort(i):i},filter:function(e){return this.pushStack(k(this,e||[],!1))},not:function(e){return this.pushStack(k(this,e||[],!0))},is:function(e){return!!k(this,"string"==typeof e&&U.test(e)?O(e):e||[],!1).length}});var j,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(O.fn.init=function(e,t,i){var n,s;if(!e)return this;if(i=i||j,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:z.exec(e))||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof O?t[0]:t,O.merge(this,O.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:y,!0)),X.test(n[1])&&O.isPlainObject(t))for(n in t)_(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(s=y.getElementById(n[2]))&&(this[0]=s,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):_(e)?void 0!==i.ready?i.ready(e):e(O):O.makeArray(e,this)}).prototype=O.fn,j=O(y);var G=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function q(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}O.fn.extend({has:function(e){var t=O(e,this),i=t.length;return this.filter((function(){for(var e=0;e<i;e++)if(O.contains(this,t[e]))return!0}))},closest:function(e,t){var i,n=0,s=this.length,r=[],o="string"!=typeof e&&O(e);if(!U.test(e))for(;n<s;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(o?o.index(i)>-1:1===i.nodeType&&O.find.matchesSelector(i,e))){r.push(i);break}return this.pushStack(r.length>1?O.uniqueSort(r):r)},index:function(e){return e?"string"==typeof e?h.call(O(e),this[0]):h.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(O.uniqueSort(O.merge(this.get(),O(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),O.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return L(e,"parentNode")},parentsUntil:function(e,t,i){return L(e,"parentNode",i)},next:function(e){return q(e,"nextSibling")},prev:function(e){return q(e,"previousSibling")},nextAll:function(e){return L(e,"nextSibling")},prevAll:function(e){return L(e,"previousSibling")},nextUntil:function(e,t,i){return L(e,"nextSibling",i)},prevUntil:function(e,t,i){return L(e,"previousSibling",i)},siblings:function(e){return B((e.parentNode||{}).firstChild,e)},children:function(e){return B(e.firstChild)},contents:function(e){return null!=e.contentDocument&&o(e.contentDocument)?e.contentDocument:(N(e,"template")&&(e=e.content||e),O.merge([],e.childNodes))}},(function(e,t){O.fn[e]=function(i,n){var s=O.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=O.filter(n,s)),this.length>1&&(H[e]||O.uniqueSort(s),G.test(e)&&s.reverse()),this.pushStack(s)}}));var Y=/[^\x20\t\r\n\f]+/g;function W(e){return e}function $(e){throw e}function J(e,t,i,n){var s;try{e&&_(s=e.promise)?s.call(e).done(t).fail(i):e&&_(s=e.then)?s.call(e,t,i):t.apply(void 0,[e].slice(n))}catch(e){i.apply(void 0,[e])}}O.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return O.each(e.match(Y)||[],(function(e,i){t[i]=!0})),t}(e):O.extend({},e);var t,i,n,s,r=[],o=[],a=-1,l=function(){for(s=s||e.once,n=t=!0;o.length;a=-1)for(i=o.shift();++a<r.length;)!1===r[a].apply(i[0],i[1])&&e.stopOnFalse&&(a=r.length,i=!1);e.memory||(i=!1),t=!1,s&&(r=i?[]:"")},u={add:function(){return r&&(i&&!t&&(a=r.length-1,o.push(i)),function t(i){O.each(i,(function(i,n){_(n)?e.unique&&u.has(n)||r.push(n):n&&n.length&&"string"!==S(n)&&t(n)}))}(arguments),i&&!t&&l()),this},remove:function(){return O.each(arguments,(function(e,t){for(var i;(i=O.inArray(t,r,i))>-1;)r.splice(i,1),i<=a&&a--})),this},has:function(e){return e?O.inArray(e,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return s=o=[],r=i="",this},disabled:function(){return!r},lock:function(){return s=o=[],i||t||(r=i=""),this},locked:function(){return!!s},fireWith:function(e,i){return s||(i=[e,(i=i||[]).slice?i.slice():i],o.push(i),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},O.extend({Deferred:function(e){var t=[["notify","progress",O.Callbacks("memory"),O.Callbacks("memory"),2],["resolve","done",O.Callbacks("once memory"),O.Callbacks("once memory"),0,"resolved"],["reject","fail",O.Callbacks("once memory"),O.Callbacks("once memory"),1,"rejected"]],i="pending",s={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},catch:function(e){return s.then(null,e)},pipe:function(){var e=arguments;return O.Deferred((function(i){O.each(t,(function(t,n){var s=_(e[n[4]])&&e[n[4]];r[n[1]]((function(){var e=s&&s.apply(this,arguments);e&&_(e.promise)?e.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,s?[e]:arguments)}))})),e=null})).promise()},then:function(e,i,s){var r=0;function o(e,t,i,s){return function(){var a=this,l=arguments,u=function(){var n,u;if(!(e<r)){if((n=i.apply(a,l))===t.promise())throw new TypeError("Thenable self-resolution");u=n&&("object"==typeof n||"function"==typeof n)&&n.then,_(u)?s?u.call(n,o(r,t,W,s),o(r,t,$,s)):(r++,u.call(n,o(r,t,W,s),o(r,t,$,s),o(r,t,W,t.notifyWith))):(i!==W&&(a=void 0,l=[n]),(s||t.resolveWith)(a,l))}},h=s?u:function(){try{u()}catch(n){O.Deferred.exceptionHook&&O.Deferred.exceptionHook(n,h.error),e+1>=r&&(i!==$&&(a=void 0,l=[n]),t.rejectWith(a,l))}};e?h():(O.Deferred.getErrorHook?h.error=O.Deferred.getErrorHook():O.Deferred.getStackHook&&(h.error=O.Deferred.getStackHook()),n.setTimeout(h))}}return O.Deferred((function(n){t[0][3].add(o(0,n,_(s)?s:W,n.notifyWith)),t[1][3].add(o(0,n,_(e)?e:W)),t[2][3].add(o(0,n,_(i)?i:$))})).promise()},promise:function(e){return null!=e?O.extend(e,s):s}},r={};return O.each(t,(function(e,n){var o=n[2],a=n[5];s[n[1]]=o.add,a&&o.add((function(){i=a}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),o.add(n[3].fire),r[n[0]]=function(){return r[n[0]+"With"](this===r?void 0:this,arguments),this},r[n[0]+"With"]=o.fireWith})),s.promise(r),e&&e.call(r,r),r},when:function(e){var t=arguments.length,i=t,n=Array(i),s=a.call(arguments),r=O.Deferred(),o=function(e){return function(i){n[e]=this,s[e]=arguments.length>1?a.call(arguments):i,--t||r.resolveWith(n,s)}};if(t<=1&&(J(e,r.done(o(i)).resolve,r.reject,!t),"pending"===r.state()||_(s[i]&&s[i].then)))return r.then();for(;i--;)J(s[i],o(i),r.reject);return r.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;O.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&K.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},O.readyException=function(e){n.setTimeout((function(){throw e}))};var Z=O.Deferred();function Q(){y.removeEventListener("DOMContentLoaded",Q),n.removeEventListener("load",Q),O.ready()}O.fn.ready=function(e){return Z.then(e).catch((function(e){O.readyException(e)})),this},O.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--O.readyWait:O.isReady)||(O.isReady=!0,!0!==e&&--O.readyWait>0||Z.resolveWith(y,[O]))}}),O.ready.then=Z.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(O.ready):(y.addEventListener("DOMContentLoaded",Q),n.addEventListener("load",Q));var ee=function(e,t,i,n,s,r,o){var a=0,l=e.length,u=null==i;if("object"===S(i))for(a in s=!0,i)ee(e,t,a,i[a],!0,r,o);else if(void 0!==n&&(s=!0,_(n)||(o=!0),u&&(o?(t.call(e,n),t=null):(u=t,t=function(e,t,i){return u.call(O(e),i)})),t))for(;a<l;a++)t(e[a],i,o?n:n.call(e[a],a,t(e[a],i)));return s?e:u?t.call(e):l?t(e[0],i):r},te=/^-ms-/,ie=/-([a-z])/g;function ne(e,t){return t.toUpperCase()}function se(e){return e.replace(te,"ms-").replace(ie,ne)}var re=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function oe(){this.expando=O.expando+oe.uid++}oe.uid=1,oe.prototype={cache:function(e){var t=e[this.expando];return t||(t={},re(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,i){var n,s=this.cache(e);if("string"==typeof t)s[se(t)]=i;else for(n in t)s[se(n)]=t[n];return s},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][se(t)]},access:function(e,t,i){return void 0===t||t&&"string"==typeof t&&void 0===i?this.get(e,t):(this.set(e,t,i),void 0!==i?i:t)},remove:function(e,t){var i,n=e[this.expando];if(void 0!==n){if(void 0!==t){i=(t=Array.isArray(t)?t.map(se):(t=se(t))in n?[t]:t.match(Y)||[]).length;for(;i--;)delete n[t[i]]}(void 0===t||O.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!O.isEmptyObject(t)}};var ae=new oe,le=new oe,ue=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,he=/[A-Z]/g;function de(e,t,i){var n;if(void 0===i&&1===e.nodeType)if(n="data-"+t.replace(he,"-$&").toLowerCase(),"string"==typeof(i=e.getAttribute(n))){try{i=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ue.test(e)?JSON.parse(e):e)}(i)}catch(e){}le.set(e,t,i)}else i=void 0;return i}O.extend({hasData:function(e){return le.hasData(e)||ae.hasData(e)},data:function(e,t,i){return le.access(e,t,i)},removeData:function(e,t){le.remove(e,t)},_data:function(e,t,i){return ae.access(e,t,i)},_removeData:function(e,t){ae.remove(e,t)}}),O.fn.extend({data:function(e,t){var i,n,s,r=this[0],o=r&&r.attributes;if(void 0===e){if(this.length&&(s=le.get(r),1===r.nodeType&&!ae.get(r,"hasDataAttrs"))){for(i=o.length;i--;)o[i]&&0===(n=o[i].name).indexOf("data-")&&(n=se(n.slice(5)),de(r,n,s[n]));ae.set(r,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each((function(){le.set(this,e)})):ee(this,(function(t){var i;if(r&&void 0===t)return void 0!==(i=le.get(r,e))||void 0!==(i=de(r,e))?i:void 0;this.each((function(){le.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){le.remove(this,e)}))}}),O.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=ae.get(e,t),i&&(!n||Array.isArray(i)?n=ae.access(e,t,O.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=O.queue(e,t),n=i.length,s=i.shift(),r=O._queueHooks(e,t);"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===t&&i.unshift("inprogress"),delete r.stop,s.call(e,(function(){O.dequeue(e,t)}),r)),!n&&r&&r.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return ae.get(e,i)||ae.access(e,i,{empty:O.Callbacks("once memory").add((function(){ae.remove(e,[t+"queue",i])}))})}}),O.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length<i?O.queue(this[0],e):void 0===t?this:this.each((function(){var i=O.queue(this,e,t);O._queueHooks(this,e),"fx"===e&&"inprogress"!==i[0]&&O.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){O.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,s=O.Deferred(),r=this,o=this.length,a=function(){--n||s.resolveWith(r,[r])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(i=ae.get(r[o],e+"queueHooks"))&&i.empty&&(n++,i.empty.add(a));return a(),s.promise(t)}});var ce=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,pe=new RegExp("^(?:([+-])=|)("+ce+")([a-z%]*)$","i"),ge=["Top","Right","Bottom","Left"],fe=y.documentElement,me=function(e){return O.contains(e.ownerDocument,e)},_e={composed:!0};fe.getRootNode&&(me=function(e){return O.contains(e.ownerDocument,e)||e.getRootNode(_e)===e.ownerDocument});var xe=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&me(e)&&"none"===O.css(e,"display")};function ye(e,t,i,n){var s,r,o=20,a=n?function(){return n.cur()}:function(){return O.css(e,t,"")},l=a(),u=i&&i[3]||(O.cssNumber[t]?"":"px"),h=e.nodeType&&(O.cssNumber[t]||"px"!==u&&+l)&&pe.exec(O.css(e,t));if(h&&h[3]!==u){for(l/=2,u=u||h[3],h=+l||1;o--;)O.style(e,t,h+u),(1-r)*(1-(r=a()/l||.5))<=0&&(o=0),h/=r;h*=2,O.style(e,t,h+u),i=i||[]}return i&&(h=+h||+l||0,s=i[1]?h+(i[1]+1)*i[2]:+i[2],n&&(n.unit=u,n.start=h,n.end=s)),s}var we={};function be(e){var t,i=e.ownerDocument,n=e.nodeName,s=we[n];return s||(t=i.body.appendChild(i.createElement(n)),s=O.css(t,"display"),t.parentNode.removeChild(t),"none"===s&&(s="block"),we[n]=s,s)}function Se(e,t){for(var i,n,s=[],r=0,o=e.length;r<o;r++)(n=e[r]).style&&(i=n.style.display,t?("none"===i&&(s[r]=ae.get(n,"display")||null,s[r]||(n.style.display="")),""===n.style.display&&xe(n)&&(s[r]=be(n))):"none"!==i&&(s[r]="none",ae.set(n,"display",i)));for(r=0;r<o;r++)null!=s[r]&&(e[r].style.display=s[r]);return e}O.fn.extend({show:function(){return Se(this,!0)},hide:function(){return Se(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){xe(this)?O(this).show():O(this).hide()}))}});var Te,ve,Oe=/^(?:checkbox|radio)$/i,Ee=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ne=/^$|^module$|\/(?:java|ecma)script/i;Te=y.createDocumentFragment().appendChild(y.createElement("div")),(ve=y.createElement("input")).setAttribute("type","radio"),ve.setAttribute("checked","checked"),ve.setAttribute("name","t"),Te.appendChild(ve),m.checkClone=Te.cloneNode(!0).cloneNode(!0).lastChild.checked,Te.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!Te.cloneNode(!0).lastChild.defaultValue,Te.innerHTML="<option></option>",m.option=!!Te.lastChild;var Ce={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Fe(e,t){var i;return i=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?O.merge([e],i):i}function Ie(e,t){for(var i=0,n=e.length;i<n;i++)ae.set(e[i],"globalEval",!t||ae.get(t[i],"globalEval"))}Ce.tbody=Ce.tfoot=Ce.colgroup=Ce.caption=Ce.thead,Ce.th=Ce.td,m.option||(Ce.optgroup=Ce.option=[1,"<select multiple='multiple'>","</select>"]);var Me=/<|&#?\w+;/;function De(e,t,i,n,s){for(var r,o,a,l,u,h,d=t.createDocumentFragment(),c=[],p=0,g=e.length;p<g;p++)if((r=e[p])||0===r)if("object"===S(r))O.merge(c,r.nodeType?[r]:r);else if(Me.test(r)){for(o=o||d.appendChild(t.createElement("div")),a=(Ee.exec(r)||["",""])[1].toLowerCase(),l=Ce[a]||Ce._default,o.innerHTML=l[1]+O.htmlPrefilter(r)+l[2],h=l[0];h--;)o=o.lastChild;O.merge(c,o.childNodes),(o=d.firstChild).textContent=""}else c.push(t.createTextNode(r));for(d.textContent="",p=0;r=c[p++];)if(n&&O.inArray(r,n)>-1)s&&s.push(r);else if(u=me(r),o=Fe(d.appendChild(r),"script"),u&&Ie(o),i)for(h=0;r=o[h++];)Ne.test(r.type||"")&&i.push(r);return d}var Pe=/^([^.]*)(?:\.(.+)|)/;function Re(){return!0}function Ae(){return!1}function Ve(e,t,i,n,s,r){var o,a;if("object"==typeof t){for(a in"string"!=typeof i&&(n=n||i,i=void 0),t)Ve(e,a,i,n,t[a],r);return e}if(null==n&&null==s?(s=i,n=i=void 0):null==s&&("string"==typeof i?(s=n,n=void 0):(s=n,n=i,i=void 0)),!1===s)s=Ae;else if(!s)return e;return 1===r&&(o=s,s=function(e){return O().off(e),o.apply(this,arguments)},s.guid=o.guid||(o.guid=O.guid++)),e.each((function(){O.event.add(this,t,s,n,i)}))}function Le(e,t,i){i?(ae.set(e,t,!1),O.event.add(e,t,{namespace:!1,handler:function(e){var i,n=ae.get(this,t);if(1&e.isTrigger&&this[t]){if(n)(O.event.special[t]||{}).delegateType&&e.stopPropagation();else if(n=a.call(arguments),ae.set(this,t,n),this[t](),i=ae.get(this,t),ae.set(this,t,!1),n!==i)return e.stopImmediatePropagation(),e.preventDefault(),i}else n&&(ae.set(this,t,O.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Re)}})):void 0===ae.get(e,t)&&O.event.add(e,t,Re)}O.event={global:{},add:function(e,t,i,n,s){var r,o,a,l,u,h,d,c,p,g,f,m=ae.get(e);if(re(e))for(i.handler&&(i=(r=i).handler,s=r.selector),s&&O.find.matchesSelector(fe,s),i.guid||(i.guid=O.guid++),(l=m.events)||(l=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(t){return void 0!==O&&O.event.triggered!==t.type?O.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(Y)||[""]).length;u--;)p=f=(a=Pe.exec(t[u])||[])[1],g=(a[2]||"").split(".").sort(),p&&(d=O.event.special[p]||{},p=(s?d.delegateType:d.bindType)||p,d=O.event.special[p]||{},h=O.extend({type:p,origType:f,data:n,handler:i,guid:i.guid,selector:s,needsContext:s&&O.expr.match.needsContext.test(s),namespace:g.join(".")},r),(c=l[p])||((c=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,n,g,o)||e.addEventListener&&e.addEventListener(p,o)),d.add&&(d.add.call(e,h),h.handler.guid||(h.handler.guid=i.guid)),s?c.splice(c.delegateCount++,0,h):c.push(h),O.event.global[p]=!0)},remove:function(e,t,i,n,s){var r,o,a,l,u,h,d,c,p,g,f,m=ae.hasData(e)&&ae.get(e);if(m&&(l=m.events)){for(u=(t=(t||"").match(Y)||[""]).length;u--;)if(p=f=(a=Pe.exec(t[u])||[])[1],g=(a[2]||"").split(".").sort(),p){for(d=O.event.special[p]||{},c=l[p=(n?d.delegateType:d.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=r=c.length;r--;)h=c[r],!s&&f!==h.origType||i&&i.guid!==h.guid||a&&!a.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(c.splice(r,1),h.selector&&c.delegateCount--,d.remove&&d.remove.call(e,h));o&&!c.length&&(d.teardown&&!1!==d.teardown.call(e,g,m.handle)||O.removeEvent(e,p,m.handle),delete l[p])}else for(p in l)O.event.remove(e,p+t[u],i,n,!0);O.isEmptyObject(l)&&ae.remove(e,"handle events")}},dispatch:function(e){var t,i,n,s,r,o,a=new Array(arguments.length),l=O.event.fix(e),u=(ae.get(this,"events")||Object.create(null))[l.type]||[],h=O.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){for(o=O.event.handlers.call(this,l,u),t=0;(s=o[t++])&&!l.isPropagationStopped();)for(l.currentTarget=s.elem,i=0;(r=s.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==r.namespace&&!l.rnamespace.test(r.namespace)||(l.handleObj=r,l.data=r.data,void 0!==(n=((O.event.special[r.origType]||{}).handle||r.handler).apply(s.elem,a))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(e,t){var i,n,s,r,o,a=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(r=[],o={},i=0;i<l;i++)void 0===o[s=(n=t[i]).selector+" "]&&(o[s]=n.needsContext?O(s,this).index(u)>-1:O.find(s,this,null,[u]).length),o[s]&&r.push(n);r.length&&a.push({elem:u,handlers:r})}return u=this,l<t.length&&a.push({elem:u,handlers:t.slice(l)}),a},addProp:function(e,t){Object.defineProperty(O.Event.prototype,e,{enumerable:!0,configurable:!0,get:_(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[O.expando]?e:new O.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Oe.test(t.type)&&t.click&&N(t,"input")&&Le(t,"click",!0),!1},trigger:function(e){var t=this||e;return Oe.test(t.type)&&t.click&&N(t,"input")&&Le(t,"click"),!0},_default:function(e){var t=e.target;return Oe.test(t.type)&&t.click&&N(t,"input")&&ae.get(t,"click")||N(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},O.removeEvent=function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i)},O.Event=function(e,t){if(!(this instanceof O.Event))return new O.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Re:Ae,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&O.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[O.expando]=!0},O.Event.prototype={constructor:O.Event,isDefaultPrevented:Ae,isPropagationStopped:Ae,isImmediatePropagationStopped:Ae,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Re,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Re,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Re,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},O.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},O.event.addProp),O.each({focus:"focusin",blur:"focusout"},(function(e,t){function i(e){if(y.documentMode){var i=ae.get(this,"handle"),n=O.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,i(e),n.target===n.currentTarget&&i(n)}else O.event.simulate(t,e.target,O.event.fix(e))}O.event.special[e]={setup:function(){var n;if(Le(this,e,!0),!y.documentMode)return!1;(n=ae.get(this,t))||this.addEventListener(t,i),ae.set(this,t,(n||0)+1)},trigger:function(){return Le(this,e),!0},teardown:function(){var e;if(!y.documentMode)return!1;(e=ae.get(this,t)-1)?ae.set(this,t,e):(this.removeEventListener(t,i),ae.remove(this,t))},_default:function(t){return ae.get(t.target,e)},delegateType:t},O.event.special[t]={setup:function(){var n=this.ownerDocument||this.document||this,s=y.documentMode?this:n,r=ae.get(s,t);r||(y.documentMode?this.addEventListener(t,i):n.addEventListener(e,i,!0)),ae.set(s,t,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,s=y.documentMode?this:n,r=ae.get(s,t)-1;r?ae.set(s,t,r):(y.documentMode?this.removeEventListener(t,i):n.removeEventListener(e,i,!0),ae.remove(s,t))}}})),O.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){O.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=e.relatedTarget,s=e.handleObj;return n&&(n===this||O.contains(this,n))||(e.type=s.origType,i=s.handler.apply(this,arguments),e.type=t),i}}})),O.fn.extend({on:function(e,t,i,n){return Ve(this,e,t,i,n)},one:function(e,t,i,n){return Ve(this,e,t,i,n,1)},off:function(e,t,i){var n,s;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,O(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(s in e)this.off(s,t,e[s]);return this}return!1!==t&&"function"!=typeof t||(i=t,t=void 0),!1===i&&(i=Ae),this.each((function(){O.event.remove(this,e,i,t)}))}});var Be=/<script|<style|<link/i,Ue=/checked\s*(?:[^=]|=\s*.checked.)/i,Xe=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function ke(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")&&O(e).children("tbody")[0]||e}function je(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ze(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ge(e,t){var i,n,s,r,o,a;if(1===t.nodeType){if(ae.hasData(e)&&(a=ae.get(e).events))for(s in ae.remove(t,"handle events"),a)for(i=0,n=a[s].length;i<n;i++)O.event.add(t,s,a[s][i]);le.hasData(e)&&(r=le.access(e),o=O.extend({},r),le.set(t,o))}}function He(e,t){var i=t.nodeName.toLowerCase();"input"===i&&Oe.test(e.type)?t.checked=e.checked:"input"!==i&&"textarea"!==i||(t.defaultValue=e.defaultValue)}function qe(e,t,i,n){t=l(t);var s,r,o,a,u,h,d=0,c=e.length,p=c-1,g=t[0],f=_(g);if(f||c>1&&"string"==typeof g&&!m.checkClone&&Ue.test(g))return e.each((function(s){var r=e.eq(s);f&&(t[0]=g.call(this,s,r.html())),qe(r,t,i,n)}));if(c&&(r=(s=De(t,e[0].ownerDocument,!1,e,n)).firstChild,1===s.childNodes.length&&(s=r),r||n)){for(a=(o=O.map(Fe(s,"script"),je)).length;d<c;d++)u=s,d!==p&&(u=O.clone(u,!0,!0),a&&O.merge(o,Fe(u,"script"))),i.call(e[d],u,d);if(a)for(h=o[o.length-1].ownerDocument,O.map(o,ze),d=0;d<a;d++)u=o[d],Ne.test(u.type||"")&&!ae.access(u,"globalEval")&&O.contains(h,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?O._evalUrl&&!u.noModule&&O._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},h):b(u.textContent.replace(Xe,""),u,h))}return e}function Ye(e,t,i){for(var n,s=t?O.filter(t,e):e,r=0;null!=(n=s[r]);r++)i||1!==n.nodeType||O.cleanData(Fe(n)),n.parentNode&&(i&&me(n)&&Ie(Fe(n,"script")),n.parentNode.removeChild(n));return e}O.extend({htmlPrefilter:function(e){return e},clone:function(e,t,i){var n,s,r,o,a=e.cloneNode(!0),l=me(e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||O.isXMLDoc(e)))for(o=Fe(a),n=0,s=(r=Fe(e)).length;n<s;n++)He(r[n],o[n]);if(t)if(i)for(r=r||Fe(e),o=o||Fe(a),n=0,s=r.length;n<s;n++)Ge(r[n],o[n]);else Ge(e,a);return(o=Fe(a,"script")).length>0&&Ie(o,!l&&Fe(e,"script")),a},cleanData:function(e){for(var t,i,n,s=O.event.special,r=0;void 0!==(i=e[r]);r++)if(re(i)){if(t=i[ae.expando]){if(t.events)for(n in t.events)s[n]?O.event.remove(i,n):O.removeEvent(i,n,t.handle);i[ae.expando]=void 0}i[le.expando]&&(i[le.expando]=void 0)}}}),O.fn.extend({detach:function(e){return Ye(this,e,!0)},remove:function(e){return Ye(this,e)},text:function(e){return ee(this,(function(e){return void 0===e?O.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return qe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ke(this,e).appendChild(e)}))},prepend:function(){return qe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ke(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return qe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return qe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(O.cleanData(Fe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return O.clone(this,e,t)}))},html:function(e){return ee(this,(function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Be.test(e)&&!Ce[(Ee.exec(e)||["",""])[1].toLowerCase()]){e=O.htmlPrefilter(e);try{for(;i<n;i++)1===(t=this[i]||{}).nodeType&&(O.cleanData(Fe(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return qe(this,arguments,(function(t){var i=this.parentNode;O.inArray(this,e)<0&&(O.cleanData(Fe(this)),i&&i.replaceChild(t,this))}),e)}}),O.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){O.fn[e]=function(e){for(var i,n=[],s=O(e),r=s.length-1,o=0;o<=r;o++)i=o===r?this:this.clone(!0),O(s[o])[t](i),u.apply(n,i.get());return this.pushStack(n)}}));var We=new RegExp("^("+ce+")(?!px)[a-z%]+$","i"),$e=/^--/,Je=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)},Ke=function(e,t,i){var n,s,r={};for(s in t)r[s]=e.style[s],e.style[s]=t[s];for(s in n=i.call(e),t)e.style[s]=r[s];return n},Ze=new RegExp(ge.join("|"),"i");function Qe(e,t,i){var n,s,r,o,a=$e.test(t),l=e.style;return(i=i||Je(e))&&(o=i.getPropertyValue(t)||i[t],a&&o&&(o=o.replace(D,"$1")||void 0),""!==o||me(e)||(o=O.style(e,t)),!m.pixelBoxStyles()&&We.test(o)&&Ze.test(t)&&(n=l.width,s=l.minWidth,r=l.maxWidth,l.minWidth=l.maxWidth=l.width=o,o=i.width,l.width=n,l.minWidth=s,l.maxWidth=r)),void 0!==o?o+"":o}function et(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(h){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",fe.appendChild(u).appendChild(h);var e=n.getComputedStyle(h);i="1%"!==e.top,l=12===t(e.marginLeft),h.style.right="60%",o=36===t(e.right),s=36===t(e.width),h.style.position="absolute",r=12===t(h.offsetWidth/3),fe.removeChild(u),h=null}}function t(e){return Math.round(parseFloat(e))}var i,s,r,o,a,l,u=y.createElement("div"),h=y.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===h.style.backgroundClip,O.extend(m,{boxSizingReliable:function(){return e(),s},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),i},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),r},reliableTrDimensions:function(){var e,t,i,s;return null==a&&(e=y.createElement("table"),t=y.createElement("tr"),i=y.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",i.style.height="9px",i.style.display="block",fe.appendChild(e).appendChild(t).appendChild(i),s=n.getComputedStyle(t),a=parseInt(s.height,10)+parseInt(s.borderTopWidth,10)+parseInt(s.borderBottomWidth,10)===t.offsetHeight,fe.removeChild(e)),a}}))}();var tt=["Webkit","Moz","ms"],it=y.createElement("div").style,nt={};function st(e){var t=O.cssProps[e]||nt[e];return t||(e in it?e:nt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),i=tt.length;i--;)if((e=tt[i]+t)in it)return e}(e)||e)}var rt=/^(none|table(?!-c[ea]).+)/,ot={position:"absolute",visibility:"hidden",display:"block"},at={letterSpacing:"0",fontWeight:"400"};function lt(e,t,i){var n=pe.exec(t);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):t}function ut(e,t,i,n,s,r){var o="width"===t?1:0,a=0,l=0,u=0;if(i===(n?"border":"content"))return 0;for(;o<4;o+=2)"margin"===i&&(u+=O.css(e,i+ge[o],!0,s)),n?("content"===i&&(l-=O.css(e,"padding"+ge[o],!0,s)),"margin"!==i&&(l-=O.css(e,"border"+ge[o]+"Width",!0,s))):(l+=O.css(e,"padding"+ge[o],!0,s),"padding"!==i?l+=O.css(e,"border"+ge[o]+"Width",!0,s):a+=O.css(e,"border"+ge[o]+"Width",!0,s));return!n&&r>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-r-l-a-.5))||0),l+u}function ht(e,t,i){var n=Je(e),s=(!m.boxSizingReliable()||i)&&"border-box"===O.css(e,"boxSizing",!1,n),r=s,o=Qe(e,t,n),a="offset"+t[0].toUpperCase()+t.slice(1);if(We.test(o)){if(!i)return o;o="auto"}return(!m.boxSizingReliable()&&s||!m.reliableTrDimensions()&&N(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===O.css(e,"display",!1,n))&&e.getClientRects().length&&(s="border-box"===O.css(e,"boxSizing",!1,n),(r=a in e)&&(o=e[a])),(o=parseFloat(o)||0)+ut(e,t,i||(s?"border":"content"),r,n,o)+"px"}function dt(e,t,i,n,s){return new dt.prototype.init(e,t,i,n,s)}O.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=Qe(e,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var s,r,o,a=se(t),l=$e.test(t),u=e.style;if(l||(t=st(a)),o=O.cssHooks[t]||O.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(s=o.get(e,!1,n))?s:u[t];"string"==(r=typeof i)&&(s=pe.exec(i))&&s[1]&&(i=ye(e,t,s),r="number"),null!=i&&i==i&&("number"!==r||l||(i+=s&&s[3]||(O.cssNumber[a]?"":"px")),m.clearCloneStyle||""!==i||0!==t.indexOf("background")||(u[t]="inherit"),o&&"set"in o&&void 0===(i=o.set(e,i,n))||(l?u.setProperty(t,i):u[t]=i))}},css:function(e,t,i,n){var s,r,o,a=se(t);return $e.test(t)||(t=st(a)),(o=O.cssHooks[t]||O.cssHooks[a])&&"get"in o&&(s=o.get(e,!0,i)),void 0===s&&(s=Qe(e,t,n)),"normal"===s&&t in at&&(s=at[t]),""===i||i?(r=parseFloat(s),!0===i||isFinite(r)?r||0:s):s}}),O.each(["height","width"],(function(e,t){O.cssHooks[t]={get:function(e,i,n){if(i)return!rt.test(O.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ht(e,t,n):Ke(e,ot,(function(){return ht(e,t,n)}))},set:function(e,i,n){var s,r=Je(e),o=!m.scrollboxSize()&&"absolute"===r.position,a=(o||n)&&"border-box"===O.css(e,"boxSizing",!1,r),l=n?ut(e,t,n,a,r):0;return a&&o&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(r[t])-ut(e,t,"border",!1,r)-.5)),l&&(s=pe.exec(i))&&"px"!==(s[3]||"px")&&(e.style[t]=i,i=O.css(e,t)),lt(0,i,l)}}})),O.cssHooks.marginLeft=et(m.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Qe(e,"marginLeft"))||e.getBoundingClientRect().left-Ke(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),O.each({margin:"",padding:"",border:"Width"},(function(e,t){O.cssHooks[e+t]={expand:function(i){for(var n=0,s={},r="string"==typeof i?i.split(" "):[i];n<4;n++)s[e+ge[n]+t]=r[n]||r[n-2]||r[0];return s}},"margin"!==e&&(O.cssHooks[e+t].set=lt)})),O.fn.extend({css:function(e,t){return ee(this,(function(e,t,i){var n,s,r={},o=0;if(Array.isArray(t)){for(n=Je(e),s=t.length;o<s;o++)r[t[o]]=O.css(e,t[o],!1,n);return r}return void 0!==i?O.style(e,t,i):O.css(e,t)}),e,t,arguments.length>1)}}),O.Tween=dt,dt.prototype={constructor:dt,init:function(e,t,i,n,s,r){this.elem=e,this.prop=i,this.easing=s||O.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=r||(O.cssNumber[i]?"":"px")},cur:function(){var e=dt.propHooks[this.prop];return e&&e.get?e.get(this):dt.propHooks._default.get(this)},run:function(e){var t,i=dt.propHooks[this.prop];return this.options.duration?this.pos=t=O.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):dt.propHooks._default.set(this),this}},dt.prototype.init.prototype=dt.prototype,dt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=O.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){O.fx.step[e.prop]?O.fx.step[e.prop](e):1!==e.elem.nodeType||!O.cssHooks[e.prop]&&null==e.elem.style[st(e.prop)]?e.elem[e.prop]=e.now:O.style(e.elem,e.prop,e.now+e.unit)}}},dt.propHooks.scrollTop=dt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},O.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},O.fx=dt.prototype.init,O.fx.step={};var ct,pt,gt=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;function mt(){pt&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(mt):n.setTimeout(mt,O.fx.interval),O.fx.tick())}function _t(){return n.setTimeout((function(){ct=void 0})),ct=Date.now()}function xt(e,t){var i,n=0,s={height:e};for(t=t?1:0;n<4;n+=2-t)s["margin"+(i=ge[n])]=s["padding"+i]=e;return t&&(s.opacity=s.width=e),s}function yt(e,t,i){for(var n,s=(wt.tweeners[t]||[]).concat(wt.tweeners["*"]),r=0,o=s.length;r<o;r++)if(n=s[r].call(i,t,e))return n}function wt(e,t,i){var n,s,r=0,o=wt.prefilters.length,a=O.Deferred().always((function(){delete l.elem})),l=function(){if(s)return!1;for(var t=ct||_t(),i=Math.max(0,u.startTime+u.duration-t),n=1-(i/u.duration||0),r=0,o=u.tweens.length;r<o;r++)u.tweens[r].run(n);return a.notifyWith(e,[u,n,i]),n<1&&o?i:(o||a.notifyWith(e,[u,1,0]),a.resolveWith(e,[u]),!1)},u=a.promise({elem:e,props:O.extend({},t),opts:O.extend(!0,{specialEasing:{},easing:O.easing._default},i),originalProperties:t,originalOptions:i,startTime:ct||_t(),duration:i.duration,tweens:[],createTween:function(t,i){var n=O.Tween(e,u.opts,t,i,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(n),n},stop:function(t){var i=0,n=t?u.tweens.length:0;if(s)return this;for(s=!0;i<n;i++)u.tweens[i].run(1);return t?(a.notifyWith(e,[u,1,0]),a.resolveWith(e,[u,t])):a.rejectWith(e,[u,t]),this}}),h=u.props;for(function(e,t){var i,n,s,r,o;for(i in e)if(s=t[n=se(i)],r=e[i],Array.isArray(r)&&(s=r[1],r=e[i]=r[0]),i!==n&&(e[n]=r,delete e[i]),(o=O.cssHooks[n])&&"expand"in o)for(i in r=o.expand(r),delete e[n],r)i in e||(e[i]=r[i],t[i]=s);else t[n]=s}(h,u.opts.specialEasing);r<o;r++)if(n=wt.prefilters[r].call(u,e,h,u.opts))return _(n.stop)&&(O._queueHooks(u.elem,u.opts.queue).stop=n.stop.bind(n)),n;return O.map(h,yt,u),_(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),O.fx.timer(O.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}O.Animation=O.extend(wt,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);return ye(i.elem,e,pe.exec(t),i),i}]},tweener:function(e,t){_(e)?(t=e,e=["*"]):e=e.match(Y);for(var i,n=0,s=e.length;n<s;n++)i=e[n],wt.tweeners[i]=wt.tweeners[i]||[],wt.tweeners[i].unshift(t)},prefilters:[function(e,t,i){var n,s,r,o,a,l,u,h,d="width"in t||"height"in t,c=this,p={},g=e.style,f=e.nodeType&&xe(e),m=ae.get(e,"fxshow");for(n in i.queue||(null==(o=O._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,c.always((function(){c.always((function(){o.unqueued--,O.queue(e,"fx").length||o.empty.fire()}))}))),t)if(s=t[n],gt.test(s)){if(delete t[n],r=r||"toggle"===s,s===(f?"hide":"show")){if("show"!==s||!m||void 0===m[n])continue;f=!0}p[n]=m&&m[n]||O.style(e,n)}if((l=!O.isEmptyObject(t))||!O.isEmptyObject(p))for(n in d&&1===e.nodeType&&(i.overflow=[g.overflow,g.overflowX,g.overflowY],null==(u=m&&m.display)&&(u=ae.get(e,"display")),"none"===(h=O.css(e,"display"))&&(u?h=u:(Se([e],!0),u=e.style.display||u,h=O.css(e,"display"),Se([e]))),("inline"===h||"inline-block"===h&&null!=u)&&"none"===O.css(e,"float")&&(l||(c.done((function(){g.display=u})),null==u&&(h=g.display,u="none"===h?"":h)),g.display="inline-block")),i.overflow&&(g.overflow="hidden",c.always((function(){g.overflow=i.overflow[0],g.overflowX=i.overflow[1],g.overflowY=i.overflow[2]}))),l=!1,p)l||(m?"hidden"in m&&(f=m.hidden):m=ae.access(e,"fxshow",{display:u}),r&&(m.hidden=!f),f&&Se([e],!0),c.done((function(){for(n in f||Se([e]),ae.remove(e,"fxshow"),p)O.style(e,n,p[n])}))),l=yt(f?m[n]:0,n,c),n in m||(m[n]=l.start,f&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?wt.prefilters.unshift(e):wt.prefilters.push(e)}}),O.speed=function(e,t,i){var n=e&&"object"==typeof e?O.extend({},e):{complete:i||!i&&t||_(e)&&e,duration:e,easing:i&&t||t&&!_(t)&&t};return O.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in O.fx.speeds?n.duration=O.fx.speeds[n.duration]:n.duration=O.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){_(n.old)&&n.old.call(this),n.queue&&O.dequeue(this,n.queue)},n},O.fn.extend({fadeTo:function(e,t,i,n){return this.filter(xe).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var s=O.isEmptyObject(e),r=O.speed(t,i,n),o=function(){var t=wt(this,O.extend({},e),r);(s||ae.get(this,"finish"))&&t.stop(!0)};return o.finish=o,s||!1===r.queue?this.each(o):this.queue(r.queue,o)},stop:function(e,t,i){var n=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,s=null!=e&&e+"queueHooks",r=O.timers,o=ae.get(this);if(s)o[s]&&o[s].stop&&n(o[s]);else for(s in o)o[s]&&o[s].stop&&ft.test(s)&&n(o[s]);for(s=r.length;s--;)r[s].elem!==this||null!=e&&r[s].queue!==e||(r[s].anim.stop(i),t=!1,r.splice(s,1));!t&&i||O.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,i=ae.get(this),n=i[e+"queue"],s=i[e+"queueHooks"],r=O.timers,o=n?n.length:0;for(i.finish=!0,O.queue(this,e,[]),s&&s.stop&&s.stop.call(this,!0),t=r.length;t--;)r[t].elem===this&&r[t].queue===e&&(r[t].anim.stop(!0),r.splice(t,1));for(t=0;t<o;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish}))}}),O.each(["toggle","show","hide"],(function(e,t){var i=O.fn[t];O.fn[t]=function(e,n,s){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(xt(t,!0),e,n,s)}})),O.each({slideDown:xt("show"),slideUp:xt("hide"),slideToggle:xt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){O.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}})),O.timers=[],O.fx.tick=function(){var e,t=0,i=O.timers;for(ct=Date.now();t<i.length;t++)(e=i[t])()||i[t]!==e||i.splice(t--,1);i.length||O.fx.stop(),ct=void 0},O.fx.timer=function(e){O.timers.push(e),O.fx.start()},O.fx.interval=13,O.fx.start=function(){pt||(pt=!0,mt())},O.fx.stop=function(){pt=null},O.fx.speeds={slow:600,fast:200,_default:400},O.fn.delay=function(e,t){return e=O.fx&&O.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,i){var s=n.setTimeout(t,e);i.stop=function(){n.clearTimeout(s)}}))},function(){var e=y.createElement("input"),t=y.createElement("select").appendChild(y.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=y.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var bt,St=O.expr.attrHandle;O.fn.extend({attr:function(e,t){return ee(this,O.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){O.removeAttr(this,e)}))}}),O.extend({attr:function(e,t,i){var n,s,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===e.getAttribute?O.prop(e,t,i):(1===r&&O.isXMLDoc(e)||(s=O.attrHooks[t.toLowerCase()]||(O.expr.match.bool.test(t)?bt:void 0)),void 0!==i?null===i?void O.removeAttr(e,t):s&&"set"in s&&void 0!==(n=s.set(e,i,t))?n:(e.setAttribute(t,i+""),i):s&&"get"in s&&null!==(n=s.get(e,t))?n:null==(n=O.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&N(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n=0,s=t&&t.match(Y);if(s&&1===e.nodeType)for(;i=s[n++];)e.removeAttribute(i)}}),bt={set:function(e,t,i){return!1===t?O.removeAttr(e,i):e.setAttribute(i,i),i}},O.each(O.expr.match.bool.source.match(/\w+/g),(function(e,t){var i=St[t]||O.find.attr;St[t]=function(e,t,n){var s,r,o=t.toLowerCase();return n||(r=St[o],St[o]=s,s=null!=i(e,t,n)?o:null,St[o]=r),s}}));var Tt=/^(?:input|select|textarea|button)$/i,vt=/^(?:a|area)$/i;function Ot(e){return(e.match(Y)||[]).join(" ")}function Et(e){return e.getAttribute&&e.getAttribute("class")||""}function Nt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(Y)||[]}O.fn.extend({prop:function(e,t){return ee(this,O.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[O.propFix[e]||e]}))}}),O.extend({prop:function(e,t,i){var n,s,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&O.isXMLDoc(e)||(t=O.propFix[t]||t,s=O.propHooks[t]),void 0!==i?s&&"set"in s&&void 0!==(n=s.set(e,i,t))?n:e[t]=i:s&&"get"in s&&null!==(n=s.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=O.find.attr(e,"tabindex");return t?parseInt(t,10):Tt.test(e.nodeName)||vt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(O.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),O.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){O.propFix[this.toLowerCase()]=this})),O.fn.extend({addClass:function(e){var t,i,n,s,r,o;return _(e)?this.each((function(t){O(this).addClass(e.call(this,t,Et(this)))})):(t=Nt(e)).length?this.each((function(){if(n=Et(this),i=1===this.nodeType&&" "+Ot(n)+" "){for(r=0;r<t.length;r++)s=t[r],i.indexOf(" "+s+" ")<0&&(i+=s+" ");o=Ot(i),n!==o&&this.setAttribute("class",o)}})):this},removeClass:function(e){var t,i,n,s,r,o;return _(e)?this.each((function(t){O(this).removeClass(e.call(this,t,Et(this)))})):arguments.length?(t=Nt(e)).length?this.each((function(){if(n=Et(this),i=1===this.nodeType&&" "+Ot(n)+" "){for(r=0;r<t.length;r++)for(s=t[r];i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");o=Ot(i),n!==o&&this.setAttribute("class",o)}})):this:this.attr("class","")},toggleClass:function(e,t){var i,n,s,r,o=typeof e,a="string"===o||Array.isArray(e);return _(e)?this.each((function(i){O(this).toggleClass(e.call(this,i,Et(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(i=Nt(e),this.each((function(){if(a)for(r=O(this),s=0;s<i.length;s++)n=i[s],r.hasClass(n)?r.removeClass(n):r.addClass(n);else void 0!==e&&"boolean"!==o||((n=Et(this))&&ae.set(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||!1===e?"":ae.get(this,"__className__")||""))})))},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&(" "+Ot(Et(i))+" ").indexOf(t)>-1)return!0;return!1}});var Ct=/\r/g;O.fn.extend({val:function(e){var t,i,n,s=this[0];return arguments.length?(n=_(e),this.each((function(i){var s;1===this.nodeType&&(null==(s=n?e.call(this,i,O(this).val()):e)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=O.map(s,(function(e){return null==e?"":e+""}))),(t=O.valHooks[this.type]||O.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,s,"value")||(this.value=s))}))):s?(t=O.valHooks[s.type]||O.valHooks[s.nodeName.toLowerCase()])&&"get"in t&&void 0!==(i=t.get(s,"value"))?i:"string"==typeof(i=s.value)?i.replace(Ct,""):null==i?"":i:void 0}}),O.extend({valHooks:{option:{get:function(e){var t=O.find.attr(e,"value");return null!=t?t:Ot(O.text(e))}},select:{get:function(e){var t,i,n,s=e.options,r=e.selectedIndex,o="select-one"===e.type,a=o?null:[],l=o?r+1:s.length;for(n=r<0?l:o?r:0;n<l;n++)if(((i=s[n]).selected||n===r)&&!i.disabled&&(!i.parentNode.disabled||!N(i.parentNode,"optgroup"))){if(t=O(i).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var i,n,s=e.options,r=O.makeArray(t),o=s.length;o--;)((n=s[o]).selected=O.inArray(O.valHooks.option.get(n),r)>-1)&&(i=!0);return i||(e.selectedIndex=-1),r}}}}),O.each(["radio","checkbox"],(function(){O.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=O.inArray(O(e).val(),t)>-1}},m.checkOn||(O.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Ft=n.location,It={guid:Date.now()},Mt=/\?/;O.parseXML=function(e){var t,i;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){}return i=t&&t.getElementsByTagName("parsererror")[0],t&&!i||O.error("Invalid XML: "+(i?O.map(i.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Pt=function(e){e.stopPropagation()};O.extend(O.event,{trigger:function(e,t,i,s){var r,o,a,l,u,h,d,c,g=[i||y],f=p.call(e,"type")?e.type:e,m=p.call(e,"namespace")?e.namespace.split("."):[];if(o=c=a=i=i||y,3!==i.nodeType&&8!==i.nodeType&&!Dt.test(f+O.event.triggered)&&(f.indexOf(".")>-1&&(m=f.split("."),f=m.shift(),m.sort()),u=f.indexOf(":")<0&&"on"+f,(e=e[O.expando]?e:new O.Event(f,"object"==typeof e&&e)).isTrigger=s?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),t=null==t?[e]:O.makeArray(t,[e]),d=O.event.special[f]||{},s||!d.trigger||!1!==d.trigger.apply(i,t))){if(!s&&!d.noBubble&&!x(i)){for(l=d.delegateType||f,Dt.test(l+f)||(o=o.parentNode);o;o=o.parentNode)g.push(o),a=o;a===(i.ownerDocument||y)&&g.push(a.defaultView||a.parentWindow||n)}for(r=0;(o=g[r++])&&!e.isPropagationStopped();)c=o,e.type=r>1?l:d.bindType||f,(h=(ae.get(o,"events")||Object.create(null))[e.type]&&ae.get(o,"handle"))&&h.apply(o,t),(h=u&&o[u])&&h.apply&&re(o)&&(e.result=h.apply(o,t),!1===e.result&&e.preventDefault());return e.type=f,s||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(g.pop(),t)||!re(i)||u&&_(i[f])&&!x(i)&&((a=i[u])&&(i[u]=null),O.event.triggered=f,e.isPropagationStopped()&&c.addEventListener(f,Pt),i[f](),e.isPropagationStopped()&&c.removeEventListener(f,Pt),O.event.triggered=void 0,a&&(i[u]=a)),e.result}},simulate:function(e,t,i){var n=O.extend(new O.Event,i,{type:e,isSimulated:!0});O.event.trigger(n,null,t)}}),O.fn.extend({trigger:function(e,t){return this.each((function(){O.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var i=this[0];if(i)return O.event.trigger(e,t,i,!0)}});var Rt=/\[\]$/,At=/\r?\n/g,Vt=/^(?:submit|button|image|reset|file)$/i,Lt=/^(?:input|select|textarea|keygen)/i;function Bt(e,t,i,n){var s;if(Array.isArray(t))O.each(t,(function(t,s){i||Rt.test(e)?n(e,s):Bt(e+"["+("object"==typeof s&&null!=s?t:"")+"]",s,i,n)}));else if(i||"object"!==S(t))n(e,t);else for(s in t)Bt(e+"["+s+"]",t[s],i,n)}O.param=function(e,t){var i,n=[],s=function(e,t){var i=_(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==i?"":i)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!O.isPlainObject(e))O.each(e,(function(){s(this.name,this.value)}));else for(i in e)Bt(i,e[i],t,s);return n.join("&")},O.fn.extend({serialize:function(){return O.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=O.prop(this,"elements");return e?O.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!O(this).is(":disabled")&&Lt.test(this.nodeName)&&!Vt.test(e)&&(this.checked||!Oe.test(e))})).map((function(e,t){var i=O(this).val();return null==i?null:Array.isArray(i)?O.map(i,(function(e){return{name:t.name,value:e.replace(At,"\r\n")}})):{name:t.name,value:i.replace(At,"\r\n")}})).get()}});var Ut=/%20/g,Xt=/#.*$/,kt=/([?&])_=[^&]*/,jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,zt=/^(?:GET|HEAD)$/,Gt=/^\/\//,Ht={},qt={},Yt="*/".concat("*"),Wt=y.createElement("a");function $t(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,s=0,r=t.toLowerCase().match(Y)||[];if(_(i))for(;n=r[s++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function Jt(e,t,i,n){var s={},r=e===qt;function o(a){var l;return s[a]=!0,O.each(e[a]||[],(function(e,a){var u=a(t,i,n);return"string"!=typeof u||r||s[u]?r?!(l=u):void 0:(t.dataTypes.unshift(u),o(u),!1)})),l}return o(t.dataTypes[0])||!s["*"]&&o("*")}function Kt(e,t){var i,n,s=O.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((s[i]?e:n||(n={}))[i]=t[i]);return n&&O.extend(!0,e,n),e}Wt.href=Ft.href,O.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ft.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ft.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Yt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":O.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Kt(Kt(e,O.ajaxSettings),t):Kt(O.ajaxSettings,e)},ajaxPrefilter:$t(Ht),ajaxTransport:$t(qt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,s,r,o,a,l,u,h,d,c,p=O.ajaxSetup({},t),g=p.context||p,f=p.context&&(g.nodeType||g.jquery)?O(g):O.event,m=O.Deferred(),_=O.Callbacks("once memory"),x=p.statusCode||{},w={},b={},S="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(u){if(!o)for(o={};t=jt.exec(r);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?r:null},setRequestHeader:function(e,t){return null==u&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==u&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)T.always(e[T.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||S;return i&&i.abort(t),v(0,t),this}};if(m.promise(T),p.url=((e||p.url||Ft.href)+"").replace(Gt,Ft.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(Y)||[""],null==p.crossDomain){l=y.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Wt.protocol+"//"+Wt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=O.param(p.data,p.traditional)),Jt(Ht,p,t,T),u)return T;for(d in(h=O.event&&p.global)&&0==O.active++&&O.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!zt.test(p.type),s=p.url.replace(Xt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ut,"+")):(c=p.url.slice(s.length),p.data&&(p.processData||"string"==typeof p.data)&&(s+=(Mt.test(s)?"&":"?")+p.data,delete p.data),!1===p.cache&&(s=s.replace(kt,"$1"),c=(Mt.test(s)?"&":"?")+"_="+It.guid+++c),p.url=s+c),p.ifModified&&(O.lastModified[s]&&T.setRequestHeader("If-Modified-Since",O.lastModified[s]),O.etag[s]&&T.setRequestHeader("If-None-Match",O.etag[s])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Yt+"; q=0.01":""):p.accepts["*"]),p.headers)T.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(g,T,p)||u))return T.abort();if(S="abort",_.add(p.complete),T.done(p.success),T.fail(p.error),i=Jt(qt,p,t,T)){if(T.readyState=1,h&&f.trigger("ajaxSend",[T,p]),u)return T;p.async&&p.timeout>0&&(a=n.setTimeout((function(){T.abort("timeout")}),p.timeout));try{u=!1,i.send(w,v)}catch(e){if(u)throw e;v(-1,e)}}else v(-1,"No Transport");function v(e,t,o,l){var d,c,y,w,b,S=t;u||(u=!0,a&&n.clearTimeout(a),i=void 0,r=l||"",T.readyState=e>0?4:0,d=e>=200&&e<300||304===e,o&&(w=function(e,t,i){for(var n,s,r,o,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(s in a)if(a[s]&&a[s].test(n)){l.unshift(s);break}if(l[0]in i)r=l[0];else{for(s in i){if(!l[0]||e.converters[s+" "+l[0]]){r=s;break}o||(o=s)}r=r||o}if(r)return r!==l[0]&&l.unshift(r),i[r]}(p,T,o)),!d&&O.inArray("script",p.dataTypes)>-1&&O.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(e,t,i,n){var s,r,o,a,l,u={},h=e.dataTypes.slice();if(h[1])for(o in e.converters)u[o.toLowerCase()]=e.converters[o];for(r=h.shift();r;)if(e.responseFields[r]&&(i[e.responseFields[r]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=r,r=h.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(o=u[l+" "+r]||u["* "+r]))for(s in u)if((a=s.split(" "))[1]===r&&(o=u[l+" "+a[0]]||u["* "+a[0]])){!0===o?o=u[s]:!0!==u[s]&&(r=a[0],h.unshift(a[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+r}}}return{state:"success",data:t}}(p,w,T,d),d?(p.ifModified&&((b=T.getResponseHeader("Last-Modified"))&&(O.lastModified[s]=b),(b=T.getResponseHeader("etag"))&&(O.etag[s]=b)),204===e||"HEAD"===p.type?S="nocontent":304===e?S="notmodified":(S=w.state,c=w.data,d=!(y=w.error))):(y=S,!e&&S||(S="error",e<0&&(e=0))),T.status=e,T.statusText=(t||S)+"",d?m.resolveWith(g,[c,S,T]):m.rejectWith(g,[T,S,y]),T.statusCode(x),x=void 0,h&&f.trigger(d?"ajaxSuccess":"ajaxError",[T,p,d?c:y]),_.fireWith(g,[T,S]),h&&(f.trigger("ajaxComplete",[T,p]),--O.active||O.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,i){return O.get(e,t,i,"json")},getScript:function(e,t){return O.get(e,void 0,t,"script")}}),O.each(["get","post"],(function(e,t){O[t]=function(e,i,n,s){return _(i)&&(s=s||n,n=i,i=void 0),O.ajax(O.extend({url:e,type:t,dataType:s,data:i,success:n},O.isPlainObject(e)&&e))}})),O.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),O._evalUrl=function(e,t,i){return O.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){O.globalEval(e,t,i)}})},O.fn.extend({wrapAll:function(e){var t;return this[0]&&(_(e)&&(e=e.call(this[0])),t=O(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return _(e)?this.each((function(t){O(this).wrapInner(e.call(this,t))})):this.each((function(){var t=O(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)}))},wrap:function(e){var t=_(e);return this.each((function(i){O(this).wrapAll(t?e.call(this,i):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){O(this).replaceWith(this.childNodes)})),this}}),O.expr.pseudos.hidden=function(e){return!O.expr.pseudos.visible(e)},O.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},O.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Zt={0:200,1223:204},Qt=O.ajaxSettings.xhr();m.cors=!!Qt&&"withCredentials"in Qt,m.ajax=Qt=!!Qt,O.ajaxTransport((function(e){var t,i;if(m.cors||Qt&&!e.crossDomain)return{send:function(s,r){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];for(o in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)a.setRequestHeader(o,s[o]);t=function(e){return function(){t&&(t=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?r(0,"error"):r(a.status,a.statusText):r(Zt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),i=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){t&&i()}))},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),O.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),O.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return O.globalEval(e),e}}}),O.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),O.ajaxTransport("script",(function(e){var t,i;if(e.crossDomain||e.scriptAttrs)return{send:function(n,s){t=O("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",i=function(e){t.remove(),i=null,e&&s("error"===e.type?404:200,e.type)}),y.head.appendChild(t[0])},abort:function(){i&&i()}}}));var ei,ti=[],ii=/(=)\?(?=&|$)|\?\?/;O.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=ti.pop()||O.expando+"_"+It.guid++;return this[e]=!0,e}}),O.ajaxPrefilter("json jsonp",(function(e,t,i){var s,r,o,a=!1!==e.jsonp&&(ii.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&ii.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return s=e.jsonpCallback=_(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(ii,"$1"+s):!1!==e.jsonp&&(e.url+=(Mt.test(e.url)?"&":"?")+e.jsonp+"="+s),e.converters["script json"]=function(){return o||O.error(s+" was not called"),o[0]},e.dataTypes[0]="json",r=n[s],n[s]=function(){o=arguments},i.always((function(){void 0===r?O(n).removeProp(s):n[s]=r,e[s]&&(e.jsonpCallback=t.jsonpCallback,ti.push(s)),o&&_(r)&&r(o[0]),o=r=void 0})),"script"})),m.createHTMLDocument=((ei=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===ei.childNodes.length),O.parseHTML=function(e,t,i){return"string"!=typeof e?[]:("boolean"==typeof t&&(i=t,t=!1),t||(m.createHTMLDocument?((n=(t=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,t.head.appendChild(n)):t=y),r=!i&&[],(s=X.exec(e))?[t.createElement(s[1])]:(s=De([e],t,r),r&&r.length&&O(r).remove(),O.merge([],s.childNodes)));var n,s,r},O.fn.load=function(e,t,i){var n,s,r,o=this,a=e.indexOf(" ");return a>-1&&(n=Ot(e.slice(a)),e=e.slice(0,a)),_(t)?(i=t,t=void 0):t&&"object"==typeof t&&(s="POST"),o.length>0&&O.ajax({url:e,type:s||"GET",dataType:"html",data:t}).done((function(e){r=arguments,o.html(n?O("<div>").append(O.parseHTML(e)).find(n):e)})).always(i&&function(e,t){o.each((function(){i.apply(this,r||[e.responseText,t,e])}))}),this},O.expr.pseudos.animated=function(e){return O.grep(O.timers,(function(t){return e===t.elem})).length},O.offset={setOffset:function(e,t,i){var n,s,r,o,a,l,u=O.css(e,"position"),h=O(e),d={};"static"===u&&(e.style.position="relative"),a=h.offset(),r=O.css(e,"top"),l=O.css(e,"left"),("absolute"===u||"fixed"===u)&&(r+l).indexOf("auto")>-1?(o=(n=h.position()).top,s=n.left):(o=parseFloat(r)||0,s=parseFloat(l)||0),_(t)&&(t=t.call(e,i,O.extend({},a))),null!=t.top&&(d.top=t.top-a.top+o),null!=t.left&&(d.left=t.left-a.left+s),"using"in t?t.using.call(e,d):h.css(d)}},O.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){O.offset.setOffset(this,e,t)}));var t,i,n=this[0];return n?n.getClientRects().length?(t=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,i,n=this[0],s={top:0,left:0};if("fixed"===O.css(n,"position"))t=n.getBoundingClientRect();else{for(t=this.offset(),i=n.ownerDocument,e=n.offsetParent||i.documentElement;e&&(e===i.body||e===i.documentElement)&&"static"===O.css(e,"position");)e=e.parentNode;e&&e!==n&&1===e.nodeType&&((s=O(e).offset()).top+=O.css(e,"borderTopWidth",!0),s.left+=O.css(e,"borderLeftWidth",!0))}return{top:t.top-s.top-O.css(n,"marginTop",!0),left:t.left-s.left-O.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===O.css(e,"position");)e=e.offsetParent;return e||fe}))}}),O.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var i="pageYOffset"===t;O.fn[e]=function(n){return ee(this,(function(e,n,s){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===s)return r?r[t]:e[n];r?r.scrollTo(i?r.pageXOffset:s,i?s:r.pageYOffset):e[n]=s}),e,n,arguments.length)}})),O.each(["top","left"],(function(e,t){O.cssHooks[t]=et(m.pixelPosition,(function(e,i){if(i)return i=Qe(e,t),We.test(i)?O(e).position()[t]+"px":i}))})),O.each({Height:"height",Width:"width"},(function(e,t){O.each({padding:"inner"+e,content:t,"":"outer"+e},(function(i,n){O.fn[n]=function(s,r){var o=arguments.length&&(i||"boolean"!=typeof s),a=i||(!0===s||!0===r?"margin":"border");return ee(this,(function(t,i,s){var r;return x(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(r=t.documentElement,Math.max(t.body["scroll"+e],r["scroll"+e],t.body["offset"+e],r["offset"+e],r["client"+e])):void 0===s?O.css(t,i,a):O.style(t,i,s,a)}),t,o?s:void 0,o)}}))})),O.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){O.fn[t]=function(e){return this.on(t,e)}})),O.fn.extend({bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),O.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){O.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}}));var ni=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;O.proxy=function(e,t){var i,n,s;if("string"==typeof t&&(i=e[t],t=e,e=i),_(e))return n=a.call(arguments,2),s=function(){return e.apply(t||this,n.concat(a.call(arguments)))},s.guid=e.guid=e.guid||O.guid++,s},O.holdReady=function(e){e?O.readyWait++:O.ready(!0)},O.isArray=Array.isArray,O.parseJSON=JSON.parse,O.nodeName=N,O.isFunction=_,O.isWindow=x,O.camelCase=se,O.type=S,O.now=Date.now,O.isNumeric=function(e){var t=O.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},O.trim=function(e){return null==e?"":(e+"").replace(ni,"$1")},void 0===(i=function(){return O}.apply(t,[]))||(e.exports=i);var si=n.jQuery,ri=n.$;return O.noConflict=function(e){return n.$===O&&(n.$=ri),e&&n.jQuery===O&&(n.jQuery=si),O},void 0===s&&(n.jQuery=n.$=O),O},"object"==typeof e.exports?e.exports=n.document?s(n,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return s(e)}:s(n)},602:e=>{var t={DEBUG:!1,assert:function(e,i){if(t.DEBUG&&!e)throw new Error("Assertion failed"+(i?": "+i:""))},GLU_TESS_MAX_COORD:1e150,TRUE_PROJECT:!1,GLU_TESS_DEFAULT_TOLERANCE:0,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111,GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901}};t.PQHandle,t.geom={},t.geom.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},t.geom.vertLeq=function(e,t){return e.s<t.s||e.s===t.s&&e.t<=t.t},t.geom.edgeEval=function(e,t,i){var n=t.s-e.s,s=i.s-t.s;return n+s>0?n<s?t.t-e.t+(e.t-i.t)*(n/(n+s)):t.t-i.t+(i.t-e.t)*(s/(n+s)):0},t.geom.edgeSign=function(e,t,i){var n=t.s-e.s,s=i.s-t.s;return n+s>0?(t.t-i.t)*n+(t.t-e.t)*s:0},t.geom.transLeq=function(e,t){return e.t<t.t||e.t===t.t&&e.s<=t.s},t.geom.transEval=function(e,t,i){var n=t.t-e.t,s=i.t-t.t;return n+s>0?n<s?t.s-e.s+(e.s-i.s)*(n/(n+s)):t.s-i.s+(i.s-e.s)*(s/(n+s)):0},t.geom.transSign=function(e,t,i){var n=t.t-e.t,s=i.t-t.t;return n+s>0?(t.s-i.s)*n+(t.s-e.s)*s:0},t.geom.edgeGoesLeft=function(e){return t.geom.vertLeq(e.dst(),e.org)},t.geom.edgeGoesRight=function(e){return t.geom.vertLeq(e.org,e.dst())},t.geom.vertL1dist=function(e,t){return Math.abs(e.s-t.s)+Math.abs(e.t-t.t)},t.geom.vertCCW=function(e,t,i){return e.s*(t.t-i.t)+t.s*(i.t-e.t)+i.s*(e.t-t.t)>=0},t.geom.interpolate_=function(e,t,i,n){return(e=e<0?0:e)<=(i=i<0?0:i)?0===i?(t+n)/2:t+e/(e+i)*(n-t):n+i/(e+i)*(t-n)},t.geom.edgeIntersect=function(e,i,n,s,r){var o,a,l;t.geom.vertLeq(e,i)||(l=e,e=i,i=l),t.geom.vertLeq(n,s)||(l=n,n=s,s=l),t.geom.vertLeq(e,n)||(l=e,e=n,n=l,l=i,i=s,s=l),t.geom.vertLeq(n,i)?t.geom.vertLeq(i,s)?((o=t.geom.edgeEval(e,n,i))+(a=t.geom.edgeEval(n,i,s))<0&&(o=-o,a=-a),r.s=t.geom.interpolate_(o,n.s,a,i.s)):((o=t.geom.edgeSign(e,n,i))+(a=-t.geom.edgeSign(e,s,i))<0&&(o=-o,a=-a),r.s=t.geom.interpolate_(o,n.s,a,s.s)):r.s=(n.s+i.s)/2,t.geom.transLeq(e,i)||(l=e,e=i,i=l),t.geom.transLeq(n,s)||(l=n,n=s,s=l),t.geom.transLeq(e,n)||(l=e,e=n,n=l,l=i,i=s,s=l),t.geom.transLeq(n,i)?t.geom.transLeq(i,s)?((o=t.geom.transEval(e,n,i))+(a=t.geom.transEval(n,i,s))<0&&(o=-o,a=-a),r.t=t.geom.interpolate_(o,n.t,a,i.t)):((o=t.geom.transSign(e,n,i))+(a=-t.geom.transSign(e,s,i))<0&&(o=-o,a=-a),r.t=t.geom.interpolate_(o,n.t,a,s.t)):r.t=(n.t+i.t)/2},t.mesh={},t.mesh.makeEdge=function(e){var i=t.mesh.makeEdgePair_(e.eHead);return t.mesh.makeVertex_(i,e.vHead),t.mesh.makeVertex_(i.sym,e.vHead),t.mesh.makeFace_(i,e.fHead),i},t.mesh.meshSplice=function(e,i){var n=!1,s=!1;e!==i&&(i.org!==e.org&&(s=!0,t.mesh.killVertex_(i.org,e.org)),i.lFace!==e.lFace&&(n=!0,t.mesh.killFace_(i.lFace,e.lFace)),t.mesh.splice_(i,e),s||(t.mesh.makeVertex_(i,e.org),e.org.anEdge=e),n||(t.mesh.makeFace_(i,e.lFace),e.lFace.anEdge=e))},t.mesh.deleteEdge=function(e){var i=e.sym,n=!1;e.lFace!==e.rFace()&&(n=!0,t.mesh.killFace_(e.lFace,e.rFace())),e.oNext===e?t.mesh.killVertex_(e.org,null):(e.rFace().anEdge=e.oPrev(),e.org.anEdge=e.oNext,t.mesh.splice_(e,e.oPrev()),n||t.mesh.makeFace_(e,e.lFace)),i.oNext===i?(t.mesh.killVertex_(i.org,null),t.mesh.killFace_(i.lFace,null)):(e.lFace.anEdge=i.oPrev(),i.org.anEdge=i.oNext,t.mesh.splice_(i,i.oPrev())),t.mesh.killEdge_(e)},t.mesh.addEdgeVertex=function(e){var i=t.mesh.makeEdgePair_(e),n=i.sym;return t.mesh.splice_(i,e.lNext),i.org=e.dst(),t.mesh.makeVertex_(n,i.org),i.lFace=n.lFace=e.lFace,i},t.mesh.splitEdge=function(e){var i=t.mesh.addEdgeVertex(e).sym;return t.mesh.splice_(e.sym,e.sym.oPrev()),t.mesh.splice_(e.sym,i),e.sym.org=i.org,i.dst().anEdge=i.sym,i.sym.lFace=e.rFace(),i.winding=e.winding,i.sym.winding=e.sym.winding,i},t.mesh.connect=function(e,i){var n=!1,s=t.mesh.makeEdgePair_(e),r=s.sym;return i.lFace!==e.lFace&&(n=!0,t.mesh.killFace_(i.lFace,e.lFace)),t.mesh.splice_(s,e.lNext),t.mesh.splice_(r,i),s.org=e.dst(),r.org=i.org,s.lFace=r.lFace=e.lFace,e.lFace.anEdge=r,n||t.mesh.makeFace_(s,e.lFace),s},t.mesh.zapFace=function(e){var i,n=e.anEdge,s=n.lNext;do{if(s=(i=s).lNext,i.lFace=null,null===i.rFace()){i.oNext===i?t.mesh.killVertex_(i.org,null):(i.org.anEdge=i.oNext,t.mesh.splice_(i,i.oPrev()));var r=i.sym;r.oNext===r?t.mesh.killVertex_(r.org,null):(r.org.anEdge=r.oNext,t.mesh.splice_(r,r.oPrev())),t.mesh.killEdge_(i)}}while(i!==n);var o=e.prev,a=e.next;a.prev=o,o.next=a},t.mesh.meshUnion=function(e,t){var i=e.fHead,n=e.vHead,s=e.eHead,r=t.fHead,o=t.vHead,a=t.eHead;return r.next!==r&&(i.prev.next=r.next,r.next.prev=i.prev,r.prev.next=i,i.prev=r.prev),o.next!==o&&(n.prev.next=o.next,o.next.prev=n.prev,o.prev.next=n,n.prev=o.prev),a.next!==a&&(s.sym.next.sym.next=a.next,a.next.sym.next=s.sym.next,a.sym.next.sym.next=s,s.sym.next=a.sym.next),e},t.mesh.deleteMesh=function(e){},t.mesh.makeEdgePair_=function(e){var i=new t.GluHalfEdge,n=new t.GluHalfEdge,s=e.sym.next;return n.next=s,s.sym.next=i,i.next=e,e.sym.next=n,i.sym=n,i.oNext=i,i.lNext=n,n.sym=i,n.oNext=n,n.lNext=i,i},t.mesh.splice_=function(e,t){var i=e.oNext,n=t.oNext;i.sym.lNext=t,n.sym.lNext=e,e.oNext=n,t.oNext=i},t.mesh.makeVertex_=function(e,i){var n=i.prev,s=new t.GluVertex(i,n);n.next=s,i.prev=s,s.anEdge=e;var r=e;do{r.org=s,r=r.oNext}while(r!==e)},t.mesh.makeFace_=function(e,i){var n=i.prev,s=new t.GluFace(i,n);n.next=s,i.prev=s,s.anEdge=e,s.inside=i.inside;var r=e;do{r.lFace=s,r=r.lNext}while(r!==e)},t.mesh.killEdge_=function(e){var t=e.next,i=e.sym.next;t.sym.next=i,i.sym.next=t},t.mesh.killVertex_=function(e,t){var i=e.anEdge,n=i;do{n.org=t,n=n.oNext}while(n!==i);var s=e.prev,r=e.next;r.prev=s,s.next=r},t.mesh.killFace_=function(e,t){var i=e.anEdge,n=i;do{n.lFace=t,n=n.lNext}while(n!==i);var s=e.prev,r=e.next;r.prev=s,s.next=r},t.normal={},t.normal.S_UNIT_X_=1,t.normal.S_UNIT_Y_=0,t.normal.projectPolygon=function(e,i,n,s){var r=!1,o=[i,n,s];0===i&&0===n&&0===s&&(t.normal.computeNormal_(e,o),r=!0);var a,l=t.normal.longAxis_(o),u=e.mesh.vHead;if(t.TRUE_PROJECT){t.normal.normalize_(o);var h=[0,0,0],d=[0,0,0];h[l]=0,h[(l+1)%3]=t.normal.S_UNIT_X_,h[(l+2)%3]=t.normal.S_UNIT_Y_;var c=t.normal.dot_(h,o);for(h[0]-=c*o[0],h[1]-=c*o[1],h[2]-=c*o[2],t.normal.normalize_(h),d[0]=o[1]*h[2]-o[2]*h[1],d[1]=o[2]*h[0]-o[0]*h[2],d[2]=o[0]*h[1]-o[1]*h[0],t.normal.normalize_(d),a=u.next;a!==u;a=a.next)a.s=t.normal.dot_(a.coords,h),a.t=t.normal.dot_(a.coords,d)}else{var p=(l+1)%3,g=(l+2)%3,f=o[l]>0?1:-1;for(a=u.next;a!==u;a=a.next)a.s=a.coords[p],a.t=f*a.coords[g]}r&&t.normal.checkOrientation_(e)},t.normal.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},t.normal.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},t.normal.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},t.normal.computeNormal_=function(e,i){var n,s=[-2*t.GLU_TESS_MAX_COORD,-2*t.GLU_TESS_MAX_COORD,-2*t.GLU_TESS_MAX_COORD],r=[2*t.GLU_TESS_MAX_COORD,2*t.GLU_TESS_MAX_COORD,2*t.GLU_TESS_MAX_COORD],o=[],a=[],l=e.mesh.vHead;for(n=l.next;n!==l;n=n.next)for(var u=0;u<3;++u){var h=n.coords[u];h<r[u]&&(r[u]=h,a[u]=n),h>s[u]&&(s[u]=h,o[u]=n)}var d=0;if(s[1]-r[1]>s[0]-r[0]&&(d=1),s[2]-r[2]>s[d]-r[d]&&(d=2),r[d]>=s[d])return i[0]=0,i[1]=0,void(i[2]=1);var c=0,p=a[d],g=o[d],f=[0,0,0],m=[p.coords[0]-g.coords[0],p.coords[1]-g.coords[1],p.coords[2]-g.coords[2]],_=[0,0,0];for(n=l.next;n!==l;n=n.next){_[0]=n.coords[0]-g.coords[0],_[1]=n.coords[1]-g.coords[1],_[2]=n.coords[2]-g.coords[2],f[0]=m[1]*_[2]-m[2]*_[1],f[1]=m[2]*_[0]-m[0]*_[2],f[2]=m[0]*_[1]-m[1]*_[0];var x=f[0]*f[0]+f[1]*f[1]+f[2]*f[2];x>c&&(c=x,i[0]=f[0],i[1]=f[1],i[2]=f[2])}c<=0&&(i[0]=i[1]=i[2]=0,i[t.normal.longAxis_(m)]=1)},t.normal.checkOrientation_=function(e){for(var t=0,i=e.mesh.fHead,n=i.next;n!==i;n=n.next){var s=n.anEdge;if(!(s.winding<=0))do{t+=(s.org.s-s.dst().s)*(s.org.t+s.dst().t),s=s.lNext}while(s!==n.anEdge)}if(t<0)for(var r=e.mesh.vHead,o=r.next;o!==r;o=o.next)o.t=-o.t},t.render={},t.render.renderMesh=function(e,i,n){for(var s=!1,r=-1,o=i.fHead.prev;o!==i.fHead;o=o.prev)if(o.inside){s||(e.callBeginCallback(t.primitiveType.GL_TRIANGLES),s=!0);var a=o.anEdge;do{if(n){var l=a.rFace().inside?0:1;r!==l&&(r=l,e.callEdgeFlagCallback(!!r))}e.callVertexCallback(a.org.data),a=a.lNext}while(a!==o.anEdge)}s&&e.callEndCallback()},t.render.renderBoundary=function(e,i){for(var n=i.fHead.next;n!==i.fHead;n=n.next)if(n.inside){e.callBeginCallback(t.primitiveType.GL_LINE_LOOP);var s=n.anEdge;do{e.callVertexCallback(s.org.data),s=s.lNext}while(s!==n.anEdge);e.callEndCallback()}},t.sweep={},t.sweep.SENTINEL_COORD_=4*t.GLU_TESS_MAX_COORD,t.sweep.TOLERANCE_NONZERO_=!1,t.sweep.computeInterior=function(e){var i;for(e.fatalError=!1,t.sweep.removeDegenerateEdges_(e),t.sweep.initPriorityQ_(e),t.sweep.initEdgeDict_(e);null!==(i=e.pq.extractMin());){for(;;){var n=e.pq.minimum();if(null===n||!t.geom.vertEq(n,i))break;n=e.pq.extractMin(),t.sweep.spliceMergeVertices_(e,i.anEdge,n.anEdge)}t.sweep.sweepEvent_(e,i)}var s=e.dict.getMin().getKey();e.event=s.eUp.org,t.sweep.doneEdgeDict_(e),t.sweep.donePriorityQ_(e),t.sweep.removeDegenerateFaces_(e.mesh),e.mesh.checkMesh()},t.sweep.addWinding_=function(e,t){e.winding+=t.winding,e.sym.winding+=t.sym.winding},t.sweep.edgeLeq_=function(e,i,n){var s=e.event,r=i.eUp,o=n.eUp;return r.dst()===s?o.dst()===s?t.geom.vertLeq(r.org,o.org)?t.geom.edgeSign(o.dst(),r.org,o.org)<=0:t.geom.edgeSign(r.dst(),o.org,r.org)>=0:t.geom.edgeSign(o.dst(),s,o.org)<=0:o.dst()===s?t.geom.edgeSign(r.dst(),s,r.org)>=0:t.geom.edgeEval(r.dst(),s,r.org)>=t.geom.edgeEval(o.dst(),s,o.org)},t.sweep.deleteRegion_=function(e,t){t.fixUpperEdge,t.eUp.activeRegion=null,e.dict.deleteNode(t.nodeUp),t.nodeUp=null},t.sweep.fixUpperEdge_=function(e,i){t.mesh.deleteEdge(e.eUp),e.fixUpperEdge=!1,e.eUp=i,i.activeRegion=e},t.sweep.topLeftRegion_=function(e){var i=e.eUp.org;do{e=e.regionAbove()}while(e.eUp.org===i);if(e.fixUpperEdge){var n=t.mesh.connect(e.regionBelow().eUp.sym,e.eUp.lNext);t.sweep.fixUpperEdge_(e,n),e=e.regionAbove()}return e},t.sweep.topRightRegion_=function(e){var t=e.eUp.dst();do{e=e.regionAbove()}while(e.eUp.dst()===t);return e},t.sweep.addRegionBelow_=function(e,i,n){var s=new t.ActiveRegion;return s.eUp=n,s.nodeUp=e.dict.insertBefore(i.nodeUp,s),n.activeRegion=s,s},t.sweep.isWindingInside_=function(e,i){switch(e.windingRule){case t.windingRule.GLU_TESS_WINDING_ODD:return 0!=(1&i);case t.windingRule.GLU_TESS_WINDING_NONZERO:return 0!==i;case t.windingRule.GLU_TESS_WINDING_POSITIVE:return i>0;case t.windingRule.GLU_TESS_WINDING_NEGATIVE:return i<0;case t.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return i>=2||i<=-2}return!1},t.sweep.computeWinding_=function(e,i){i.windingNumber=i.regionAbove().windingNumber+i.eUp.winding,i.inside=t.sweep.isWindingInside_(e,i.windingNumber)},t.sweep.finishRegion_=function(e,i){var n=i.eUp,s=n.lFace;s.inside=i.inside,s.anEdge=n,t.sweep.deleteRegion_(e,i)},t.sweep.finishLeftRegions_=function(e,i,n){for(var s=i,r=i.eUp;s!==n;){s.fixUpperEdge=!1;var o=s.regionBelow(),a=o.eUp;if(a.org!==r.org){if(!o.fixUpperEdge){t.sweep.finishRegion_(e,s);break}a=t.mesh.connect(r.lPrev(),a.sym),t.sweep.fixUpperEdge_(o,a)}r.oNext!==a&&(t.mesh.meshSplice(a.oPrev(),a),t.mesh.meshSplice(r,a)),t.sweep.finishRegion_(e,s),r=o.eUp,s=o}return r},t.sweep.addRightEdges_=function(e,i,n,s,r,o){var a=!0,l=n;do{t.sweep.addRegionBelow_(e,i,l.sym),l=l.oNext}while(l!==s);null===r&&(r=i.regionBelow().eUp.rPrev());for(var u,h=i,d=r;(l=(u=h.regionBelow()).eUp.sym).org===d.org;)l.oNext!==d&&(t.mesh.meshSplice(l.oPrev(),l),t.mesh.meshSplice(d.oPrev(),l)),u.windingNumber=h.windingNumber-l.winding,u.inside=t.sweep.isWindingInside_(e,u.windingNumber),h.dirty=!0,!a&&t.sweep.checkForRightSplice_(e,h)&&(t.sweep.addWinding_(l,d),t.sweep.deleteRegion_(e,h),t.mesh.deleteEdge(d)),a=!1,h=u,d=l;h.dirty=!0,o&&t.sweep.walkDirtyRegions_(e,h)},t.sweep.callCombine_=function(e,i,n,s,r){var o=[i.coords[0],i.coords[1],i.coords[2]];i.data=null,i.data=e.callCombineCallback(o,n,s),null===i.data&&(r?e.fatalError||(e.callErrorCallback(t.errorType.GLU_TESS_NEED_COMBINE_CALLBACK),e.fatalError=!0):i.data=n[0])},t.sweep.spliceMergeVertices_=function(e,i,n){var s=[null,null,null,null];s[0]=i.org.data,s[1]=n.org.data,t.sweep.callCombine_(e,i.org,s,[.5,.5,0,0],!1),t.mesh.meshSplice(i,n)},t.sweep.vertexWeights_=function(e,i,n,s,r){var o=t.geom.vertL1dist(i,e),a=t.geom.vertL1dist(n,e),l=r,u=r+1;s[l]=.5*a/(o+a),s[u]=.5*o/(o+a),e.coords[0]+=s[l]*i.coords[0]+s[u]*n.coords[0],e.coords[1]+=s[l]*i.coords[1]+s[u]*n.coords[1],e.coords[2]+=s[l]*i.coords[2]+s[u]*n.coords[2]},t.sweep.getIntersectData_=function(e,i,n,s,r,o){var a=[0,0,0,0],l=[n.data,s.data,r.data,o.data];i.coords[0]=i.coords[1]=i.coords[2]=0,t.sweep.vertexWeights_(i,n,s,a,0),t.sweep.vertexWeights_(i,r,o,a,2),t.sweep.callCombine_(e,i,l,a,!0)},t.sweep.checkForRightSplice_=function(e,i){var n=i.regionBelow(),s=i.eUp,r=n.eUp;if(t.geom.vertLeq(s.org,r.org)){if(t.geom.edgeSign(r.dst(),s.org,r.org)>0)return!1;t.geom.vertEq(s.org,r.org)?s.org!==r.org&&(e.pq.remove(s.org.pqHandle),t.sweep.spliceMergeVertices_(e,r.oPrev(),s)):(t.mesh.splitEdge(r.sym),t.mesh.meshSplice(s,r.oPrev()),i.dirty=n.dirty=!0)}else{if(t.geom.edgeSign(s.dst(),r.org,s.org)<0)return!1;i.regionAbove().dirty=i.dirty=!0,t.mesh.splitEdge(s.sym),t.mesh.meshSplice(r.oPrev(),s)}return!0},t.sweep.checkForLeftSplice_=function(e,i){var n,s=i.regionBelow(),r=i.eUp,o=s.eUp;if(t.geom.vertLeq(r.dst(),o.dst())){if(t.geom.edgeSign(r.dst(),o.dst(),r.org)<0)return!1;i.regionAbove().dirty=i.dirty=!0,n=t.mesh.splitEdge(r),t.mesh.meshSplice(o.sym,n),n.lFace.inside=i.inside}else{if(t.geom.edgeSign(o.dst(),r.dst(),o.org)>0)return!1;i.dirty=s.dirty=!0,n=t.mesh.splitEdge(o),t.mesh.meshSplice(r.lNext,o.sym),n.rFace().inside=i.inside}return!0},t.sweep.checkForIntersect_=function(e,i){var n=i.regionBelow(),s=i.eUp,r=n.eUp,o=s.org,a=r.org,l=s.dst(),u=r.dst(),h=new t.GluVertex;if(o===a)return!1;if(Math.min(o.t,l.t)>Math.max(a.t,u.t))return!1;if(t.geom.vertLeq(o,a)){if(t.geom.edgeSign(u,o,a)>0)return!1}else if(t.geom.edgeSign(l,a,o)<0)return!1;t.geom.edgeIntersect(l,o,u,a,h),t.geom.vertLeq(h,e.event)&&(h.s=e.event.s,h.t=e.event.t);var d=t.geom.vertLeq(o,a)?o:a;if(t.geom.vertLeq(d,h)&&(h.s=d.s,h.t=d.t),t.geom.vertEq(h,o)||t.geom.vertEq(h,a))return t.sweep.checkForRightSplice_(e,i),!1;if(!t.geom.vertEq(l,e.event)&&t.geom.edgeSign(l,e.event,h)>=0||!t.geom.vertEq(u,e.event)&&t.geom.edgeSign(u,e.event,h)<=0){if(u===e.event)return t.mesh.splitEdge(s.sym),t.mesh.meshSplice(r.sym,s),s=(i=t.sweep.topLeftRegion_(i)).regionBelow().eUp,t.sweep.finishLeftRegions_(e,i.regionBelow(),n),t.sweep.addRightEdges_(e,i,s.oPrev(),s,s,!0),!0;if(l===e.event){t.mesh.splitEdge(r.sym),t.mesh.meshSplice(s.lNext,r.oPrev()),n=i;var c=(i=t.sweep.topRightRegion_(i)).regionBelow().eUp.rPrev();return n.eUp=r.oPrev(),r=t.sweep.finishLeftRegions_(e,n,null),t.sweep.addRightEdges_(e,i,r.oNext,s.rPrev(),c,!0),!0}return t.geom.edgeSign(l,e.event,h)>=0&&(i.regionAbove().dirty=i.dirty=!0,t.mesh.splitEdge(s.sym),s.org.s=e.event.s,s.org.t=e.event.t),t.geom.edgeSign(u,e.event,h)<=0&&(i.dirty=n.dirty=!0,t.mesh.splitEdge(r.sym),r.org.s=e.event.s,r.org.t=e.event.t),!1}return t.mesh.splitEdge(s.sym),t.mesh.splitEdge(r.sym),t.mesh.meshSplice(r.oPrev(),s),s.org.s=h.s,s.org.t=h.t,s.org.pqHandle=e.pq.insert(s.org),t.sweep.getIntersectData_(e,s.org,o,l,a,u),i.regionAbove().dirty=i.dirty=n.dirty=!0,!1},t.sweep.walkDirtyRegions_=function(e,i){for(var n=i.regionBelow();;){for(;n.dirty;)i=n,n=n.regionBelow();if(!i.dirty&&(n=i,null===(i=i.regionAbove())||!i.dirty))return;i.dirty=!1;var s=i.eUp,r=n.eUp;if(s.dst()!==r.dst()&&t.sweep.checkForLeftSplice_(e,i)&&(n.fixUpperEdge?(t.sweep.deleteRegion_(e,n),t.mesh.deleteEdge(r),r=(n=i.regionBelow()).eUp):i.fixUpperEdge&&(t.sweep.deleteRegion_(e,i),t.mesh.deleteEdge(s),s=(i=n.regionAbove()).eUp)),s.org!==r.org)if(s.dst()===r.dst()||i.fixUpperEdge||n.fixUpperEdge||s.dst()!==e.event&&r.dst()!==e.event)t.sweep.checkForRightSplice_(e,i);else if(t.sweep.checkForIntersect_(e,i))return;s.org===r.org&&s.dst()===r.dst()&&(t.sweep.addWinding_(r,s),t.sweep.deleteRegion_(e,i),t.mesh.deleteEdge(s),i=n.regionAbove())}},t.sweep.connectRightVertex_=function(e,i,n){var s,r=n.oNext,o=i.regionBelow(),a=i.eUp,l=o.eUp,u=!1;(a.dst()!==l.dst()&&t.sweep.checkForIntersect_(e,i),t.geom.vertEq(a.org,e.event)&&(t.mesh.meshSplice(r.oPrev(),a),r=(i=t.sweep.topLeftRegion_(i)).regionBelow().eUp,t.sweep.finishLeftRegions_(e,i.regionBelow(),o),u=!0),t.geom.vertEq(l.org,e.event)&&(t.mesh.meshSplice(n,l.oPrev()),n=t.sweep.finishLeftRegions_(e,o,null),u=!0),u)?t.sweep.addRightEdges_(e,i,n.oNext,r,r,!0):(s=t.geom.vertLeq(l.org,a.org)?l.oPrev():a,s=t.mesh.connect(n.lPrev(),s),t.sweep.addRightEdges_(e,i,s,s.oNext,s.oNext,!1),s.sym.activeRegion.fixUpperEdge=!0,t.sweep.walkDirtyRegions_(e,i))},t.sweep.connectLeftDegenerate_=function(e,i,n){var s=i.eUp;if(t.geom.vertEq(s.org,n))t.sweep.TOLERANCE_NONZERO_&&t.sweep.spliceMergeVertices_(e,s,n.anEdge);else{if(!t.geom.vertEq(s.dst(),n))return t.mesh.splitEdge(s.sym),i.fixUpperEdge&&(t.mesh.deleteEdge(s.oNext),i.fixUpperEdge=!1),t.mesh.meshSplice(n.anEdge,s),void t.sweep.sweepEvent_(e,n);if(t.sweep.TOLERANCE_NONZERO_){var r=(i=t.sweep.topRightRegion_(i)).regionBelow(),o=r.eUp.sym,a=o.oNext,l=a;r.fixUpperEdge&&(t.sweep.deleteRegion_(e,r),t.mesh.deleteEdge(o),o=a.oPrev()),t.mesh.meshSplice(n.anEdge,o),t.geom.edgeGoesLeft(a)||(a=null),t.sweep.addRightEdges_(e,i,o.oNext,l,a,!0)}}},t.sweep.connectLeftVertex_=function(e,i){var n=new t.ActiveRegion;n.eUp=i.anEdge.sym;var s=e.dict.search(n).getKey(),r=s.regionBelow(),o=s.eUp,a=r.eUp;if(0!==t.geom.edgeSign(o.dst(),i,o.org)){var l,u=t.geom.vertLeq(a.dst(),o.dst())?s:r;if(s.inside||u.fixUpperEdge){if(u===s)l=t.mesh.connect(i.anEdge.sym,o.lNext);else l=t.mesh.connect(a.dNext(),i.anEdge).sym;u.fixUpperEdge?t.sweep.fixUpperEdge_(u,l):t.sweep.computeWinding_(e,t.sweep.addRegionBelow_(e,s,l)),t.sweep.sweepEvent_(e,i)}else t.sweep.addRightEdges_(e,s,i.anEdge,i.anEdge,null,!0)}else t.sweep.connectLeftDegenerate_(e,s,i)},t.sweep.sweepEvent_=function(e,i){e.event=i;for(var n=i.anEdge;null===n.activeRegion;)if((n=n.oNext)===i.anEdge)return void t.sweep.connectLeftVertex_(e,i);var s=t.sweep.topLeftRegion_(n.activeRegion),r=s.regionBelow(),o=r.eUp,a=t.sweep.finishLeftRegions_(e,r,null);a.oNext===o?t.sweep.connectRightVertex_(e,s,a):t.sweep.addRightEdges_(e,s,a.oNext,o,o,!0)},t.sweep.addSentinel_=function(e,i){var n=new t.ActiveRegion,s=t.mesh.makeEdge(e.mesh);s.org.s=t.sweep.SENTINEL_COORD_,s.org.t=i,s.dst().s=-t.sweep.SENTINEL_COORD_,s.dst().t=i,e.event=s.dst(),n.eUp=s,n.windingNumber=0,n.inside=!1,n.fixUpperEdge=!1,n.sentinel=!0,n.dirty=!1,n.nodeUp=e.dict.insert(n)},t.sweep.initEdgeDict_=function(e){e.dict=new t.Dict(e,t.sweep.edgeLeq_),t.sweep.addSentinel_(e,-t.sweep.SENTINEL_COORD_),t.sweep.addSentinel_(e,t.sweep.SENTINEL_COORD_)},t.sweep.doneEdgeDict_=function(e){for(var i;null!==(i=e.dict.getMin().getKey());)i.sentinel,t.sweep.deleteRegion_(e,i);e.dict=null},t.sweep.removeDegenerateEdges_=function(e){for(var i,n=e.mesh.eHead,s=n.next;s!==n;s=i){i=s.next;var r=s.lNext;t.geom.vertEq(s.org,s.dst())&&s.lNext.lNext!==s&&(t.sweep.spliceMergeVertices_(e,r,s),t.mesh.deleteEdge(s),r=(s=r).lNext),r.lNext===s&&(r!==s&&(r!==i&&r!==i.sym||(i=i.next),t.mesh.deleteEdge(r)),s!==i&&s!==i.sym||(i=i.next),t.mesh.deleteEdge(s))}},t.sweep.initPriorityQ_=function(e){var i=new t.PriorityQ;e.pq=i;var n,s=e.mesh.vHead;for(n=s.next;n!==s;n=n.next)n.pqHandle=i.insert(n);i.init()},t.sweep.donePriorityQ_=function(e){e.pq.deleteQ(),e.pq=null},t.sweep.removeDegenerateFaces_=function(e){for(var i,n=e.fHead.next;n!==e.fHead;n=i){i=n.next;var s=n.anEdge;s.lNext.lNext===s&&(t.sweep.addWinding_(s.oNext,s),t.mesh.deleteEdge(s))}},t.tessmono={},t.tessmono.tessellateMonoRegion_=function(e){for(var i=e.anEdge;t.geom.vertLeq(i.dst(),i.org);i=i.lPrev());for(;t.geom.vertLeq(i.org,i.dst());i=i.lNext);for(var n,s=i.lPrev();i.lNext!==s;)if(t.geom.vertLeq(i.dst(),s.org)){for(;s.lNext!==i&&(t.geom.edgeGoesLeft(s.lNext)||t.geom.edgeSign(s.org,s.dst(),s.lNext.dst())<=0);)s=(n=t.mesh.connect(s.lNext,s)).sym;s=s.lPrev()}else{for(;s.lNext!==i&&(t.geom.edgeGoesRight(i.lPrev())||t.geom.edgeSign(i.dst(),i.org,i.lPrev().org)>=0);)n=t.mesh.connect(i,i.lPrev()),i=n.sym;i=i.lNext}for(;s.lNext.lNext!==i;)s=(n=t.mesh.connect(s.lNext,s)).sym},t.tessmono.tessellateInterior=function(e){for(var i,n=e.fHead.next;n!==e.fHead;n=i)i=n.next,n.inside&&t.tessmono.tessellateMonoRegion_(n)},t.tessmono.discardExterior=function(e){for(var i,n=e.fHead.next;n!==e.fHead;n=i)i=n.next,n.inside||t.mesh.zapFace(n)},t.tessmono.setWindingNumber=function(e,i,n){for(var s,r=e.eHead.next;r!==e.eHead;r=s)s=r.next,r.rFace().inside!==r.lFace.inside?r.winding=r.lFace.inside?i:-i:n?t.mesh.deleteEdge(r):r.winding=0},t.Dict=function(e,i){this.head_=new t.DictNode,this.frame_=e,this.leq_=i},t.Dict.prototype.deleteDict_=function(){},t.Dict.prototype.insertBefore=function(e,i){do{e=e.prev}while(null!==e.key&&!this.leq_(this.frame_,e.key,i));var n=new t.DictNode(i,e.next,e);return e.next.prev=n,e.next=n,n},t.Dict.prototype.insert=function(e){return this.insertBefore(this.head_,e)},t.Dict.prototype.deleteNode=function(e){e.next.prev=e.prev,e.prev.next=e.next},t.Dict.prototype.search=function(e){var t=this.head_;do{t=t.next}while(null!==t.key&&!this.leq_(this.frame_,e,t.key));return t},t.Dict.prototype.getMin=function(){return this.head_.next},t.Dict.prototype.getMax=function(){return this.head_.prev},t.DictNode=function(e,t,i){this.key=e||null,this.next=t||this,this.prev=i||this},t.DictNode.prototype.getKey=function(){return this.key},t.DictNode.prototype.getSuccessor=function(){return this.next},t.DictNode.prototype.getPredecessor=function(){return this.prev},t.GluTesselator=function(){this.state_=t.GluTesselator.tessState_.T_DORMANT,this.lastEdge_=null,this.mesh=null,this.errorCallback_=null,this.normal_=[0,0,0],this.windingRule=t.windingRule.GLU_TESS_WINDING_ODD,this.fatalError=!1,this.dict=null,this.pq=null,this.event=null,this.combineCallback_=null,this.boundaryOnly_=!1,this.beginCallback_=null,this.edgeFlagCallback_=null,this.vertexCallback_=null,this.endCallback_=null,this.meshCallback_=null,this.polygonData_=null},t.GluTesselator.tessState_={T_DORMANT:0,T_IN_POLYGON:1,T_IN_CONTOUR:2},t.GluTesselator.prototype.gluDeleteTess=function(){this.requireState_(t.GluTesselator.tessState_.T_DORMANT)},t.GluTesselator.prototype.gluTessProperty=function(e,i){switch(e){case t.gluEnum.GLU_TESS_TOLERANCE:return;case t.gluEnum.GLU_TESS_WINDING_RULE:var n=i;switch(n){case t.windingRule.GLU_TESS_WINDING_ODD:case t.windingRule.GLU_TESS_WINDING_NONZERO:case t.windingRule.GLU_TESS_WINDING_POSITIVE:case t.windingRule.GLU_TESS_WINDING_NEGATIVE:case t.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return void(this.windingRule=n)}break;case t.gluEnum.GLU_TESS_BOUNDARY_ONLY:return void(this.boundaryOnly_=!!i);default:return void this.callErrorCallback(t.gluEnum.GLU_INVALID_ENUM)}this.callErrorCallback(t.gluEnum.GLU_INVALID_VALUE)},t.GluTesselator.prototype.gluGetTessProperty=function(e){switch(e){case t.gluEnum.GLU_TESS_TOLERANCE:return 0;case t.gluEnum.GLU_TESS_WINDING_RULE:return this.windingRule;case t.gluEnum.GLU_TESS_BOUNDARY_ONLY:return this.boundaryOnly_;default:this.callErrorCallback(t.gluEnum.GLU_INVALID_ENUM)}return!1},t.GluTesselator.prototype.gluTessNormal=function(e,t,i){this.normal_[0]=e,this.normal_[1]=t,this.normal_[2]=i},t.GluTesselator.prototype.gluTessCallback=function(e,i){var n=i||null;switch(e){case t.gluEnum.GLU_TESS_BEGIN:case t.gluEnum.GLU_TESS_BEGIN_DATA:return void(this.beginCallback_=n);case t.gluEnum.GLU_TESS_EDGE_FLAG:case t.gluEnum.GLU_TESS_EDGE_FLAG_DATA:return void(this.edgeFlagCallback_=n);case t.gluEnum.GLU_TESS_VERTEX:case t.gluEnum.GLU_TESS_VERTEX_DATA:return void(this.vertexCallback_=n);case t.gluEnum.GLU_TESS_END:case t.gluEnum.GLU_TESS_END_DATA:return void(this.endCallback_=n);case t.gluEnum.GLU_TESS_ERROR:case t.gluEnum.GLU_TESS_ERROR_DATA:return void(this.errorCallback_=n);case t.gluEnum.GLU_TESS_COMBINE:case t.gluEnum.GLU_TESS_COMBINE_DATA:return void(this.combineCallback_=n);case t.gluEnum.GLU_TESS_MESH:return void(this.meshCallback_=n);default:return void this.callErrorCallback(t.gluEnum.GLU_INVALID_ENUM)}},t.GluTesselator.prototype.gluTessVertex=function(e,i){var n=!1,s=[0,0,0];this.requireState_(t.GluTesselator.tessState_.T_IN_CONTOUR);for(var r=0;r<3;++r){var o=e[r];o<-t.GLU_TESS_MAX_COORD&&(o=-t.GLU_TESS_MAX_COORD,n=!0),o>t.GLU_TESS_MAX_COORD&&(o=t.GLU_TESS_MAX_COORD,n=!0),s[r]=o}n&&this.callErrorCallback(t.errorType.GLU_TESS_COORD_TOO_LARGE),this.addVertex_(s,i)},t.GluTesselator.prototype.gluTessBeginPolygon=function(e){this.requireState_(t.GluTesselator.tessState_.T_DORMANT),this.state_=t.GluTesselator.tessState_.T_IN_POLYGON,this.mesh=new t.GluMesh,this.polygonData_=e},t.GluTesselator.prototype.gluTessBeginContour=function(){this.requireState_(t.GluTesselator.tessState_.T_IN_POLYGON),this.state_=t.GluTesselator.tessState_.T_IN_CONTOUR,this.lastEdge_=null},t.GluTesselator.prototype.gluTessEndContour=function(){this.requireState_(t.GluTesselator.tessState_.T_IN_CONTOUR),this.state_=t.GluTesselator.tessState_.T_IN_POLYGON},t.GluTesselator.prototype.gluTessEndPolygon=function(){if(this.requireState_(t.GluTesselator.tessState_.T_IN_POLYGON),this.state_=t.GluTesselator.tessState_.T_DORMANT,t.normal.projectPolygon(this,this.normal_[0],this.normal_[1],this.normal_[2]),t.sweep.computeInterior(this),!this.fatalError){var e=this.mesh;if(this.boundaryOnly_?t.tessmono.setWindingNumber(e,1,!0):t.tessmono.tessellateInterior(e),this.mesh.checkMesh(),this.beginCallback_||this.endCallback_||this.vertexCallback_||this.edgeFlagCallback_)if(this.boundaryOnly_)t.render.renderBoundary(this,this.mesh);else{var i=!!this.edgeFlagCallback_;t.render.renderMesh(this,this.mesh,i)}if(this.meshCallback_)return t.tessmono.discardExterior(this.mesh),this.meshCallback_(this.mesh),this.mesh=null,void(this.polygonData_=null)}t.mesh.deleteMesh(this.mesh),this.polygonData_=null,this.mesh=null},t.GluTesselator.prototype.requireState_=function(e){this.state_!==e&&this.gotoState_(e)},t.GluTesselator.prototype.gotoState_=function(e){for(;this.state_!==e;)if(this.state_<e)switch(this.state_){case t.GluTesselator.tessState_.T_DORMANT:this.callErrorCallback(t.errorType.GLU_TESS_MISSING_BEGIN_POLYGON),this.gluTessBeginPolygon(null);break;case t.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorCallback(t.errorType.GLU_TESS_MISSING_BEGIN_CONTOUR),this.gluTessBeginContour()}else switch(this.state_){case t.GluTesselator.tessState_.T_IN_CONTOUR:this.callErrorCallback(t.errorType.GLU_TESS_MISSING_END_CONTOUR),this.gluTessEndContour();break;case t.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorCallback(t.errorType.GLU_TESS_MISSING_END_POLYGON),this.gluTessEndPolygon()}},t.GluTesselator.prototype.addVertex_=function(e,i){var n=this.lastEdge_;null===n?(n=t.mesh.makeEdge(this.mesh),t.mesh.meshSplice(n,n.sym)):(t.mesh.splitEdge(n),n=n.lNext),n.org.data=i,n.org.coords[0]=e[0],n.org.coords[1]=e[1],n.org.coords[2]=e[2],n.winding=1,n.sym.winding=-1,this.lastEdge_=n},t.GluTesselator.prototype.callBeginCallback=function(e){this.beginCallback_&&this.beginCallback_(e,this.polygonData_)},t.GluTesselator.prototype.callVertexCallback=function(e){this.vertexCallback_&&this.vertexCallback_(e,this.polygonData_)},t.GluTesselator.prototype.callEdgeFlagCallback=function(e){this.edgeFlagCallback_&&this.edgeFlagCallback_(e,this.polygonData_)},t.GluTesselator.prototype.callEndCallback=function(){this.endCallback_&&this.endCallback_(this.polygonData_)},t.GluTesselator.prototype.callCombineCallback=function(e,t,i){return this.combineCallback_&&this.combineCallback_(e,t,i,this.polygonData_)||null},t.GluTesselator.prototype.callErrorCallback=function(e){this.errorCallback_&&this.errorCallback_(e,this.polygonData_)},t.GluFace=function(e,t){this.next=e||this,this.prev=t||this,this.anEdge=null,this.data=null,this.inside=!1},t.GluHalfEdge=function(e){this.next=e||this,this.sym=null,this.oNext=null,this.lNext=null,this.org=null,this.lFace=null,this.activeRegion=null,this.winding=0},t.GluHalfEdge.prototype.rFace=function(){return this.sym.lFace},t.GluHalfEdge.prototype.dst=function(){return this.sym.org},t.GluHalfEdge.prototype.oPrev=function(){return this.sym.lNext},t.GluHalfEdge.prototype.lPrev=function(){return this.oNext.sym},t.GluHalfEdge.prototype.dPrev=function(){return this.lNext.sym},t.GluHalfEdge.prototype.rPrev=function(){return this.sym.oNext},t.GluHalfEdge.prototype.dNext=function(){return this.rPrev().sym},t.GluHalfEdge.prototype.rNext=function(){return this.oPrev().sym},t.GluMesh=function(){this.vHead=new t.GluVertex,this.fHead=new t.GluFace,this.eHead=new t.GluHalfEdge,this.eHeadSym=new t.GluHalfEdge,this.eHead.sym=this.eHeadSym,this.eHeadSym.sym=this.eHead},t.GluMesh.prototype.checkMesh=function(){if(t.DEBUG){var e,i,n,s=this.fHead,r=this.vHead,o=this.eHead,a=s;for(a=s;(i=a.next)!==s;a=i){e=i.anEdge;do{e=e.lNext}while(e!==i.anEdge)}var l=r;for(l=r;(n=l.next)!==r;l=n){e=n.anEdge;do{e=e.oNext}while(e!==n.anEdge)}var u=o;for(u=o;(e=u.next)!==o;u=e);}},t.GluVertex=function(e,t){this.next=e||this,this.prev=t||this,this.anEdge=null,this.data=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0},t.PriorityQ=function(){this.verts_=[],this.order_=null,this.size_=0,this.initialized_=!1,this.heap_=new t.PriorityQHeap},t.PriorityQ.prototype.deleteQ=function(){this.heap_=null,this.order_=null,this.verts_=null},t.PriorityQ.prototype.init=function(){this.order_=[];for(var e=0;e<this.size_;e++)this.order_[e]=e;var i,n=(i=this.verts_,function(e,n){return t.geom.vertLeq(i[e],i[n])?1:-1});if(this.order_.sort(n),this.initialized_=!0,this.heap_.init(),t.DEBUG){var s=0+this.size_-1;for(e=0;e<s;++e);}},t.PriorityQ.prototype.insert=function(e){if(this.initialized_)return this.heap_.insert(e);var t=this.size_++;return this.verts_[t]=e,-(t+1)},t.PriorityQ.prototype.extractMin=function(){if(0===this.size_)return this.heap_.extractMin();var e=this.verts_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var i=this.heap_.minimum();if(t.geom.vertLeq(i,e))return this.heap_.extractMin()}do{--this.size_}while(this.size_>0&&null===this.verts_[this.order_[this.size_-1]]);return e},t.PriorityQ.prototype.minimum=function(){if(0===this.size_)return this.heap_.minimum();var e=this.verts_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var i=this.heap_.minimum();if(t.geom.vertLeq(i,e))return i}return e},t.PriorityQ.prototype.remove=function(e){if(e>=0)this.heap_.remove(e);else for(e=-(e+1),this.verts_[e]=null;this.size_>0&&null===this.verts_[this.order_[this.size_-1]];)--this.size_},t.PriorityQHeap=function(){this.heap_=t.PriorityQHeap.reallocNumeric_([0],t.PriorityQHeap.INIT_SIZE_+1),this.verts_=[null,null],this.handles_=[0,0],this.size_=0,this.max_=t.PriorityQHeap.INIT_SIZE_,this.freeList_=0,this.initialized_=!1,this.heap_[1]=1},t.PriorityQHeap.INIT_SIZE_=32,t.PriorityQHeap.reallocNumeric_=function(e,t){for(var i=new Array(t),n=0;n<e.length;n++)i[n]=e[n];for(;n<t;n++)i[n]=0;return i},t.PriorityQHeap.prototype.init=function(){for(var e=this.size_;e>=1;--e)this.floatDown_(e);this.initialized_=!0},t.PriorityQHeap.prototype.insert=function(e){var i,n=++this.size_;return 2*n>this.max_&&(this.max_*=2,this.handles_=t.PriorityQHeap.reallocNumeric_(this.handles_,this.max_+1)),0===this.freeList_?i=n:(i=this.freeList_,this.freeList_=this.handles_[this.freeList_]),this.verts_[i]=e,this.handles_[i]=n,this.heap_[n]=i,this.initialized_&&this.floatUp_(n),i},t.PriorityQHeap.prototype.isEmpty=function(){return 0===this.size_},t.PriorityQHeap.prototype.minimum=function(){return this.verts_[this.heap_[1]]},t.PriorityQHeap.prototype.extractMin=function(){var e=this.heap_,t=this.verts_,i=this.handles_,n=e[1],s=t[n];return this.size_>0&&(e[1]=e[this.size_],i[e[1]]=1,t[n]=null,i[n]=this.freeList_,this.freeList_=n,--this.size_>0&&this.floatDown_(1)),s},t.PriorityQHeap.prototype.remove=function(e){var i=this.heap_,n=this.verts_,s=this.handles_,r=s[e];if(i[r]=i[this.size_],s[i[r]]=r,r<=--this.size_)if(r<=1)this.floatDown_(r);else{var o=n[i[r]],a=n[i[r>>1]];t.geom.vertLeq(a,o)?this.floatDown_(r):this.floatUp_(r)}n[e]=null,s[e]=this.freeList_,this.freeList_=e},t.PriorityQHeap.prototype.floatDown_=function(e){for(var i=this.heap_,n=this.verts_,s=this.handles_,r=e,o=i[r];;){var a=r<<1;a<this.size_&&t.geom.vertLeq(n[i[a+1]],n[i[a]])&&(a+=1);var l=i[a];if(a>this.size_||t.geom.vertLeq(n[o],n[l]))return i[r]=o,void(s[o]=r);i[r]=l,s[l]=r,r=a}},t.PriorityQHeap.prototype.floatUp_=function(e){for(var i=this.heap_,n=this.verts_,s=this.handles_,r=e,o=i[r];;){var a=r>>1,l=i[a];if(0===a||t.geom.vertLeq(n[l],n[o]))return i[r]=o,void(s[o]=r);i[r]=l,s[l]=r,r=a}},t.ActiveRegion=function(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1},t.ActiveRegion.prototype.regionBelow=function(){return this.nodeUp.getPredecessor().getKey()},t.ActiveRegion.prototype.regionAbove=function(){return this.nodeUp.getSuccessor().getKey()},e.exports=t},644:function(e,t){!function(e){var t=(e,t,i,n)=>{let s=65535&e|0,r=e>>>16&65535|0,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do{s=s+t[n++]|0,r=r+s|0}while(--o);s%=65521,r%=65521}return s|r<<16|0};const i=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var n=(e,t,n,s)=>{const r=i,o=s+n;e^=-1;for(let i=s;i<o;i++)e=e>>>8^r[255&(e^t[i])];return-1^e};const s=16209,r=16191;var o=function(e,t){let i,n,o,a,l,u,h,d,c,p,g,f,m,_,x,y,w,b,S,T,v,O,E,N;const C=e.state;i=e.next_in,E=e.input,n=i+(e.avail_in-5),o=e.next_out,N=e.output,a=o-(t-e.avail_out),l=o+(e.avail_out-257),u=C.dmax,h=C.wsize,d=C.whave,c=C.wnext,p=C.window,g=C.hold,f=C.bits,m=C.lencode,_=C.distcode,x=(1<<C.lenbits)-1,y=(1<<C.distbits)-1;e:do{f<15&&(g+=E[i++]<<f,f+=8,g+=E[i++]<<f,f+=8),w=m[g&x];t:for(;;){if(b=w>>>24,g>>>=b,f-=b,b=w>>>16&255,0===b)N[o++]=65535&w;else{if(!(16&b)){if(0==(64&b)){w=m[(65535&w)+(g&(1<<b)-1)];continue t}if(32&b){C.mode=r;break e}e.msg="invalid literal/length code",C.mode=s;break e}S=65535&w,b&=15,b&&(f<b&&(g+=E[i++]<<f,f+=8),S+=g&(1<<b)-1,g>>>=b,f-=b),f<15&&(g+=E[i++]<<f,f+=8,g+=E[i++]<<f,f+=8),w=_[g&y];i:for(;;){if(b=w>>>24,g>>>=b,f-=b,b=w>>>16&255,!(16&b)){if(0==(64&b)){w=_[(65535&w)+(g&(1<<b)-1)];continue i}e.msg="invalid distance code",C.mode=s;break e}if(T=65535&w,b&=15,f<b&&(g+=E[i++]<<f,f+=8,f<b&&(g+=E[i++]<<f,f+=8)),T+=g&(1<<b)-1,T>u){e.msg="invalid distance too far back",C.mode=s;break e}if(g>>>=b,f-=b,b=o-a,T>b){if(b=T-b,b>d&&C.sane){e.msg="invalid distance too far back",C.mode=s;break e}if(v=0,O=p,0===c){if(v+=h-b,b<S){S-=b;do{N[o++]=p[v++]}while(--b);v=o-T,O=N}}else if(c<b){if(v+=h+c-b,b-=c,b<S){S-=b;do{N[o++]=p[v++]}while(--b);if(v=0,c<S){b=c,S-=b;do{N[o++]=p[v++]}while(--b);v=o-T,O=N}}}else if(v+=c-b,b<S){S-=b;do{N[o++]=p[v++]}while(--b);v=o-T,O=N}for(;S>2;)N[o++]=O[v++],N[o++]=O[v++],N[o++]=O[v++],S-=3;S&&(N[o++]=O[v++],S>1&&(N[o++]=O[v++]))}else{v=o-T;do{N[o++]=N[v++],N[o++]=N[v++],N[o++]=N[v++],S-=3}while(S>2);S&&(N[o++]=N[v++],S>1&&(N[o++]=N[v++]))}break}}break}}while(i<n&&o<l);S=f>>3,i-=S,f-=S<<3,g&=(1<<f)-1,e.next_in=i,e.next_out=o,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=o<l?l-o+257:257-(o-l),C.hold=g,C.bits=f};const a=15,l=852,u=592,h=0,d=1,c=2,p=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),g=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),f=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),m=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var _=(e,t,i,n,s,r,o,_)=>{const x=_.bits;let y,w,b,S,T,v,O=0,E=0,N=0,C=0,F=0,I=0,M=0,D=0,P=0,R=0,A=null;const V=new Uint16Array(a+1),L=new Uint16Array(a+1);let B,U,X,k=null;for(O=0;O<=a;O++)V[O]=0;for(E=0;E<n;E++)V[t[i+E]]++;for(F=x,C=a;C>=1&&0===V[C];C--);if(F>C&&(F=C),0===C)return s[r++]=20971520,s[r++]=20971520,_.bits=1,0;for(N=1;N<C&&0===V[N];N++);for(F<N&&(F=N),D=1,O=1;O<=a;O++)if(D<<=1,D-=V[O],D<0)return-1;if(D>0&&(e===h||1!==C))return-1;for(L[1]=0,O=1;O<a;O++)L[O+1]=L[O]+V[O];for(E=0;E<n;E++)0!==t[i+E]&&(o[L[t[i+E]]++]=E);if(e===h?(A=k=o,v=20):e===d?(A=p,k=g,v=257):(A=f,k=m,v=0),R=0,E=0,O=N,T=r,I=F,M=0,b=-1,P=1<<F,S=P-1,e===d&&P>l||e===c&&P>u)return 1;for(;;){B=O-M,o[E]+1<v?(U=0,X=o[E]):o[E]>=v?(U=k[o[E]-v],X=A[o[E]-v]):(U=96,X=0),y=1<<O-M,w=1<<I,N=w;do{w-=y,s[T+(R>>M)+w]=B<<24|U<<16|X|0}while(0!==w);for(y=1<<O-1;R&y;)y>>=1;if(0!==y?(R&=y-1,R+=y):R=0,E++,0==--V[O]){if(O===C)break;O=t[i+o[E]]}if(O>F&&(R&S)!==b){for(0===M&&(M=F),T+=N,I=O-M,D=1<<I;I+M<C&&(D-=V[I+M],!(D<=0));)I++,D<<=1;if(P+=1<<I,e===d&&P>l||e===c&&P>u)return 1;b=R&S,s[b]=F<<24|I<<16|T-r|0}}return 0!==R&&(s[T+R]=O-M<<24|64<<16|0),_.bits=F,0},x={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const y=0,w=1,b=2,{Z_FINISH:S,Z_BLOCK:T,Z_TREES:v,Z_OK:O,Z_STREAM_END:E,Z_NEED_DICT:N,Z_STREAM_ERROR:C,Z_DATA_ERROR:F,Z_MEM_ERROR:I,Z_BUF_ERROR:M,Z_DEFLATED:D}=x,P=16180,R=16181,A=16182,V=16183,L=16184,B=16185,U=16186,X=16187,k=16188,j=16189,z=16190,G=16191,H=16192,q=16193,Y=16194,W=16195,$=16196,J=16197,K=16198,Z=16199,Q=16200,ee=16201,te=16202,ie=16203,ne=16204,se=16205,re=16206,oe=16207,ae=16208,le=16209,ue=16210,he=16211,de=852,ce=592,pe=15,ge=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function fe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const me=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<P||t.mode>he?1:0},_e=e=>{if(me(e))return C;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(de),t.distcode=t.distdyn=new Int32Array(ce),t.sane=1,t.back=-1,O},xe=e=>{if(me(e))return C;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,_e(e)},ye=(e,t)=>{let i;if(me(e))return C;const n=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?C:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,xe(e))},we=(e,t)=>{if(!e)return C;const i=new fe;e.state=i,i.strm=e,i.window=null,i.mode=P;const n=ye(e,t);return n!==O&&(e.state=null),n};let be,Se,Te=!0;const ve=e=>{if(Te){be=new Int32Array(512),Se=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(_(w,e.lens,0,288,be,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;_(b,e.lens,0,32,Se,0,e.work,{bits:5}),Te=!1}e.lencode=be,e.lenbits=9,e.distcode=Se,e.distbits=5},Oe=(e,t,i,n)=>{let s;const r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),n>=r.wsize?(r.window.set(t.subarray(i-r.wsize,i),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>n&&(s=n),r.window.set(t.subarray(i-n,i-n+s),r.wnext),(n-=s)?(r.window.set(t.subarray(i-n,i),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=s))),0};var Ee={inflateReset:xe,inflateReset2:ye,inflateResetKeep:_e,inflateInit:e=>we(e,pe),inflateInit2:we,inflate:(e,i)=>{let s,r,a,l,u,h,d,c,p,g,f,m,x,he,de,ce,pe,fe,_e,xe,ye,we,be=0;const Se=new Uint8Array(4);let Te,Ee;const Ne=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(me(e)||!e.output||!e.input&&0!==e.avail_in)return C;s=e.state,s.mode===G&&(s.mode=H),u=e.next_out,a=e.output,d=e.avail_out,l=e.next_in,r=e.input,h=e.avail_in,c=s.hold,p=s.bits,g=h,f=d,we=O;e:for(;;)switch(s.mode){case P:if(0===s.wrap){s.mode=H;break}for(;p<16;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(2&s.wrap&&35615===c){0===s.wbits&&(s.wbits=15),s.check=0,Se[0]=255&c,Se[1]=c>>>8&255,s.check=n(s.check,Se,2,0),c=0,p=0,s.mode=R;break}if(s.head&&(s.head.done=!1),!(1&s.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",s.mode=le;break}if((15&c)!==D){e.msg="unknown compression method",s.mode=le;break}if(c>>>=4,p-=4,ye=8+(15&c),0===s.wbits&&(s.wbits=ye),ye>15||ye>s.wbits){e.msg="invalid window size",s.mode=le;break}s.dmax=1<<s.wbits,s.flags=0,e.adler=s.check=1,s.mode=512&c?j:G,c=0,p=0;break;case R:for(;p<16;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(s.flags=c,(255&s.flags)!==D){e.msg="unknown compression method",s.mode=le;break}if(57344&s.flags){e.msg="unknown header flags set",s.mode=le;break}s.head&&(s.head.text=c>>8&1),512&s.flags&&4&s.wrap&&(Se[0]=255&c,Se[1]=c>>>8&255,s.check=n(s.check,Se,2,0)),c=0,p=0,s.mode=A;case A:for(;p<32;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}s.head&&(s.head.time=c),512&s.flags&&4&s.wrap&&(Se[0]=255&c,Se[1]=c>>>8&255,Se[2]=c>>>16&255,Se[3]=c>>>24&255,s.check=n(s.check,Se,4,0)),c=0,p=0,s.mode=V;case V:for(;p<16;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}s.head&&(s.head.xflags=255&c,s.head.os=c>>8),512&s.flags&&4&s.wrap&&(Se[0]=255&c,Se[1]=c>>>8&255,s.check=n(s.check,Se,2,0)),c=0,p=0,s.mode=L;case L:if(1024&s.flags){for(;p<16;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}s.length=c,s.head&&(s.head.extra_len=c),512&s.flags&&4&s.wrap&&(Se[0]=255&c,Se[1]=c>>>8&255,s.check=n(s.check,Se,2,0)),c=0,p=0}else s.head&&(s.head.extra=null);s.mode=B;case B:if(1024&s.flags&&(m=s.length,m>h&&(m=h),m&&(s.head&&(ye=s.head.extra_len-s.length,s.head.extra||(s.head.extra=new Uint8Array(s.head.extra_len)),s.head.extra.set(r.subarray(l,l+m),ye)),512&s.flags&&4&s.wrap&&(s.check=n(s.check,r,m,l)),h-=m,l+=m,s.length-=m),s.length))break e;s.length=0,s.mode=U;case U:if(2048&s.flags){if(0===h)break e;m=0;do{ye=r[l+m++],s.head&&ye&&s.length<65536&&(s.head.name+=String.fromCharCode(ye))}while(ye&&m<h);if(512&s.flags&&4&s.wrap&&(s.check=n(s.check,r,m,l)),h-=m,l+=m,ye)break e}else s.head&&(s.head.name=null);s.length=0,s.mode=X;case X:if(4096&s.flags){if(0===h)break e;m=0;do{ye=r[l+m++],s.head&&ye&&s.length<65536&&(s.head.comment+=String.fromCharCode(ye))}while(ye&&m<h);if(512&s.flags&&4&s.wrap&&(s.check=n(s.check,r,m,l)),h-=m,l+=m,ye)break e}else s.head&&(s.head.comment=null);s.mode=k;case k:if(512&s.flags){for(;p<16;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(4&s.wrap&&c!==(65535&s.check)){e.msg="header crc mismatch",s.mode=le;break}c=0,p=0}s.head&&(s.head.hcrc=s.flags>>9&1,s.head.done=!0),e.adler=s.check=0,s.mode=G;break;case j:for(;p<32;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}e.adler=s.check=ge(c),c=0,p=0,s.mode=z;case z:if(0===s.havedict)return e.next_out=u,e.avail_out=d,e.next_in=l,e.avail_in=h,s.hold=c,s.bits=p,N;e.adler=s.check=1,s.mode=G;case G:if(i===T||i===v)break e;case H:if(s.last){c>>>=7&p,p-=7&p,s.mode=re;break}for(;p<3;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}switch(s.last=1&c,c>>>=1,p-=1,3&c){case 0:s.mode=q;break;case 1:if(ve(s),s.mode=Z,i===v){c>>>=2,p-=2;break e}break;case 2:s.mode=$;break;case 3:e.msg="invalid block type",s.mode=le}c>>>=2,p-=2;break;case q:for(c>>>=7&p,p-=7&p;p<32;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",s.mode=le;break}if(s.length=65535&c,c=0,p=0,s.mode=Y,i===v)break e;case Y:s.mode=W;case W:if(m=s.length,m){if(m>h&&(m=h),m>d&&(m=d),0===m)break e;a.set(r.subarray(l,l+m),u),h-=m,l+=m,d-=m,u+=m,s.length-=m;break}s.mode=G;break;case $:for(;p<14;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(s.nlen=257+(31&c),c>>>=5,p-=5,s.ndist=1+(31&c),c>>>=5,p-=5,s.ncode=4+(15&c),c>>>=4,p-=4,s.nlen>286||s.ndist>30){e.msg="too many length or distance symbols",s.mode=le;break}s.have=0,s.mode=J;case J:for(;s.have<s.ncode;){for(;p<3;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}s.lens[Ne[s.have++]]=7&c,c>>>=3,p-=3}for(;s.have<19;)s.lens[Ne[s.have++]]=0;if(s.lencode=s.lendyn,s.lenbits=7,Te={bits:s.lenbits},we=_(y,s.lens,0,19,s.lencode,0,s.work,Te),s.lenbits=Te.bits,we){e.msg="invalid code lengths set",s.mode=le;break}s.have=0,s.mode=K;case K:for(;s.have<s.nlen+s.ndist;){for(;be=s.lencode[c&(1<<s.lenbits)-1],de=be>>>24,ce=be>>>16&255,pe=65535&be,!(de<=p);){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(pe<16)c>>>=de,p-=de,s.lens[s.have++]=pe;else{if(16===pe){for(Ee=de+2;p<Ee;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(c>>>=de,p-=de,0===s.have){e.msg="invalid bit length repeat",s.mode=le;break}ye=s.lens[s.have-1],m=3+(3&c),c>>>=2,p-=2}else if(17===pe){for(Ee=de+3;p<Ee;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}c>>>=de,p-=de,ye=0,m=3+(7&c),c>>>=3,p-=3}else{for(Ee=de+7;p<Ee;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}c>>>=de,p-=de,ye=0,m=11+(127&c),c>>>=7,p-=7}if(s.have+m>s.nlen+s.ndist){e.msg="invalid bit length repeat",s.mode=le;break}for(;m--;)s.lens[s.have++]=ye}}if(s.mode===le)break;if(0===s.lens[256]){e.msg="invalid code -- missing end-of-block",s.mode=le;break}if(s.lenbits=9,Te={bits:s.lenbits},we=_(w,s.lens,0,s.nlen,s.lencode,0,s.work,Te),s.lenbits=Te.bits,we){e.msg="invalid literal/lengths set",s.mode=le;break}if(s.distbits=6,s.distcode=s.distdyn,Te={bits:s.distbits},we=_(b,s.lens,s.nlen,s.ndist,s.distcode,0,s.work,Te),s.distbits=Te.bits,we){e.msg="invalid distances set",s.mode=le;break}if(s.mode=Z,i===v)break e;case Z:s.mode=Q;case Q:if(h>=6&&d>=258){e.next_out=u,e.avail_out=d,e.next_in=l,e.avail_in=h,s.hold=c,s.bits=p,o(e,f),u=e.next_out,a=e.output,d=e.avail_out,l=e.next_in,r=e.input,h=e.avail_in,c=s.hold,p=s.bits,s.mode===G&&(s.back=-1);break}for(s.back=0;be=s.lencode[c&(1<<s.lenbits)-1],de=be>>>24,ce=be>>>16&255,pe=65535&be,!(de<=p);){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(ce&&0==(240&ce)){for(fe=de,_e=ce,xe=pe;be=s.lencode[xe+((c&(1<<fe+_e)-1)>>fe)],de=be>>>24,ce=be>>>16&255,pe=65535&be,!(fe+de<=p);){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}c>>>=fe,p-=fe,s.back+=fe}if(c>>>=de,p-=de,s.back+=de,s.length=pe,0===ce){s.mode=se;break}if(32&ce){s.back=-1,s.mode=G;break}if(64&ce){e.msg="invalid literal/length code",s.mode=le;break}s.extra=15&ce,s.mode=ee;case ee:if(s.extra){for(Ee=s.extra;p<Ee;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}s.length+=c&(1<<s.extra)-1,c>>>=s.extra,p-=s.extra,s.back+=s.extra}s.was=s.length,s.mode=te;case te:for(;be=s.distcode[c&(1<<s.distbits)-1],de=be>>>24,ce=be>>>16&255,pe=65535&be,!(de<=p);){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(0==(240&ce)){for(fe=de,_e=ce,xe=pe;be=s.distcode[xe+((c&(1<<fe+_e)-1)>>fe)],de=be>>>24,ce=be>>>16&255,pe=65535&be,!(fe+de<=p);){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}c>>>=fe,p-=fe,s.back+=fe}if(c>>>=de,p-=de,s.back+=de,64&ce){e.msg="invalid distance code",s.mode=le;break}s.offset=pe,s.extra=15&ce,s.mode=ie;case ie:if(s.extra){for(Ee=s.extra;p<Ee;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}s.offset+=c&(1<<s.extra)-1,c>>>=s.extra,p-=s.extra,s.back+=s.extra}if(s.offset>s.dmax){e.msg="invalid distance too far back",s.mode=le;break}s.mode=ne;case ne:if(0===d)break e;if(m=f-d,s.offset>m){if(m=s.offset-m,m>s.whave&&s.sane){e.msg="invalid distance too far back",s.mode=le;break}m>s.wnext?(m-=s.wnext,x=s.wsize-m):x=s.wnext-m,m>s.length&&(m=s.length),he=s.window}else he=a,x=u-s.offset,m=s.length;m>d&&(m=d),d-=m,s.length-=m;do{a[u++]=he[x++]}while(--m);0===s.length&&(s.mode=Q);break;case se:if(0===d)break e;a[u++]=s.length,d--,s.mode=Q;break;case re:if(s.wrap){for(;p<32;){if(0===h)break e;h--,c|=r[l++]<<p,p+=8}if(f-=d,e.total_out+=f,s.total+=f,4&s.wrap&&f&&(e.adler=s.check=s.flags?n(s.check,a,f,u-f):t(s.check,a,f,u-f)),f=d,4&s.wrap&&(s.flags?c:ge(c))!==s.check){e.msg="incorrect data check",s.mode=le;break}c=0,p=0}s.mode=oe;case oe:if(s.wrap&&s.flags){for(;p<32;){if(0===h)break e;h--,c+=r[l++]<<p,p+=8}if(4&s.wrap&&c!==(4294967295&s.total)){e.msg="incorrect length check",s.mode=le;break}c=0,p=0}s.mode=ae;case ae:we=E;break e;case le:we=F;break e;case ue:return I;default:return C}return e.next_out=u,e.avail_out=d,e.next_in=l,e.avail_in=h,s.hold=c,s.bits=p,(s.wsize||f!==e.avail_out&&s.mode<le&&(s.mode<re||i!==S))&&Oe(e,e.output,e.next_out,f-e.avail_out),g-=e.avail_in,f-=e.avail_out,e.total_in+=g,e.total_out+=f,s.total+=f,4&s.wrap&&f&&(e.adler=s.check=s.flags?n(s.check,a,f,e.next_out-f):t(s.check,a,f,e.next_out-f)),e.data_type=s.bits+(s.last?64:0)+(s.mode===G?128:0)+(s.mode===Z||s.mode===Y?256:0),(0===g&&0===f||i===S)&&we===O&&(we=M),we},inflateEnd:e=>{if(me(e))return C;let t=e.state;return t.window&&(t.window=null),e.state=null,O},inflateGetHeader:(e,t)=>{if(me(e))return C;const i=e.state;return 0==(2&i.wrap)?C:(i.head=t,t.done=!1,O)},inflateSetDictionary:(e,i)=>{const n=i.length;let s,r,o;return me(e)?C:(s=e.state,0!==s.wrap&&s.mode!==z?C:s.mode===z&&(r=1,r=t(r,i,n,0),r!==s.check)?F:(o=Oe(e,i,n,n),o?(s.mode=ue,I):(s.havedict=1,O)))},inflateInfo:"pako inflate (from Nodeca project)"};const Ne=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ce=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)Ne(i,t)&&(e[t]=i[t])}}return e},Fe={assign:Ce,flattenChunks:e=>{let t=0;for(let i=0,n=e.length;i<n;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,n=0,s=e.length;t<s;t++){let s=e[t];i.set(s,n),n+=s.length}return i}};let Ie=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ie=!1}const Me=new Uint8Array(256);for(let e=0;e<256;e++)Me[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Me[254]=Me[254]=1;const De=(e,t)=>{if(t<65534&&e.subarray&&Ie)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i};var Pe={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,n,s,r,o=e.length,a=0;for(s=0;s<o;s++)i=e.charCodeAt(s),55296==(64512&i)&&s+1<o&&(n=e.charCodeAt(s+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),s++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(a),r=0,s=0;r<a;s++)i=e.charCodeAt(s),55296==(64512&i)&&s+1<o&&(n=e.charCodeAt(s+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),s++)),i<128?t[r++]=i:i<2048?(t[r++]=192|i>>>6,t[r++]=128|63&i):i<65536?(t[r++]=224|i>>>12,t[r++]=128|i>>>6&63,t[r++]=128|63&i):(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63,t[r++]=128|i>>>6&63,t[r++]=128|63&i);return t},buf2string:(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,s;const r=new Array(2*i);for(s=0,n=0;n<i;){let t=e[n++];if(t<128){r[s++]=t;continue}let o=Me[t];if(o>4)r[s++]=65533,n+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&n<i;)t=t<<6|63&e[n++],o--;o>1?r[s++]=65533:t<65536?r[s++]=t:(t-=65536,r[s++]=55296|t>>10&1023,r[s++]=56320|1023&t)}}return De(r,s)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+Me[e[i]]>t?i:t}},Re={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function Ae(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Ve=Ae;function Le(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Be=Le;const Ue=Object.prototype.toString,{Z_NO_FLUSH:Xe,Z_FINISH:ke,Z_OK:je,Z_STREAM_END:ze,Z_NEED_DICT:Ge,Z_STREAM_ERROR:He,Z_DATA_ERROR:qe,Z_MEM_ERROR:Ye}=x;function We(e){this.options=Fe.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ve,this.strm.avail_out=0;let i=Ee.inflateInit2(this.strm,t.windowBits);if(i!==je)throw new Error(Re[i]);if(this.header=new Be,Ee.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Pe.string2buf(t.dictionary):"[object ArrayBuffer]"===Ue.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=Ee.inflateSetDictionary(this.strm,t.dictionary),i!==je)))throw new Error(Re[i])}function $e(e,t){const i=new We(t);if(i.push(e),i.err)throw i.msg||Re[i.err];return i.result}function Je(e,t){return(t=t||{}).raw=!0,$e(e,t)}We.prototype.push=function(e,t){const i=this.strm,n=this.options.chunkSize,s=this.options.dictionary;let r,o,a;if(this.ended)return!1;for(o=t===~~t?t:!0===t?ke:Xe,"[object ArrayBuffer]"===Ue.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(n),i.next_out=0,i.avail_out=n),r=Ee.inflate(i,o),r===Ge&&s&&(r=Ee.inflateSetDictionary(i,s),r===je?r=Ee.inflate(i,o):r===qe&&(r=Ge));i.avail_in>0&&r===ze&&i.state.wrap>0&&0!==e[i.next_in];)Ee.inflateReset(i),r=Ee.inflate(i,o);switch(r){case He:case qe:case Ge:case Ye:return this.onEnd(r),this.ended=!0,!1}if(a=i.avail_out,i.next_out&&(0===i.avail_out||r===ze))if("string"===this.options.to){let e=Pe.utf8border(i.output,i.next_out),t=i.next_out-e,s=Pe.buf2string(i.output,e);i.next_out=t,i.avail_out=n-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(s)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(r!==je||0!==a){if(r===ze)return r=Ee.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},We.prototype.onData=function(e){this.chunks.push(e)},We.prototype.onEnd=function(e){e===je&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Fe.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ke=We,Ze=$e,Qe=Je,et=$e,tt=x,it={Inflate:Ke,inflate:Ze,inflateRaw:Qe,ungzip:et,constants:tt};e.Inflate=Ke,e.constants=tt,e.default=it,e.inflate=Ze,e.inflateRaw=Qe,e.ungzip=et,Object.defineProperty(e,"__esModule",{value:!0})}(t)},49:function(e,t){var i,n,s;n=[],void 0===(s="function"==typeof(i=function(){var e=function(e){return e.reduce((function(e,t){return 2*e+t}),0)},t=function(e){for(var t=[],i=7;i>=0;i--)t.push(!!(e&1<<i));return t},i=function(e){this.data=e,this.len=this.data.length,this.pos=0,this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return e instanceof Uint8Array?e[this.pos++]:255&e.charCodeAt(this.pos++)},this.readBytes=function(e){for(var t=[],i=0;i<e;i++)t.push(this.readByte());return t},this.read=function(e){for(var t="",i=0;i<e;i++)t+=String.fromCharCode(this.readByte());return t},this.readUnsigned=function(){var e=this.readBytes(2);return(e[1]<<8)+e[0]}},n=function(e,t){for(var i,n,s=0,r=function(e){for(var i=0,n=0;n<e;n++)t.charCodeAt(s>>3)&1<<(7&s)&&(i|=1<<n),s++;return i},o=[],a=1<<e,l=a+1,u=e+1,h=[],d=function(){h=[],u=e+1;for(var t=0;t<a;t++)h[t]=[t];h[a]=[],h[l]=null};;)if(n=i,(i=r(u))!==a){if(i===l)break;if(i<h.length)n!==a&&h.push(h[n].concat(h[i][0]));else{if(i!==h.length)throw new Error("Invalid LZW code.");h.push(h[n].concat(h[n][0]))}o.push.apply(o,h[i]),h.length===1<<u&&u<12&&u++}else d();return o},s=function(i,s){s||(s={});var r=function(e){for(var t=[],n=0;n<e;n++)t.push(i.readBytes(3));return t},o=function(){var e,t;t="";do{e=i.readByte(),t+=i.read(e)}while(0!==e);return t},a=function(){var n={};if(n.sig=i.read(3),n.ver=i.read(3),"GIF"!==n.sig)throw new Error("Not a GIF file.");n.width=i.readUnsigned(),n.height=i.readUnsigned();var o=t(i.readByte());n.gctFlag=o.shift(),n.colorRes=e(o.splice(0,3)),n.sorted=o.shift(),n.gctSize=e(o.splice(0,3)),n.bgColor=i.readByte(),n.pixelAspectRatio=i.readByte(),n.gctFlag&&(n.gct=r(1<<n.gctSize+1)),s.hdr&&s.hdr(n)},l=function(n){var r=function(n){i.readByte();var r=t(i.readByte());n.reserved=r.splice(0,3),n.disposalMethod=e(r.splice(0,3)),n.userInput=r.shift(),n.transparencyGiven=r.shift(),n.delayTime=i.readUnsigned(),n.transparencyIndex=i.readByte(),n.terminator=i.readByte(),s.gce&&s.gce(n)},a=function(e){e.comment=o(),s.com&&s.com(e)},l=function(e){i.readByte(),e.ptHeader=i.readBytes(12),e.ptData=o(),s.pte&&s.pte(e)},u=function(e){var t=function(e){i.readByte(),e.unknown=i.readByte(),e.iterations=i.readUnsigned(),e.terminator=i.readByte(),s.app&&s.app.NETSCAPE&&s.app.NETSCAPE(e)},n=function(e){e.appData=o(),s.app&&s.app[e.identifier]&&s.app[e.identifier](e)};i.readByte(),e.identifier=i.read(8),e.authCode=i.read(3),"NETSCAPE"===e.identifier?t(e):n(e)},h=function(e){e.data=o(),s.unknown&&s.unknown(e)};switch(n.label=i.readByte(),n.label){case 249:n.extType="gce",r(n);break;case 254:n.extType="com",a(n);break;case 1:n.extType="pte",l(n);break;case 255:n.extType="app",u(n);break;default:n.extType="unknown",h(n)}},u=function(a){var l=function(e,t){for(var i=new Array(e.length),n=e.length/t,s=function(n,s){var r=e.slice(s*t,(s+1)*t);i.splice.apply(i,[n*t,t].concat(r))},r=[0,4,2,1],o=[8,8,4,2],a=0,l=0;l<4;l++)for(var u=r[l];u<n;u+=o[l])s(u,a),a++;return i};a.leftPos=i.readUnsigned(),a.topPos=i.readUnsigned(),a.width=i.readUnsigned(),a.height=i.readUnsigned();var u=t(i.readByte());a.lctFlag=u.shift(),a.interlaced=u.shift(),a.sorted=u.shift(),a.reserved=u.splice(0,2),a.lctSize=e(u.splice(0,3)),a.lctFlag&&(a.lct=r(1<<a.lctSize+1)),a.lzwMinCodeSize=i.readByte();var h=o();a.pixels=n(a.lzwMinCodeSize,h),a.interlaced&&(a.pixels=l(a.pixels,a.width)),s.img&&s.img(a)},h=function(){var e={};switch(e.sentinel=i.readByte(),String.fromCharCode(e.sentinel)){case"!":e.type="ext",l(e);break;case",":e.type="img",u(e);break;case";":e.type="eof",s.eof&&s.eof(e);break;default:throw new Error("Unknown block: 0x"+e.sentinel.toString(16))}"eof"!==e.type&&setTimeout(h,0)};a(),setTimeout(h,0)};return function(e){var t,n,r={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var o in e)r[o]=e[o];r.vp_w&&r.vp_h&&(r.is_vp=!0);var a=null,l=!1,u=null,h=null,d=null,c=null,p=null,g=null,f=null,m=!0,_=!0,x=!1,y=[],w=[],b=r.gif;void 0===r.auto_play&&(r.auto_play=!b.getAttribute("rel:auto_play")||"1"==b.getAttribute("rel:auto_play"));var S,T,v,O,E=r.hasOwnProperty("on_end")?r.on_end:null,N=r.hasOwnProperty("on_error")?r.on_error:null,C=r.hasOwnProperty("loop_delay")?r.loop_delay:0,F=r.hasOwnProperty("loop_mode")?r.loop_mode:"auto",I=!r.hasOwnProperty("draw_while_loading")||r.draw_while_loading,M=!!I&&(!r.hasOwnProperty("show_progress_bar")||r.show_progress_bar),D=r.hasOwnProperty("progressbar_height")?r.progressbar_height:25,P=r.hasOwnProperty("progressbar_background_color")?r.progressbar_background_color:"rgba(255,255,255,0.4)",R=r.hasOwnProperty("progressbar_foreground_color")?r.progressbar_foreground_color:"rgba(255,0,22,.8)",A=function(){u=null,h=null,p=d,d=null,g=null},V=function(){try{s(t,$)}catch(e){X("parse")}},L=function(e,t){S.width=e*K(),S.height=t*K(),v.style.minWidth=e*K()+"px",O.width=e,O.height=t,O.style.width=e+"px",O.style.height=t+"px",O.getContext("2d").setTransform(1,0,0,1,0,0)},B=function(e,t){w[e]?(void 0!==t.x&&(w[e].x=t.x),void 0!==t.y&&(w[e].y=t.y)):w[e]=t},U=function(e,t,i){if(i&&M){var n,s,o,a=D;r.is_vp?x?(s=(r.vp_t+r.vp_h-a)/K(),a/=K(),n=r.vp_l/K()+e/t*(r.vp_w/K()),o=S.width/K()):(s=r.vp_t+r.vp_h-a,n=r.vp_l+e/t*r.vp_w,o=S.width):(s=(S.height-a)/(x?K():1),n=e/t*S.width/(x?K():1),o=S.width/(x?K():1),a/=x?K():1),T.fillStyle=P,T.fillRect(n,s,o-n,a),T.fillStyle=R,T.fillRect(0,s,n,a)}},X=function(e){var t=function(){T.fillStyle="black",T.fillRect(0,0,r.c_w?r.c_w:n.width,r.c_h?r.c_h:n.height),T.strokeStyle="red",T.lineWidth=3,T.moveTo(0,0),T.lineTo(r.c_w?r.c_w:n.width,r.c_h?r.c_h:n.height),T.moveTo(0,r.c_h?r.c_h:n.height),T.lineTo(r.c_w?r.c_w:n.width,0),T.stroke()};a=e,n={width:b.width,height:b.height},y=[],t(),e&&N(e)},k=function(e){L((n=e).width,n.height)},j=function(e){z(),A(),u=e.transparencyGiven?e.transparencyIndex:null,h=e.delayTime,d=e.disposalMethod},z=function(){g&&(y.push({data:g.getImageData(0,0,n.width,n.height),delay:h}),w.push({x:0,y:0}))},G=function(e){g||(g=O.getContext("2d"));var t=y.length,i=e.lctFlag?e.lct:n.gct;t>0&&(3===p?null!==c?g.putImageData(y[c].data,0,0):g.clearRect(f.leftPos,f.topPos,f.width,f.height):c=t-1,2===p&&g.clearRect(f.leftPos,f.topPos,f.width,f.height));var s=g.getImageData(e.leftPos,e.topPos,e.width,e.height);e.pixels.forEach((function(e,t){e!==u&&(s.data[4*t+0]=i[e][0],s.data[4*t+1]=i[e][1],s.data[4*t+2]=i[e][2],s.data[4*t+3]=255)})),g.putImageData(s,e.leftPos,e.topPos),x||(T.scale(K(),K()),x=!0),I&&(T.drawImage(O,0,0),I=r.auto_play),f=e},H=function(){var e,t,i,n=-1,s=0,o=function(){return(n+(_?1:-1)+y.length)%y.length},l=function(e){n+=e,h()},u=(e=!1,t=function(){null!==E&&E(b),s++,!1!==F||s<0?i():(e=!1,m=!1)},i=function(){if(e=m){l(1);var s=10*y[n].delay;s||(s=100),0===o()?(s+=C,setTimeout(t,s)):setTimeout(i,s)}},function(){e||setTimeout(i,0)}),h=function(){var e;(n=parseInt(n,10))>y.length-1&&(n=0),n<0&&(n=0),e=w[n],O.getContext("2d").putImageData(y[n].data,e.x,e.y),T.globalCompositeOperation="copy",T.drawImage(O,0,0)},d=function(){m=!0,u()};return{init:function(){a||(r.c_w&&r.c_h||T.scale(K(),K()),r.auto_play?u():(n=0,h()))},step:u,play:d,pause:function(){m=!1},playing:m,move_relative:l,current_frame:function(){return n},length:function(){return y.length},move_to:function(e){n=e,h()}}}(),q=function(e){U(t.pos,t.data.length,e)},Y=function(){},W=function(e,t){return function(i){e(i),q(t)}},$={hdr:W(k),gce:W(j),com:W(Y),app:{NETSCAPE:W(Y)},img:W(G,!0),eof:function(e){z(),q(!1),r.c_w&&r.c_h||(S.width=n.width*K(),S.height=n.height*K()),H.init(),l=!1,Q&&Q(b)}},J=function(){var e=b.parentNode,t=document.createElement("div");S=document.createElement("canvas"),T=S.getContext("2d"),v=document.createElement("div"),O=document.createElement("canvas"),t.width=S.width=b.width,t.height=S.height=b.height,v.style.minWidth=b.width+"px",t.className="jsgif",v.className="jsgif_toolbar",t.appendChild(S),t.appendChild(v),e.insertBefore(t,b),e.removeChild(b),r.c_w&&r.c_h&&L(r.c_w,r.c_h),Z=!0},K=function(){return r.max_width&&n&&n.width>r.max_width?r.max_width/n.width:1},Z=!1,Q=!1,ee=function(e){return!l&&(Q=e||!1,l=!0,y=[],A(),c=null,p=null,g=null,f=null,!0)},te=function(){return y.reduce((function(e,t){return e+t.delay}),0)};return{play:H.play,pause:H.pause,move_relative:H.move_relative,move_to:H.move_to,get_playing:function(){return m},get_canvas:function(){return S},get_canvas_scale:function(){return K()},get_loading:function(){return l},get_auto_play:function(){return r.auto_play},get_length:function(){return H.length()},get_frames:function(){return y},get_duration:function(){return te()},get_duration_ms:function(){return 10*te()},get_current_frame:function(){return H.current_frame()},load_url:function(e,n){if(ee(n)){var s=new XMLHttpRequest;s.open("GET",e,!0),"overrideMimeType"in s?s.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in s?s.responseType="arraybuffer":s.setRequestHeader("Accept-Charset","x-user-defined"),s.onloadstart=function(){Z||J()},s.onload=function(e){200!=this.status&&X("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var n=this.response;n.toString().indexOf("ArrayBuffer")>0&&(n=new Uint8Array(n)),t=new i(n),setTimeout(V,0)},s.onprogress=function(e){e.lengthComputable&&U(e.loaded,e.total,!0)},s.onerror=function(){X("xhr")},s.send()}},load:function(e){this.load_url(b.getAttribute("rel:animated_src")||b.src,e)},load_raw:function(e,n){ee(n)&&(Z||J(),t=new i(e),setTimeout(V,0))},set_frame_offset:B}}})?i.apply(t,n):i)||(e.exports=s)}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var r=i[e]={exports:{}};return t[e].call(r.exports,r,r.exports,n),r.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};(()=>{n.d(s,{Z:()=>GI});const t=new Map;Object.defineProperty(t,"add",{value(e,i,n){if(t.hasOwnProperty(e));else{const i=window[Symbol.for("X_ITE.X3D-8.12.0")];i&&(i[e]=n),t[e]=n}t.set(i,n)}}),t.add("Namespace","x_ite/Namespace",t);const i=t;let r=0,o=0,a=0,l=0;const u={CONNECTION_ERROR:r++,BROWSER_EVENT:r++,INITIALIZED_EVENT:r++,SHUTDOWN_EVENT:r++,INITIALIZED_ERROR:r++,NOT_STARTED_STATE:o++,IN_PROGRESS_STATE:o++,COMPLETE_STATE:o++,FAILED_STATE:o++,initializeOnly:1,inputOnly:2,outputOnly:4,inputOutput:7,SFBool:a++,SFColor:a++,SFColorRGBA:a++,SFDouble:a++,SFFloat:a++,SFImage:a++,SFInt32:a++,SFMatrix3d:a++,SFMatrix3f:a++,SFMatrix4d:a++,SFMatrix4f:a++,SFNode:a++,SFRotation:a++,SFString:a++,SFTime:a++,SFVec2d:a++,SFVec2f:a++,SFVec3d:a++,SFVec3f:a++,SFVec4d:a++,SFVec4f:a++,VrmlMatrix:a++,MFBool:a++,MFColor:a++,MFColorRGBA:a++,MFDouble:a++,MFFloat:a++,MFImage:a++,MFInt32:a++,MFMatrix3d:a++,MFMatrix3f:a++,MFMatrix4d:a++,MFMatrix4f:a++,MFNode:a++,MFRotation:a++,MFString:a++,MFTime:a++,MFVec2d:a++,MFVec2f:a++,MFVec3d:a++,MFVec3f:a++,MFVec4d:a++,MFVec4f:a++,X3DBaseNode:l,[Symbol.toStringTag]:"X3DConstants"};Object.defineProperty(u,"addNode",{value({typeName:e}){this.hasOwnProperty(e)||(this[e]=++l)}});const h=u;i.add("X3DConstants","x_ite/Base/X3DConstants",h);const d=h,c={radians:e=>e*(Math.PI/180),degrees:e=>e*(180/Math.PI),random:(e,t)=>e+Math.random()*(t-e),fract:e=>e%1,clamp:(e,t,i)=>Math.min(Math.max(e,t),i),interval:(e,t,i)=>e>=i?(e-t)%(i-t)+t:e<t?(e-i)%(i-t)+i:e,lerp:(e,t,i)=>e+i*(t-e),slerp(e,t,i){let n=e.dot(t);if(n>=1)return e;n<0&&(n=-n,t.negate());const s=Math.acos(n),r=Math.sin(s),o=Math.sin((1-i)*s)/r,a=Math.sin(i*s)/r;return e.x=e.x*o+t.x*a,e.y=e.y*o+t.y*a,e.z=e.z*o+t.z*a,e.w=e.w*o+t.w*a,e},simpleSlerp(e,t,i){const n=e.dot(t);if(n>=1)return e;const s=Math.acos(n),r=Math.sin(s),o=Math.sin((1-i)*s)/r,a=Math.sin(i*s)/r;return e.x=e.x*o+t.x*a,e.y=e.y*o+t.y*a,e.z=e.z*o+t.z*a,e.w=e.w*o+t.w*a,e},isPowerOfTwo:e=>0==(e-1&e),nextPowerOfTwo:e=>c.isPowerOfTwo(e)?e:1<<32-Math.clz32(e),bitCount:e=>16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24,cmp:(e,t)=>e>t?1:e<t?-1:0,less:(e,t)=>e<t,greater:(e,t)=>e>t,lowerBound(e,t,i,n,s=c.less){let r=0,o=0,a=i-t;for(;a>0;)o=a>>>1,r=t+o,s(e[r],n)?(t=++r,a-=o+1):a=o;return t},upperBound(e,t,i,n,s=c.less){let r=0,o=0,a=i-t;for(;a>0;)o=a>>>1,r=t+o,s(n,e[r])?a=o:(t=++r,a-=o+1);return t}},p=c;i.add("Algorithm","standard/Math/Algorithm",p);const g=p;function f({style:e="TIDY",indent:t="",precision:i=7,doublePrecision:n=15,html:s=!1,closingTags:r=!1}){this.string="",this.indent=t,this.listIndent=t,this.precision=g.clamp(i,1,21),this.doublePrecision=g.clamp(n,1,21),this.html=s,this.closingTags=s||r,this.floatFormat=new Intl.NumberFormat("en",{notation:"standard",maximumSignificantDigits:this.precision,useGrouping:!1}).format,this.floatExponentialFormat=new Intl.NumberFormat("en",{notation:"scientific",maximumSignificantDigits:this.precision,useGrouping:!1}).format,this.doubleFormat=new Intl.NumberFormat("en",{notation:"standard",maximumSignificantDigits:this.doublePrecision,useGrouping:!1}).format,this.doubleExponentialFormat=new Intl.NumberFormat("en",{notation:"scientific",maximumSignificantDigits:this.doublePrecision,useGrouping:!1}).format,this.Style(e),this.executionContextStack=[],this.importedNodesIndex=new Map,this.exportedNodesIndex=new Map,this.nodes=new Set,this.names=new Map,this.namesByNode=new Map,this.importedNames=new Map,this.routeNodes=new Set,this.level=0,this.containerFields=[],this.units=!0,this.unitCategories=[],this.PushExecutionContext(null)}Object.assign(f.prototype,{Style(e){switch(e){case"CLEAN":this.listIndent="",this.comma=" ",this.break=" ",this.tidyBreak="",this.tidySpace="",this.indentChar="",this.listEnclosure="",this.listBreak="",this.listIndentChar="",this.attribBreak=" ";break;case"SMALL":this.listIndent="",this.comma=",",this.break="\n",this.tidyBreak="\n",this.tidySpace="",this.indentChar="",this.listEnclosure="",this.listBreak="",this.listIndentChar="",this.attribBreak=" ";break;case"COMPACT":this.listIndent="",this.comma=",",this.break="\n",this.tidyBreak="\n",this.tidySpace=" ",this.indentChar=" ",this.listEnclosure=" ",this.listBreak=" ",this.listIndentChar="",this.attribBreak=" ";break;default:this.comma=",",this.break="\n",this.tidyBreak="\n",this.tidySpace=" ",this.indentChar=" ",this.listEnclosure="\n",this.listBreak="\n",this.listIndentChar=" ",this.attribBreak="\n"}},Comma(){return this.comma},Break(){return this.break},TidyBreak(){return this.tidyBreak},ForceBreak:()=>"\n",Space:()=>" ",TidySpace(){return this.tidySpace},ListStart(){return this.listEnclosure},ListEnd(){return this.listEnclosure},ListBreak(){return this.listBreak},AttribBreak(){return this.attribBreak},Indent(){return this.indent},ListIndent(){return this.listIndent},IncIndent(){return this.indent+=this.indentChar,this.listIndent+=this.listIndentChar,""},DecIndent(){return this.indent=this.indent.slice(0,this.indent.length-this.indentChar.length),this.listIndent=this.listIndent.slice(0,this.listIndent.length-this.listIndentChar.length),""},FloatFormat(e){if(Number.isFinite(e)){const t=Math.log10(Math.abs(e));return this.precision>t&&t>=-4||0===e?this.floatFormat(e):this.floatExponentialFormat(e).toLowerCase()}return String(e)},DoubleFormat(e){if(Number.isFinite(e)){const t=Math.log10(Math.abs(e));return this.doublePrecision>t&&t>=-4||0===e?this.doubleFormat(e):this.doubleExponentialFormat(e).toLowerCase()}return String(e)},PushExecutionContext(e){this.executionContextStack.push(e),this.names.has(e)||this.names.set(e,Object.assign(new Set,{index:0})),this.importedNodesIndex.has(e)||this.importedNodesIndex.set(e,new Set),this.exportedNodesIndex.has(e)||this.exportedNodesIndex.set(e,new Set)},PopExecutionContext(){this.executionContextStack.pop(),this.ExecutionContext()||(this.importedNodesIndex.clear(),this.exportedNodesIndex.clear())},ExecutionContext(){return this.executionContextStack.at(-1)},EnterScope(){++this.level},LeaveScope(){--this.level,0===this.level&&(this.nodes.clear(),this.namesByNode.clear(),this.importedNames.clear())},NamedNodes(e){const t=this.names.get(this.ExecutionContext()),i=this.namesByNode;for(const n of e)n.getNodeName().match(/^_\d+$/)||(t.add(n.getNodeName()),i.set(n.getValue(),n.getNodeName()))},ExportedNodes(e){const t=this.exportedNodesIndex.get(this.ExecutionContext());for(const i of e)t.add(i.getLocalNode())},ImportedNodes(e){const t=this.importedNodesIndex.get(this.ExecutionContext());for(const i of e)try{t.add(i.getInlineNode())}catch{}},AddImportedNode(e,t){this.importedNames.set(e,t)},AddRouteNode(e){this.routeNodes.add(e)},ExistsRouteNode(e){return this.namesByNode.get(e)||this.routeNodes.has(e)},IsSharedNode(e){return this.ExecutionContext()!==e.getExecutionContext()},AddNode(e){this.nodes.add(e),this.AddRouteNode(e)},ExistsNode(e){return this.nodes.has(e)},Name(e){const t=this.namesByNode.get(e);if(void 0!==t)return t;{const t=this.names.get(this.ExecutionContext());if(!this.NeedsName(e))return"";const i="_"+ ++t.index;return t.add(i),this.namesByNode.set(e,i),i}},NeedsName(e){if(e.getCloneCount()>1)return!0;if(e.hasRoutes())return!0;const t=e.getExecutionContext(),i=this.importedNodesIndex.get(t);if(!i){const i=this.exportedNodesIndex.get(t);return!(!i||!i.has(e))}return!!i.has(e)||void 0},LocalName(e){const t=this.importedNames.get(e);if(void 0!==t)return t;if(this.ExistsNode(e))return this.Name(e);throw new Error(`Couldn't get local name for node '${e.getTypeName()}'.`)},PushContainerField(e){this.containerFields.push(e)},PopContainerField(){this.containerFields.pop()},ContainerField(){return this.containerFields.length?this.containerFields[this.containerFields.length-1]:null},AccessType(e){switch(e){case d.initializeOnly:return"initializeOnly";case d.inputOnly:return"inputOnly";case d.outputOnly:return"outputOnly";case d.inputOutput:return"inputOutput"}},SetUnits(e){this.units=e},GetUnits(){return this.units},PushUnitCategory(e){this.unitCategories.push(e)},PopUnitCategory(){this.unitCategories.pop()},Unit(e){return 0==this.unitCategories.length?e:this.unitCategories.at(-1)},ToUnit(e,t){if(this.units){const i=this.ExecutionContext();if(i)return i.toUnit(e,t)}return t},XMLEncode:(()=>{const e={"\\":"\\\\","\r":"&#xD;","\n":"&#xA;","\t":"&#x9;",'"':'\\"',"'":"&apos;","<":"&lt;",">":"&gt;","&":"&amp;"},t=/([\\\r\n\t"'<>&])/g;return function(i){return i.replace(t,(t=>e[t]))}})(),XMLEncodeSourceText:(()=>{const e={"\\":"\\\\",'"':'\\"',"'":"&apos;","<":"&lt;",">":"&gt;","&":"&amp;"},t=/([\\"'<>&])/g;return function(i){return i.replace(t,(t=>e[t]))}})(),JSONEncode:(()=>{const e={"\\":"\\\\","\r":"\\r","\n":"\\n","\t":"\\t",'"':'\\"'},t=/([\\\t\n\r"])/g;return function(i){return i.replace(t,(t=>e[t]))}})(),JSONNumber(e){switch(e){case"NaN":case"Infinity":case"-Infinity":return'"'+e+'"';default:return e}},JSONRemoveComma(){this.string=this.string.trimEnd(),this.string.endsWith(",")&&(this.string=this.string.slice(0,-1)),this.string+=this.TidyBreak()}});for(const e of Object.keys(f.prototype))Object.defineProperty(f.prototype,e,{enumerable:!1});const m=f;i.add("Generator","x_ite/InputOutput/Generator",m);const _=m,x={assign:(()=>{function e(e,t){this.set(t,e)}return function(t,i){return t.clear(),i.forEach(e,t),t}})(),values:(()=>{function e(e){this.push(e)}return function(t,i){return t.length=0,i.forEach(e,t),t}})()},y=x;i.add("MapUtilities","standard/Utility/MapUtilities",y);const w=y;i.add("DEVELOPMENT","x_ite/DEVELOPMENT",false);const b=false,S=Symbol(),T=Symbol(),v=Symbol(),O=Symbol();function E(){}Object.assign(E.prototype,{[S]:"",[T]:new Map,[v]:[],[O]:new Map,getId(){return E.getId(this)},getTypeName(){return this.constructor.typeName},setName(e){this[S]=e},getName(){return this[S]},getDisplayName(){return this[S]},hasInterest(e,t){return this[T].has(E.getInterestId(e,t))},addInterest(e,t,...i){this[T]===E.prototype[T]&&(this[T]=new Map,this[v]=[]);const n=E.getInterestId(e,t),s=t[e];this[T].set(n,s.bind(t,...i,this))},removeInterest(e,t){this[T].delete(E.getInterestId(e,t))},getInterests(){return this[T]},processInterests(){if(this[T].size)for(const e of w.values(this[v],this[T]))e()},getUserData(e){return this[O].get(e)??this[O].map?.get(e)},setUserData(e,t){try{this[O]===E.prototype[O]&&(this[O]=new WeakMap),this[O].set(e,t)}catch{this[O].map||(this[O].map=new Map),this[O].map.set(e,t)}},removeUserData(e){this[O].delete(e)||this[O].map?.delete(e)},toString(e=Object.prototype){const t=new _(e);return e.scene&&t.PushExecutionContext(e.scene),this.toStream(t),t.string},toVRMLString(e=Object.prototype){const t=new _(e);return e.scene&&t.PushExecutionContext(e.scene),this.toVRMLStream(t),t.string},toXMLString(e=Object.prototype){const t=new _(e);return e.scene&&t.PushExecutionContext(e.scene),this.toXMLStream(t),t.string},toJSONString(e=Object.prototype){const t=new _(e);return e.scene&&t.PushExecutionContext(e.scene),this.toJSONStream(t),t.string},toStream(e){e.string=Object.prototype.toString.call(this)},dispose(){this[T].clear(),this[O].map?.clear()}});for(const e of Object.keys(E.prototype))Object.defineProperty(E.prototype,e,{enumerable:!1});Object.defineProperties(E.prototype,{[Symbol.toStringTag]:{get(){return this.getTypeName()}}}),Object.assign(E,{getId:(()=>{const e=new WeakMap;let t=0;return function(i){const n=e.get(i);return void 0!==n?n:(e.set(i,++t),t)}})(),getInterestId(e,t){return`${this.getId(t)}.${this.getId(t[e])}`}});const N=E;i.add("X3DObject","x_ite/Base/X3DObject",N);const C=N,F=Symbol(),I=Symbol(),M=Symbol();Symbol();function D(){C.call(this)}Object.assign(Object.setPrototypeOf(D.prototype,C.prototype),{[F]:0,[I]:!1,[M]:new Set,isInitializable:()=>!0,isInput:()=>!1,isOutput:()=>!1,setModificationTime(e){this[F]=e},getModificationTime(){return this[F]},setTainted(e){this[I]=e},isTainted(){return this[I]},addEvent(){this.setModificationTime(Date.now());for(const e of this[M])e.addEvent(this)},addEventObject(e,t){this.setModificationTime(Date.now());for(const e of this[M])e.addEventObject(this,t)},processEvent(){this.setTainted(!1),this.processInterests()},collectCloneCount(){let e=0;for(const t of this[M])e+=t.collectCloneCount();return e},addParent(e){this[M]===D.prototype[M]&&(this[M]=new Set),this[M].add(e),this.parentsChanged()},removeParent(e){this[M].delete(e),this.parentsChanged()},getParents(){return this[M]},parentsChanged(){},dispose(){this[M].clear(),C.prototype.dispose.call(this)}});for(const e of Object.keys(D.prototype))Object.defineProperty(D.prototype,e,{enumerable:!1});const P=D;i.add("X3DChildObject","x_ite/Base/X3DChildObject",P);const R=P,A=Object.assign([],{create(e){const t=this.pop()??new Set;return t.field=e,t.clear(),t},copy(e){const t=this.create(e.field);for(const i of e)t.add(i);return t}});for(const e of Object.keys(A))Object.defineProperty(A,e,{enumerable:!1});const V=A;i.add("Events","x_ite/Base/Events",V);const L=V;function B(e,t,i){Object.defineProperties(this,{accessType:{value:e,enumerable:!0},dataType:{value:i.getType(),enumerable:!0},name:{value:t,enumerable:!0},value:{value:i}})}Object.setPrototypeOf(B.prototype,C.prototype);for(const e of Object.keys(B.prototype))Object.defineProperty(B.prototype,e,{enumerable:!1});Object.defineProperties(B,{typeName:{value:"X3DFieldDefinition",enumerable:!0}});const U=B;i.add("X3DFieldDefinition","x_ite/Base/X3DFieldDefinition",U);const X=U,k=Symbol(),j=Symbol(),z=Symbol(),G={get(e,t){const i=e[t];if(void 0!==i)return i;if("string"==typeof t){const i=+t;return Number.isInteger(i)?e[k][i]:void 0}},set:(e,t,i)=>void 0!==e[t]&&(e[t]=i,!0),has:(e,t)=>Number.isInteger(+t)?t<e[k].length:t in e,ownKeys:e=>Object.keys(e[k]),getOwnPropertyDescriptor(e,t){if("string"!=typeof t)return;const i=+t;if(Number.isInteger(i)&&i<e[k].length){const i=Object.getOwnPropertyDescriptor(e[k],t);return i&&(i.writable=!1),i}}};function H(e,t){const i=new Proxy(this,G);R.call(this),this[k]=[],this[j]=new Map,this[z]=t;for(const[t,i]of e)this.add(t,i);return i}Object.assign(Object.setPrototypeOf(H.prototype,R.prototype),{*[Symbol.iterator](){yield*this[k]},copy(){const e=new this.constructor;return e.assign(this),e},assign(e){if(!(e instanceof this.constructor))throw new Error("Couldn't assign info array, wrong type.");this[k]=Array.from(e[k]),this[j]=new Map(e[j]),this.addEvent()},equals(e){const t=this[k],i=e[k],n=t.length;if(t===i)return!0;if(n!==i.length)return!1;for(let e=0;e<n;++e)if(t[e]!==i[e])return!1;return!0},has(e){return this[j].has(e)},get(e){return this[j].get(e)},add(e,t){if(this[j].has(e))throw new Error(`Couldn't add value to ${this.getTypeName()}, key '${e}' already exists.`);if(!(t instanceof this[z]))throw new Error(`Couldn't add value to ${this.getTypeName()}, value for key '${e}' has wrong type.`);this[k].push(t),this[j].set(e,t),this.addEvent()},alias(e,t){this[j].set(e,t),this.addEvent()},update(e,t,i){if(!(i instanceof this[z]))throw new Error(`Couldn't update value of ${this.getTypeName()}, value for key '${key}' has wrong type.`);const n=this[j].get(e);if(e!==t&&this.remove(t),this[j].delete(e),this[j].set(t,i),void 0!==n){const e=this[k].indexOf(n);e>-1&&(this[k][e]=i)}else this[k].push(i);this.addEvent()},remove(e){const t=this[j].get(e);if(void 0===t)return;const i=this[k].indexOf(t);this[j].delete(e),i>-1&&this[k].splice(i,1),this.addEvent()},at:Array.prototype.at,entries:Array.prototype.entries,every:Array.prototype.every,filter(e,t){return new this.constructor(Array.prototype.filter.call(this,e,t))},find:Array.prototype.find,findIndex:Array.prototype.findIndex,findLast:Array.prototype.findLast,findLastIndex:Array.prototype.findLastIndex,forEach:Array.prototype.forEach,includes:Array.prototype.includes,indexOf:Array.prototype.indexOf,join:Array.prototype.join,keys:Array.prototype.keys,lastIndexOf:Array.prototype.lastIndexOf,map(e,t){return new this.constructor(Array.prototype.map.call(this,e,t))},reduce:Array.prototype.reduce,reduceRight:Array.prototype.reduceRight,slice(e,t){return new this.constructor(Array.prototype.slice.call(this,e,t))},some:Array.prototype.some,toReversed(){return new this.constructor([...this].reverse())},toSorted(e){return new this.constructor([...this].sort(e))},toSpliced(e,t,...i){const n=[...this];return n.splice(e,t,...i),new this.constructor(n)},values:Array.prototype.values,with(e,t){const i=[...this];return i[e]=t,new this.constructor(i)},toVRMLStream(e){for(const t of this[k])try{t.toVRMLStream(e),e.string+=e.Break(),this.getTypeName().match(/Proto/)&&(e.string+=e.TidyBreak())}catch(e){}},toXMLStream(e){for(const t of this[k])try{t.toXMLStream(e),e.string+=e.TidyBreak()}catch(e){}},toJSONStream(e,t){let i=!1;for(const t of this[k])try{t.toJSONStream(e,!0),e.string+=",",e.string+=e.TidyBreak(),i=!0}catch(e){}return i&&!t&&e.JSONRemoveComma(),i}});for(const e of Object.keys(H.prototype))Object.defineProperty(H.prototype,e,{enumerable:!1});Object.defineProperties(H.prototype,{length:{get(){return this[k].length}}});const q=H;i.add("X3DInfoArray","x_ite/Base/X3DInfoArray",q);const Y=q;function W(e=[]){return Y.call(this,Array.from(e,(e=>[e.name,e])),X)}Object.setPrototypeOf(W.prototype,Y.prototype);for(const e of Object.keys(W.prototype))Object.defineProperty(W.prototype,e,{enumerable:!1});Object.defineProperties(W,{typeName:{value:"FieldDefinitionArray",enumerable:!0}});const $=W;i.add("FieldDefinitionArray","x_ite/Base/FieldDefinitionArray",$);const J=$,K=Symbol(),Z=Symbol(),Q=Symbol(),ee=Symbol(),te=Symbol(),ie=Symbol(),ne=Symbol(),se=Symbol(),re=Symbol(),oe=Symbol(),ae=Symbol.for("X_ITE.X3DField.uniformLocation");function le(e){R.call(this),this[K]=e}Object.assign(Object.setPrototypeOf(le.prototype,R.prototype),{[K]:null,[Z]:d.initializeOnly,[Q]:null,[ee]:new Set,[te]:new Map,[ie]:new Set,[ne]:new Map,[se]:new Set,[re]:new Set,[oe]:new Map,[ae]:null,create(){return new this.constructor},equals(e){return this[K]===e.valueOf()},assign(e){this.set(e.getValue()),this.addEvent()},set(e){this[K]=e},setValue(e){this.set(e instanceof this.constructor?e.getValue():e),this.addEvent()},getValue(){return this[K]},getType(){return d[this.constructor.typeName]},setAccessType(e){this[Z]=e},getAccessType(){return this[Z]},isInitializable(){return!!(this[Z]&d.initializeOnly)},isInput(){return!!(this[Z]&d.inputOnly)},isOutput(){return!!(this[Z]&d.outputOnly)},isReadable(){return this[Z]!==d.inputOnly},isWritable(){return this[Z]!==d.outputOnly},setUnit(e){this[Q]=e},getUnit(){return this[Q]},hasReferences(){return 0!==this[ee].size},isReference(e){return e===this[Z]||e===d.inputOutput},addReference(e){const t=this.getReferences();if(!t.has(e)){switch(t.add(e),this.getAccessType()&e.getAccessType()){case d.initializeOnly:e.addFieldInterest(this),this.assign(e);break;case d.inputOnly:e.addFieldInterest(this);break;case d.outputOnly:this.addFieldInterest(e);break;case d.inputOutput:e.addFieldInterest(this),this.addFieldInterest(e),this.assign(e)}this.processReferencesCallbacks()}},removeReference(e){switch(this.getReferences().delete(e),this.getAccessType()&e.getAccessType()){case d.initializeOnly:case d.inputOnly:e.removeFieldInterest(this);break;case d.outputOnly:this.removeFieldInterest(e);break;case d.inputOutput:e.removeFieldInterest(this),this.removeFieldInterest(e)}this.processReferencesCallbacks()},getReferences(){return this[ee]===le.prototype[ee]&&(this[ee]=new Set),this[ee]},addReferencesCallback(e,t){this[te]===le.prototype[te]&&(this[te]=new Map),this[te].set(e,t)},removeReferencesCallback(e){this[te].delete(e)},getReferencesCallbacks(){return this[te]},processReferencesCallbacks:(()=>{const e=[];return function(){if(this[te].size)for(const t of w.values(e,this[te]))t()}})(),addFieldInterest(e){this[ie]===le.prototype[ie]&&(this[ie]=new Set),this[ie].add(e)},removeFieldInterest(e){this[ie].delete(e)},getFieldInterests(){return this[ie]},addFieldCallback(e,t){this[ne]===le.prototype[ne]&&(this[ne]=new Map),this[ne].set(e,t)},removeFieldCallback(e){this[ne].delete(e)},getFieldCallbacks(){return this[ne]},addInputRoute(e){this[se]===le.prototype[se]&&(this[se]=new Set),this[se].add(e),this.processRouteCallbacks()},removeInputRoute(e){this[se].delete(e),this.processRouteCallbacks()},getInputRoutes(){return this[se]},addOutputRoute(e){this[re]===le.prototype[re]&&(this[re]=new Set),this[re].add(e),this.processRouteCallbacks()},removeOutputRoute(e){this[re].delete(e),this.processRouteCallbacks()},getOutputRoutes(){return this[re]},addRouteCallback(e,t){this[oe]===le.prototype[oe]&&(this[oe]=new Map),this[oe].set(e,t)},removeRouteCallback(e){this[oe].delete(e)},getRouteCallbacks(){return this[oe]},processRouteCallbacks:(()=>{const e=[];return function(){if(this[oe].size)for(const t of w.values(e,this[oe]))t()}})(),processEvent:(()=>{const e=[];return function(t=L.create(this)){if(t.has(this))return;t.add(this),this.setTainted(!1);const i=t.field;i!==this&&this.set(i.getValue(),i.length),this.processInterests();let n=!0;for(const e of this[ie])n?(n=!1,e.addEventObject(this,t)):e.addEventObject(this,L.copy(t));if(n&&L.push(t),this[ne].size)for(const t of w.values(e,this[ne]))t(this.valueOf())}})(),fromString(e,t){},dispose(){this[ee].clear(),this[te].clear(),this[ie].clear(),this[ne].clear(),this[oe].clear();for(const e of new Set(this[se]))e.dispose();for(const e of new Set(this[re]))e.dispose();R.prototype.dispose.call(this)}});for(const e of Object.keys(le.prototype))Object.defineProperty(le.prototype,e,{enumerable:!1});const ue=le;i.add("X3DField","x_ite/Base/X3DField",ue);const he=ue;function de(e=[]){return Y.call(this,Array.from(e,(e=>[e.getName(),e])),he)}Object.setPrototypeOf(de.prototype,Y.prototype);for(const e of Object.keys(de.prototype))Object.defineProperty(de.prototype,e,{enumerable:!1});Object.defineProperties(de,{typeName:{value:"FieldArray",enumerable:!0}});const ce=de;i.add("FieldArray","x_ite/Base/FieldArray",ce);const pe=ce;function ge(e){he.call(this,!!e)}Object.assign(Object.setPrototypeOf(ge.prototype,he.prototype),{copy(){return new ge(this.getValue())},isDefaultValue(){return!1===this.getValue()},set(e){he.prototype.set.call(this,!!e)},valueOf:he.prototype.getValue,toStream(e){e.string+=this.getValue()?"TRUE":"FALSE"},toVRMLStream(e){this.toStream(e)},toXMLStream(e){e.string+=this.getValue()?"true":"false"},toJSONStream(e){this.toJSONStreamValue(e)},toJSONStreamValue(e){e.string+=this.getValue()?"true":"false"}});for(const e of Object.keys(ge.prototype))Object.defineProperty(ge.prototype,e,{enumerable:!1});Object.defineProperties(ge,{typeName:{value:"SFBool",enumerable:!0}});const fe=ge;i.add("SFBool","x_ite/Fields/SFBool",fe);const me=fe,{clamp:_e,interval:xe,degrees:ye}=g,we=Symbol.for("X_ITE.Color3.r"),be=Symbol.for("X_ITE.Color3.g"),Se=Symbol.for("X_ITE.Color3.b");function Te(e,t,i){this[we]=_e(e,0,1),this[be]=_e(t,0,1),this[Se]=_e(i,0,1)}Object.assign(Te.prototype,{*[Symbol.iterator](){yield this[we],yield this[be],yield this[Se]},copy(){const e=Object.create(Te.prototype);return e[we]=this[we],e[be]=this[be],e[Se]=this[Se],e},assign(e){return this[we]=e[we],this[be]=e[be],this[Se]=e[Se],this},set(e,t,i){return this[we]=_e(e,0,1),this[be]=_e(t,0,1),this[Se]=_e(i,0,1),this},equals(e){return this[we]===e[we]&&this[be]===e[be]&&this[Se]===e[Se]},getHSV(e){let t,i,n;const s=Math.min(this[we],this[be],this[Se]),r=Math.max(this[we],this[be],this[Se]);n=r;const o=r-s;return 0!==r&&0!==o?(i=o/r,t=this[we]===r?(this[be]-this[Se])/o:this[be]===r?2+(this[Se]-this[we])/o:4+(this[we]-this[be])/o,t*=Math.PI/3,t<0&&(t+=2*Math.PI)):i=t=0,e[0]=t,e[1]=i,e[2]=n,e},setHSV(e,t,i){if(t=_e(t,0,1),i=_e(i,0,1),0===t)this[we]=this[be]=this[Se]=i;else{const n=ye(xe(e,0,2*Math.PI))/60,s=Math.floor(n),r=n-s,o=i*(1-t),a=i*(1-t*r),l=i*(1-t*(1-r));switch(s%6){case 0:this[we]=i,this[be]=l,this[Se]=o;break;case 1:this[we]=a,this[be]=i,this[Se]=o;break;case 2:this[we]=o,this[be]=i,this[Se]=l;break;case 3:this[we]=o,this[be]=a,this[Se]=i;break;case 4:this[we]=l,this[be]=o,this[Se]=i;break;default:this[we]=i,this[be]=o,this[Se]=a}}return this},toString(){return this[we]+" "+this[be]+" "+this[Se]}});const ve={get(){return this[we]},set(e){this[we]=_e(e,0,1)}},Oe={get(){return this[be]},set(e){this[be]=_e(e,0,1)}},Ee={get(){return this[Se]},set(e){this[Se]=_e(e,0,1)}};Object.defineProperties(Te.prototype,{length:{value:3},0:ve,1:Oe,2:Ee,r:Object.assign({enumerable:!0},ve),g:Object.assign({enumerable:!0},Oe),b:Object.assign({enumerable:!0},Ee)}),Object.assign(Te,{Black:new Te(0,0,0),White:new Te(1,1,1),HSV(e,t,i){const n=Object.create(this.prototype);return n.setHSV(e,t,i),n},lerp(e,t,i,n){let[s,r,o]=e,[a,l,u]=t;0===r&&(s=a),0===l&&(a=s);const h=Math.abs(a-s);if(h<=Math.PI)return n[0]=s+i*(a-s),n[1]=r+i*(l-r),n[2]=o+i*(u-o),n;const d=2*Math.PI,c=(d-h)*i;let p=s<a?s-c:s+c;return p<0?p+=d:p>d&&(p-=d),n[0]=p,n[1]=r+i*(l-r),n[2]=o+i*(u-o),n}});const Ne=Te;i.add("Color3","standard/Math/Numbers/Color3",Ne);const Ce=Ne;function Fe(e,t,i){switch(arguments.length){case 0:he.call(this,new Ce(0,0,0));break;case 1:he.call(this,arguments[0]);break;case 3:he.call(this,new Ce(+e,+t,+i));break;default:throw new Error("Invalid arguments.")}}Object.assign(Object.setPrototypeOf(Fe.prototype,he.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new Fe(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(Ce.Black)},set(e){this.getValue().assign(e)},getHSV(){return this.getValue().getHSV([])},setHSV(e,t,i){this.getValue().setHSV(e,t,i),this.addEvent()},lerp:(()=>{const e=[],t=[],i=[];return function(n,s){const r=new Fe;return this.getValue().getHSV(e),n.getValue().getHSV(t),Ce.lerp(e,t,s,i),r.setHSV(i[0],i[1],i[2]),r}})(),toStream(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e.FloatFormat(t[n]),e.string+=e.Space();e.string+=e.FloatFormat(t[i])},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.string+=e.TidySpace(),this.toJSONStreamValue(e),e.string+=e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e.JSONNumber(e.FloatFormat(t[n])),e.string+=",",e.string+=e.TidySpace();e.string+=e.JSONNumber(e.FloatFormat(t[i]))}});for(const e of Object.keys(Fe.prototype))Object.defineProperty(Fe.prototype,e,{enumerable:!1});const Ie={get(){return this.getValue().r},set(e){this.getValue().r=+e,this.addEvent()}},Me={get(){return this.getValue().g},set(e){this.getValue().g=+e,this.addEvent()}},De={get(){return this.getValue().b},set(e){this.getValue().b=+e,this.addEvent()}};Object.defineProperties(Fe.prototype,{0:Ie,1:Me,2:De,r:Object.assign({enumerable:!0},Ie),g:Object.assign({enumerable:!0},Me),b:Object.assign({enumerable:!0},De)}),Object.defineProperties(Fe,{typeName:{value:"SFColor",enumerable:!0}});const Pe=Fe;i.add("SFColor","x_ite/Fields/SFColor",Pe);const Re=Pe,{clamp:Ae}=g,Ve=Symbol.for("X_ITE.Color3.r"),Le=Symbol.for("X_ITE.Color3.g"),Be=Symbol.for("X_ITE.Color3.b"),Ue=Symbol();function Xe(e,t,i,n){this[Ve]=Ae(e,0,1),this[Le]=Ae(t,0,1),this[Be]=Ae(i,0,1),this[Ue]=Ae(n,0,1)}Object.assign(Xe.prototype,{*[Symbol.iterator](){yield this[Ve],yield this[Le],yield this[Be],yield this[Ue]},copy(){const e=Object.create(Xe.prototype);return e[Ve]=this[Ve],e[Le]=this[Le],e[Be]=this[Be],e[Ue]=this[Ue],e},assign(e){return this[Ve]=e[Ve],this[Le]=e[Le],this[Be]=e[Be],this[Ue]=e[Ue],this},set(e,t,i,n){return this[Ve]=Ae(e,0,1),this[Le]=Ae(t,0,1),this[Be]=Ae(i,0,1),this[Ue]=Ae(n,0,1),this},equals(e){return this[Ve]===e[Ve]&&this[Le]===e[Le]&&this[Be]===e[Be]&&this[Ue]===e[Ue]},getHSVA(e){return Ce.prototype.getHSV.call(this,e),e[3]=this[Ue],e},setHSVA(e,t,i,n){return Ce.prototype.setHSV.call(this,e,t,i),this[Ue]=Ae(n,0,1),this},toString(){return this[Ve]+" "+this[Le]+" "+this[Be]+" "+this[Ue]}});const ke={get(){return this[Ve]},set(e){this[Ve]=Ae(e,0,1)}},je={get(){return this[Le]},set(e){this[Le]=Ae(e,0,1)}},ze={get(){return this[Be]},set(e){this[Be]=Ae(e,0,1)}},Ge={get(){return this[Ue]},set(e){this[Ue]=Ae(e,0,1)}};Object.defineProperties(Xe.prototype,{length:{value:4},0:ke,1:je,2:ze,3:Ge,r:Object.assign({enumerable:!0},ke),g:Object.assign({enumerable:!0},je),b:Object.assign({enumerable:!0},ze),a:Object.assign({enumerable:!0},Ge)}),Object.assign(Xe,{Transparent:new Xe(0,0,0,0),Black:new Xe(0,0,0,1),White:new Xe(1,1,1,1),HSVA(e,t,i,n){const s=Object.create(this.prototype);return s.setHSVA(e,t,i,n),s},lerp(e,t,i,n){const s=e[3];return Ce.lerp(e,t,i,n),n[3]=s+i*(t[3]-s),n}});const He=Xe;i.add("Color4","standard/Math/Numbers/Color4",He);const qe=He;function Ye(e,t,i,n){switch(arguments.length){case 0:he.call(this,new qe(0,0,0,0));break;case 1:he.call(this,arguments[0]);break;case 4:he.call(this,new qe(+e,+t,+i,+n));break;default:throw new Error("Invalid arguments.")}}Object.assign(Object.setPrototypeOf(Ye.prototype,he.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new Ye(this.getValue().copy())},equals:Re.prototype.equals,isDefaultValue(){return this.getValue().equals(qe.Transparent)},set:Re.prototype.set,getHSVA(){return this.getValue().getHSVA([])},setHSVA(e,t,i,n){this.getValue().setHSVA(e,t,i,n),this.addEvent()},lerp:(()=>{const e=[],t=[],i=[];return function(n,s){const r=new Ye;return this.getValue().getHSVA(e),n.getValue().getHSVA(t),qe.lerp(e,t,s,i),r.setHSVA(i[0],i[1],i[2],i[3]),r}})(),toStream:Re.prototype.toStream,toVRMLStream:Re.prototype.toVRMLStream,toXMLStream:Re.prototype.toXMLStream,toJSONStream:Re.prototype.toJSONStream,toJSONStreamValue:Re.prototype.toJSONStreamValue});for(const e of Object.keys(Ye.prototype))Object.defineProperty(Ye.prototype,e,{enumerable:!1});const We={get(){return this.getValue().r},set(e){this.getValue().r=+e,this.addEvent()}},$e={get(){return this.getValue().g},set(e){this.getValue().g=+e,this.addEvent()}},Je={get(){return this.getValue().b},set(e){this.getValue().b=+e,this.addEvent()}},Ke={get(){return this.getValue().a},set(e){this.getValue().a=+e,this.addEvent()}};Object.defineProperties(Ye.prototype,{0:We,1:$e,2:Je,3:Ke,r:Object.assign({enumerable:!0},We),g:Object.assign({enumerable:!0},$e),b:Object.assign({enumerable:!0},Je),a:Object.assign({enumerable:!0},Ke)}),Object.defineProperties(Ye,{typeName:{value:"SFColorRGBA",enumerable:!0}});const Ze=Ye;i.add("SFColorRGBA","x_ite/Fields/SFColorRGBA",Ze);const Qe=Ze;function et(e){he.call(this,arguments.length?+e:0)}Object.assign(Object.setPrototypeOf(et.prototype,he.prototype),{copy(){return new et(this.getValue())},isDefaultValue(){return 0===this.getValue()},set(e){he.prototype.set.call(this,+e)},valueOf:he.prototype.getValue,toStream(e){const t=e.Unit(this.getUnit());e.string+=e.DoubleFormat(e.ToUnit(t,this.getValue()))},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){this.toJSONStreamValue(e)},toJSONStreamValue(e){const t=e.Unit(this.getUnit());e.string+=e.JSONNumber(e.DoubleFormat(e.ToUnit(t,this.getValue())))}});for(const e of Object.keys(et.prototype))Object.defineProperty(et.prototype,e,{enumerable:!1});Object.defineProperties(et,{typeName:{value:"SFDouble",enumerable:!0}});const tt=et;i.add("SFDouble","x_ite/Fields/SFDouble",tt);const it=tt;function nt(e){he.call(this,arguments.length?+e:0)}Object.assign(Object.setPrototypeOf(nt.prototype,he.prototype),{copy(){return new nt(this.getValue())},isDefaultValue(){return 0===this.getValue()},set(e){he.prototype.set.call(this,+e)},valueOf:he.prototype.getValue,toStream(e){const t=e.Unit(this.getUnit());e.string+=e.FloatFormat(e.ToUnit(t,this.getValue()))},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){this.toJSONStreamValue(e)},toJSONStreamValue(e){const t=e.Unit(this.getUnit());e.string+=e.JSONNumber(e.FloatFormat(e.ToUnit(t,this.getValue())))}});for(const e of Object.keys(nt.prototype))Object.defineProperty(nt.prototype,e,{enumerable:!1});Object.defineProperties(nt,{typeName:{value:"SFFloat",enumerable:!0}});const st=nt;i.add("SFFloat","x_ite/Fields/SFFloat",st);const rt=st;function ot(e){he.call(this,0|e)}Object.assign(Object.setPrototypeOf(ot.prototype,he.prototype),{copy(){return new ot(this.getValue())},isDefaultValue(){return 0===this.getValue()},set(e){he.prototype.set.call(this,0|e)},valueOf:he.prototype.getValue,toStream(e){e.string+=this.getValue().toString()},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){this.toStream(e)},toJSONStreamValue(e){this.toStream(e)}});for(const e of Object.keys(ot.prototype))Object.defineProperty(ot.prototype,e,{enumerable:!1});Object.defineProperties(ot,{typeName:{value:"SFInt32",enumerable:!0}});const at=ot;i.add("SFInt32","x_ite/Fields/SFInt32",at);const lt=at;const ut=function(e,t,i,n,s){const r=s?"DoubleFormat":"FloatFormat";return Object.defineProperties(e,{typeName:{value:t,enumerable:!0}}),Object.assign(Object.setPrototypeOf(e.prototype,he.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new this.constructor(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(i.Identity)},set(e){this.getValue().assign(e)},setTransform(e,t,i,n,s){e=e?e.getValue():null,t=t?t.getValue():null,i=i?i.getValue():null,n=n?n.getValue():null,s=s?s.getValue():null,this.getValue().set(e,t,i,n,s)},getTransform(e,t,i,n,s){e=e?e.getValue():null,t=t?t.getValue():null,i=i?i.getValue():null,n=n?n.getValue():null,s=s?s.getValue():null,this.getValue().get(e,t,i,n,s)},determinant(){return this.getValue().determinant()},transpose(){return new this.constructor(this.getValue().copy().transpose())},inverse(){return new this.constructor(this.getValue().copy().inverse())},multLeft(e){return new this.constructor(this.getValue().copy().multLeft(e.getValue()))},multRight(e){return new this.constructor(this.getValue().copy().multRight(e.getValue()))},multVecMatrix(e){return new n(this.getValue().multVecMatrix(e.getValue().copy()))},multMatrixVec(e){return new n(this.getValue().multMatrixVec(e.getValue().copy()))},multDirMatrix(e){return new n(this.getValue().multDirMatrix(e.getValue().copy()))},multMatrixDir(e){return new n(this.getValue().multMatrixDir(e.getValue().copy()))},toStream(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e[r](t[n]),e.string+=e.Space();e.string+=e[r](t[i])},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.string+=e.TidySpace(),this.toJSONStreamValue(e),e.string+=e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e.JSONNumber(e[r](t[n])),e.string+=",",e.string+=e.TidySpace();e.string+=e.JSONNumber(e[r](t[i]))}})};i.add("SFMatrixPrototypeTemplate","x_ite/Fields/SFMatrixPrototypeTemplate",ut);const ht=ut;const dt=function(e,t,i,n){const s=n?"DoubleFormat":"FloatFormat";return Object.defineProperties(e,{typeName:{value:t,enumerable:!0}}),Object.assign(Object.setPrototypeOf(e.prototype,he.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new this.constructor(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(i.Zero)},set(e){this.getValue().assign(e)},abs(){return new this.constructor(this.getValue().copy().abs())},add(e){return new this.constructor(this.getValue().copy().add(e.getValue()))},distance(e){return this.getValue().distance(e.getValue())},divide(e){return new this.constructor(this.getValue().copy().divide(e))},divVec(e){return new this.constructor(this.getValue().copy().divVec(e.getValue()))},dot(e){return this.getValue().dot(e.getValue())},inverse(){return new this.constructor(this.getValue().copy().inverse())},length(){return this.getValue().magnitude()},lerp(e,t){return new this.constructor(this.getValue().copy().lerp(e,t))},max(e){return new this.constructor(this.getValue().copy().max(e.getValue()))},min(e){return new this.constructor(this.getValue().copy().min(e.getValue()))},multiply(e){return new this.constructor(this.getValue().copy().multiply(e))},multVec(e){return new this.constructor(this.getValue().copy().multVec(e.getValue()))},negate(){return new this.constructor(this.getValue().copy().negate())},normalize(e){return new this.constructor(this.getValue().copy().normalize())},subtract(e){return new this.constructor(this.getValue().copy().subtract(e.getValue()))},toStream(e){const t=this.getValue(),i=t.length-1,n=e.Unit(this.getUnit());for(let r=0;r<i;++r)e.string+=e[s](e.ToUnit(n,t[r])),e.string+=e.Space();e.string+=e[s](e.ToUnit(n,t[i]))},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.string+=e.TidySpace(),this.toJSONStreamValue(e),e.string+=e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const t=this.getValue(),i=t.length-1,n=e.Unit(this.getUnit());for(let r=0;r<i;++r)e.string+=e.JSONNumber(e[s](e.ToUnit(n,t[r]))),e.string+=",",e.string+=e.TidySpace();e.string+=e.JSONNumber(e[s](e.ToUnit(n,t[i])))}})};i.add("SFVecPrototypeTemplate","x_ite/Fields/SFVecPrototypeTemplate",dt);const ct=dt;function pt(e,t){this.x=e,this.y=t}Object.assign(pt.prototype,{*[Symbol.iterator](){yield this.x,yield this.y},copy(){const e=Object.create(pt.prototype);return e.x=this.x,e.y=this.y,e},assign(e){return this.x=e.x,this.y=e.y,this},set(e,t){return this.x=e,this.y=t,this},equals(e){return this.x===e.x&&this.y===e.y},negate(){return this.x=-this.x,this.y=-this.y,this},inverse(){return this.x=1/this.x,this.y=1/this.y,this},add(e){return this.x+=e.x,this.y+=e.y,this},subtract(e){return this.x-=e.x,this.y-=e.y,this},multiply(e){return this.x*=e,this.y*=e,this},multVec(e){return this.x*=e.x,this.y*=e.y,this},divide(e){return this.x/=e,this.y/=e,this},divVec(e){return this.x/=e.x,this.y/=e.y,this},normalize(){const e=Math.hypot(this.x,this.y);return e&&(this.x/=e,this.y/=e),this},dot(e){return this.x*e.x+this.y*e.y},norm(){const{x:e,y:t}=this;return e*e+t*t},magnitude(){return Math.hypot(this.x,this.y)},distance(e){return Math.hypot(this.x-e.x,this.y-e.y)},lerp(e,t){const{x:i,y:n}=this;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this},abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},min(e){let{x:t,y:i}=this;for(const e of arguments)t=Math.min(t,e.x),i=Math.min(i,e.y);return this.x=t,this.y=i,this},max(e){let{x:t,y:i}=this;for(const e of arguments)t=Math.max(t,e.x),i=Math.max(i,e.y);return this.x=t,this.y=i,this},toString(){return this.x+" "+this.y}}),Object.defineProperties(pt.prototype,{length:{value:2},0:{get(){return this.x},set(e){this.x=e}},1:{get(){return this.y},set(e){this.y=e}}}),Object.assign(pt,{Zero:new pt(0,0),One:new pt(1,1),xAxis:new pt(1,0),yAxis:new pt(0,1)});const gt=pt;i.add("Vector2","standard/Math/Numbers/Vector2",gt);const ft=gt;function mt(e,t){function i(e,t){switch(arguments.length){case 0:he.call(this,new ft(0,0));break;case 1:he.call(this,arguments[0]);break;case 2:he.call(this,new ft(+e,+t));break;default:throw new Error("Invalid arguments.")}}ct(i,e,ft,t);for(const e of Object.keys(i.prototype))Object.defineProperty(i.prototype,e,{enumerable:!1});const n={get(){return this.getValue().x},set(e){this.getValue().x=+e,this.addEvent()}},s={get(){return this.getValue().y},set(e){this.getValue().y=+e,this.addEvent()}};return Object.defineProperties(i.prototype,{0:n,1:s,x:Object.assign({enumerable:!0},n),y:Object.assign({enumerable:!0},s)}),i}const _t={SFVec2d:mt("SFVec2d",!0),SFVec2f:mt("SFVec2f",!1)};i.add("SFVec2","x_ite/Fields/SFVec2",_t);const xt=_t;function yt(e,t,i){this.x=e,this.y=t,this.z=i}Object.assign(yt.prototype,{*[Symbol.iterator](){yield this.x,yield this.y,yield this.z},copy(){const e=Object.create(yt.prototype);return e.x=this.x,e.y=this.y,e.z=this.z,e},assign(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},set(e,t,i){return this.x=e,this.y=t,this.z=i,this},equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z},negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},inverse(){return this.x=1/this.x,this.y=1/this.y,this.z=1/this.z,this},add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},subtract(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this},multiply(e){return this.x*=e,this.y*=e,this.z*=e,this},multVec(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this},divide(e){return this.x/=e,this.y/=e,this.z/=e,this},divVec(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},cross(e){const{x:t,y:i,z:n}=this,{x:s,y:r,z:o}=e;return this.x=i*o-n*r,this.y=n*s-t*o,this.z=t*r-i*s,this},normalize(){const e=Math.hypot(this.x,this.y,this.z);return e&&(this.x/=e,this.y/=e,this.z/=e),this},dot(e){return this.x*e.x+this.y*e.y+this.z*e.z},norm(){const{x:e,y:t,z:i}=this;return e*e+t*t+i*i},magnitude(){return Math.hypot(this.x,this.y,this.z)},distance(e){return Math.hypot(this.x-e.x,this.y-e.y,this.z-e.z)},lerp(e,t){const{x:i,y:n,z:s}=this;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this.z=s+t*(e.z-s),this},slerp:(()=>{const e=new yt(0,0,0);return function(t,i){return g.simpleSlerp(this,e.assign(t),i)}})(),abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this},min(e){let{x:t,y:i,z:n}=this;for(const e of arguments)t=Math.min(t,e.x),i=Math.min(i,e.y),n=Math.min(n,e.z);return this.x=t,this.y=i,this.z=n,this},max(e){let{x:t,y:i,z:n}=this;for(const e of arguments)t=Math.max(t,e.x),i=Math.max(i,e.y),n=Math.max(n,e.z);return this.x=t,this.y=i,this.z=n,this},toString(){return this.x+" "+this.y+" "+this.z}}),Object.defineProperties(yt.prototype,{length:{value:3},0:{get(){return this.x},set(e){this.x=e}},1:{get(){return this.y},set(e){this.y=e}},2:{get(){return this.z},set(e){this.z=e}}}),Object.assign(yt,{Zero:new yt(0,0,0),One:new yt(1,1,1),xAxis:new yt(1,0,0),yAxis:new yt(0,1,0),zAxis:new yt(0,0,1)});const wt=yt;i.add("Vector3","standard/Math/Numbers/Vector3",wt);const bt=wt;function St(){if(arguments.length)for(let e=0;e<4;++e)this[e]=arguments[e];else this.identity()}Object.assign(St.prototype,{*[Symbol.iterator](){for(let e=0;e<4;++e)yield this[e]},copy(){const e=Object.create(St.prototype);for(let t=0;t<4;++t)e[t]=this[t];return e},assign(e){for(let t=0;t<4;++t)this[t]=e[t];return this},equals(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]},set1(e,t,i){this[e*this.order+t]=i},get1(e,t){return this[e*this.order+t]},set(){switch(arguments.length){case 0:this.identity();break;case 4:for(let e=0;e<4;++e)this[e]=arguments[e]}return this},determinant1(){return this[0]},determinant(){return this[0]*this[3]-this[1]*this[2]},transpose(){const e=this[1];return this[1]=this[2],this[2]=e,this},inverse(){const{0:e,1:t,2:i,3:n}=this,s=e*n-t*i;return this[0]=n/s,this[1]=-t/s,this[2]=-i/s,this[3]=e/s,this},multLeft(e){const{0:t,1:i,2:n,3:s}=this,{0:r,1:o,2:a,3:l}=e;return this[0]=t*r+n*o,this[1]=i*r+s*o,this[2]=t*a+n*l,this[3]=i*a+s*l,this},multRight(e){const{0:t,1:i,2:n,3:s}=this,{0:r,1:o,2:a,3:l}=e;return this[0]=r*t+a*i,this[1]=o*t+l*i,this[2]=r*n+a*s,this[3]=o*n+l*s,this},multVecMatrix(e){if("number"==typeof e){const t=e,i=t*this[1]+this[3];return(t*this[0]+this[2])/i}{const{x:t,y:i}=e;return e.x=t*this[0]+i*this[2],e.y=t*this[1]+i*this[3],e}},multMatrixVec(e){if("number"==typeof e){const t=e,i=t*this[2]+this[3];return(t*this[0]+this[1])/i}{const{x:t,y:i}=e;return e.x=t*this[0]+i*this[1],e.y=t*this[2]+i*this[3],e}},identity(){this[0]=1,this[1]=0,this[2]=0,this[3]=1},toString(){return Array.prototype.join.call(this," ")}}),Object.defineProperties(St.prototype,{order:{value:2},length:{value:4},x:{get:(()=>{const e=new ft(0,0);return function(){return e.set(this[0],this[1])}})()},y:{get:(()=>{const e=new ft(0,0);return function(){return e.set(this[2],this[3])}})()},xAxis:{get(){return this[0]}},origin:{get(){return this[2]}},submatrix:{get(){return this[0]}}}),Object.assign(St,{Identity:new St});const Tt=St;i.add("Matrix2","standard/Math/Numbers/Matrix2",Tt);const vt=Tt,Ot=[],Et=[],Nt=[];const Ct=function(e,t){const i=e.order,n=e.length,s=t.values,r=t.vectors;let o,a,l,u,h,d,c,p,g,f,m,_,x;for(_=0;_<i;++_)for(Ot[_]=Ot[_]??[],Et[_]=s[_]=e.get1(_,_),Nt[_]=0,x=0;x<i;++x)r[_][x]=_===x?1:0,Ot[_][x]=e.get1(x,_);for(_=0;_<50;++_){for(o=0,f=0;f<i-1;++f)for(m=f+1;m<i;++m)o+=Math.abs(Ot[f][m]);if(0===o)break;for(g=_<3?.2*o/n:0,f=0;f<i-1;++f)for(m=f+1;m<i;++m)if(p=100*Math.abs(Ot[f][m]),_>3&&Math.abs(s[f])+p===Math.abs(s[f])&&Math.abs(s[m])+p===Math.abs(s[m]))Ot[f][m]=0;else if(Math.abs(Ot[f][m])>g){for(c=s[m]-s[f],Math.abs(c)+p===Math.abs(c)?h=Ot[f][m]/c:(a=.5*c/Ot[f][m],h=1/(Math.abs(a)+Math.sqrt(1+a*a)),a<0&&(h=-h)),l=1/Math.sqrt(1+h*h),u=h*l,d=u/(1+l),c=h*Ot[f][m],Nt[f]-=c,Nt[m]+=c,s[f]-=c,s[m]+=c,Ot[f][m]=0,x=0;x<f;++x)p=Ot[x][f],c=Ot[x][m],Ot[x][f]=p-u*(c+p*d),Ot[x][m]=c+u*(p-c*d);for(x=f+1;x<m;++x)p=Ot[f][x],c=Ot[x][m],Ot[f][x]=p-u*(c+p*d),Ot[x][m]=c+u*(p-c*d);for(x=m+1;x<i;++x)p=Ot[f][x],c=Ot[m][x],Ot[f][x]=p-u*(c+p*d),Ot[m][x]=c+u*(p-c*d);for(x=0;x<i;++x)p=r[x][f],c=r[x][m],r[x][f]=p-u*(c+p*d),r[x][m]=c+u*(p-c*d)}for(f=0;f<i;++f)s[f]=Et[f]+=Nt[f],Nt[f]=0}return t};i.add("eigen_decomposition","standard/Math/Algorithms/eigen_decomposition",Ct);const Ft=Ct;function It(){if(arguments.length)for(let e=0;e<9;++e)this[e]=arguments[e];else this.identity()}Object.assign(It.prototype,{*[Symbol.iterator](){for(let e=0;e<9;++e)yield this[e]},copy(){const e=Object.create(It.prototype);for(let t=0;t<9;++t)e[t]=this[t];return e},assign(e){for(let t=0;t<9;++t)this[t]=e[t];return this},equals(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]&&this[4]===e[4]&&this[5]===e[5]&&this[6]===e[6]&&this[7]===e[7]&&this[8]===e[8]},rotation(){return Math.atan2(this[1],this[0])},set1(e,t,i){return this[e*this.order+t]=i,this},get1(e,t){return this[e*this.order+t]},set:(()=>{const e=new ft(0,0);return function(t,i,n,s,r){switch(arguments.length){case 0:this.identity();break;case 1:null===t&&(t=ft.Zero),this.identity(),this.translate(t);break;case 2:null===t&&(t=ft.Zero),null===i&&(i=0),this.identity(),this.translate(t),0!==i&&this.rotate(i);break;case 3:null===t&&(t=ft.Zero),null===i&&(i=0),null===n&&(n=ft.One),this.identity(),this.translate(t),0!==i&&this.rotate(i),n.equals(ft.One)||this.scale(n);break;case 4:if(null===t&&(t=ft.Zero),null===i&&(i=0),null===n&&(n=ft.One),null===s&&(s=0),this.identity(),this.translate(t),0!==i&&this.rotate(i),!n.equals(ft.One)){0!==s?(this.rotate(s),this.scale(n),this.rotate(-s)):this.scale(n)}break;case 5:{null===t&&(t=ft.Zero),null===i&&(i=0),null===n&&(n=ft.One),null===s&&(s=0),null===r&&(r=ft.Zero),this.identity(),this.translate(t);const o=!r.equals(ft.Zero);o&&this.translate(r),0!==i&&this.rotate(i),n.equals(ft.One)||(0!==s?(this.rotate(s),this.scale(n),this.rotate(-s)):this.scale(n)),o&&this.translate(e.assign(r).negate());break}case 9:for(let e=0;e<9;++e)this[e]=arguments[e]}return this}})(),get:(()=>{const e=new ft(0,0),t=new bt(0,0,0),i=new ft(0,0),n=new bt(0,0,0),s=new ft(0,0),r=new vt,o=new vt,a=new ft(0,0);return function(l,u,h,d,c){switch(null===l&&(l=e),null===u&&(u=t),null===h&&(h=i),null===d&&(d=n),null===c&&(c=s),arguments.length){case 1:l.set(this[6],this[7]);break;case 2:this.factor(l,r,i,o),u[0]=r[0],u[1]=r[1],u[2]=Math.atan2(r[1],r[0]);break;case 3:this.factor(l,r,h,o),u[0]=r[0],u[1]=r[1],u[2]=Math.atan2(r[1],r[0]);break;case 4:this.factor(l,r,h,o),u[0]=r[0],u[1]=r[1],u[2]=Math.atan2(r[1],r[0]),d[0]=o[0],d[1]=o[1],d[2]=Math.atan2(o[1],o[0]);break;case 5:Mt.set(a.assign(c).negate()),Mt.multLeft(this),Mt.translate(c),Mt.get(l,u,h,d)}}})(),factor:(()=>{const e=new vt,t=new vt,i=new vt,n={values:[],vectors:[[],[]]};return function(s,r,o,a){s.set(this[6],this[7]);const l=this.submatrix,u=l.determinant()<0?-1:1;i.assign(l).transpose().multLeft(l);const h=Ft(i,n);a.set(h.vectors[0][0],h.vectors[1][0],h.vectors[0][1],h.vectors[1][1]),o.x=u*Math.sqrt(h.values[0]),o.y=u*Math.sqrt(h.values[1]),e[0]=1/o.x,e[3]=1/o.y,r.assign(t.assign(a).transpose().multRight(e).multRight(a).multRight(l))}})(),determinant2(){return this[0]*this[4]-this[1]*this[3]},determinant(){const{0:e,1:t,2:i,3:n,4:s,5:r,6:o,7:a,8:l}=this;return e*(s*l-r*a)-t*(n*l-r*o)+i*(n*a-s*o)},transpose(){let e;return e=this[1],this[1]=this[3],this[3]=e,e=this[2],this[2]=this[6],this[6]=e,e=this[5],this[5]=this[7],this[7]=e,this},inverse(){const{0:e,1:t,2:i,3:n,4:s,5:r,6:o,7:a,8:l}=this,u=e*s,h=e*a,d=n*t,c=n*a,p=o*t,g=o*s;let f=u*l-h*r-d*l+c*i+p*r-g*i;f=1/f;const m=(s*l-a*r)*f,_=-(t*l-a*i)*f,x=(t*r-s*i)*f,y=-(n*l-o*r)*f,w=(e*l-o*i)*f,b=-(e*r-n*i)*f;return this[0]=m,this[1]=_,this[2]=x,this[3]=y,this[4]=w,this[5]=b,this[6]=(c-g)*f,this[7]=-(h-p)*f,this[8]=(u-d)*f,this},multLeft(e){const{0:t,1:i,2:n,3:s,4:r,5:o,6:a,7:l,8:u}=this,{0:h,1:d,2:c,3:p,4:g,5:f,6:m,7:_,8:x}=e;return this[0]=t*h+s*d+a*c,this[1]=i*h+r*d+l*c,this[2]=n*h+o*d+u*c,this[3]=t*p+s*g+a*f,this[4]=i*p+r*g+l*f,this[5]=n*p+o*g+u*f,this[6]=t*m+s*_+a*x,this[7]=i*m+r*_+l*x,this[8]=n*m+o*_+u*x,this},multRight(e){const{0:t,1:i,2:n,3:s,4:r,5:o,6:a,7:l,8:u}=this,{0:h,1:d,2:c,3:p,4:g,5:f,6:m,7:_,8:x}=e;return this[0]=t*h+i*p+n*m,this[1]=t*d+i*g+n*_,this[2]=t*c+i*f+n*x,this[3]=s*h+r*p+o*m,this[4]=s*d+r*g+o*_,this[5]=s*c+r*f+o*x,this[6]=a*h+l*p+u*m,this[7]=a*d+l*g+u*_,this[8]=a*c+l*f+u*x,this},multVecMatrix(e){if(2===e.length){const{x:t,y:i}=e,n=t*this[2]+i*this[5]+this[8];return e.x=(t*this[0]+i*this[3]+this[6])/n,e.y=(t*this[1]+i*this[4]+this[7])/n,e}{const{x:t,y:i,z:n}=e;return e.x=t*this[0]+i*this[3]+n*this[6],e.y=t*this[1]+i*this[4]+n*this[7],e.z=t*this[2]+i*this[5]+n*this[8],e}},multMatrixVec(e){if(2===e.length){const{x:t,y:i}=e,n=t*this[6]+i*this[7]+this[8];return e.x=(t*this[0]+i*this[1]+this[2])/n,e.y=(t*this[3]+i*this[4]+this[5])/n,e}{const{x:t,y:i,z:n}=e;return e.x=t*this[0]+i*this[1]+n*this[2],e.y=t*this[3]+i*this[4]+n*this[5],e.z=t*this[6]+i*this[7]+n*this[8],e}},multDirMatrix(e){const{x:t,y:i}=e;return e.x=t*this[0]+i*this[3],e.y=t*this[1]+i*this[4],e},multMatrixDir(e){const{x:t,y:i}=e;return e.x=t*this[0]+i*this[1],e.y=t*this[3]+i*this[4],e},identity(){return this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=1,this[5]=0,this[6]=0,this[7]=0,this[8]=1,this},translate(e){const{x:t,y:i}=e;return this[6]+=this[0]*t+this[3]*i,this[7]+=this[1]*t+this[4]*i,this},rotate(e){return this.multLeft(It.Rotation(e))},scale(e){const{x:t,y:i}=e;return this[0]*=t,this[3]*=i,this[1]*=t,this[4]*=i,this},skewX(e){const t=Math.tan(e);return this[3]+=this[0]*t,this[4]+=this[1]*t,this[5]+=this[2]*t,this},skewY(e){const t=Math.tan(e);return this[0]+=this[3]*t,this[1]+=this[4]*t,this[2]+=this[5]*t,this},toString(){return Array.prototype.join.call(this," ")}}),Object.defineProperties(It.prototype,{order:{value:3},length:{value:9},x:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this[0],this[1],this[2])}})()},y:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this[3],this[4],this[5])}})()},z:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this[6],this[7],this[8])}})()},xAxis:{get:(()=>{const e=new ft(0,0);return function(){return e.set(this[0],this[1])}})()},yAxis:{get:(()=>{const e=new ft(0,0);return function(){return e.set(this[3],this[4])}})()},origin:{get:(()=>{const e=new ft(0,0);return function(){return e.set(this[6],this[7])}})()},submatrix:{get:(()=>{const e=new vt;return function(){return e[0]=this[0],e[1]=this[1],e[2]=this[3],e[3]=this[4],e}})()}}),Object.assign(It,{Identity:new It,Rotation(e){const t=Math.sin(e),i=Math.cos(e);return new It(i,t,0,-t,i,0,0,0,1)},Matrix2:e=>new It(e[0],e[1],0,e[2],e[3],0,0,0,1)});const Mt=new It,Dt=It;i.add("Matrix3","standard/Math/Numbers/Matrix3",Dt);const Pt=Dt;function Rt(e,t,i){function n(e,t,i,n,s,r,o,a,l){switch(arguments.length){case 0:he.call(this,new Pt);break;case 1:he.call(this,arguments[0]);break;case 3:{const e=arguments[0],t=arguments[1],i=arguments[2];he.call(this,new Pt(e.x,e.y,e.z,t.x,t.y,t.z,i.x,i.y,i.z));break}case 9:he.call(this,new Pt(+e,+t,+i,+n,+s,+r,+o,+a,+l));break;default:throw new Error("Invalid arguments.")}}Object.assign(ht(n,e,Pt,t,i),{setTransform(e,t,i,n,s){e=e?e.getValue():null,t=t||0,i=i?i.getValue():null,n=n||0,s=s?s.getValue():null,this.getValue().set(e,t,i,n,s)}});for(const e of Object.keys(n.prototype))Object.defineProperty(n.prototype,e,{enumerable:!1});function s(e){Object.defineProperty(n.prototype,e,{get(){return this.getValue()[e]},set(t){this.getValue()[e]=+t,this.addEvent()},enumerable:!0})}for(let e=0,t=Pt.prototype.length;e<t;++e)s(e);return n}const At={SFMatrix3d:Rt("SFMatrix3d",xt.SFVec2d,!0),SFMatrix3f:Rt("SFMatrix3f",xt.SFVec2f,!1)};i.add("SFMatrix3","x_ite/Fields/SFMatrix3",At);const Vt=At;function Lt(e,t){function i(e,t,i){switch(arguments.length){case 0:he.call(this,new bt(0,0,0));break;case 1:he.call(this,arguments[0]);break;case 3:he.call(this,new bt(+e,+t,+i));break;default:throw new Error("Invalid arguments.")}}Object.assign(ct(i,e,bt,t),{cross(e){return new this.constructor(this.getValue().copy().cross(e.getValue()))}});for(const e of Object.keys(i.prototype))Object.defineProperty(i.prototype,e,{enumerable:!1});const n={get(){return this.getValue().x},set(e){this.getValue().x=+e,this.addEvent()}},s={get(){return this.getValue().y},set(e){this.getValue().y=+e,this.addEvent()}},r={get(){return this.getValue().z},set(e){this.getValue().z=+e,this.addEvent()}};return Object.defineProperties(i.prototype,{0:n,1:s,2:r,x:Object.assign({enumerable:!0},n),y:Object.assign({enumerable:!0},s),z:Object.assign({enumerable:!0},r)}),i}const Bt={SFVec3d:Lt("SFVec3d",!0),SFVec3f:Lt("SFVec3f",!1)};i.add("SFVec3","x_ite/Fields/SFVec3",Bt);const Ut=Bt;function Xt(e,t,i,n){this.x=e,this.y=t,this.z=i,this.w=n}Object.assign(Xt.prototype,{*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w},copy(){const e=Object.create(Xt.prototype);return e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w,e},assign(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},getReal(e){return e.x=this.x/this.w,e.y=this.y/this.w,e.z=this.z/this.w,e},negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},inverse(){return this.x=1/this.x,this.y=1/this.y,this.z=1/this.z,this.w=1/this.w,this},add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},subtract(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},multiply(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},multVec(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},divide(e){return this.x/=e,this.y/=e,this.z/=e,this.w/=e,this},divVec(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this},normalize(){const e=Math.hypot(this.x,this.y,this.z,this.w);return e&&(this.x/=e,this.y/=e,this.z/=e,this.w/=e),this},dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},norm(){const{x:e,y:t,z:i,w:n}=this;return e*e+t*t+i*i+n*n},magnitude(){return Math.hypot(this.x,this.y,this.z,this.w)},distance(e){return Math.hypot(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)},lerp(e,t){const{x:i,y:n,z:s,w:r}=this;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this.z=s+t*(e.z-s),this.w=r+t*(e.w-r),this},abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this.w=Math.abs(this.w),this},min(e){let{x:t,y:i,z:n,w:s}=this;for(const e of arguments)t=Math.min(t,e.x),i=Math.min(i,e.y),n=Math.min(n,e.z),s=Math.min(s,e.w);return this.x=t,this.y=i,this.z=n,this.w=s,this},max(e){let{x:t,y:i,z:n,w:s}=this;for(const e of arguments)t=Math.max(t,e.x),i=Math.max(i,e.y),n=Math.max(n,e.z),s=Math.max(s,e.w);return this.x=t,this.y=i,this.z=n,this.w=s,this},toString(){return this.x+" "+this.y+" "+this.z+" "+this.w}}),Object.defineProperties(Xt.prototype,{length:{value:4},0:{get(){return this.x},set(e){this.x=e}},1:{get(){return this.y},set(e){this.y=e}},2:{get(){return this.z},set(e){this.z=e}},3:{get(){return this.w},set(e){this.w=e}}}),Object.assign(Xt,{Zero:new Xt(0,0,0,0),One:new Xt(1,1,1,1),xAxis:new Xt(1,0,0,0),yAxis:new Xt(0,1,0,0),zAxis:new Xt(0,0,1,0),wAxis:new Xt(0,0,0,1)});const kt=Xt;i.add("Vector4","standard/Math/Numbers/Vector4",kt);const jt=kt;function zt(e,t,i,n){this.x=e,this.y=t,this.z=i,this.w=n}Object.assign(zt.prototype,{*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w},copy(){const e=Object.create(zt.prototype);return e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w,e},assign(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},setMatrix(e){if(e[0]>e[4])var t=e[0]>e[8]?0:2;else t=e[4]>e[8]?1:2;const i=e[0]+e[4]+e[8];if(i>e[3*t+t]){this[3]=Math.sqrt(i+1)/2;const t=4*this[3];this[0]=(e[5]-e[7])/t,this[1]=(e[6]-e[2])/t,this[2]=(e[1]-e[3])/t}else{const i=(t+1)%3,n=(t+2)%3;this[t]=Math.sqrt(e[3*t+t]-e[3*i+i]-e[3*n+n]+1)/2;const s=4*this[t];this[i]=(e[3*t+i]+e[3*i+t])/s,this[n]=(e[3*t+n]+e[3*n+t])/s,this[3]=(e[3*i+n]-e[3*n+i])/s}return this},getMatrix(e=new Pt){const{x:t,y:i,z:n,w:s}=this,r=t*t,o=t*i,a=i*i,l=i*n,u=n*t,h=n*n,d=s*t,c=s*i,p=s*n;return e[0]=1-2*(a+h),e[1]=2*(o+p),e[2]=2*(u-c),e[3]=2*(o-p),e[4]=1-2*(h+r),e[5]=2*(l+d),e[6]=2*(u+c),e[7]=2*(l-d),e[8]=1-2*(a+r),e},setEuler(e,t,i,n="XYZ"){const s=Math.cos(e/2),r=Math.cos(t/2),o=Math.cos(i/2),a=Math.sin(e/2),l=Math.sin(t/2),u=Math.sin(i/2);switch(n){case"XYZ":this.x=a*r*o+s*l*u,this.y=s*l*o-a*r*u,this.z=s*r*u+a*l*o,this.w=s*r*o-a*l*u;break;case"ZYX":this.x=a*r*o-s*l*u,this.y=s*l*o+a*r*u,this.z=s*r*u-a*l*o,this.w=s*r*o+a*l*u;break;case"YXZ":this.x=a*r*o+s*l*u,this.y=s*l*o-a*r*u,this.z=s*r*u-a*l*o,this.w=s*r*o+a*l*u;break;case"ZXY":this.x=a*r*o-s*l*u,this.y=s*l*o+a*r*u,this.z=s*r*u+a*l*o,this.w=s*r*o-a*l*u;break;case"YZX":this.x=a*r*o+s*l*u,this.y=s*l*o+a*r*u,this.z=s*r*u-a*l*o,this.w=s*r*o-a*l*u;break;case"XZY":this.x=a*r*o-s*l*u,this.y=s*l*o-a*r*u,this.z=s*r*u+a*l*o,this.w=s*r*o+a*l*u}return this},getEuler(e=[],t="XYZ"){const{0:i,1:n,2:s,3:r,4:o,5:a,6:l,7:u,8:h}=this.getMatrix(Yt);switch(t){case"XYZ":e[1]=Math.asin(g.clamp(l,-1,1)),Math.abs(l)<.9999999?(e[0]=Math.atan2(-u,h),e[2]=Math.atan2(-r,i)):(e[0]=Math.atan2(a,o),e[2]=0);break;case"ZYX":e[1]=Math.asin(-g.clamp(s,-1,1)),Math.abs(s)<.9999999?(e[0]=Math.atan2(a,h),e[2]=Math.atan2(n,i)):(e[0]=0,e[2]=Math.atan2(-r,o));break;case"YXZ":e[0]=Math.asin(-g.clamp(u,-1,1)),Math.abs(u)<.9999999?(e[1]=Math.atan2(l,h),e[2]=Math.atan2(n,o)):(e[1]=Math.atan2(-s,i),e[2]=0);break;case"ZXY":e[0]=Math.asin(g.clamp(a,-1,1)),Math.abs(a)<.9999999?(e[1]=Math.atan2(-s,h),e[2]=Math.atan2(-r,o)):(e[1]=0,e[2]=Math.atan2(n,i));break;case"YZX":e[2]=Math.asin(g.clamp(n,-1,1)),Math.abs(n)<.9999999?(e[0]=Math.atan2(-u,o),e[1]=Math.atan2(-s,i)):(e[0]=0,e[1]=Math.atan2(l,h));break;case"XZY":e[2]=Math.asin(-g.clamp(r,-1,1)),Math.abs(r)<.9999999?(e[0]=Math.atan2(a,o),e[1]=Math.atan2(l,i)):(e[0]=Math.atan2(-u,h),e[1]=0)}return e},isReal(){return!(this.x||this.y||this.z)},isImag(){return!this.w},equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},inverse(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},subtract(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},multiply(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},multLeft(e){const{x:t,y:i,z:n,w:s}=this,{x:r,y:o,z:a,w:l}=e;return this.x=s*r+t*l+i*a-n*o,this.y=s*o+i*l+n*r-t*a,this.z=s*a+n*l+t*o-i*r,this.w=s*l-t*r-i*o-n*a,this},multRight(e){const{x:t,y:i,z:n,w:s}=this,{x:r,y:o,z:a,w:l}=e;return this.x=l*t+r*s+o*n-a*i,this.y=l*i+o*s+a*t-r*n,this.z=l*n+a*s+r*i-o*t,this.w=l*s-r*t-o*i-a*n,this},divide(e){return this.x/=e,this.y/=e,this.z/=e,this.w/=e,this},multVecQuat(e){const{x:t,y:i,z:n,w:s}=this,{x:r,y:o,z:a}=e,l=2*(i*a-n*o),u=2*(n*r-t*a),h=2*(t*o-i*r);return e.x+=s*l+i*h-n*u,e.y+=s*u+n*l-t*h,e.z+=s*h+t*u-i*l,e},multQuatVec(e){const{x:t,y:i,z:n,w:s}=this,{x:r,y:o,z:a}=e,l=2*(n*o-i*a),u=2*(t*a-n*r),h=2*(i*r-t*o);return e.x+=s*l-i*h+n*u,e.y+=s*u-n*l+t*h,e.z+=s*h-t*u+i*l,e},normalize(){const e=Math.hypot(this.x,this.y,this.z,this.w);return e&&(this.x/=e,this.y/=e,this.z/=e,this.w/=e),this},dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},norm(){const{x:e,y:t,z:i,w:n}=this;return e*e+t*t+i*i+n*n},magnitude(){return Math.hypot(this.x,this.y,this.z,this.w)},pow(t){if(t instanceof zt)return this.assign(e.assign(t).multRight(this.log()).exp());if(this.isReal())return this.set(0,0,0,this.w**t);const i=this.magnitude(),n=i**t,s=t*Math.acos(this.w/i),r=n/this.imag.magnitude()*Math.sin(s);return this.x*=r,this.y*=r,this.z*=r,this.w=n*Math.cos(s),this},log(){if(this.isReal())return this.w>0?this.set(0,0,0,Math.log(this.w)):this.set(Math.PI,0,0,Math.log(-this.w));const e=this.magnitude(),t=this.imag.normalize().multiply(Math.acos(this.w/e)),i=Math.log(e);return this.x=t.x,this.y=t.y,this.z=t.z,this.w=i,this},exp(){if(this.isReal())return this.set(0,0,0,Math.exp(this.w));const e=this.imag,t=e.magnitude(),i=Math.exp(this.w),n=i*Math.cos(t),s=e.multiply(i*Math.sin(t)/t);return this.x=s.x,this.y=s.y,this.z=s.z,this.w=n,this},slerp(e,t){return g.slerp(this,Gt.assign(e),t)},squad(e,t,i,n){return g.slerp(g.slerp(this,Gt.assign(i),n),g.slerp(Ht.assign(e),qt.assign(t),n),2*n*(1-n))},toString(){return this.x+" "+this.y+" "+this.z+" "+this.w}}),Object.defineProperties(zt.prototype,{length:{value:4},0:{get(){return this.x},set(e){this.x=e}},1:{get(){return this.y},set(e){this.y=e}},2:{get(){return this.z},set(e){this.z=e}},3:{get(){return this.w},set(e){this.w=e}},real:{get(){return this.w}},imag:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this.x,this.y,this.z)}})()}}),Object.assign(zt,{Identity:new zt(0,0,0,1),spline:(()=>{const e=new zt(0,0,0,1),t=new zt(0,0,0,1),i=new zt(0,0,0,1),n=new zt(0,0,0,1);return function(s,r,o){return e.assign(s),t.assign(r),i.assign(o),e.dot(t)<0&&e.negate(),i.dot(t)<0&&i.negate(),n.assign(t).inverse(),t.multRight(Gt.assign(n).multRight(e).log().add(Ht.assign(n).multRight(i).log()).divide(-4).exp()).normalize().copy()}})()});const Gt=new zt(0,0,0,1),Ht=new zt(0,0,0,1),qt=new zt(0,0,0,1),Yt=new Pt,Wt=zt;i.add("Quaternion","standard/Math/Numbers/Quaternion",Wt);const $t=Wt,Jt=Symbol(),Kt=Symbol(),Zt=Symbol(),Qt=Symbol(),ei=Symbol();function ti(e,t,i,n){switch(this[Jt]=0,this[Kt]=0,this[Zt]=1,this[Qt]=0,arguments.length){case 0:return void(this[ei]=new $t(0,0,0,1));case 1:return this[ei]=arguments[0],void this.update();case 2:{const e=arguments[0],t=arguments[1];return this[ei]=new $t(0,0,0,1),t instanceof bt?this.setFromToVec(e,t):void this.set(e.x,e.y,e.z,t)}case 4:return this[ei]=new $t(0,0,0,1),void this.set(e,t,i,n)}}Object.assign(ti.prototype,{*[Symbol.iterator](){yield this[Jt],yield this[Kt],yield this[Zt],yield this[Qt]},update(){const e=this.get();return this[Jt]=e.x,this[Kt]=e.y,this[Zt]=e.z,this[Qt]=e.w,this},copy(){const e=Object.create(ti.prototype);return e[Jt]=this[Jt],e[Kt]=this[Kt],e[Zt]=this[Zt],e[Qt]=this[Qt],e[ei]=this[ei].copy(),e},assign(e){return this[Jt]=e[Jt],this[Kt]=e[Kt],this[Zt]=e[Zt],this[Qt]=e[Qt],this[ei].assign(e[ei]),this},set(e,t,i,n){this[Jt]=e,this[Kt]=t,this[Zt]=i,this[Qt]=n;const s=Math.hypot(e,t,i);if(0===s)return this[ei].set(0,0,0,1),this;const r=g.interval(n/2,0,Math.PI),o=Math.sin(r)/s;return this[ei].set(e*o,t*o,i*o,Math.cos(r)),this},get:(()=>{const e=new jt(0,0,0,0);return function(){const t=this[ei];if(Math.abs(t.w)>1)return jt.zAxis;{const i=2*Math.acos(t.w),n=Math.sin(i/2);if(0===n)return jt.zAxis;{const s=t.imag.divide(n);return e.set(s.x,s.y,s.z,i)}}}})(),setAxisAngle(e,t){return this.set(e.x,e.y,e.z,t)},setFromToVec:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0);return function(s,r){e.assign(s).normalize(),t.assign(r).normalize();const o=g.clamp(e.dot(t),-1,1),a=i.assign(e).cross(t).normalize();return 0===a.magnitude()?o>0?this[ei].set(0,0,0,1):(n.assign(e).cross(bt.xAxis),0===n.norm()&&n.assign(e).cross(bt.yAxis),n.normalize(),this[ei].set(n.x,n.y,n.z,0)):(a.multiply(Math.sqrt(Math.abs(1-o)/2)),this[ei].set(a.x,a.y,a.z,Math.sqrt(Math.abs(1+o)/2))),this.update(),this}})(),setAxis(e){this.set(e.x,e.y,e.z,this[Qt])},getAxis(e=new bt(0,0,0)){return e.set(this[Jt],this[Kt],this[Zt])},setQuaternion(e){return this[ei].assign(e).normalize(),this.update(),this},getQuaternion(e=new $t(0,0,0,1)){return e.assign(this[ei])},setMatrix(e){return this[ei].setMatrix(e).normalize(),this.update(),this},getMatrix(e=new Pt){return this[ei].getMatrix(e)},setEuler(e,t,i,n="XYZ"){return this[ei].setEuler(e,t,i,n),this.update(),this},getEuler(e=[],t="XYZ"){return this[ei].getEuler(e,t)},equals(e){return this[ei].equals(e[ei])},inverse(){return this[ei].inverse(),this.update(),this},multLeft(e){return this[ei].multLeft(e[ei]).normalize(),this.update(),this},multRight(e){return this[ei].multRight(e[ei]).normalize(),this.update(),this},multVecRot(e){return this[ei].multVecQuat(e)},multRotVec(e){return this[ei].multQuatVec(e)},normalize(){return this[ei].normalize(),this.update(),this},pow(e){return this[ei].pow(e),this.update(),this},slerp(e,t){return this[ei].slerp(e[ei],t),this.update(),this},squad(e,t,i,n){return this[ei].squad(e[ei],t[ei],i[ei],n),this.update(),this},toString(){return this[Jt]+" "+this[Kt]+" "+this[Zt]+" "+this[Qt]}});const ii={get(){return this[Jt]},set(e){this[Jt]=e,this.set(e,this[Kt],this[Zt],this[Qt])},enumerable:!0},ni={get(){return this[Kt]},set(e){this[Kt]=e,this.set(this[Jt],e,this[Zt],this[Qt])},enumerable:!0},si={get(){return this[Zt]},set(e){this[Zt]=e,this.set(this[Jt],this[Kt],e,this[Qt])},enumerable:!0},ri={get(){return this[Qt]},set(e){this[Qt]=e,this.set(this[Jt],this[Kt],this[Zt],e)},enumerable:!0};Object.defineProperties(ti.prototype,{length:{value:4},x:ii,y:ni,z:si,angle:ri}),ii.enumerable=!1,ni.enumerable=!1,si.enumerable=!1,ri.enumerable=!1,Object.defineProperties(ti.prototype,{0:ii,1:ni,2:si,3:ri}),Object.assign(ti,{Identity:new ti,fromQuaternion:e=>(new ti).setQuaternion(e),fromMatrix:e=>(new ti).setMatrix(e),fromEuler:(e,t,i,n="XYZ")=>(new ti).setEuler(e,t,i,n),spline(e,t,i){const n=Object.create(this.prototype);return n[ei]=$t.spline(e[ei],t[ei],i[ei]),n.update(),n}});const oi=ti;i.add("Rotation4","standard/Math/Numbers/Rotation4",oi);const ai=oi;function li(){if(arguments.length)for(let e=0;e<16;++e)this[e]=arguments[e];else this.identity()}Object.assign(li.prototype,{*[Symbol.iterator](){for(let e=0;e<16;++e)yield this[e]},copy(){const e=Object.create(li.prototype);for(let t=0;t<16;++t)e[t]=this[t];return e},assign(e){for(let t=0;t<16;++t)this[t]=e[t];return this},equals(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]&&this[4]===e[4]&&this[5]===e[5]&&this[6]===e[6]&&this[7]===e[7]&&this[8]===e[8]&&this[9]===e[9]&&this[10]===e[10]&&this[11]===e[11]&&this[12]===e[12]&&this[13]===e[13]&&this[14]===e[14]&&this[15]===e[15]},set1(e,t,i){return this[e*this.order+t]=i,this},get1(e,t){return this[e*this.order+t]},set:(()=>{const e=new ai,t=new bt(0,0,0);return function(i,n,s,r,o){switch(arguments.length){case 0:this.identity();break;case 1:null===i&&(i=bt.Zero),this.identity(),this.translate(i);break;case 2:null===i&&(i=bt.Zero),null===n&&(n=ai.Identity),this.identity(),this.translate(i),n.equals(ai.Identity)||this.rotate(n);break;case 3:null===i&&(i=bt.Zero),null===n&&(n=ai.Identity),null===s&&(s=bt.One),this.identity(),this.translate(i),n.equals(ai.Identity)||this.rotate(n),s.equals(bt.One)||this.scale(s);break;case 4:if(null===i&&(i=bt.Zero),null===n&&(n=ai.Identity),null===s&&(s=bt.One),null===r&&(r=ai.Identity),this.identity(),this.translate(i),n.equals(ai.Identity)||this.rotate(n),!s.equals(bt.One)){!r.equals(ai.Identity)?(this.rotate(r),this.scale(s),this.rotate(e.assign(r).inverse())):this.scale(s)}break;case 5:{null===i&&(i=bt.Zero),null===n&&(n=ai.Identity),null===s&&(s=bt.One),null===r&&(r=ai.Identity),null===o&&(o=bt.Zero),this.identity(),this.translate(i);const a=!o.equals(bt.Zero);a&&this.translate(o),n.equals(ai.Identity)||this.rotate(n),s.equals(bt.One)||(r.equals(ai.Identity)?this.scale(s):(this.rotate(r),this.scale(s),this.rotate(e.assign(r).inverse()))),a&&this.translate(t.assign(o).negate());break}case 16:for(let e=0;e<16;++e)this[e]=arguments[e]}return this}})(),get:(()=>{const e=new bt(0,0,0),t=new ai,i=new bt(0,0,0),n=new ai,s=new bt(0,0,0),r=new Pt,o=new Pt,a=new bt(0,0,0);return function(l,u,h,d,c){switch(null===l&&(l=e),null===u&&(u=t),null===h&&(h=i),null===d&&(d=n),null===c&&(c=s),arguments.length){case 1:l.set(this[12],this[13],this[14]);break;case 2:this.factor(l,r,i,o),u.setMatrix(r);break;case 3:this.factor(l,r,h,o),u.setMatrix(r);break;case 4:this.factor(l,r,h,o),u.setMatrix(r),d.setMatrix(o);break;case 5:hi.set(a.assign(c).negate()),hi.multLeft(this),hi.translate(c),hi.get(l,u,h,d)}}})(),setRotation(e){return this.setQuaternion(e.getQuaternion(ui))},setQuaternion(e){const{x:t,y:i,z:n,w:s}=e,r=i*i,o=n*n,a=t*i,l=n*s,u=n*t,h=i*s,d=t*t,c=i*n,p=t*s;return this[0]=1-2*(r+o),this[1]=2*(a+l),this[2]=2*(u-h),this[3]=0,this[4]=2*(a-l),this[5]=1-2*(o+d),this[6]=2*(c+p),this[7]=0,this[8]=2*(u+h),this[9]=2*(c-p),this[10]=1-2*(r+d),this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},factor:(()=>{const e=new Pt,t=new Pt,i=new Pt,n={values:[],vectors:[[],[],[]]};return function(s,r,o,a){s.set(this[12],this[13],this[14]);const l=this.submatrix,u=l.determinant()<0?-1:1;i.assign(l).transpose().multLeft(l);const h=Ft(i,n);a.set(h.vectors[0][0],h.vectors[1][0],h.vectors[2][0],h.vectors[0][1],h.vectors[1][1],h.vectors[2][1],h.vectors[0][2],h.vectors[1][2],h.vectors[2][2]),o.x=u*Math.sqrt(h.values[0]),o.y=u*Math.sqrt(h.values[1]),o.z=u*Math.sqrt(h.values[2]),e[0]=1/o.x,e[4]=1/o.y,e[8]=1/o.z,r.assign(t.assign(a).transpose().multRight(e).multRight(a).multRight(l))}})(),determinant3(){const e=this[0],t=this[1],i=this[2],n=this[4],s=this[5],r=this[6],o=this[8],a=this[9],l=this[10];return e*(s*l-r*a)-t*(n*l-r*o)+i*(n*a-s*o)},determinant(){const{0:e,1:t,2:i,3:n,4:s,5:r,6:o,7:a,8:l,9:u,10:h,11:d,12:c,13:p,14:g,15:f}=this,m=h*f,_=g*d,x=o*f,y=g*a,w=o*d,b=h*a,S=i*f,T=g*n,v=i*d,O=h*n,E=i*a,N=o*n;return e*(m*r+y*u+w*p-_*r-x*u-b*p)+s*(_*t+S*u+O*p-m*t-T*u-v*p)+l*(x*t+T*r+E*p-y*t-S*r-N*p)+c*(b*t+v*r+N*u-w*t-O*r-E*u)},transpose(){let e;return e=this[1],this[1]=this[4],this[4]=e,e=this[2],this[2]=this[8],this[8]=e,e=this[3],this[3]=this[12],this[12]=e,e=this[6],this[6]=this[9],this[9]=e,e=this[7],this[7]=this[13],this[13]=e,e=this[11],this[11]=this[14],this[14]=e,this},inverse(){const{0:e,1:t,2:i,3:n,4:s,5:r,6:o,7:a,8:l,9:u,10:h,11:d,12:c,13:p,14:g,15:f}=this,m=h*f,_=g*d,x=o*f,y=g*a,w=o*d,b=h*a,S=i*f,T=g*n,v=i*d,O=h*n,E=i*a,N=o*n,C=l*p,F=c*u,I=s*p,M=c*r,D=s*u,P=l*r,R=e*p,A=c*t,V=e*u,L=l*t,B=e*r,U=s*t,X=m*r+y*u+w*p-(_*r+x*u+b*p),k=_*t+S*u+O*p-(m*t+T*u+v*p),j=x*t+T*r+E*p-(y*t+S*r+N*p),z=b*t+v*r+N*u-(w*t+O*r+E*u);let G=e*X+s*k+l*j+c*z;return G=1/G,this[0]=G*X,this[1]=G*k,this[2]=G*j,this[3]=G*z,this[4]=G*(_*s+x*l+b*c-m*s-y*l-w*c),this[5]=G*(m*e+T*l+v*c-_*e-S*l-O*c),this[6]=G*(y*e+S*s+N*c-x*e-T*s-E*c),this[7]=G*(w*e+O*s+E*l-b*e-v*s-N*l),this[8]=G*(C*a+M*d+D*f-F*a-I*d-P*f),this[9]=G*(F*n+R*d+L*f-C*n-A*d-V*f),this[10]=G*(I*n+A*a+B*f-M*n-R*a-U*f),this[11]=G*(P*n+V*a+U*d-D*n-L*a-B*d),this[12]=G*(I*h+P*g+F*o-D*g-C*o-M*h),this[13]=G*(V*g+C*i+A*h-R*h-L*g-F*i),this[14]=G*(R*o+U*g+M*i-B*g-I*i-A*o),this[15]=G*(B*h+D*i+L*o-V*o-U*h-P*i),this},multLeft(e){const{0:t,1:i,2:n,3:s,4:r,5:o,6:a,7:l,8:u,9:h,10:d,11:c,12:p,13:g,14:f,15:m}=this,{0:_,1:x,2:y,3:w,4:b,5:S,6:T,7:v,8:O,9:E,10:N,11:C,12:F,13:I,14:M,15:D}=e;return this[0]=t*_+r*x+u*y+p*w,this[1]=i*_+o*x+h*y+g*w,this[2]=n*_+a*x+d*y+f*w,this[3]=s*_+l*x+c*y+m*w,this[4]=t*b+r*S+u*T+p*v,this[5]=i*b+o*S+h*T+g*v,this[6]=n*b+a*S+d*T+f*v,this[7]=s*b+l*S+c*T+m*v,this[8]=t*O+r*E+u*N+p*C,this[9]=i*O+o*E+h*N+g*C,this[10]=n*O+a*E+d*N+f*C,this[11]=s*O+l*E+c*N+m*C,this[12]=t*F+r*I+u*M+p*D,this[13]=i*F+o*I+h*M+g*D,this[14]=n*F+a*I+d*M+f*D,this[15]=s*F+l*I+c*M+m*D,this},multRight(e){const{0:t,1:i,2:n,3:s,4:r,5:o,6:a,7:l,8:u,9:h,10:d,11:c,12:p,13:g,14:f,15:m}=this,{0:_,1:x,2:y,3:w,4:b,5:S,6:T,7:v,8:O,9:E,10:N,11:C,12:F,13:I,14:M,15:D}=e;return this[0]=t*_+i*b+n*O+s*F,this[1]=t*x+i*S+n*E+s*I,this[2]=t*y+i*T+n*N+s*M,this[3]=t*w+i*v+n*C+s*D,this[4]=r*_+o*b+a*O+l*F,this[5]=r*x+o*S+a*E+l*I,this[6]=r*y+o*T+a*N+l*M,this[7]=r*w+o*v+a*C+l*D,this[8]=u*_+h*b+d*O+c*F,this[9]=u*x+h*S+d*E+c*I,this[10]=u*y+h*T+d*N+c*M,this[11]=u*w+h*v+d*C+c*D,this[12]=p*_+g*b+f*O+m*F,this[13]=p*x+g*S+f*E+m*I,this[14]=p*y+g*T+f*N+m*M,this[15]=p*w+g*v+f*C+m*D,this},multVecMatrix(e){if(3===e.length){const{x:t,y:i,z:n}=e,s=1/(t*this[3]+i*this[7]+n*this[11]+this[15]);return e.x=(t*this[0]+i*this[4]+n*this[8]+this[12])*s,e.y=(t*this[1]+i*this[5]+n*this[9]+this[13])*s,e.z=(t*this[2]+i*this[6]+n*this[10]+this[14])*s,e}{const{x:t,y:i,z:n,w:s}=e;return e.x=t*this[0]+i*this[4]+n*this[8]+s*this[12],e.y=t*this[1]+i*this[5]+n*this[9]+s*this[13],e.z=t*this[2]+i*this[6]+n*this[10]+s*this[14],e.w=t*this[3]+i*this[7]+n*this[11]+s*this[15],e}},multMatrixVec(e){if(3===e.length){const{x:t,y:i,z:n}=e,s=1/(t*this[12]+i*this[13]+n*this[14]+this[15]);return e.x=(t*this[0]+i*this[1]+n*this[2]+this[3])*s,e.y=(t*this[4]+i*this[5]+n*this[6]+this[7])*s,e.z=(t*this[8]+i*this[9]+n*this[10]+this[11])*s,e}{const{x:t,y:i,z:n,w:s}=e;return e.x=t*this[0]+i*this[1]+n*this[2]+s*this[3],e.y=t*this[4]+i*this[5]+n*this[6]+s*this[7],e.z=t*this[8]+i*this[9]+n*this[10]+s*this[11],e.w=t*this[12]+i*this[13]+n*this[14]+s*this[15],e}},multDirMatrix(e){const{x:t,y:i,z:n}=e;return e.x=t*this[0]+i*this[4]+n*this[8],e.y=t*this[1]+i*this[5]+n*this[9],e.z=t*this[2]+i*this[6]+n*this[10],e},multMatrixDir(e){const{x:t,y:i,z:n}=e;return e.x=t*this[0]+i*this[1]+n*this[2],e.y=t*this[4]+i*this[5]+n*this[6],e.z=t*this[8]+i*this[9]+n*this[10],e},identity(){return this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=0,this[5]=1,this[6]=0,this[7]=0,this[8]=0,this[9]=0,this[10]=1,this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},translate(e){const{x:t,y:i,z:n}=e;return this[12]+=this[0]*t+this[4]*i+this[8]*n,this[13]+=this[1]*t+this[5]*i+this[9]*n,this[14]+=this[2]*t+this[6]*i+this[10]*n,this},rotate(e){return this.multLeft(hi.setQuaternion(e.getQuaternion(ui)))},scale(e){const{x:t,y:i,z:n}=e;return this[0]*=t,this[4]*=i,this[8]*=n,this[1]*=t,this[5]*=i,this[9]*=n,this[2]*=t,this[6]*=i,this[10]*=n,this},toString(){return Array.prototype.join.call(this," ")}}),Object.defineProperties(li.prototype,{order:{value:4},length:{value:16},x:{get:(()=>{const e=new jt(0,0,0,0);return function(){return e.set(this[0],this[1],this[2],this[3])}})()},y:{get:(()=>{const e=new jt(0,0,0,0);return function(){return e.set(this[4],this[5],this[6],this[7])}})()},z:{get:(()=>{const e=new jt(0,0,0,0);return function(){return e.set(this[8],this[9],this[10],this[11])}})()},w:{get:(()=>{const e=new jt(0,0,0,0);return function(){return e.set(this[12],this[13],this[14],this[15])}})()},xAxis:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this[0],this[1],this[2])}})()},yAxis:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this[4],this[5],this[6])}})()},zAxis:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this[8],this[9],this[10])}})()},origin:{get:(()=>{const e=new bt(0,0,0);return function(){return e.set(this[12],this[13],this[14])}})()},submatrix:{get:(()=>{const e=new Pt;return function(){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e[3]=this[4],e[4]=this[5],e[5]=this[6],e[6]=this[8],e[7]=this[9],e[8]=this[10],e}})()}}),Object.assign(li,{Identity:new li,Rotation(e){return Object.create(this.prototype).setQuaternion(e.getQuaternion(ui))},Quaternion(e){return Object.create(this.prototype).setQuaternion(e)},Matrix3:e=>new li(e[0],e[1],0,0,e[3],e[4],0,0,0,0,1,0,e[6],e[7],0,1),SubMatrix:e=>new li(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)});const ui=new $t,hi=new li,di=li;i.add("Matrix4","standard/Math/Numbers/Matrix4",di);const ci=di;function pi(e,t,i){function n(e,t,i,n,s,r,o,a,l,u,h,d,c,p,g,f){switch(arguments.length){case 0:he.call(this,new ci);break;case 1:he.call(this,arguments[0]);break;case 4:{const e=arguments[0],t=arguments[1],i=arguments[2],n=arguments[3];he.call(this,new ci(e.x,e.y,e.z,e.w,t.x,t.y,t.z,t.w,i.x,i.y,i.z,i.w,n.x,n.y,n.z,n.w));break}case 16:he.call(this,new ci(+e,+t,+i,+n,+s,+r,+o,+a,+l,+u,+h,+d,+c,+p,+g,+f));break;default:throw new Error("Invalid arguments.")}}ht(n,e,ci,t,i);for(const e of Object.keys(n.prototype))Object.defineProperty(n.prototype,e,{enumerable:!1});function s(e){Object.defineProperty(n.prototype,e,{get(){return this.getValue()[e]},set(t){this.getValue()[e]=t,this.addEvent()},enumerable:!0})}for(let e=0,t=ci.prototype.length;e<t;++e)s(e);return n}const gi={SFMatrix4d:pi("SFMatrix4d",Ut.SFVec3d,!0),SFMatrix4f:pi("SFMatrix4f",Ut.SFVec3f,!1),VrmlMatrix:pi("VrmlMatrix",Ut.SFVec3f,!1)};i.add("SFMatrix4","x_ite/Fields/SFMatrix4",gi);const fi=gi,mi=new WeakMap;function _i(){const e=this.getValue();e?.dispose(),Oi.prototype.dispose.call(this),mi.delete(e)}const xi={get(e){const t=mi.get(e);if(t)return t;{const t=new Oi(e);return t.dispose=_i,mi.set(e,t),t}}};i.add("SFNodeCache","x_ite/Fields/SFNodeCache",xi);const yi=xi,wi=Symbol(),bi=Symbol(),Si={get(e,t){try{const i=e[t];if(void 0!==i)return i;const n=e.getValue().getField(t);if(n.getAccessType()===d.inputOnly)return;return n.valueOf()}catch{return}},set(e,t,i){if(t in e)return e[t]=i,!0;try{const n=e.getValue().getField(t);return n.getAccessType()!==d.outputOnly&&n.setValue(i),!0}catch(i){return console.error(e,t,i),!1}},has(e,t){try{return!!e.getValue().getField(t)}catch{return t in e}},ownKeys(e){const t=e.getValue(),i=[];if(t)for(const e of t.getFieldDefinitions())i.push(e.name);return i},getOwnPropertyDescriptor(e,t){const i=e.getValue();if(i){const n=i.getFieldDefinitions().get(t);if(n)return{value:this.get(e,t),writable:n.accessType!==d.outputOnly,enumerable:!0,configurable:!0}}}};function Ti(e){const t=new Proxy(this,Si);return this[wi]=this,this[bi]=t,e?(e.addParent(t),he.call(this,e)):he.call(this,null),t}Object.assign(Object.setPrototypeOf(Ti.prototype,he.prototype),{[wi]:null,[bi]:null,copy(e){const t=this[wi].getValue();return t?new Ti(e?t.copy(e):t):new Ti},equals(e){const t=this[wi];return e?t.getValue()===e.getValue():null===t.getValue()},isDefaultValue(){return null===this[wi].getValue()},set(e){const t=this[wi],i=t.getValue();i&&i.removeParent(t[bi]),e?(e.addParent(t[bi]),he.prototype.set.call(t,e)):he.prototype.set.call(t,null)},getNodeTypeName(){const e=this[wi].getValue();if(e)return e.getTypeName();throw new Error("SFNode.getNodeTypeName: node is null.")},getNodeName(){const e=this[wi].getValue();if(e)return e.getName();throw new Error("SFNode.getNodeName: node is null.")},getNodeDisplayName(){const e=this[wi].getValue();if(e)return e.getDisplayName();throw new Error("SFNode.getNodeDisplayName: node is null.")},getNodeType(){const e=this[wi].getValue();if(e)return Array.from(e.getType());throw new Error("SFNode.getNodeType: node is null.")},getFieldDefinitions(){const e=this[wi].getValue();if(e)return e.getFieldDefinitions();throw new Error("SFNode.getFieldDefinitions: node is null.")},getField(e){const t=this[wi].getValue();if(t)return t.getField(e);throw new Error("SFNode is disposed.")},addFieldCallback(e,t,i){const n=this[wi];switch(arguments.length){case 2:return he.prototype.addFieldCallback.apply(n,arguments);case 3:{const s=n.getValue();if(s)return s.getField(e).addFieldCallback(t,i);throw new Error("SFNode.addFieldCallback: node is null.")}}},removeFieldCallback(e,t){const i=this[wi];switch(arguments.length){case 1:return he.prototype.removeFieldCallback.apply(i,arguments);case 2:{const n=i.getValue();if(n)return n.getField(e).removeFieldCallback(t);throw new Error("SFNode.removeFieldCallback: node is null.")}}},getNodeUserData(e){const t=this[wi].getValue();if(t)return t.getUserData(e);throw new Error("SFNode.getNodeUserData: node is null.")},setNodeUserData(e,t){const i=this[wi].getValue();if(i)return i.setUserData(e,t);throw new Error("SFNode.setNodeUserData: node is null.")},removeNodeUserData(e){const t=this[wi].getValue();if(t)return t.removeUserData(e);throw new Error("SFNode.removeNodeUserData: node is null.")},valueOf(){const e=this[wi].getValue();return e?yi.get(e):null},toStream(e){const t=this[wi].getValue();t?t.toStream(e):e.string+="NULL"},toVRMLStream(e){const t=this[wi].getValue();t?t.toVRMLStream(e):e.string+="NULL"},toXMLStream(e){const t=this[wi].getValue();t?t.toXMLStream(e):e.string+="\x3c!-- NULL --\x3e"},toJSONStream(e){this.toJSONStreamValue(e)},toJSONStreamValue(e){const t=this[wi].getValue();t?t.toJSONStream(e):e.string+="null"},dispose(){const e=this[wi];e.set(null),e.processInterests(),he.prototype.dispose.call(e)}});for(const e of Object.keys(Ti.prototype))Object.defineProperty(Ti.prototype,e,{enumerable:!1});Object.defineProperties(Ti,{typeName:{value:"SFNode",enumerable:!0}});const vi=Ti;i.add("SFNode","x_ite/Fields/SFNode",vi);const Oi=vi,Ei=Ut.SFVec3d,Ni=Ut.SFVec3f,Ci=Vt.SFMatrix3d,Fi=Vt.SFMatrix3f;function Ii(e,t,i,n){switch(arguments.length){case 0:he.call(this,new ai);break;case 1:if(arguments[0]instanceof Ci||arguments[0]instanceof Fi){he.call(this,(new ai).setMatrix(arguments[0].getValue()));break}he.call(this,arguments[0]);break;case 2:if(arguments[1]instanceof Ei||arguments[1]instanceof Ni){he.call(this,new ai(arguments[0].getValue(),arguments[1].getValue()));break}he.call(this,new ai(arguments[0].getValue(),+arguments[1]));break;case 4:he.call(this,new ai(+e,+t,+i,+n));break;default:throw new Error("Invalid arguments.")}}Object.assign(Object.setPrototypeOf(Ii.prototype,he.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new Ii(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(ai.Identity)},set(e){this.getValue().assign(e)},setAxis(e){this.getValue().setAxis(e.getValue()),this.addEvent()},getAxis(){return new Ni(this.getValue().getAxis())},setMatrix(e){this.getValue().setMatrix(e.getValue()),this.addEvent()},getMatrix(){return new Fi(this.getValue().getMatrix())},inverse(){return new Ii(this.getValue().copy().inverse())},multiply(e){return new Ii(this.getValue().copy().multRight(e.getValue()))},multVec(e){return new e.constructor(this.getValue().multVecRot(e.getValue().copy()))},slerp(e,t){return new Ii(this.getValue().copy().slerp(e.getValue(),t))},toStream(e){const{x:t,y:i,z:n,angle:s}=this.getValue();e.string+=e.DoubleFormat(t),e.string+=e.Space(),e.string+=e.DoubleFormat(i),e.string+=e.Space(),e.string+=e.DoubleFormat(n),e.string+=e.Space(),e.string+=e.DoubleFormat(e.ToUnit("angle",s))},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.string+=e.TidySpace(),this.toJSONStreamValue(e),e.string+=e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const{x:t,y:i,z:n,angle:s}=this.getValue();e.string+=e.JSONNumber(e.DoubleFormat(t)),e.string+=",",e.string+=e.TidySpace(),e.string+=e.JSONNumber(e.DoubleFormat(i)),e.string+=",",e.string+=e.TidySpace(),e.string+=e.JSONNumber(e.DoubleFormat(n)),e.string+=",",e.string+=e.TidySpace(),e.string+=e.JSONNumber(e.DoubleFormat(e.ToUnit("angle",s)))}});for(const e of Object.keys(Ii.prototype))Object.defineProperty(Ii.prototype,e,{enumerable:!1});const Mi={get(){return this.getValue().x},set(e){this.getValue().x=+e,this.addEvent()}},Di={get(){return this.getValue().y},set(e){this.getValue().y=+e,this.addEvent()}},Pi={get(){return this.getValue().z},set(e){this.getValue().z=+e,this.addEvent()}},Ri={get(){return this.getValue().angle},set(e){this.getValue().angle=+e,this.addEvent()}};Object.defineProperties(Ii.prototype,{0:Mi,1:Di,2:Pi,3:Ri,x:Object.assign({enumerable:!0},Mi),y:Object.assign({enumerable:!0},Di),z:Object.assign({enumerable:!0},Pi),angle:Object.assign({enumerable:!0},Ri)}),Object.defineProperties(Ii,{typeName:{value:"SFRotation",enumerable:!0}});const Ai=Ii;i.add("SFRotation","x_ite/Fields/SFRotation",Ai);const Vi=Ai;function Li(e){he.call(this,arguments.length?String(e):"")}Object.assign(Object.setPrototypeOf(Li.prototype,he.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new Li(this.getValue())},isDefaultValue(){return""===this.getValue()},set(e){he.prototype.set.call(this,String(e))},valueOf:he.prototype.getValue,toStream(e){e.string+='"',e.string+=Li.escape(this.getValue()),e.string+='"'},toVRMLStream(e){this.toStream(e)},toXMLStream(e,t=!1){e.string+=t?e.XMLEncodeSourceText(this.getValue()):e.XMLEncode(this.getValue())},toJSONStream(e){this.toJSONStreamValue(e)},toJSONStreamValue(e){e.string+='"',e.string+=e.JSONEncode(this.getValue()),e.string+='"'}});for(const e of Object.keys(Li.prototype))Object.defineProperty(Li.prototype,e,{enumerable:!1});Object.defineProperty(Li.prototype,"length",{get(){return this.getValue().length}}),Object.defineProperties(Li,{typeName:{value:"SFString",enumerable:!0}}),Object.assign(Li,{unescape:e=>e.replace(/\\([\\"])/g,"$1"),escape:e=>e.replace(/([\\"])/g,"\\$1")});const Bi=Li;i.add("SFString","x_ite/Fields/SFString",Bi);const Ui=Bi;function Xi(e){he.call(this,arguments.length?+e:0)}Object.assign(Object.setPrototypeOf(Xi.prototype,he.prototype),{copy(){return new Xi(this.getValue())},isDefaultValue(){return 0===this.getValue()},set(e){he.prototype.set.call(this,+e)},valueOf:he.prototype.getValue,toStream(e){e.string+=this.getValue()},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){this.toJSONStreamValue(e)},toJSONStreamValue(e){e.string+=e.JSONNumber(e.DoubleFormat(this.getValue()))}});for(const e of Object.keys(Xi.prototype))Object.defineProperty(Xi.prototype,e,{enumerable:!1});Object.defineProperties(Xi,{typeName:{value:"SFTime",enumerable:!0}});const ki=Xi;i.add("SFTime","x_ite/Fields/SFTime",ki);const ji=ki;function zi(e,t){function i(e,t,i,n){switch(arguments.length){case 0:he.call(this,new jt(0,0,0,0));break;case 1:he.call(this,arguments[0]);break;case 4:he.call(this,new jt(+e,+t,+i,+n));break;default:throw new Error("Invalid arguments.")}}ct(i,e,jt,t);for(const e of Object.keys(i.prototype))Object.defineProperty(i.prototype,e,{enumerable:!1});const n={get(){return this.getValue().x},set(e){this.getValue().x=+e,this.addEvent()}},s={get(){return this.getValue().y},set(e){this.getValue().y=+e,this.addEvent()}},r={get(){return this.getValue().z},set(e){this.getValue().z=+e,this.addEvent()}},o={get(){return this.getValue().w},set(e){this.getValue().w=+e,this.addEvent()}};return Object.defineProperties(i.prototype,{0:n,1:s,2:r,3:o,x:Object.assign({enumerable:!0},n),y:Object.assign({enumerable:!0},s),z:Object.assign({enumerable:!0},r),w:Object.assign({enumerable:!0},o)}),i}const Gi={SFVec4d:zi("SFVec4d",!0),SFVec4f:zi("SFVec4f",!1)};i.add("SFVec4","x_ite/Fields/SFVec4",Gi);const Hi=Gi;function qi(e){he.call(this,e)}Object.assign(Object.setPrototypeOf(qi.prototype,he.prototype),{at:Array.prototype.at,entries:Array.prototype.entries,every:Array.prototype.every,fill:Array.prototype.fill,filter(){const e=new this.constructor;for(const t of Array.prototype.filter.call(this,...arguments))e.push(t);return e},find:Array.prototype.find,findIndex:Array.prototype.findIndex,findLast:Array.prototype.findLast,findLastIndex:Array.prototype.findLastIndex,forEach:Array.prototype.forEach,includes:Array.prototype.includes,indexOf:Array.prototype.indexOf,join:Array.prototype.join,keys:Array.prototype.keys,lastIndexOf:Array.prototype.lastIndexOf,map(){const e=new this.constructor;for(const t of Array.prototype.map.call(this,...arguments))e.push(t);return e},reduce:Array.prototype.reduce,reduceRight:Array.prototype.reduceRight,reverse:Array.prototype.reverse,slice(){const e=new this.constructor;for(const t of Array.prototype.slice.call(this,...arguments))e.push(t);return e},some:Array.prototype.some,sort:Array.prototype.sort,toReversed(){return this.copy().reverse()},toSorted(){return this.copy().sort(...arguments)},toSpliced(){const e=this.copy();return e.splice(...arguments),e},values:Array.prototype.values,with(e,t){const i=this.copy();return i[e]=t,i}});for(const e of Object.keys(qi.prototype))Object.defineProperty(qi.prototype,e,{enumerable:!1});const Yi=qi;i.add("X3DArrayField","x_ite/Base/X3DArrayField",Yi);const Wi=Yi,$i=Symbol(),Ji=Symbol(),Ki=Symbol(),Zi=Symbol(),Qi={get(e,t){const i=e[t];if(void 0!==i)return i;if("string"==typeof t){const i=e.getValue(),n=+t;return Number.isInteger(n)?(n>=i.length&&e.resize(n+1),i[n].valueOf()):e[t]}},set(e,t,i){if(t in e)return e[t]=i,!0;const n=e.getValue(),s=+t;return s>=n.length&&e.resize(s+1),n[s].setValue(i),!0},has:(e,t)=>Number.isInteger(+t)?t<e.getValue().length:t in e,ownKeys:e=>Object.keys(e.getValue()),getOwnPropertyDescriptor(e,t){if("string"!=typeof t)return;const i=+t;return Number.isInteger(i)&&i<e.getValue().length?Object.getOwnPropertyDescriptor(e.getValue(),t):void 0}};function en(e){const t=new Proxy(this,Qi);Wi.call(this,[]),this[$i]=this,this[Ji]=t;for(const t of e)this.push(t);return t}Object.assign(Object.setPrototypeOf(en.prototype,Wi.prototype),{[$i]:null,[Ji]:null,*[Symbol.iterator](){const e=this[$i].getValue();for(const t of e)yield t.valueOf()},getTarget(){return this[$i]},copy(){const e=this[$i],t=e.create();return t.assign(e),t.setModificationTime(0),t},equals(e){const t=this[$i].getValue(),i=e.getValue(),n=t.length;if(t===i)return!0;if(n!==i.length)return!1;for(let e=0;e<n;++e)if(!t[e].equals(i[e]))return!1;return!0},isDefaultValue(){return 0===this.length},set(e){const t=this[$i],i=t.getValue(),n=e.length;t.resize(n,void 0,!0);for(let t=0;t<n;++t)i[t].set(e[t]instanceof he?e[t].getValue():e[t])},setValue(e){const t=this[$i];t.set(e instanceof en?e.getValue():e),t.addEvent()},unshift(e){const t=this[$i],i=t.getValue();for(let e=arguments.length-1;e>=0;--e){const n=new(t.getSingleType());n.setValue(arguments[e]),t.addChildObject(n),i.unshift(n)}return t.addEvent(),i.length},shift(){const e=this[$i],t=e.getValue();if(t.length){const i=t.shift(),n=i.valueOf();return e.removeChildObject(i),e.addEvent(),n}},push(e){const t=this[$i],i=t.getValue();for(const e of arguments){const n=new(t.getSingleType());n.setValue(e),t.addChildObject(n),i.push(n)}return t.addEvent(),i.length},pop(){const e=this[$i],t=e.getValue();if(t.length){const i=t.pop(),n=i.valueOf();return e.removeChildObject(i),e.addEvent(),n}},splice(e,t,...i){const n=this[$i],s=n.getValue().length;if(0===arguments.length)return new n.constructor;arguments.length<2&&(t=s);const r=n[Zi](e,t);return i.length&&n[Ki](e,i),r},[Ki](e,t){const i=this[$i],n=[];for(const e of t){const t=new(i.getSingleType());t.setValue(e),i.addChildObject(t),n.push(t)}i.getValue().splice(e,0,...n),i.addEvent()},[Zi](e,t){const i=this[$i],n=i.getValue().splice(e,t),s=new i.constructor;for(const e of n)s.push(e),i.removeChildObject(e);return i.addEvent(),s},resize(e,t,i){const n=this[$i],s=n.getValue(),r=s.length;if(e<r){for(let t=e;t<r;++t)n.removeChildObject(s[t]);s.length=e,i||n.addEvent()}else if(e>r){for(let i=r;i<e;++i){const e=new(n.getSingleType());void 0!==t&&e.setValue(t),n.addChildObject(e),s.push(e)}i||n.addEvent()}},addChildObject(e){e.addParent(this[Ji])},removeChildObject(e){e.removeParent(this[Ji]),e.dispose()},reverse(){const e=this[$i];return e.getValue().reverse(),e.addEvent(),e[Ji]},sort(e){const t=this[$i];return Array.prototype.sort.call(this,e),t.addEvent(),t[Ji]},toStream(e){const t=this[$i],i=t.getValue();switch(i.length){case 0:e.string+="[",e.string+=e.TidySpace(),e.string+="]";break;case 1:e.PushUnitCategory(t.getUnit()),i[0].toStream(e),e.PopUnitCategory();break;default:e.PushUnitCategory(t.getUnit()),e.string+="[",e.string+=e.ListStart(),e.IncIndent();for(let t=0,n=i.length-1;t<n;++t)e.string+=e.ListIndent(),i[t].toStream(e),e.string+=e.Comma(),e.string+=e.ListBreak();e.string+=e.ListIndent(),i.at(-1).toStream(e),e.string+=e.ListEnd(),e.DecIndent(),e.string+=e.ListIndent(),e.string+="]",e.PopUnitCategory()}},toVRMLStream(e){this.toStream(e)},toXMLStream(e){const t=this[$i];if(t.length){const i=t.getValue();e.PushUnitCategory(t.getUnit());for(let t=0,n=i.length-1;t<n;++t)i[t].toXMLStream(e),e.string+=e.Comma(),e.string+=e.TidySpace();i.at(-1).toXMLStream(e),e.PopUnitCategory()}},toJSONStream(e){const t=this[$i],i=t.length;if(i){const n=this.getValue();e.PushUnitCategory(t.getUnit()),e.string+="[",e.string+=e.ListBreak(),e.string+=e.IncIndent();for(let t=0,s=i-1;t<s;++t)e.string+=e.ListIndent(),n[t].toJSONStreamValue(e),e.string+=",",e.string+=e.ListBreak();e.string+=e.ListIndent(),n.at(-1).toJSONStreamValue(e),e.string+=e.ListBreak(),e.string+=e.DecIndent(),e.string+=e.ListIndent(),e.string+="]",e.PopUnitCategory()}else e.string+="[",e.string+=e.TidySpace(),e.string+="]"}});for(const e of Object.keys(en.prototype))Object.defineProperty(en.prototype,e,{enumerable:!1});Object.defineProperty(en.prototype,"length",{get(){return this[$i].getValue().length},set(e){this[$i].resize(e)}});const tn=en;i.add("X3DObjectArrayField","x_ite/Base/X3DObjectArrayField",tn);const nn=tn,sn=Symbol(),rn=Symbol(),on=Symbol(),an=Symbol(),ln=Symbol(),un=Symbol(),hn=Symbol(),dn=Symbol(),cn={get(e,t){const i=e[t];if(void 0!==i)return i;if("string"==typeof t){const i=+t;if(Number.isInteger(i)){const t=e.getComponents(),n=e.getValueType();let s=e.getValue();return i>=e[ln]&&(s=e.resize(i+1)),1===t?n(s[i]):e[on][i]??(e[on][i]=gn(e,i,t,n))}return e[t]}},set(e,t,i){if(t in e)return e[t]=i,!0;const n=e.getComponents();let s=+t,r=e.getValue();if(s>=e[ln]&&(r=e.resize(s+1)),1===n){const t=e.getValueType();r[s]=t(i)}else{s*=n;for(let e=0;e<n;++e,++s)r[s]=i[e]}return e.addEvent(),!0},has:(e,t)=>Number.isInteger(+t)?t<e[ln]:t in e,ownKeys(e){const t=[];for(let i=0,n=e[ln];i<n;++i)t.push(String(i));return t},getOwnPropertyDescriptor(e,t){if("string"!=typeof t)return;const i=+t;return Number.isInteger(i)&&i<e[ln]?Object.getOwnPropertyDescriptor(e.getValue(),t):void 0}};function pn(e){const t=new Proxy(this,cn);Wi.call(this,new(this.getArrayType())(16)),this[sn]=this,this[rn]=t,this.getComponents()>1&&(this[on]=[],this[an]=[]);for(const t of e)this.push(t);return t}Object.assign(Object.setPrototypeOf(pn.prototype,Wi.prototype),{[sn]:null,[an]:null,[ln]:0,*[Symbol.iterator](){const e=this[sn],t=e.getValue(),i=e.getComponents(),n=e.getValueType(),s=e[ln];if(1===i)for(let e=0;e<s;++e)yield n(t[e]);else{const t=e[on];for(let r=0;r<s;++r)yield t[r]??(t[r]=gn(e,r,i,n))}},getTarget(){return this[sn]},copy(){const e=this[sn],t=e.getValue(),i=e.create(),n=new(e.getArrayType())(t);return i[ln]=e[ln],Wi.prototype.set.call(i,n),i.setModificationTime(0),i},equals(e){const t=this[sn],i=e[sn],n=t[ln];if(t===i)return!0;if(n!==i[ln])return!1;const s=t.getValue(),r=i.getValue();for(let e=0,i=n*t.getComponents();e<i;++e)if(s[e]!==r[e])return!1;return!0},assign(e){const t=this[sn];t.set(e.getValue(),e.length),t.addEvent()},set(e,t){const i=this[sn],n=i.getComponents(),s=i[ln];let r=i.getValue(),o=void 0!==t?t*n:e.length;const a=o%n;a&&(o-=a,console.warn(`Array length must be multiple of components size, which is ${n}.`)),o/=n,r.length<e.length?(r=i[dn](e.length),r.set(e),a&&r.fill(0,o*n,o*n+a)):(r.set(e),o<s&&r.fill(0,o*n,s*n)),i[ln]=o},isDefaultValue(){return 0===this[ln]},setValue(e){const t=this[sn];e instanceof t.constructor?t.assign(e):(t.set(e),t.addEvent())},unshift(e){const t=this[sn],i=t.getComponents(),n=t[ln],s=arguments.length,r=t[dn]((n+s)*i);if(r.copyWithin(s*i,0,n*i),1===i){const e=t.getValueType();for(let t=0;t<s;++t)r[t]=e(arguments[t])}else for(let e=0,t=0;t<s;++t){const n=arguments[t];for(let t=0;t<i;++t,++e)r[e]=n[t]}return t[ln]+=s,t.addEvent(),t[ln]},shift(){const e=this[sn],t=e[ln];if(t){const n=e.getValue(),s=e.getComponents(),r=e.getValueType(),o=t-1;if(1===s)var i=r(n[0]);else{const t=e[an];for(let e=0;e<s;++e)t[e]=n[e];i=new r(...t)}return n.copyWithin(0,s,t*s),n.fill(0,s*o,t*s),e[ln]=o,e.addEvent(),i}},push(e){const t=this[sn],i=t.getComponents(),n=t[ln],s=arguments.length,r=t[dn]((n+s)*i);if(1===i){const e=t.getValueType();for(let t=0,i=n;t<s;++t,++i)r[i]=e(arguments[t])}else for(let e=n*i,t=0;t<s;++t){const n=arguments[t];for(let t=0;t<i;++t,++e)r[e]=n[t]}return t[ln]+=s,t.addEvent(),t[ln]},pop(){const e=this[sn],t=e[ln];if(t){const n=e.getValue(),s=e.getComponents(),r=e.getValueType(),o=t-1;if(1===s)var i=r(n[t-1]);else{const t=e[an];for(let e=0,i=o*s;e<s;++e,++i)t[e]=n[i];i=new r(...t)}return n.fill(0,o*s,t*s),e[ln]=o,e.addEvent(),i}},splice(e,t,...i){const n=this[sn],s=n[ln];if(0===arguments.length)return new n.constructor;e=Math.min(0|e,s),arguments.length<2&&(t=s),e+(t|=0)>s&&(t=s-e);const r=n[hn](e,e+t);return i.length&&n[un](e,i),n.addEvent(),r},[un](e,t){const i=this[sn],n=i.getComponents(),s=i[ln],r=t.length,o=i[dn]((s+r)*n);if(e*=n,o.copyWithin(e+r*n,e,s*n),1===n){const n=i.getValueType();for(let i=0,s=e;i<r;++i,++s)o[s]=n(t[i])}else for(let i=0,s=e;i<r;++i){const e=t[i];for(let t=0;t<n;++t,++s)o[s]=e[t]}i[ln]+=r},[hn](e,t){const i=this[sn],n=i.getValue(),s=i.getComponents(),r=t-e,o=i[ln],a=o-r,l=i[rn].slice(e,t);return e*=s,t*=s,n.copyWithin(e,t,o*s),n.fill(0,a*s,o*s),i[ln]=a,s>1&&(i[on].length=a),i.addEvent(),l},resize(e,t,i){const n=this[sn],s=n[ln],r=n.getComponents();let o=n.getValue();if(e<s)o.fill(0,e*r,s*r),r>1&&(n[on].length=e),i||n.addEvent();else if(e>s){if(o=n[dn](e*r),void 0!==t)if(1===r)o.fill(t,s*r,e*r);else for(let i=s*r,n=e*r;i<n;)for(let e=0;e<r;++e,++i)o[i]=t[e];i||n.addEvent()}return n[ln]=e,o},[dn](e){const t=this[sn],i=t.getValue();if(e<i.length)return i;const n=g.nextPowerOfTwo(e),s=new(t.getArrayType())(n);return s.set(i),Wi.prototype.set.call(t,s),s},shrinkToFit(){const e=this[sn],t=e.getValue(),i=e[ln]*e.getComponents();if(t.length==i)return t;const n=t.subarray(0,i);return Wi.prototype.set.call(e,n),n},reverse(){const e=this[sn],t=e.getValue(),i=e.getComponents(),n=e[ln]*i,s=Math.floor(e[ln]/2)*i;if(1===i)for(let e=0;e<s;++e){const i=n-e-1,s=t[e];t[e]=t[i],t[i]=s}else for(let e=0;e<s;e+=i)for(let s=0;s<i;++s){const r=e+s,o=n-e-1-(i-s-1),a=t[r];t[r]=t[o],t[o]=a}return e.addEvent(),e[rn]},sort(e){const t=this[sn],i=t.getValue(),n=t.getComponents(),s=t[ln];if(1===n){const n=t.getValueType(),r=e?(t,i)=>e(n(t),n(i)):g.cmp;t.set(i.subarray(0,s).sort(r))}else{const r=Array.from(t[rn],(e=>e.copy())).sort(e??((e,t)=>{for(let i=0;i<n;++i){if(e[i]<t[i])return-1;if(t[i]<e[i])return 1}return 0}));for(let e=0;e<s;++e){const t=r[e];for(let s=0,r=e*n;s<n;++s,++r)i[r]=t[s]}}return t.addEvent(),t[rn]},toStream(e){const t=this[sn],i=t.getValue(),n=t[ln],s=t.getComponents(),r=new(t.getSingleType());switch(n){case 0:e.string+="[",e.string+=e.TidySpace(),e.string+="]";break;case 1:if(e.PushUnitCategory(t.getUnit()),1===s)r.set(i[0]),r.toStream(e);else{for(let e=0,t=0;e<s;++e,++t)r[e]=i[t];r.toStream(e)}e.PopUnitCategory();break;default:if(e.PushUnitCategory(t.getUnit()),e.string+="[",e.string+=e.ListStart(),e.IncIndent(),1===s){for(let t=0,o=n-1;t<o;++t)e.string+=e.ListIndent(),r.set(i[t*s]),r.toStream(e),e.string+=e.Comma(),e.string+=e.ListBreak();e.string+=e.ListIndent(),r.set(i[(n-1)*s]),r.toStream(e)}else{for(let t=0,o=n-1;t<o;++t){e.string+=e.ListIndent();for(let e=0,n=t*s;e<s;++e,++n)r[e]=i[n];r.toStream(e),e.string+=e.Comma(),e.string+=e.ListBreak()}e.string+=e.ListIndent();for(let e=0,t=(n-1)*s;e<s;++e,++t)r[e]=i[t];r.toStream(e)}e.string+=e.ListEnd(),e.DecIndent(),e.string+=e.ListIndent(),e.string+="]",e.PopUnitCategory()}},toVRMLStream(e){this.toStream(e)},toXMLStream(e){const t=this[sn],i=t[ln];if(i){const n=t.getValue(),s=t.getComponents(),r=new(t.getSingleType());if(e.PushUnitCategory(t.getUnit()),1===s){for(let t=0,o=i-1;t<o;++t)r.set(n[t*s]),r.toXMLStream(e),e.string+=e.Comma(),e.string+=e.TidySpace();r.set(n[(i-1)*s]),r.toXMLStream(e)}else{for(let t=0,o=i-1;t<o;++t){for(let e=0,i=t*s;e<s;++e,++i)r[e]=n[i];r.toXMLStream(e),e.string+=e.Comma(),e.string+=e.TidySpace()}for(let e=0,t=(i-1)*s;e<s;++e,++t)r[e]=n[t];r.toXMLStream(e)}e.PopUnitCategory()}},toJSONStream(e){const t=this[sn],i=t.length;if(i){const n=t.getValue(),s=t.getComponents(),r=new(t.getSingleType());if(e.PushUnitCategory(t.getUnit()),e.string+="[",e.string+=e.ListBreak(),e.string+=e.IncIndent(),1===s){for(let t=0,o=i-1;t<o;++t)e.string+=e.ListIndent(),r.set(n[t*s]),r.toJSONStreamValue(e),e.string+=",",e.string+=e.ListBreak();e.string+=e.ListIndent(),r.set(n[(i-1)*s]),r.toJSONStreamValue(e)}else{for(let t=0,o=i-1;t<o;++t){e.string+=e.ListIndent();for(let e=0,i=t*s;e<s;++e,++i)r[e]=n[i];r.toJSONStreamValue(e),e.string+=",",e.string+=e.ListBreak()}e.string+=e.ListIndent();for(let e=0,t=(i-1)*s;e<s;++e,++t)r[e]=n[t];r.toJSONStreamValue(e)}e.string+=e.ListBreak(),e.string+=e.DecIndent(),e.string+=e.ListIndent(),e.string+="]",e.PopUnitCategory()}else e.string+="[",e.string+=e.TidySpace(),e.string+="]"},dispose(){Wi.prototype.dispose.call(this[sn])}});for(const e of Object.keys(pn.prototype))Object.defineProperty(pn.prototype,e,{enumerable:!1});function gn(e,t,i,n){const s=new n,r=s.getValue(),o=t*i;return s.addEvent=mn.bind(e,o,i,r),s.getValue=fn.bind(e,o,i,r),s}function fn(e,t,i){const n=this.getValue();for(let s=0;s<t;++s,++e)i[s]=n[e];return i}function mn(e,t,i){const n=this.getValue();for(let s=0;s<t;++s,++e)n[e]=i[s];this.addEvent()}Object.defineProperty(pn.prototype,"length",{get(){return this[ln]},set(e){this[sn].resize(e)}});const _n=pn;i.add("X3DTypedArrayField","x_ite/Base/X3DTypedArrayField",_n);const xn=_n,{SFMatrix3d:yn,SFMatrix3f:wn}=Vt,{SFMatrix4d:bn,SFMatrix4f:Sn}=fi,{SFVec2d:Tn,SFVec2f:vn}=xt,{SFVec3d:On,SFVec3f:En}=Ut,{SFVec4d:Nn,SFVec4f:Cn}=Hi;function Fn(...e){return nn.call(this,e)}Object.assign(Object.setPrototypeOf(Fn.prototype,nn.prototype),{getSingleType:()=>Oi,copy(e){if(e){const t=new Fn;for(const i of this.getValue())t.push(i.copy(e));return t.setModificationTime(0),t}return nn.prototype.copy.call(this)},toStream(e){const t=this.getTarget(),i=t.getValue(),n=i.length;switch(n){case 0:e.string+="[",e.string+=e.TidySpace(),e.string+="]";break;case 1:e.PushUnitCategory(t.getUnit()),i[0].toStream(e),e.PopUnitCategory();break;default:e.PushUnitCategory(t.getUnit()),e.string+="[",e.string+=e.TidyBreak(),e.IncIndent();for(let t=0;t<n;++t)e.string+=e.Indent(),i[t].toStream(e),e.string+="}"===e.string.at(-1)?e.TidyBreak():e.Break();e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.PopUnitCategory()}},toVRMLStream(e){const t=this.getTarget().getValue();switch(t.length){case 0:e.string+="[",e.string+=e.TidySpace(),e.string+="]";break;case 1:e.EnterScope(),t[0].toVRMLStream(e),e.LeaveScope();break;default:e.EnterScope(),e.string+="[",e.string+=e.TidyBreak(),e.IncIndent();for(const i of t)e.string+=e.Indent(),i.toVRMLStream(e),e.string+="}"===e.string.at(-1)?e.TidyBreak():e.Break();e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.LeaveScope()}},toXMLStream(e){const t=this.getTarget(),i=t.length;if(i){e.EnterScope();const n=t.getValue();for(let t=0,s=i-1;t<s;++t){const i=n[t].getValue();if(i)i.toXMLStream(e),e.string+=e.TidyBreak();else{e.string+=e.Indent(),e.string+="<",e.string+="NULL";const t=e.ContainerField();t&&(e.string+=e.Space(),e.string+="containerField='",e.string+=e.XMLEncode(t.getName()),e.string+="'"),e.string+=e.closingTags?"></NULL>":"/>"}}const s=n.at(-1).getValue();if(s)s.toXMLStream(e);else{e.string+=e.Indent(),e.string+="<",e.string+="NULL";const t=e.ContainerField();t&&(e.string+=e.Space(),e.string+="containerField='",e.string+=e.XMLEncode(t.getName()),e.string+="'")}e.LeaveScope()}},toJSONStream(e){const t=this.getTarget(),i=t.length;if(i){const n=t.getValue();e.EnterScope(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();for(let t=0,s=i-1;t<s;++t)e.string+=e.Indent(),n[t]?n[t].toJSONStreamValue(e):e.string+="null",e.string+=",",e.string+=e.TidyBreak();e.string+=e.Indent(),n.at(-1)?n.at(-1).toJSONStreamValue(e):e.string+="null",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.LeaveScope()}else e.string+="[",e.string+=e.TidySpace(),e.string+="]"},dispose(){const e=this.getTarget();e.resize(0,void 0,!1),e.processInterests(),nn.prototype.dispose.call(e)}});for(const e of Object.keys(Fn.prototype))Object.defineProperty(Fn.prototype,e,{enumerable:!1});function In(...e){return nn.call(this,e)}Object.defineProperties(Fn,{typeName:{value:"MFNode",enumerable:!0}}),Object.assign(Object.setPrototypeOf(In.prototype,nn.prototype),{getSingleType:()=>Ui,toXMLStream(e,t=!1){const i=this.getTarget(),n=i.length;if(n){const s=i.getValue();for(let i=0,r=n-1;i<r;++i)e.string+='"',s[i].toXMLStream(e,t),e.string+='"',e.string+=e.Comma(),e.string+=e.TidySpace();e.string+='"',s.at(-1).toXMLStream(e,t),e.string+='"'}}});for(const e of Object.keys(In.prototype))Object.defineProperty(In.prototype,e,{enumerable:!1});function Mn(...e){return nn.call(this,e)}Object.defineProperties(In,{typeName:{value:"MFString",enumerable:!0}}),Object.assign(Object.setPrototypeOf(Mn.prototype,nn.prototype),{getSingleType:()=>Hn});for(const e of Object.keys(Mn.prototype))Object.defineProperty(Mn.prototype,e,{enumerable:!1});function Dn(e,t,i,n,s){function r(...e){return xn.call(this,e)}Object.assign(Object.setPrototypeOf(r.prototype,xn.prototype),{getSingleType:()=>t,getValueType:()=>i,getArrayType:()=>n,getComponents:()=>s});for(const e of Object.keys(r.prototype))Object.defineProperty(r.prototype,e,{enumerable:!1});return Object.defineProperties(r,{typeName:{value:e,enumerable:!0}}),r}Object.defineProperties(Mn,{typeName:{value:"MFImage",enumerable:!0}});const Pn=e=>e,Rn={MFBool:Dn("MFBool",me,Boolean,Uint8Array,1),MFColor:Dn("MFColor",Re,Re,Float32Array,3),MFColorRGBA:Dn("MFColorRGBA",Qe,Qe,Float32Array,4),MFDouble:Dn("MFDouble",it,Pn,Float64Array,1),MFFloat:Dn("MFFloat",rt,Pn,Float32Array,1),MFImage:Mn,MFInt32:Dn("MFInt32",lt,Pn,Int32Array,1),MFMatrix3d:Dn("MFMatrix3d",yn,yn,Float64Array,9),MFMatrix3f:Dn("MFMatrix3f",wn,wn,Float32Array,9),MFMatrix4d:Dn("MFMatrix4d",bn,bn,Float64Array,16),MFMatrix4f:Dn("MFMatrix4f",Sn,Sn,Float32Array,16),MFNode:Fn,MFRotation:Dn("MFRotation",Vi,Vi,Float64Array,4),MFString:In,MFTime:Dn("MFTime",ji,Pn,Float64Array,1),MFVec2d:Dn("MFVec2d",Tn,Tn,Float64Array,2),MFVec2f:Dn("MFVec2f",vn,vn,Float32Array,2),MFVec3d:Dn("MFVec3d",On,On,Float64Array,3),MFVec3f:Dn("MFVec3f",En,En,Float32Array,3),MFVec4d:Dn("MFVec4d",Nn,Nn,Float64Array,4),MFVec4f:Dn("MFVec4f",Cn,Cn,Float32Array,4)};i.add("ArrayFields","x_ite/Fields/ArrayFields",Rn);const An=Rn,Vn=An.MFInt32;function Ln(e,t,i,n){this.width=Math.max(0|e,0),this.height=Math.max(0|t,0),this.comp=g.clamp(0|i,0,4),this.array=new Vn,this.array.setValue(n),this.array.length=this.width*this.height}Object.assign(Ln.prototype,{copy(){return new Ln(this.width,this.height,this.comp,this.array)},equals(e){return this.width===e.width&&this.height===e.height&&this.comp===e.comp&&this.array.equals(e.array)},assign(e){this.width=e.width,this.height=e.height,this.comp=e.comp,this.array.assign(e.array)},set(e,t,i,n){this.width=0|e,this.height=0|t,this.comp=0|i,this.array.assign(n)},setWidth(e){this.width=Math.max(0|e,0),this.array.length=this.width*this.height},getWidth(){return this.width},setHeight(e){this.height=Math.max(0|e,0),this.array.length=this.width*this.height},getHeight(){return this.height},setComp(e){this.comp=g.clamp(0|e,0,4)},getComp(){return this.comp},setArray(e){this.array.setValue(e),this.array.length=this.width*this.height},getArray(){return this.array}});const Bn=Symbol();function Un(e,t,i,n){switch(arguments.length){case 0:he.call(this,new Ln(0,0,0,new Vn));break;case 1:he.call(this,arguments[0]);break;case 3:he.call(this,new Ln(e,t,i,new Vn));break;case 4:he.call(this,new Ln(e,t,i,n));break;default:throw new Error("Invalid arguments.")}this.getValue().getArray().addParent(this),this.addInterest(Bn,this)}Object.assign(Object.setPrototypeOf(Un.prototype,he.prototype),{[Bn](){this.getValue().getArray().length=this.width*this.height},*[Symbol.iterator](){yield this.width,yield this.height,yield this.comp,yield this.array},copy(){return new Un(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return 0===this.width&&0===this.height&&0===this.comp},set(e){this.getValue().assign(e)},toStream(e){const t=this.array;e.string+=this.width,e.string+=e.Space(),e.string+=this.height,e.string+=e.Space(),e.string+=this.comp,e.string+=e.AttribBreak(),e.IncIndent();for(let i=0,n=this.height;i<n;++i){e.string+=e.ListIndent();const s=i*this.width;for(let i=0,n=this.width;i<n;++i)e.string+="0x",e.string+=t[i+s].toString(16),i!==n-1&&(e.string+=e.Space());i!==n-1&&(e.string+=e.AttribBreak())}e.DecIndent()},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.string+=e.ListBreak(),e.string+=e.IncIndent(),e.string+=e.ListIndent(),this.toJSONStreamValue(e),e.string+=e.DecIndent(),e.string+=e.ListBreak(),e.string+=e.ListIndent(),e.string+="]"},toJSONStreamValue(e){const t=this.array,i=t.length;if(e.string+=this.width,e.string+=",",e.string+=e.TidySpace(),e.string+=this.height,e.string+=",",e.string+=e.TidySpace(),e.string+=this.comp,e.string+=",",this.width&&this.height){e.string+=e.ListBreak(),e.string+=e.IncIndent();for(let n=0,s=this.height;n<s;++n){e.string+=e.ListIndent();const r=n*this.width;for(let n=0,s=this.width;n<s;++n)e.string+=t[n+r],n+r!==i-1&&(e.string+=","),n!==s-1&&(e.string+=e.TidySpace());n!==s-1&&(e.string+=e.ListBreak())}e.string+=e.DecIndent()}}});for(const e of Object.keys(Un.prototype))Object.defineProperty(Un.prototype,e,{enumerable:!1});const Xn={get(){return this.getValue().getWidth()},set(e){this.getValue().setWidth(e),this.addEvent()}},kn={get(){return this.getValue().getHeight()},set(e){this.getValue().setHeight(e),this.addEvent()}},jn={get(){return this.getValue().getComp()},set(e){this.getValue().setComp(e),this.addEvent()}},zn={get(){return this.getValue().getArray()},set(e){this.getValue().setArray(e),this.addEvent()}};Object.defineProperties(Un.prototype,{x:Xn,y:kn,width:Object.assign({enumerable:!0},Xn),height:Object.assign({enumerable:!0},kn),comp:Object.assign({enumerable:!0},jn),array:Object.assign({enumerable:!0},zn)}),Object.defineProperties(Un,{typeName:{value:"SFImage",enumerable:!0}});const Gn=Un;i.add("SFImage","x_ite/Fields/SFImage",Gn);const Hn=Gn,qn={SFBool:me,SFColor:Re,SFColorRGBA:Qe,SFDouble:it,SFFloat:rt,SFImage:Hn,SFInt32:lt,...Vt,...fi,SFNode:Oi,SFRotation:Vi,SFString:Ui,SFTime:ji,...xt,...Ut,...Hi,...An};i.add("Fields","x_ite/Fields",qn);const Yn=qn,Wn=new Map,$n=new Map,Jn={addConcreteNode({typeName:e,fieldDefinitions:t}){if(!Wn.has(e)){this.addNodeTypeName(e);for(const{name:e,accessType:i}of t)i&d.initializeOnly&&this.addFieldName(e)}},addNodeTypeName(e){Wn.set(e,e),Wn.set(e.toUpperCase(),e)},getNodeTypeName:e=>Wn.get(e),addFieldName(e){$n.set(e,e),$n.set(e.toLowerCase(),e)},getFieldName:e=>$n.get(e)};i.add("HTMLSupport","x_ite/Parser/HTMLSupport",Jn);const Kn=Jn,Zn=Symbol(),Qn=Symbol(),es=Symbol(),ts=Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions"),is=Symbol(),ns=Symbol(),ss=Symbol(),rs=Symbol(),os=Symbol(),as=Symbol();function ls(e,t=e.getBrowser()){if(!this[Qn]){R.call(this),this[Zn]=t,this[Qn]=e,this[es]=[d.X3DBaseNode],this[ts]=this.constructor.fieldDefinitions??this[ts],this[is]=new pe,this[ns]=new pe,this[ss]=[],this[os]=!0,this[rs]=!1,this.canUserDefinedFields()&&(this[ts]=new J(this[ts])),this.addChildObjects(d.outputOnly,"name_changed",new Yn.SFTime,d.outputOnly,"typeName_changed",new Yn.SFTime,d.outputOnly,"parents_changed",new Yn.SFTime);for(const e of this[ts])this.addPredefinedField(e)}}Object.assign(Object.setPrototypeOf(ls.prototype,R.prototype),{[ts]:new J([]),setName(e){R.prototype.setName.call(this,e),this._name_changed=this[Zn].getCurrentTime()},getBrowser(){return this[Zn]},getMainScene(){let e=this[Qn].getScene();for(;!e.isMainScene();)e=e.getScene();return e},getScene(){let e=this[Qn];for(;!e.isScene();)e=e.getExecutionContext();return e},getExecutionContext(){return this[Qn]},setExecutionContext(e){this[Qn]=e},addType(e){this[es].push(e)},getType(){return this[es]},create(e=this[Qn]){return new this.constructor(e)},copy(e){const t=this.create(e);for(const e of this[is])t.getPredefinedFields().get(e.getName()).assign(e);if(this.canUserDefinedFields())for(const e of this[ns])t.addUserDefinedField(e.getAccessType(),e.getName(),e.copy());return t.setup(),t},setup(){Object.freeze(this[es]),this[ts].addParent(this),this[is].addParent(this),this[ns].addParent(this);for(const e of this[ss])e.setTainted(!1);for(const e of this[is])e.setTainted(!1);for(const e of this[ns])e.setTainted(!1);this.initialize(),this[rs]=!0},initialize(){},isInitialized(){return this[rs]},getInnerNode(){return this},isLive(){return this[os]},setLive(e){this[os]=e.valueOf(),this[as]()},getLive:(()=>{function e(){return this._live}return function(){return Object.defineProperty(this,"getLive",{value:e}),this.addChildObjects(d.outputOnly,"live",new Yn.SFBool(this.getLiveState())),this._live.removeParent(this),this.getOuterNode?.()?this.getOuterNode().getLive().addInterest(as,this):this[Qn]!==this&&this[Qn].getLive().addInterest(as,this),this._live}})(),getLiveState(){return this.getOuterNode?.()?this[os]&&this.getOuterNode().getLive().getValue():this!==this[Qn]?this[os]&&this[Qn].getLive().getValue():this[os]},[as](){const e=this._live;if(e)if(this.getLiveState()){if(e.getValue())return;e.set(!0),e.processEvent()}else e.getValue()&&(e.set(!1),e.processEvent())},addChildObjects(){for(let e=0,t=arguments.length;e<t;e+=3)this.addChildObject(arguments[e],arguments[e+1],arguments[e+2])},addChildObject(e,t,i){this[ss].push(i),i.setTainted(!0),i.addParent(this),i.setName(t),i.setAccessType(e),Object.defineProperty(this,`_${t}`,{get:()=>i,set(e){i.setValue(e)}})},getFieldDefinitions(){return this[ts]},getField(e){const t=us(this[ns],e)??us(this[is],e);if(t)return t;throw new Error(`Unknown field '${e}' in node class ${this.getTypeName()}.`)},getFields(){return[...this[is],...this[ns]]},addPredefinedField({accessType:e,name:t,value:i}){const n=i.copy();n.setTainted(!this[rs]),n.addParent(this),n.setName(t),n.setAccessType(e),this[is].add(t,n),Object.defineProperty(this,`_${t}`,{get:()=>n,set(e){n.setValue(e)},configurable:!0})},addAlias(e,t){this[is].alias(e,t),t.isInitializable()&&Kn.addFieldName(e)},removePredefinedField(e){const t=this[is].get(e);t&&(t.removeParent(this),this[is].remove(e),delete this[`_${t.getName()}`])},getPredefinedField(e){const t=us(this[is],e);if(t)return t;throw new Error(`Unknown predefined field '${e}' in node class ${this.getTypeName()}.`)},getPredefinedFields(){return this[is]},canUserDefinedFields:()=>!1,addUserDefinedField(e,t,i){if(!this.canUserDefinedFields())throw new Error("Couldn't add user-defined field, node does not support this.");this[ns].has(t)&&this.removeUserDefinedField(t),i.setTainted(!this[rs]),i.addParent(this),i.setName(t),i.setAccessType(e),this[ts].remove(t),this[ts].add(t,new X(e,t,i)),this[ns].add(t,i)},removeUserDefinedField(e){const t=this[ns].get(e);t&&(t.removeParent(this),this[ts].remove(e),this[ns].remove(e))},getUserDefinedField(e){const t=us(this[ns],e);if(t)return t;throw new Error(`Unknown user-defined field '${e}' in node class ${this.getTypeName()}.`)},getUserDefinedFields(){return this[ns]},getChangedFields(e){const t=[];if(e)for(const e of this[ns])t.push(e);for(const i of this[is])if(e&&(i.getInputRoutes().size||i.getOutputRoutes().size))t.push(i);else{if(0===i.getReferences().size){if(!i.isInitializable())continue;if(this.isDefaultValue(i))continue}t.push(i)}return t},isDefaultValue(e){if((this[ns].get(e.getName())??this[is].get(e.getName()))===e)var t=this[ts].get(e.getName());else if(this.constructor.fieldDefinitions)t=this.constructor.fieldDefinitions.get(e.getName());return t?t.value!==e&&t.value.equals(e):!e.getModificationTime()},hasRoutes(){for(const e of this[is])if(e.getInputRoutes().size||e.getOutputRoutes().size)return!0;for(const e of this[ns])if(e.getInputRoutes().size||e.getOutputRoutes().size)return!0;for(const e of this[Qn].getImportedNodes())if(e.hasRoutes(this))return!0;return!1},getExtendedEventHandling:()=>!0,addEvent(e){e.isTainted()||(e.setTainted(!0),this.addEventObject(e,L.create(e)))},addEventObject(e,t){const i=this[Zn];i.addTaintedField(e,t),i.addBrowserEvent(),this.isTainted()||(e.isInput()||this.getExtendedEventHandling()&&e.isInitializable())&&this.addNodeEvent()},addNodeEvent(){if(this.isTainted())return;const e=this[Zn];this.setTainted(!0),e.addTaintedNode(this),e.addBrowserEvent()},parentsChanged(){const e=this[Zn].getCurrentTime();this[Qn]._sceneGraph_changed=e,this._parents_changed=e},dispose(){this.setLive(!1);for(const e of this[ss])e.dispose();for(const e of this[is])e.dispose();for(const e of this[ns])e.dispose();R.prototype.dispose.call(this)}});const us=(()=>{const e=/^set_(.*?)$/,t=/^(.*?)_changed$/;return function(i,n){const s=i.get(n);if(s)return s;const r=n.match(e);if(r){const e=i.get(r[1]);if(e?.getAccessType()===d.inputOutput)return e}else{const e=n.match(t);if(e){const t=i.get(e[1]);if(t?.getAccessType()===d.inputOutput)return t}}}})();for(const e of Object.keys(ls.prototype))Object.defineProperty(ls.prototype,e,{enumerable:!1});Object.defineProperties(ls.prototype,{name_changed:{get(){return this._name_changed},enumerable:!1},typeName_changed:{get(){return this._typeName_changed},enumerable:!1},parents_changed:{get(){return this._parents_changed},enumerable:!1}});const hs=ls;i.add("X3DBaseNode","x_ite/Base/X3DBaseNode",hs);const ds=hs;var cs=n(464);const ps={elements(e,t){e.length&&(console.warn("Use of <X3DCanvas> element is depreciated, please use <x3d-canvas> element instead. See https://create3000.github.io/x_ite/#embedding-x_ite-within-a-web-page."),cs.map(e,(e=>new t(e))))},browser(e){const t=e.getElement();"X3DCANVAS"===t.prop("nodeName").toUpperCase()&&(t.attr("src")?e.attributeChangedCallback("src",void 0,t.attr("src")):t.attr("url")&&e.attributeChangedCallback("url",void 0,t.attr("url")),t.attr("tabindex",t.attr("tabindex")??0))},error(e,t){console.error(t),e.children(".x_ite-private-browser").hide(),e.children(":not(.x_ite-private-browser)").show()}},gs=ps;i.add("Legacy","x_ite/Browser/Legacy",gs);const fs=gs,ms="8.12.0";i.add("VERSION","x_ite/Browser/VERSION",ms);const _s=ms,xs=Symbol();function ys(e){ds.call(this,e),this.addType(d.X3DNode),this[xs]=!1}Object.assign(Object.setPrototypeOf(ys.prototype,ds.prototype),{getComponentName(){return this.constructor.componentName},getContainerField(){return this.constructor.containerField},getSpecificationRange(){return this.constructor.specificationRange},copy(e){if(!e||e.getType().includes(d.X3DExecutionContext))return ds.prototype.copy.call(this,e);{const t=e.getBody();if(this.getName().length){const e=t.getNamedNodes().get(this.getName());if(e)return e.getValue()}const i=this.create(t);this.getNeedsName()&&this.getExecutionContext().updateNamedNode(this.getExecutionContext().getUniqueName(),this),this.getName().length&&t.updateNamedNode(this.getName(),i);for(const t of this.getPredefinedFields())try{const n=i.getPredefinedField(t.getName());if(t.hasReferences())for(const i of t.getReferences())try{n.addReference(e.getField(i.getName()))}catch(e){console.error(e)}else if(t.getAccessType()&d.initializeOnly)switch(t.getType()){case d.SFNode:case d.MFNode:n.assign(t.copy(e));break;default:n.assign(t)}n.setModificationTime(t.getModificationTime())}catch(e){console.error(e)}for(const t of this.getUserDefinedFields()){const n=t.copy(e);if(i.addUserDefinedField(t.getAccessType(),t.getName(),n),t.hasReferences())for(const i of t.getReferences())try{n.addReference(e.getField(i.getName()))}catch(t){console.error(`No reference '${i.getName()}' inside execution context ${e.getTypeName()} '${e.getName()}'.`)}n.setModificationTime(t.getModificationTime())}return i.setup(),i}},getDisplayName(){return this.getName().replace(/_\d+$/,"")},getNeedsName(){if(this.getName().length)return!1;if(this.getCloneCount()>1)return!0;if(this.hasRoutes())return!0;const e=this.getExecutionContext();for(const t of e.getImportedNodes())if(t.getInlineNode()===this)return!0;if(e.isScene())for(const t of e.getExportedNodes())if(t.getLocalNode()===this)return!0;return!1},isPrivate(){return this[xs]},setPrivate(e){this[xs]=e},getCloneCount(){return ds.prototype.collectCloneCount.call(this)},collectCloneCount(){return this.isPrivate()?0:1},getSourceText:()=>null,traverse(){},toStream(e){e.string+=this.getTypeName()+" { }"},toVRMLStream(e){e.EnterScope();const t=e.Name(this);if(t.length&&e.ExistsNode(this))return e.string+="USE",e.string+=e.Space(),e.string+=t,void e.LeaveScope();t.length&&(e.AddNode(this),e.string+="DEF",e.string+=e.Space(),e.string+=t,e.string+=e.Space()),e.string+=this.getTypeName(),e.string+=e.TidySpace(),e.string+="{";const i=this.getChangedFields(),n=this.getUserDefinedFields();if(this.canUserDefinedFields()&&n.length){let t=0,s=0;for(const i of n)t=Math.max(t,i.getTypeName().length),s=Math.max(s,e.AccessType(i.getAccessType()).length);const r=n.at(-1);e.string+=e.TidyBreak(),e.IncIndent();for(const i of n)this.toVRMLStreamUserDefinedField(e,i,t,s),e.string+=i===r?e.TidyBreak():e.Break();e.DecIndent(),0!==i.length&&(e.string+=e.TidyBreak())}if(0===i.length)n.length?e.string+=e.Indent():e.string+=e.TidySpace();else{const t=i.at(-1);0===n.length&&(e.string+=e.TidyBreak()),e.IncIndent();for(const n of i)this.toVRMLStreamField(e,n),e.string+=n===t?e.TidyBreak():e.Break();e.DecIndent(),e.string+=e.Indent()}e.string+="}",e.LeaveScope()},toVRMLStreamUserDefinedField(e,t,i,n){const s=e.IsSharedNode(this);if(0===t.getReferences().size||!e.ExecutionContext()||s)e.string+=e.Indent(),e.string+=e.AccessType(t.getAccessType()).padEnd(n," "),e.string+=e.Space(),e.string+=t.getTypeName().padEnd(i," "),e.string+=e.Space(),e.string+=t.getName(),t.isInitializable()&&(e.string+=e.Space(),t.toVRMLStream(e));else{let s=0,r=!1;for(const o of t.getReferences())r=r||o.isInitializable(),e.string+=e.Indent(),e.string+=e.AccessType(t.getAccessType()).padEnd(n," "),e.string+=e.Space(),e.string+=t.getTypeName().padEnd(i," "),e.string+=e.Space(),e.string+=t.getName(),e.string+=e.Space(),e.string+="IS",e.string+=e.Space(),e.string+=o.getName(),++s,s!==t.getReferences().size&&(e.string+=e.Break());t.getAccessType()!==d.inputOutput||r||t.isDefaultValue()||(e.string+=e.Break(),e.string+=e.Indent(),e.string+=e.AccessType(t.getAccessType()).padEnd(n," "),e.string+=e.Space(),e.string+=t.getTypeName().padEnd(i," "),e.string+=e.Space(),e.string+=t.getName(),t.isInitializable()&&(e.string+=e.Space(),t.toVRMLStream(e)))}},toVRMLStreamField(e,t){const i=e.IsSharedNode(this);if(0===t.getReferences().size||!e.ExecutionContext()||i)t.isInitializable()&&(e.string+=e.Indent(),e.string+=t.getName(),e.string+=e.Space(),t.toVRMLStream(e));else{let i=0,n=!1;for(const s of t.getReferences())n=n||s.isInitializable(),e.string+=e.Indent(),e.string+=t.getName(),e.string+=e.Space(),e.string+="IS",e.string+=e.Space(),e.string+=s.getName(),++i,i!==t.getReferences().size&&(e.string+=e.Break());t.getAccessType()!==d.inputOutput||n||this.isDefaultValue(t)||(e.string+=e.Break(),e.string+=e.Indent(),e.string+=t.getName(),e.string+=e.Space(),t.toVRMLStream(e))}},toXMLStream(e){const t=e.IsSharedNode(this);e.EnterScope();const i=e.Name(this);if(i.length&&e.ExistsNode(this)){e.string+=e.Indent(),e.string+="<",e.string+=this.getTypeName(),e.html&&"Script"===this.getTypeName()&&(e.string+=e.Space(),e.string+="type='model/x3d+xml'"),e.string+=e.Space(),e.string+="USE='",e.string+=e.XMLEncode(i),e.string+="'";const t=e.ContainerField();return t&&t.getName()!==this.getContainerField()&&(e.string+=e.Space(),e.string+="containerField='",e.string+=e.XMLEncode(t.getName()),e.string+="'"),e.closingTags?(e.string+="></",e.string+=this.getTypeName(),e.string+=">"):e.string+="/>",void e.LeaveScope()}e.string+=e.Indent(),e.string+="<",e.string+=this.getTypeName(),e.html&&"Script"===this.getTypeName()&&(e.string+=e.Space(),e.string+="type='model/x3d+xml'"),i.length&&(e.AddNode(this),e.string+=e.Space(),e.string+="DEF='",e.string+=e.XMLEncode(i),e.string+="'");const n=e.ContainerField();n&&n.getName()!==this.getContainerField()&&(e.string+=e.Space(),e.string+="containerField='",e.string+=e.XMLEncode(n.getName()),e.string+="'");const s=this.getChangedFields(),r=this.getUserDefinedFields(),o=[],a=[];let l=this.getSourceText();(0===l?.length||e.html&&"Script"!==this.getTypeName())&&(l=null),e.IncIndent(),e.IncIndent();for(const i of s){let n=!1;if(e.ExecutionContext()&&i.getAccessType()===d.inputOutput&&0!==i.getReferences().size&&([...i.getReferences()].some((e=>e.isInitializable()))||(n=!this.isDefaultValue(i))),0===i.getReferences().size||!e.ExecutionContext()||t||n){if(n&&o.push(i),i.isInitializable())switch(i.getType()){case d.SFNode:case d.MFNode:a.push(i);break;default:if(i===l)break;e.string+=e.AttribBreak(),e.string+=e.ListIndent(),e.string+=i.getName(),e.string+="='",i.toXMLStream(e,i===this.getSourceText()),e.string+="'"}}else o.push(i)}if(e.DecIndent(),e.DecIndent(),this.canUserDefinedFields()&&r.length||o.length&&!t||a.length||l){if(e.string+=">",e.string+=e.TidyBreak(),e.IncIndent(),this.canUserDefinedFields())for(const i of r){e.string+=e.Indent(),e.string+="<field",e.string+=e.Space(),e.string+="accessType='",e.string+=e.AccessType(i.getAccessType()),e.string+="'",e.string+=e.Space(),e.string+="type='",e.string+=i.getTypeName(),e.string+="'",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(i.getName()),e.string+="'";let n=!1;if(e.ExecutionContext()&&i.getAccessType()===d.inputOutput&&0!==i.getReferences().size&&([...i.getReferences()].some((e=>e.isInitializable()))||(n=!0)),0===i.getReferences().size||!e.ExecutionContext()||t||n)if(n&&e.ExecutionContext()&&o.push(i),!i.isInitializable()||i.isDefaultValue())e.string+=e.closingTags?"></field>":"/>",e.string+=e.TidyBreak();else switch(i.getType()){case d.SFNode:case d.MFNode:e.PushContainerField(null),e.string+=">",e.string+=e.TidyBreak(),e.IncIndent(),i.toXMLStream(e),e.string+=e.TidyBreak(),e.DecIndent(),e.string+=e.Indent(),e.string+="</field>",e.string+=e.TidyBreak(),e.PopContainerField();break;default:e.string+=e.Space(),e.string+="value='",i.toXMLStream(e),e.string+="'",e.string+=e.closingTags?"></field>":"/>",e.string+=e.TidyBreak()}else e.ExecutionContext()&&o.push(i),e.string+=e.closingTags?"></field>":"/>",e.string+=e.TidyBreak()}if(o.length&&!t){e.string+=e.Indent(),e.string+="<IS>",e.string+=e.TidyBreak(),e.IncIndent();for(const t of o){const i=t.getReferences();for(const n of i)e.string+=e.Indent(),e.string+="<connect",e.string+=e.Space(),e.string+="nodeField='",e.string+=e.XMLEncode(t.getName()),e.string+="'",e.string+=e.Space(),e.string+="protoField='",e.string+=e.XMLEncode(n.getName()),e.string+="'",e.string+=e.closingTags?"></connect>":"/>",e.string+=e.TidyBreak()}e.DecIndent(),e.string+=e.Indent(),e.string+="</IS>",e.string+=e.TidyBreak()}for(const t of a)e.PushContainerField(t),t.toXMLStream(e),e.string+=e.TidyBreak(),e.PopContainerField();if(l)for(const t of l)e.string+="<![CDATA[",e.string+=t,e.string+="]]>",e.string+=e.TidyBreak();e.DecIndent(),e.string+=e.Indent(),e.string+="</",e.string+=this.getTypeName(),e.string+=">"}else e.closingTags?(e.string+="></",e.string+=this.getTypeName(),e.string+=">"):e.string+="/>";e.LeaveScope()},toJSONStream(e){const t=e.IsSharedNode(this);e.EnterScope();const i=e.Name(this);if(i.length&&e.ExistsNode(this))return e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+=this.getTypeName(),e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@USE",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",void e.LeaveScope();e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+=this.getTypeName(),e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),i.length&&(e.AddNode(this),e.string+=e.Indent(),e.string+='"',e.string+="@DEF",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i),e.string+='"',e.string+=",",e.string+=e.TidyBreak());const n=this.getChangedFields(),s=this.getUserDefinedFields(),r=[];let o=this.getSourceText();if(o&&1!==o.length&&(o=null),n.length){const i=[];for(const s of n){let n=!1;e.ExecutionContext()&&s.getAccessType()===d.inputOutput&&0!==s.getReferences().size&&([...s.getReferences()].some((e=>e.isInitializable()))||(n=!this.isDefaultValue(s))),0===s.getReferences().size||!e.ExecutionContext()||t||n?(n&&r.push(s),s!==o&&i.push(s)):r.push(s)}for(const t of i)if(t.isInitializable()){switch(t.getType()){case d.SFNode:case d.MFNode:e.string+=e.Indent(),e.string+='"',e.string+="-",e.string+=t.getName(),e.string+='"',e.string+=":",e.string+=e.TidySpace(),t.toJSONStream(e);break;default:e.string+=e.Indent(),e.string+='"',e.string+="@",e.string+=t.getName(),e.string+='"',e.string+=":",e.string+=e.TidySpace(),t.toJSONStream(e)}e.string+=",",e.string+=e.TidyBreak()}}if(this.canUserDefinedFields()&&s.length){e.string+=e.Indent(),e.string+='"',e.string+="field",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();for(const i of s){e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@accessType",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.AccessType(i.getAccessType()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@type",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=i.getTypeName(),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i.getName()),e.string+='"';let n=!1;if(e.ExecutionContext()&&i.getAccessType()===d.inputOutput&&0!==i.getReferences().size&&([...i.getReferences()].some((e=>e.isInitializable()))||(n=!0)),0===i.getReferences().size||!e.ExecutionContext()||t||n)if(n&&e.ExecutionContext()&&r.push(i),!i.isInitializable()||i.isDefaultValue());else switch(e.string+=",",e.string+=e.TidyBreak(),i.getType()){case d.SFNode:e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),i.toJSONStream(e),e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]";break;case d.MFNode:e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),i.toJSONStream(e);break;default:e.string+=e.Indent(),e.string+='"',e.string+="@value",e.string+='"',e.string+=":",e.string+=e.TidySpace(),i.toJSONStream(e)}else e.ExecutionContext()&&r.push(i);e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",i!==s.at(-1)&&(e.string+=","),e.string+=e.TidyBreak()}e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=",",e.string+=e.TidyBreak()}else;if(o){e.string+=e.Indent(),e.string+='"',e.string+="#sourceText",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();const t=o[0].split("\n");for(let i=0,n=t.length;i<n;++i)e.string+=e.ListIndent(),e.string+='"',e.string+=e.JSONEncode(t[i]),e.string+='"',i!==n-1&&(e.string+=","),e.string+=e.TidyBreak();e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=",",e.string+=e.TidyBreak()}if(r.length&&!t){e.string+=e.Indent(),e.string+='"',e.string+="IS",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="connect",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();for(const t of r){const i=[...t.getReferences()];for(const n of i)e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@nodeField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t.getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@protoField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(n.getName()),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",t===r.at(-1)&&n===i.at(-1)||(e.string+=","),e.string+=e.TidyBreak()}e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak()}e.JSONRemoveComma(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.LeaveScope()},dispose(){const e=this.getExecutionContext();if(this.getName()&&e.removeNamedNode(this.getName()),e.isScene()){if(!e.isMainScene()){const t=e.getExecutionContext();for(const e of[...t.getImportedNodes()])try{e.getExportedNode()===this&&t.removeImportedNode(e.getImportedName())}catch(e){}}for(const t of[...e.getExportedNodes()])t.getLocalNode()===this&&e.removeExportedNode(t.getExportedName())}for(const e of new Set(this.getParents()))if(e instanceof Yn.SFNode)for(const t of new Set(e.getParents()))t instanceof Yn.MFNode&&t.assign(t.filter((e=>e?.getValue()!==this)));for(const e of new Set(this.getParents()))e instanceof Yn.SFNode&&e.setValue(null);ds.prototype.dispose.call(this)}});for(const e of Object.keys(ys.prototype))Object.defineProperty(ys.prototype,e,{enumerable:!1});Object.defineProperties(ys,{typeName:{value:"X3DNode",enumerable:!0},componentName:{value:"Core",enumerable:!0}});const ws=ys;i.add("X3DNode","x_ite/Components/Core/X3DNode",ws);const bs=ws;function Ss(e){this.addType(d.X3DMetadataObject)}Object.assign(Ss.prototype,{initialize(){},dispose(){}}),Object.defineProperties(Ss,{typeName:{value:"X3DMetadataObject",enumerable:!0},componentName:{value:"Core",enumerable:!0}});const Ts=Ss;i.add("X3DMetadataObject","x_ite/Components/Core/X3DMetadataObject",Ts);const vs=Ts;function Os(e){bs.call(this,e),vs.call(this,e),this.addType(d.MetadataBoolean)}Object.assign(Object.setPrototypeOf(Os.prototype,bs.prototype),vs.prototype,{initialize(){bs.prototype.initialize.call(this),vs.prototype.initialize.call(this)},getContainerField(e=!1){return e&&this.getExecutionContext().getSpecificationVersion()<=3.3?"metadata":bs.prototype.getContainerField.call(this)},dispose(){vs.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Os,{typeName:{value:"MetadataBoolean",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"value",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"name",new Yn.SFString),new X(d.inputOutput,"reference",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFBool)]),enumerable:!0}});const Es=Os;i.add("MetadataBoolean","x_ite/Components/Core/MetadataBoolean",Es);const Ns=Es;function Cs(e){bs.call(this,e),vs.call(this,e),this.addType(d.MetadataDouble)}Object.assign(Object.setPrototypeOf(Cs.prototype,bs.prototype),vs.prototype,{initialize(){bs.prototype.initialize.call(this),vs.prototype.initialize.call(this)},getContainerField(e=!1){return e&&this.getExecutionContext().getSpecificationVersion()<=3.3?"metadata":bs.prototype.getContainerField.call(this)},dispose(){vs.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Cs,{typeName:{value:"MetadataDouble",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"value",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"name",new Yn.SFString),new X(d.inputOutput,"reference",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFDouble)]),enumerable:!0}});const Fs=Cs;i.add("MetadataDouble","x_ite/Components/Core/MetadataDouble",Fs);const Is=Fs;function Ms(e){bs.call(this,e),vs.call(this,e),this.addType(d.MetadataFloat)}Object.assign(Object.setPrototypeOf(Ms.prototype,bs.prototype),vs.prototype,{initialize(){bs.prototype.initialize.call(this),vs.prototype.initialize.call(this)},getContainerField(e=!1){return e&&this.getExecutionContext().getSpecificationVersion()<=3.3?"metadata":bs.prototype.getContainerField.call(this)},dispose(){vs.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Ms,{typeName:{value:"MetadataFloat",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"value",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"name",new Yn.SFString),new X(d.inputOutput,"reference",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFFloat)]),enumerable:!0}});const Ds=Ms;i.add("MetadataFloat","x_ite/Components/Core/MetadataFloat",Ds);const Ps=Ds;function Rs(e){bs.call(this,e),vs.call(this,e),this.addType(d.MetadataInteger)}Object.assign(Object.setPrototypeOf(Rs.prototype,bs.prototype),vs.prototype,{initialize(){bs.prototype.initialize.call(this),vs.prototype.initialize.call(this)},getContainerField(e=!1){return e&&this.getExecutionContext().getSpecificationVersion()<=3.3?"metadata":bs.prototype.getContainerField.call(this)},dispose(){vs.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Rs,{typeName:{value:"MetadataInteger",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"value",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"name",new Yn.SFString),new X(d.inputOutput,"reference",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFInt32)]),enumerable:!0}});const As=Rs;i.add("MetadataInteger","x_ite/Components/Core/MetadataInteger",As);const Vs=As;function Ls(e){bs.call(this,e),vs.call(this,e),this.addType(d.MetadataSet)}Object.assign(Object.setPrototypeOf(Ls.prototype,bs.prototype),vs.prototype,{initialize(){bs.prototype.initialize.call(this),vs.prototype.initialize.call(this)},getContainerField(e=!1){return e&&this.getExecutionContext().getSpecificationVersion()<=3.3?"metadata":bs.prototype.getContainerField.call(this)},dispose(){vs.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Ls,{typeName:{value:"MetadataSet",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"value",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"name",new Yn.SFString),new X(d.inputOutput,"reference",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFNode)]),enumerable:!0}});const Bs=Ls;i.add("MetadataSet","x_ite/Components/Core/MetadataSet",Bs);const Us=Bs;function Xs(e){bs.call(this,e),vs.call(this,e),this.addType(d.MetadataString)}Object.assign(Object.setPrototypeOf(Xs.prototype,bs.prototype),vs.prototype,{initialize(){bs.prototype.initialize.call(this),vs.prototype.initialize.call(this)},getContainerField(e=!1){return e&&this.getExecutionContext().getSpecificationVersion()<=3.3?"metadata":bs.prototype.getContainerField.call(this)},dispose(){vs.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Xs,{typeName:{value:"MetadataString",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"value",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"name",new Yn.SFString),new X(d.inputOutput,"reference",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFString)]),enumerable:!0}});const ks=Xs;i.add("MetadataString","x_ite/Components/Core/MetadataString",ks);const js=ks;function zs(e){this.getExecutionContext()||(bs.call(this,e),this.addType(d.X3DChildNode),this.addChildObjects(d.outputOnly,"isCameraObject",new Yn.SFBool,d.outputOnly,"isPickableObject",new Yn.SFBool))}Object.assign(Object.setPrototypeOf(zs.prototype,bs.prototype),{setCameraObject(e){e!==this._isCameraObject.getValue()&&(this._isCameraObject=e)},isCameraObject(){return this._isCameraObject.getValue()},setPickableObject(e){e!==this._isPickableObject.getValue()&&(this._isPickableObject=e)},isPickableObject(){return this._isPickableObject.getValue()},getMustDisplay:()=>!1}),Object.defineProperties(zs,{typeName:{value:"X3DChildNode",enumerable:!0},componentName:{value:"Core",enumerable:!0}});const Gs=zs;i.add("X3DChildNode","x_ite/Components/Core/X3DChildNode",Gs);const Hs=Gs;function qs(e){Hs.call(this,e),this.addType(d.X3DInfoNode)}Object.setPrototypeOf(qs.prototype,Hs.prototype),Object.defineProperties(qs,{typeName:{value:"X3DInfoNode",enumerable:!0},componentName:{value:"Core",enumerable:!0}});const Ys=qs;i.add("X3DInfoNode","x_ite/Components/Core/X3DInfoNode",Ys);const Ws=Ys;function $s(e){Ws.call(this,e),this.addType(d.WorldInfo)}Object.assign(Object.setPrototypeOf($s.prototype,Ws.prototype),{initialize(){Ws.prototype.initialize.call(this),this.getExecutionContext().addWorldInfo(this)},dispose(){this.getExecutionContext().removeWorldInfo(this),Ws.prototype.dispose.call(this)}}),Object.defineProperties($s,{typeName:{value:"WorldInfo",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"title",new Yn.SFString),new X(d.initializeOnly,"info",new Yn.MFString)]),enumerable:!0}});const Js=$s;i.add("WorldInfo","x_ite/Components/Core/WorldInfo",Js);const Ks=Js;let Zs=0;function Qs(e){Hs.call(this,e),this.addType(d.X3DBindableNode),this.modificationCount=0}Object.assign(Object.setPrototypeOf(Qs.prototype,Hs.prototype),{initialize(){Hs.prototype.initialize.call(this),this._set_bind.addInterest("set_bind__",this)},isCameraObject:()=>!0,getModificationCount(){return this.modificationCount},transitionStart(){},set_bind__(){this.modificationCount=++Zs}}),Object.defineProperties(Qs,{typeName:{value:"X3DBindableNode",enumerable:!0},componentName:{value:"Core",enumerable:!0},getModificationCount:{value:function(){return Zs},enumerable:!1}});const er=Qs;i.add("X3DBindableNode","x_ite/Components/Core/X3DBindableNode",er);const tr=er,ir=function(e,t="",i=!1){t=String(t).replace(/_\d+$/,"");let n=i?`${t}_1`:t,s=1,r=1;for(;e.has(n)||0===n.length;)s=r,r<<=1,n=`${t}_${s}`;if(s>>>=1,r>>>=1,s&&r){for(;s<r;){const i=s+r>>>1;e.has(`${t}_${i}`)?s=i+1:r=i}n=`${t}_${s}`}return n};function nr(e=[]){return Y.call(this,Array.from(e,(e=>[e.getNodeName(),e])),Oi)}Object.setPrototypeOf(nr.prototype,Y.prototype);for(const e of Object.keys(nr.prototype))Object.defineProperty(nr.prototype,e,{enumerable:!1});Object.defineProperties(nr,{typeName:{value:"NamedNodesArray",enumerable:!0}});const sr=nr;i.add("NamedNodesArray","x_ite/Execution/NamedNodesArray",sr);const rr=sr,or=Symbol(),ar=Symbol(),lr=Symbol(),ur=Symbol();function hr(e,t,i,n){bs.call(this,e),this[or]=t,this[ar]=i,this[lr]=n,this[ur]=new Set,this[or]._loadState.addInterest("set_loadState__",this)}Object.assign(Object.setPrototypeOf(hr.prototype,bs.prototype),{getInlineNode(){return this[or]},getExportedName(){return this[ar]},getExportedNode(){return this[or].getInternalScene().getExportedNode(this[ar]).getValue()},getImportedName(){return this[lr]},hasRoutes(e){for(const t of this[ur]){if(t.sourceNode===e)return!0;if(t.destinationNode===e)return!0}return!1},addRoute(e,t,i,n){const s={sourceNode:e,sourceField:t,destinationNode:i,destinationField:n};this[ur].add(s),this[or].checkLoadState()===d.COMPLETE_STATE&&this.resolveRoute(s)},resolveRoute(e){try{const t=e.sourceField,i=e.destinationField;let n=e.sourceNode,s=e.destinationNode;e.real&&e.real.dispose(),n instanceof hr&&(n=n.getExportedNode()),s instanceof hr&&(s=s.getExportedNode()),e.real=this.getExecutionContext().addSimpleRoute(n,t,s,i)}catch(e){console.error(e.message)}},deleteRoute(e){for(const t of this[ur])t.real===e&&this[ur].delete(t)},deleteRoutes(){for(const e of this[ur]){const t=e.real;t&&(delete e.real,this.getExecutionContext().deleteSimpleRoute(t))}},set_loadState__(){switch(this[or].checkLoadState()){case d.NOT_STARTED_STATE:case d.FAILED_STATE:this.deleteRoutes();break;case d.COMPLETE_STATE:this.deleteRoutes();for(const e of this[ur])this.resolveRoute(e)}},toStream(e){C.prototype.toStream.call(this,e)},toVRMLStream(e){if(!e.ExistsNode(this.getInlineNode()))throw new Error("X3DImportedNode.toXMLStream: Inline node does not exist.");e.string+=e.Indent(),e.string+="IMPORT",e.string+=e.Space(),e.string+=e.Name(this.getInlineNode()),e.string+=".",e.string+=this.getExportedName(),this.getImportedName()!==this.getExportedName()&&(e.string+=e.Space(),e.string+="AS",e.string+=e.Space(),e.string+=this.getImportedName());try{e.AddRouteNode(this),e.AddImportedNode(this.getExportedNode(),this.getImportedName())}catch{for(const t of this[ur]){const i=t.sourceNode,n=t.sourceField,s=t.destinationNode,r=t.destinationField;if(e.ExistsRouteNode(i)&&e.ExistsRouteNode(s)){const t=i instanceof hr?i.getImportedName():e.Name(i),o=s instanceof hr?s.getImportedName():e.Name(s);e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+="ROUTE",e.string+=e.Space(),e.string+=t,e.string+=".",e.string+=n,e.string+=e.Space(),e.string+="TO",e.string+=e.Space(),e.string+=o,e.string+=".",e.string+=r}}}},toXMLStream(e){if(!e.ExistsNode(this.getInlineNode()))throw new Error("X3DImportedNode.toXMLStream: Inline node does not exist.");e.string+=e.Indent(),e.string+="<IMPORT",e.string+=e.Space(),e.string+="inlineDEF='",e.string+=e.XMLEncode(e.Name(this.getInlineNode())),e.string+="'",e.string+=e.Space(),e.string+="importedDEF='",e.string+=e.XMLEncode(this.getExportedName()),e.string+="'",this.getImportedName()!==this.getExportedName()&&(e.string+=e.Space(),e.string+="AS='",e.string+=e.XMLEncode(this.getImportedName()),e.string+="'"),e.string+=e.closingTags?"></IMPORT>":"/>";try{e.AddRouteNode(this),e.AddImportedNode(this.getExportedNode(),this.getImportedName())}catch{for(const t of this[ur]){const i=t.sourceNode,n=t.sourceField,s=t.destinationNode,r=t.destinationField;if(e.ExistsRouteNode(i)&&e.ExistsRouteNode(s)){const t=i instanceof hr?i.getImportedName():e.Name(i),o=s instanceof hr?s.getImportedName():e.Name(s);e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+="<ROUTE",e.string+=e.Space(),e.string+="fromNode='",e.string+=e.XMLEncode(t),e.string+="'",e.string+=e.Space(),e.string+="fromField='",e.string+=e.XMLEncode(n),e.string+="'",e.string+=e.Space(),e.string+="toNode='",e.string+=e.XMLEncode(o),e.string+="'",e.string+=e.Space(),e.string+="toField='",e.string+=e.XMLEncode(r),e.string+="'",e.string+=e.closingTags?"></ROUTE>":"/>"}}}},toJSONStream(e){if(!e.ExistsNode(this.getInlineNode()))throw new Error("X3DImportedNode.toJSONStream: Inline node does not exist.");e.string+=e.Indent(),e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="IMPORT",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@inlineDEF",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(e.Name(this.getInlineNode())),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@importedDEF",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this.getExportedName()),e.string+='"',this.getImportedName()!==this.getExportedName()?(e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@AS",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this.getImportedName()),e.string+='"',e.string+=e.TidyBreak()):e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}";try{e.AddRouteNode(this),e.AddImportedNode(this.getExportedNode(),this.getImportedName())}catch{for(const t of this[ur]){const i=t.sourceNode,n=t.sourceField,s=t.destinationNode,r=t.destinationField;if(e.ExistsRouteNode(i)&&e.ExistsRouteNode(s)){const t=i instanceof hr?i.getImportedName():e.Name(i),o=s instanceof hr?s.getImportedName():e.Name(s);e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="ROUTE",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@fromNode",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@fromField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(n),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@toNode",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(o),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@toField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(r),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}}}},dispose(){this[or]._loadState.removeInterest("set_loadState__",this),this.deleteRoutes(),bs.prototype.dispose.call(this)}});for(const e of Object.keys(hr.prototype))Object.defineProperty(hr.prototype,e,{enumerable:!1});Object.defineProperties(hr.prototype,{inlineNode:{get(){return yi.get(this[or])},enumerable:!0},exportedName:{get(){return this[ar]},enumerable:!0},exportedNode:{get(){return this[or].getInternalScene().getExportedNode(this[ar])},enumerable:!0},importedName:{get(){return this[lr]},enumerable:!0}}),Object.defineProperties(hr,{typeName:{value:"X3DImportedNode",enumerable:!0}});const dr=hr;i.add("X3DImportedNode","x_ite/Execution/X3DImportedNode",dr);const cr=dr;function pr(e=[]){return Y.call(this,Array.from(e,(e=>[e.getImportedName(),e])),cr)}Object.setPrototypeOf(pr.prototype,Y.prototype);for(const e of Object.keys(pr.prototype))Object.defineProperty(pr.prototype,e,{enumerable:!1});Object.defineProperties(pr,{typeName:{value:"ImportedNodesArray",enumerable:!0}});const gr=pr;i.add("ImportedNodesArray","x_ite/Execution/ImportedNodesArray",gr);const fr=gr,mr=Symbol(),_r=Symbol(),xr=Symbol(),yr=Symbol();function wr(e){this.addType(d.X3DUrlObject),this.addChildObjects(d.outputOnly,"loadState",new Yn.SFInt32(d.NOT_STARTED_STATE),d.inputOutput,"loadData",new Yn.SFTime),this[mr]=!0,this[_r]=Date.now()}Object.assign(wr.prototype,{initialize(){this.getLive().addInterest("set_live__",this),this._load.addInterest("set_load__",this),this._url.addInterest("set_url__",this),this._loadData.addInterest("loadData",this),this._autoRefresh.addInterest("set_autoRefresh__",this),this._autoRefreshTimeLimit.addInterest("set_autoRefresh__",this)},setLoadState(e,t=!0){if(this._loadState=e,e===d.COMPLETE_STATE&&(this[xr]=Date.now(),this.setAutoRefreshTimer(this._autoRefresh.getValue())),t)switch(e){case d.NOT_STARTED_STATE:break;case d.IN_PROGRESS_STATE:this.getScene().addLoadingObject(this);break;case d.COMPLETE_STATE:case d.FAILED_STATE:this.getScene().removeLoadingObject(this)}},checkLoadState(){return this._loadState.getValue()},getLoadState(){return this._loadState},setCache(e){this[mr]=e},getCache(){return this[mr]&&this.getBrowser().getBrowserOption("Cache")},requestImmediateLoad(e=!0){return new Promise(((t,i)=>{const n=()=>{const e=Symbol();this._loadState.addFieldCallback(e,(()=>{switch(this.checkLoadState()){case d.COMPLETE_STATE:this._loadState.removeFieldCallback(e),t();break;case d.FAILED_STATE:this._loadState.removeFieldCallback(e),i()}}))};switch(this.checkLoadState()){case d.IN_PROGRESS_STATE:return void n();case d.COMPLETE_STATE:return void t();case d.FAILED_STATE:return void i()}const s=this.getBrowser();s.getBrowserOption("LoadUrlObjects")||this.getExecutionContext()===s.getPrivateScene()||this.isExternProto?this._load.getValue()?0!==this._url.length?(this.setCache(e),this.setLoadState(d.IN_PROGRESS_STATE),this.isInitialized()?this._loadData=this.getBrowser().getCurrentTime():this.loadData(),n()):t():i():t()}))},loadNow(){return this.setLoadState(d.NOT_STARTED_STATE),this.requestImmediateLoad()},loadData(){},requestUnload(){const e=this.checkLoadState();e!==d.NOT_STARTED_STATE&&e!==d.FAILED_STATE&&(this.setLoadState(d.NOT_STARTED_STATE),this.unloadData())},unloadNow(){this.requestUnload()},unloadData(){},setAutoRefreshTimer(e){if(clearTimeout(this[yr]),this._autoRefresh.getValue()<=0)return;const t=this._autoRefreshTimeLimit.getValue();0!==t&&(Date.now()-this[_r])/1e3>t-e||(this[yr]=setTimeout(this.performAutoRefresh.bind(this),1e3*e))},performAutoRefresh(){this.setLoadState(d.NOT_STARTED_STATE),this.requestImmediateLoad(!1).catch(Function.prototype)},set_live__(){this.getLive().getValue()?this.set_autoRefresh__():clearTimeout(this[yr])},set_load__(){this._load.getValue()?this.requestImmediateLoad().catch(Function.prototype):this.requestUnload()},set_url__(){this._load.getValue()&&(this.setLoadState(d.NOT_STARTED_STATE),this.requestImmediateLoad().catch(Function.prototype))},set_autoRefresh__(){if(this.checkLoadState()!==d.COMPLETE_STATE)return;const e=(Date.now()-this[xr])/1e3,t=this._autoRefresh.getValue();let i=t-e;i<0&&(i=Math.ceil(e/t)*t-e),this.setAutoRefreshTimer(i)},dispose(){}}),Object.defineProperties(wr,{typeName:{value:"X3DUrlObject",enumerable:!0},componentName:{value:"Networking",enumerable:!0}});const br=wr;i.add("X3DUrlObject","x_ite/Components/Networking/X3DUrlObject",br);const Sr=br;function Tr(e){ds.call(this,e),this.addType(d.X3DProtoDeclarationNode),this.addChildObjects(d.outputOnly,"updateInstances",new Yn.SFTime)}Object.assign(Object.setPrototypeOf(Tr.prototype,ds.prototype),{canUserDefinedFields:()=>!0,createInstance(e,t=!0){if(!1===t)return new Yh(e,this);{const t=new Yh(e,this);return t.setup(),yi.get(t)}},newInstance(){return this.createInstance(this.getExecutionContext())},requestUpdateInstances(){this._updateInstances=this.getBrowser().getCurrentTime()},updateInstances(){this._updateInstances.processEvent()}});for(const e of Object.keys(Tr.prototype))Object.defineProperty(Tr.prototype,e,{enumerable:!1});Object.defineProperties(Tr,{typeName:{value:"X3DProtoDeclarationNode",enumerable:!0}}),d.addNode(Tr);const vr=Tr;i.add("X3DProtoDeclarationNode","x_ite/Prototype/X3DProtoDeclarationNode",vr);const Or=vr;var Er=n(464);function Nr(e){this.scene=e,this.executionContexts=[e],this.prototypes=[]}Object.assign(Nr.prototype,{getBrowser(){return this.scene.getBrowser()},getScene(){return this.scene},getExecutionContext(){return this.executionContexts.at(-1)},pushExecutionContext(e){return this.executionContexts.push(e)},popExecutionContext(){this.executionContexts.pop()},getPrototype(){return this.prototypes.at(-1)},pushPrototype(e){return this.prototypes.push(e)},popPrototype(){this.prototypes.pop()},isInsideProtoDefinition(){return!!this.prototypes.length},loadComponents(){const e=this.getBrowser(),t=this.getScene();return Promise.all([e.loadComponents(t.getProfile()||e.getProfile("Full")),e.loadComponents(t.getComponents())])},setUnits(e){e?delete this.fromUnit:this.fromUnit=function(e,t){return t}},fromUnit(e,t){return this.scene.fromUnit(e,t)},convertColor(e,t="white"){const i=Er("<div></div>").hide().css("color",t).appendTo(Er("body")),n=Er("<div></div>").css("color",e).appendTo(i),s=window.getComputedStyle(n[0]).color.replace(/^rgba?\(|\)$/g,"").split(/[\s,]+/).map((e=>parseFloat(e)));return i.remove(),s[0]/=255,s[1]/=255,s[2]/=255,"number"!=typeof s[3]&&(s[3]=1),s},sanitizeName:(e="")=>e=(e=(e=(e=e.replace(/^[\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*/,"")).replace(/[\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]+/g,"-")).trim().replace(/[\s_-]+/g,"-")).replace(/^-+|-+$/g,"")});const Cr=Nr;i.add("X3DParser","x_ite/Parser/X3DParser",Cr);const Fr=Cr;function Ir(e){return this.lastIndex=e.lastIndex,e.result=this.exec(e.input),!!e.result&&(e.lastIndex=this.lastIndex,!0)}function Mr(e){const t=e.lastIndex,i=this.parse(e);return e.lastIndex=t,i}const Dr=function(e){for(const t of Object.values(e))t.parse=Ir,t.lookahead=Mr;return e};i.add("Expressions","x_ite/Parser/Expressions",Dr);const Pr=Dr,Rr=Symbol();function Ar(e){Or.call(this,e),this.addType(d.X3DProtoDeclaration),this[Rr]=new Xh(e,this),this[Rr].setLive(!1),this.setLive(!1)}Object.assign(Object.setPrototypeOf(Ar.prototype,Or.prototype),{initialize(){Or.prototype.initialize.call(this),this[Rr].setup()},getProtoDeclaration(){return this},getBody(){return this[Rr]},canUserDefinedFields:()=>!0,toVRMLStream(e){e.string+=e.Indent(),e.string+="PROTO",e.string+=e.Space(),e.string+=this.getName(),e.string+=e.TidySpace(),e.string+="[",e.EnterScope();const t=this.getUserDefinedFields();if(0===t.length)e.string+=e.TidySpace();else{let i=0,n=0;for(const s of t)i=Math.max(i,s.getTypeName().length),n=Math.max(n,e.AccessType(s.getAccessType()).length);e.string+=e.TidyBreak(),e.IncIndent();for(const s of t)this.toVRMLStreamUserDefinedField(e,s,i,n),e.string+=e.Break();e.DecIndent(),e.string+=e.Indent()}e.LeaveScope(),e.string+="]",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.IncIndent(),this[Rr].toVRMLStream(e),e.DecIndent(),e.string+=e.Indent(),e.string+="}"},toVRMLStreamUserDefinedField(e,t,i,n){e.string+=e.Indent(),e.string+=e.AccessType(t.getAccessType()).padEnd(n," "),e.string+=e.Space(),e.string+=t.getTypeName().padEnd(i," "),e.string+=e.Space(),e.string+=t.getName(),t.isInitializable()&&(e.string+=e.Space(),t.toVRMLStream(e))},toXMLStream(e){e.string+=e.Indent(),e.string+="<ProtoDeclare",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(this.getName()),e.string+="'",e.string+=">",e.string+=e.TidyBreak(),e.EnterScope();const t=this.getUserDefinedFields();if(0!==t.length){e.IncIndent(),e.string+=e.Indent(),e.string+="<ProtoInterface>",e.string+=e.TidyBreak(),e.IncIndent();for(const i of t)if(e.string+=e.Indent(),e.string+="<field",e.string+=e.Space(),e.string+="accessType='",e.string+=e.AccessType(i.getAccessType()),e.string+="'",e.string+=e.Space(),e.string+="type='",e.string+=i.getTypeName(),e.string+="'",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(i.getName()),e.string+="'",i.isDefaultValue())e.string+=e.closingTags?"></field>":"/>",e.string+=e.TidyBreak();else switch(i.getType()){case d.SFNode:case d.MFNode:e.PushContainerField(i),e.string+=">",e.string+=e.TidyBreak(),e.IncIndent(),i.toXMLStream(e),e.string+=e.TidyBreak(),e.DecIndent(),e.string+=e.Indent(),e.string+="</field>",e.string+=e.TidyBreak(),e.PopContainerField();break;default:e.string+=e.Space(),e.string+="value='",i.toXMLStream(e),e.string+="'",e.string+=e.closingTags?"></field>":"/>",e.string+=e.TidyBreak()}e.DecIndent(),e.string+=e.Indent(),e.string+="</ProtoInterface>",e.string+=e.TidyBreak(),e.DecIndent()}e.LeaveScope(),e.IncIndent(),e.string+=e.Indent(),e.string+="<ProtoBody>",e.string+=e.TidyBreak(),e.IncIndent(),this[Rr].toXMLStream(e),e.DecIndent(),e.string+=e.Indent(),e.string+="</ProtoBody>",e.string+=e.TidyBreak(),e.DecIndent(),e.string+=e.Indent(),e.string+="</ProtoDeclare>"},toJSONStream(e){e.string+=e.Indent(),e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="ProtoDeclare",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+='"',e.string+=e.JSONEncode(this.getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="ProtoInterface",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.EnterScope();const t=this.getUserDefinedFields();if(t.length){e.string+=e.Indent(),e.string+='"',e.string+="field",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();for(const i of t){if(e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@accessType",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.AccessType(i.getAccessType()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@type",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=i.getTypeName(),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i.getName()),e.string+='"',i.isDefaultValue())e.string+=e.TidyBreak();else switch(e.string+=",",e.string+=e.TidyBreak(),i.getType()){case d.SFNode:e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),i.toJSONStream(e),e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=e.TidyBreak();break;case d.MFNode:e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),i.toJSONStream(e),e.string+=e.TidyBreak();break;default:e.string+=e.Indent(),e.string+='"',e.string+="@value",e.string+='"',e.string+=":",e.string+=e.TidySpace(),i.toJSONStream(e),e.string+=e.TidyBreak()}e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",i!==t.at(-1)&&(e.string+=","),e.string+=e.TidyBreak()}e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]"}e.string+=e.DecIndent(),e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+="}",e.string+=",",e.string+=e.TidyBreak(),e.LeaveScope(),e.string+=e.Indent(),e.string+='"',e.string+="ProtoBody",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),this[Rr].toJSONStream(e),e.JSONRemoveComma(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}});for(const e of Object.keys(Ar.prototype))Object.defineProperty(Ar.prototype,e,{enumerable:!1});Object.defineProperties(Ar.prototype,{name:{get:Ar.prototype.getName,enumerable:!0},fields:{get:Ar.prototype.getFieldDefinitions,enumerable:!0},isExternProto:{value:!1,enumerable:!0}}),Object.defineProperties(Ar,{typeName:{value:"X3DProtoDeclaration",enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode)]),enumerable:!0}}),d.addNode(Ar);const Vr=Ar;i.add("X3DProtoDeclaration","x_ite/Prototype/X3DProtoDeclaration",Vr);const Lr=Vr;var Br=n(464);const Ur=Pr({Whitespaces:/([\x20\n,\t\r]+)/gy,Comment:/#(.*?)(?=[\n\r])/gy,Break:/\r?\n/g,Header:/^#(VRML|X3D) V(.*?) (utf8)(?:[ \t]+(.*?))?[ \t]*[\n\r]/gy,AS:/AS/gy,COMPONENT:/COMPONENT/gy,DEF:/DEF/gy,EXPORT:/EXPORT/gy,EXTERNPROTO:/EXTERNPROTO/gy,FALSE:/FALSE|false/gy,IMPORT:/IMPORT/gy,IS:/IS/gy,META:/META/gy,NULL:/NULL/gy,TRUE:/TRUE|true/gy,PROFILE:/PROFILE/gy,PROTO:/PROTO/gy,ROUTE:/ROUTE/gy,TO:/TO/gy,UNIT:/UNIT/gy,USE:/USE/gy,OpenBrace:/\{/gy,CloseBrace:/\}/gy,OpenBracket:/\[/gy,CloseBracket:/\]/gy,Period:/\./gy,Colon:/\:/gy,Id:/([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*)/gy,ComponentNameId:/([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]*)/gy,initializeOnly:/initializeOnly/gy,inputOnly:/inputOnly/gy,outputOnly:/outputOnly/gy,inputOutput:/inputOutput/gy,field:/field/gy,eventIn:/eventIn/gy,eventOut:/eventOut/gy,exposedField:/exposedField/gy,FieldType:/([SM]F(?:Bool|ColorRGBA|Color|Double|Float|Image|Int32|Matrix3d|Matrix3f|Matrix4d|Matrix4f|Node|Rotation|String|Time|Vec2d|Vec2f|Vec3d|Vec3f|Vec4d|Vec4f))/gy,int32:/((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/gy,double:/([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/gy,string:/"((?:[^\\"]|\\\\|\\")*)"/gy,CONSTANTS:/([+-]?)\b(NAN|INFINITY|INF|PI|PI2|PI1_4|PI2_4|PI3_4|PI4_4|PI5_4|PI6_4|PI7_4|PI8_4|PI1_2|PI2_2|PI3_2|PI4_2|PI1_3|PI2_3|PI3_3|PI4_3|PI5_3|PI6_3|SQRT1_2|SQRT2)\b/giy,HTMLColor:/([a-zA-Z]+|0[xX][\da-fA-F]+|rgba?\(.*?\))/gy});function Xr(e){Fr.call(this,e)}Object.assign(Object.setPrototypeOf(Xr.prototype,Fr.prototype),{accessTypes:{field:d.initializeOnly,eventIn:d.inputOnly,eventOut:d.outputOnly,exposedField:d.inputOutput,initializeOnly:d.initializeOnly,inputOnly:d.inputOnly,outputOnly:d.outputOnly,inputOutput:d.inputOutput},SFImage:new Yn.SFImage,SFNode:new Yn.SFNode,MFString:new Yn.MFString,Color3:new Ce(0,0,0),Color4:new qe(0,0,0,0),Matrix3:new Pt,Matrix4:new ci,Rotation4:new ai,Vector2:new ft(0,0),Vector3:new bt(0,0,0),Vector4:new jt(0,0,0,0),CONSTANTS:{NAN:Number.NaN,INFINITY:Number.POSITIVE_INFINITY,INF:Number.POSITIVE_INFINITY,PI:Math.PI,PI2:2*Math.PI,PI1_4:1*Math.PI/4,PI2_4:2*Math.PI/4,PI3_4:3*Math.PI/4,PI4_4:4*Math.PI/4,PI5_4:5*Math.PI/4,PI6_4:6*Math.PI/4,PI7_4:7*Math.PI/4,PI8_4:8*Math.PI/4,PI1_2:1*Math.PI/2,PI2_2:2*Math.PI/2,PI3_2:3*Math.PI/2,PI4_2:4*Math.PI/2,PI1_3:1*Math.PI/3,PI2_3:2*Math.PI/3,PI3_3:3*Math.PI/3,PI4_3:4*Math.PI/3,PI5_3:5*Math.PI/3,PI6_3:6*Math.PI/3,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2},getEncoding:()=>"STRING",setInput(e){this.input=e,this.lineNumber=1,this.lastIndex=0},isValid(){return"string"==typeof this.input&&!!this.input.match(/^(?:#X3D|#VRML|(?:[\x20\n,\t\r]*|#.*?[\r\n])*(PROFILE|COMPONENT|META|UNIT|EXTERNPROTO|PROTO|DEF|NULL|IMPORT|EXPORT|ROUTE|\w+(?:[\x20\n,\t\r]*|#.*?[\r\n])\{|$))/)},parseIntoScene(e,t){try{this.resolve=e,this.reject=t,this.getScene().setEncoding("VRML"),this.getScene().setProfile(this.getBrowser().getProfile("Full")),this.x3dScene()}catch(e){throw new Error(this.getError(e))}},throwOrWarn(e){if(this.getBrowser().isStrict())throw new Error(e);console.warn(e)},getError(e){const t=e.message,i=this.lastIndex===this.input.length?"Unexpected end of file. ":"";let n=this.getLine(),s=this.getLastLine(),r=this.getLastLine(),o=s.length-n.length+1;s.length>80&&(s=s.substr(o-40,80),r="",o=40);return`\n********************************************************************************\nParser error at line ${this.lineNumber}:${o}\nin '${this.getExecutionContext().getWorldURL()}'\n\n${r}\n${s}\n${Array(o).join(" ")}^\n${i}${t}\n********************************************************************************\n`},getLine(){let e=this.input,t=this.lastIndex,i="";for(;t<e.length&&"\n"!==e[t]&&"\r"!==e[t];)i+=e[t++];return this.lastIndex=t,i},getLastLine(){let e=this.input,t=Math.min(this.lastIndex,this.input.length-1),i="";for(t<e.length&&("\n"!==e[t]||"\r"!==e[t])&&--t;t>=0&&"\n"!==e[t]&&"\r"!==e[t];)i=e[t--]+i;return this.lastIndex=t,i},comments(){for(;this.comment(););},comment(){return!!this.whitespaces()||Ur.Comment.parse(this)},whitespaces(){return!!Ur.Whitespaces.parse(this)&&(this.lines(this.result[1]),!0)},lines(e){const t=e.match(Ur.Break);t&&(this.lineNumber+=t.length)},x3dScene:(()=>{const e=["EnvironmentalSensor","PointingDeviceSensor","Scripting","Sound","Text"];return function(){const t=this.getBrowser(),i=this.getScene();if(this.headerStatement(),this.profileStatement(),this.componentStatements(),this.unitStatements(),this.metaStatements(),"2.0"===i.getSpecificationVersion()){i.setProfile(t.getProfile("Interchange"));for(const n of e)i.updateComponent(t.getComponent(n))}if(this.resolve)this.loadComponents().then((()=>{try{if(this.statements(this.getExecutionContext().rootNodes),this.lastIndex<this.input.length)throw new Error("Unknown statement.");this.resolve(i)}catch(e){console.error(e),this.reject(new Error(this.getError(e)))}})).catch(this.reject);else if(this.statements(this.getExecutionContext().rootNodes),this.lastIndex<this.input.length)throw new Error("Unknown statement.")}})(),headerStatement(){Ur.Header.lastIndex=0;const e=Ur.Header.exec(this.input);return!!e&&(this.getScene().setSpecificationVersion(e[2]),this.getScene().setEncoding("VRML"),!0)},profileStatement(){if(this.comments(),Ur.PROFILE.parse(this)){if(this.profileNameId()){const e=this.getBrowser().getProfile(this.result[1]);return void this.getScene().setProfile(e)}throw new Error("Expected a profile name.")}},componentStatements(){let e;for(;e=this.componentStatement();)this.getScene().updateComponent(e)},componentStatement(){if(this.comments(),Ur.COMPONENT.parse(this)){if(this.componentNameId()){const e=this.result[1];if(this.comments(),Ur.Colon.parse(this)){if(this.componentSupportLevel()){const t=this.value;return this.getBrowser().getComponent(e,t)}throw new Error("Expected a component support level.")}throw new Error("Expected a ':' after component name.")}throw new Error("Expected a component name.")}return null},componentSupportLevel(){return this.int32()},unitStatements(){for(;this.unitStatement(););},unitStatement(){if(this.comments(),Ur.UNIT.parse(this)){if(this.categoryNameId()){const e=this.result[1];if(this.unitNameId()){const t=this.result[1];if(this.unitConversionFactor()){const i=this.value;try{return this.getScene().updateUnit(e,t,i),!0}catch(e){return console.log(e.message),!0}}throw new Error("Expected unit conversion factor.")}throw new Error("Expected unit name identifier.")}throw new Error("Expected category name identifier after UNIT statement.")}return!1},unitConversionFactor(){return this.double()},metaStatements(){for(;this.metaStatement(););},metaStatement(){if(this.comments(),Ur.META.parse(this)){if(this.metaKey()){const e=this.value;if(this.metaValue()){const t=this.value;return this.getScene().addMetaData(e,t),!0}throw new Error("Expected metadata value.")}throw new Error("Expected metadata key.")}return!1},metaKey(){return this.string()},metaValue(){return this.string()},exportStatement(){if(this.comments(),Ur.EXPORT.parse(this)){if(this.nodeNameId()){const t=this.result[1];this.comments();const i=this.getScene().getLocalNode(t);if(Ur.AS.parse(this)){if(!this.exportedNodeNameId())throw new Error("No name given after AS.");var e=this.result[1]}else e=t;if(this.getScene()===this.getExecutionContext())return this.getScene().updateExportedNode(e,i),!0;throw new Error("Export statement not allowed here.")}throw new Error("No name given after EXPORT.")}return!1},importStatement(){if(this.comments(),Ur.IMPORT.parse(this)){if(this.nodeNameId()){const t=this.result[1],i=this.getExecutionContext().getNamedNode(t);if(this.comments(),Ur.Period.parse(this)){if(this.exportedNodeNameId()){const t=this.result[1];if(this.comments(),Ur.AS.parse(this)){if(!this.nodeNameId())throw new Error("No name given after AS.");var e=this.result[1]}else e=t;return this.getExecutionContext().updateImportedNode(i,t,e),!0}throw new Error("Expected exported node name.")}throw new Error("Expected a '.' after exported node name.")}throw new Error("No name given after IMPORT statement.")}return!1},statements(e){for(;this.statement(e););},statement(e){if(this.protoStatement())return!0;if(this.routeStatement())return!0;if(this.importStatement())return!0;if(this.exportStatement())return!0;const t=this.nodeStatement();return!1!==t&&(e.push(t),!0)},nodeStatement(){if(this.comments(),Ur.DEF.parse(this)){if(this.nodeNameId())return this.node(this.result[1]);throw new Error("No name given after DEF.")}if(Ur.USE.parse(this)){if(this.nodeNameId())return this.getExecutionContext().getNamedNode(this.result[1]).getValue();throw new Error("No name given after USE.")}return Ur.NULL.parse(this)?null:this.node("")},protoStatement(){return!!this.proto()||!!this.externproto()},protoStatements(){for(;this.protoStatement(););},proto(){if(this.comments(),Ur.PROTO.parse(this)){if(this.nodeTypeId()){const e=this.result[1];if(this.comments(),Ur.OpenBracket.parse(this)){const t=this.interfaceDeclarations();if(this.comments(),Ur.CloseBracket.parse(this)){if(this.comments(),Ur.OpenBrace.parse(this)){const i=new Lr(this.getExecutionContext());for(const e of t)i.addUserDefinedField(e.getAccessType(),e.getName(),e);if(this.pushPrototype(i),this.pushExecutionContext(i.getBody()),this.protoBody(i.getBody().rootNodes),this.popExecutionContext(),this.popPrototype(),this.comments(),Ur.CloseBrace.parse(this)){i.setup();try{const t=this.getExecutionContext().getProtoDeclaration(e);this.getExecutionContext().updateProtoDeclaration(this.getExecutionContext().getUniqueProtoName(e),t)}catch{}return this.getExecutionContext().updateProtoDeclaration(e,i),!0}throw new Error("Expected a '}' at the end of PROTO body.")}throw new Error("Expected a '{' at the beginning of PROTO body.")}throw new Error("Expected a ']' at the end of PROTO interface declaration.")}throw new Error("Expected a '[' at the beginning of PROTO interface declaration.")}throw new Error("Invalid PROTO definition name.")}return!1},protoBody(e){this.protoStatements();const t=this.rootNodeStatement();!1!==t&&e.push(t),this.statements(e)},rootNodeStatement(){if(this.comments(),Ur.DEF.parse(this)){if(this.nodeNameId()){const e=this.result[0],t=this.node(e);if(!1!==t)return t;throw new Error("Expected node type name after DEF.")}throw new Error("No name given after DEF.")}const e=this.node("");return!1!==e&&e},interfaceDeclarations(){const e=[];let t;for(;t=this.interfaceDeclaration();)e.push(t);return e},restrictedInterfaceDeclaration(){if(this.comments(),Ur.inputOnly.parse(this)||Ur.eventIn.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.inputOnlyId()){const t=this.result[1],i=new Yn[e];return i.setAccessType(d.inputOnly),i.setName(t),i}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}if(Ur.outputOnly.parse(this)||Ur.eventOut.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.outputOnlyId()){const t=this.result[1],i=new Yn[e];return i.setAccessType(d.outputOnly),i.setName(t),i}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}if(Ur.initializeOnly.parse(this)||Ur.field.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.initializeOnlyId()){const t=this.result[1],i=new Yn[e];if(this.fieldValue(i))return i.setAccessType(d.initializeOnly),i.setName(t),i;throw new Error(`Couldn't read value for field '${t}'.`)}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}return null},interfaceDeclaration(){const e=this.restrictedInterfaceDeclaration();if(e)return e;if(this.comments(),Ur.inputOutput.parse(this)||Ur.exposedField.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.inputOutputId()){const t=this.result[1],i=new Yn[e];if(this.fieldValue(i))return i.setAccessType(d.inputOutput),i.setName(t),i;throw new Error(`Couldn't read value for field '${t}'.`)}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}return null},externproto(){if(this.comments(),Ur.EXTERNPROTO.parse(this)){if(this.nodeTypeId()){const e=this.result[1];if(this.comments(),Ur.OpenBracket.parse(this)){const t=this.externInterfaceDeclarations();if(this.comments(),Ur.CloseBracket.parse(this)){if(this.URLList(this.MFString)){const i=new gh(this.getExecutionContext(),this.MFString);for(const e of t)i.addUserDefinedField(e.getAccessType(),e.getName(),e);i.setup();try{const t=this.getExecutionContext().getExternProtoDeclaration(e);this.getExecutionContext().updateExternProtoDeclaration(this.getExecutionContext().getUniqueExternProtoName(e),t)}catch{}return this.getExecutionContext().updateExternProtoDeclaration(e,i),!0}throw new Error(`Expected a URL list after EXTERNPROTO interface declaration '${e}'.`)}throw new Error("Expected a ']' at the end of EXTERNPROTO interface declaration.")}throw new Error("Expected a '[' at the beginning of EXTERNPROTO interface declaration.")}throw new Error("Invalid EXTERNPROTO definition name.")}return!1},externInterfaceDeclarations(){const e=[];let t;for(;t=this.externInterfaceDeclaration();)e.push(t);return e},externInterfaceDeclaration(){if(this.comments(),Ur.inputOnly.parse(this)||Ur.eventIn.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.inputOnlyId()){const t=this.result[1],i=new Yn[e];return i.setAccessType(d.inputOnly),i.setName(t),i}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}if(Ur.outputOnly.parse(this)||Ur.eventOut.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.outputOnlyId()){const t=this.result[1],i=new Yn[e];return i.setAccessType(d.outputOnly),i.setName(t),i}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}if(Ur.initializeOnly.parse(this)||Ur.field.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.initializeOnlyId()){const t=this.result[1],i=new Yn[e];return i.setAccessType(d.initializeOnly),i.setName(t),i}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}if(Ur.inputOutput.parse(this)||Ur.exposedField.parse(this)){if(this.fieldType()){const e=this.result[1];if(this.inputOutputId()){const t=this.result[1],i=new Yn[e];return i.setAccessType(d.inputOutput),i.setName(t),i}throw new Error("Expected a name for field.")}throw this.Id(),new Error(`Unknown event or field type: '${this.result[1]}'.`)}return null},URLList(e){return this.mfstringValue(e)},routeStatement(){if(this.comments(),Ur.ROUTE.parse(this)){if(this.nodeNameId()){const e=this.result[1],t=this.getExecutionContext().getLocalNode(e);if(this.comments(),Ur.Period.parse(this)){if(this.outputOnlyId()){const e=this.result[1];if(this.comments(),Ur.TO.parse(this)){if(this.nodeNameId()){const i=this.result[1],n=this.getExecutionContext().getLocalNode(i);if(this.comments(),Ur.Period.parse(this)){if(this.inputOnlyId())try{const i=this.result[1];return this.getExecutionContext().addRoute(t,e,n,i),!0}catch(e){return this.throwOrWarn(e.message),!0}throw new Error("Bad ROUTE specification: Expected a field name.")}throw new Error("Bad ROUTE specification: Expected a '.' after node name.")}throw new Error("Bad ROUTE specification: Expected a node name.")}throw new Error("Bad ROUTE specification: Expected a 'TO'.")}throw new Error("Bad ROUTE specification: Expected a field name.")}throw new Error("Bad ROUTE specification: Expected a '.' after node name.")}throw new Error("Bad ROUTE specification: Expected a node name.")}return!1},node(e){if(this.nodeTypeId()){const t=this.result[1],i=this.getExecutionContext().createNode(t,!1)??this.getExecutionContext().createProto(t,!1);if(!i)throw new Error(`Unknown node type or proto '${t}', you probably have insufficient component/profile statements, and/or an inappropriate specification version.`);if(e.length){try{const t=this.getExecutionContext().getNamedNode(e);this.getExecutionContext().updateNamedNode(this.getExecutionContext().getUniqueName(e),t)}catch{}this.getExecutionContext().updateNamedNode(e,i)}if(this.comments(),Ur.OpenBrace.parse(this)){if(i.canUserDefinedFields()?this.scriptBody(i):this.nodeBody(i),this.comments(),Ur.CloseBrace.parse(this))return this.isInsideProtoDefinition()||i.setup(),i;throw new Error("Expected '}' at the end of node body.")}throw new Error("Expected '{' at the beginning of node body.")}return!1},scriptBody(e){for(;this.scriptBodyElement(e););},scriptBodyElement(e){const t=this.lastIndex,i=this.lineNumber;if(this.Id()){const t=this.accessTypes[this.result[1]];if(t&&this.fieldType()){const i=this.result[1];if(this.Id()){const s=this.result[1];if(this.comments(),Ur.IS.parse(this)){if(this.isInsideProtoDefinition()){if(this.Id()){const r=this.result[1];try{var n=this.getPrototype().getField(r)}catch{return this.throwOrWarn(`No such event or field '${r}' inside PROTO ${this.getPrototype().getName()} interface declaration.`),!0}if(d[i]===n.getType()){if(n.isReference(t)){let r=Br.try((()=>e.getUserDefinedField(s)));if(r||(r=new Yn[i],e.addUserDefinedField(t,s,r)),t===r.getAccessType()&&n.getType()===r.getType())return r.addReference(n),!0;throw new Error(`Couldn't add field '${s}', field already exists with different access type or data type.`)}throw new Error(`Field '${s}' and '${n.getName()}' in PROTO '${this.getPrototype().getName()}' are incompatible as an IS mapping.`)}throw new Error(`Field '${s}' and '${n.getName()}' in PROTO '${this.getPrototype().getName()}' have different types.`)}throw new Error("No name give after IS statement.")}throw new Error("IS statement outside PROTO definition.")}}}}this.lastIndex=t,this.lineNumber=i;const s=this.interfaceDeclaration();if(s){const t=Br.try((()=>e.getUserDefinedField(s.getName())));if(t){if(t.getAccessType()===s.getAccessType()&&t.getType()===s.getType())return t.assign(s),!0;throw new Error(`Couldn't set value for field '${s.getName()}', field already exists with different access type or data type.`)}return e.addUserDefinedField(s.getAccessType(),s.getName(),s),!0}return this.nodeBodyElement(e)},nodeBody(e){for(;this.nodeBodyElement(e););},nodeBodyElement(e){if(this.protoStatement())return!0;if(this.routeStatement())return!0;if(this.Id()){const n=this.result[1];try{var t=e.getPredefinedField(n)}catch{throw new Error(`Unknown field '${n}' in class '${e.getTypeName()}'.`)}if(this.comments(),Ur.IS.parse(this)){if(this.isInsideProtoDefinition()){if(this.Id()){const e=this.result[1];try{var i=this.getPrototype().getField(e)}catch{return this.throwOrWarn(`No such event or field '${e}' inside PROTO ${this.getPrototype().getName()}`),!0}if(t.getType()===i.getType()){if(i.isReference(t.getAccessType()))return t.addReference(i),!0;throw new Error(`Field '${t.getName()}' and '${i.getName()}' in PROTO ${this.getPrototype().getName()} are incompatible as an IS mapping.`)}throw new Error(`Field '${t.getName()}' and '${i.getName()}' in PROTO ${this.getPrototype().getName()} have different types.`)}throw new Error("No name give after IS statement.")}throw new Error("IS statement outside PROTO definition.")}if(t.isInitializable()){if(this.fieldValue(t))return!0;throw new Error(`Couldn't read value for field '${n}'.`)}throw new Error(`Couldn't assign value to ${this.accessTypeToString(t.getAccessType())} field '${n}'.`)}return!1},profileNameId(){return this.Id()},componentNameId(){return this.comments(),Ur.ComponentNameId.parse(this)},categoryNameId(){return this.Id()},unitNameId(){return this.Id()},exportedNodeNameId(){return this.Id()},nodeNameId(){return this.Id()},nodeTypeId(){return this.Id()},initializeOnlyId(){return this.Id()},inputOnlyId(){return this.Id()},outputOnlyId(){return this.Id()},inputOutputId(){return this.Id()},Id(){return this.comments(),Ur.Id.parse(this)},fieldType(){return this.comments(),Ur.FieldType.parse(this)},fieldValue(e){return this[e.getType()](e,e.getUnit())},bool(){return this.comments(),Ur.TRUE.parse(this)?(this.value=!0,!0):!!Ur.FALSE.parse(this)&&(this.value=!1,!0)},double(){return this.comments(),Ur.double.parse(this)?(this.value=parseFloat(this.result[1]),!0):!!Ur.CONSTANTS.parse(this)&&(this.value=this.CONSTANTS[this.result[2].toUpperCase()],"-"===this.result[1]&&(this.value=-this.value),!0)},int32(){return this.comments(),!!Ur.int32.parse(this)&&(this.value=parseInt(this.result[1]),!0)},string(){return this.comments(),!!Ur.string.parse(this)&&(this.value=Yn.SFString.unescape(this.result[1]),this.lines(this.value),!0)},sfboolValue(e){return!!this.bool()&&(e.setValue(this.value),!0)},mfboolValue(e){if(e.length=0,this.bool())return e.push(this.value),!0;if(Ur.OpenBracket.parse(this)){if(this.sfboolValues(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfboolValues(e){for(e.length=0,e=e.getTarget();this.bool();)e.push(this.value)},sfcolorValue(e){const t=this.lastIndex;if(this.double()){const t=this.value;if(this.double()){const i=this.value;if(this.double()){const n=this.value;return e.r=t,e.g=i,e.b=n,!0}}}if(this.lastIndex=t,this.comments(),Ur.HTMLColor.parse(this)){const t=this.convertColor(this.result[1].replace(/0x/i,"#"));return e.r=t[0],e.g=t[1],e.b=t[2],!0}return!1},mfcolorValue(e){if(e.length=0,this.sfcolorValue(this.Color3))return e.push(this.Color3),!0;if(Ur.OpenBracket.parse(this)){if(this.sfcolorValues(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfcolorValues(e){e.length=0,e=e.getTarget();const t=this.Color3;for(;this.sfcolorValue(t);)e.push(t)},sfcolorrgbaValue(e){const t=this.lastIndex;if(this.double()){const t=this.value;if(this.double()){const i=this.value;if(this.double()){const n=this.value;if(this.double()){const s=this.value;return e.r=t,e.g=i,e.b=n,e.a=s,!0}}}}if(this.lastIndex=t,this.comments(),Ur.HTMLColor.parse(this)){const t=this.convertColor(this.result[1].replace(/0x/i,"#"));return e.r=t[0],e.g=t[1],e.b=t[2],e.a=t[3],!0}return!1},mfcolorrgbaValue(e){if(e.length=0,this.sfcolorrgbaValue(this.Color4))return e.push(this.Color4),!0;if(Ur.OpenBracket.parse(this)){if(this.sfcolorrgbaValues(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfcolorrgbaValues(e){e.length=0,e=e.getTarget();const t=this.Color4;for(;this.sfcolorrgbaValue(t);)e.push(t)},sfdoubleValue(e){return!!this.double()&&(e.setValue(this.fromUnit(e.getUnit(),this.value)),!0)},mfdoubleValue(e){if(e.length=0,this.double())return e.push(this.fromUnit(e.getUnit(),this.value)),!0;if(Ur.OpenBracket.parse(this)){if(this.sfdoubleValues(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfdoubleValues(e){e.length=0;const t=(e=e.getTarget()).getUnit();for(;this.double();)e.push(this.fromUnit(t,this.value))},sfimageValue(e){if(this.int32()){const t=this.value;if(this.int32()){const i=this.value;if(this.int32()){const n=this.value,s=t*i;e.width=t,e.height=i,e.comp=n;const r=e.array;for(let e=0;e<s;++e){if(!this.int32())return!1;r[e]=this.value}return!0}}}return!1},mfimageValue(e){if(e.length=0,this.sfimageValue(this.SFImage))return e.push(this.SFImage),!0;if(Ur.OpenBracket.parse(this)){if(this.sfimageValues(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfimageValues(e){e.length=0,e=e.getTarget();const t=this.SFImage;for(;this.sfimageValue(t);)e.push(t)},sfint32Value(e){return!!this.int32()&&(e.setValue(this.value),!0)},mfint32Value(e){if(e.length=0,this.int32())return e.push(this.value),!0;if(Ur.OpenBracket.parse(this)){if(this.sfint32Values(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfint32Values(e){for(e.length=0,e=e.getTarget();this.int32();)e.push(this.value)},sfmatrix3Value(e){if(this.double()){const t=this.value;if(this.double()){const i=this.value;if(this.double()){const n=this.value;if(this.double()){const s=this.value;if(this.double()){const r=this.value;if(this.double()){const o=this.value;if(this.double()){const a=this.value;if(this.double()){const l=this.value;if(this.double()){const u=this.value;return e[0]=t,e[1]=i,e[2]=n,e[3]=s,e[4]=r,e[5]=o,e[6]=a,e[7]=l,e[8]=u,!0}}}}}}}}}return!1},mfmatrix3Value(e){if(e.length=0,this.sfmatrix3Value(this.Matrix3))return e.push(this.Matrix3),!0;if(Ur.OpenBracket.parse(this)){if(this.sfmatrix3Values(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfmatrix3Values(e){e.length=0,e=e.getTarget();const t=this.Matrix3;for(;this.sfmatrix3Value(t);)e.push(t)},sfmatrix4Value(e){if(this.double()){const t=this.value;if(this.double()){const i=this.value;if(this.double()){const n=this.value;if(this.double()){const s=this.value;if(this.double()){const r=this.value;if(this.double()){const o=this.value;if(this.double()){const a=this.value;if(this.double()){const l=this.value;if(this.double()){const u=this.value;if(this.double()){const h=this.value;if(this.double()){const d=this.value;if(this.double()){const c=this.value;if(this.double()){const p=this.value;if(this.double()){const g=this.value;if(this.double()){const f=this.value;if(this.double()){const m=this.value;return e[0]=t,e[1]=i,e[2]=n,e[3]=s,e[4]=r,e[5]=o,e[6]=a,e[7]=l,e[8]=u,e[9]=h,e[10]=d,e[11]=c,e[12]=p,e[13]=g,e[14]=f,e[15]=m,!0}}}}}}}}}}}}}}}}return!1},mfmatrix4Value(e){if(e.length=0,this.sfmatrix4Value(this.Matrix4))return e.push(this.Matrix4),!0;if(Ur.OpenBracket.parse(this)){if(this.sfmatrix4Values(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfmatrix4Values(e){e.length=0,e=e.getTarget();const t=this.Matrix4;for(;this.sfmatrix4Value(t);)e.push(t)},sfnodeValue(e){const t=this.nodeStatement();return!1!==t&&(e.setValue(t),!0)},mfnodeValue(e){e.length=0;const t=this.nodeStatement();if(!1!==t)return e.push(t),!0;if(Ur.OpenBracket.parse(this)){if(this.nodeStatements(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},nodeStatements(e){this.statements(e)},sfrotationValue(e){if(this.double()){const t=this.value;if(this.double()){const i=this.value;if(this.double()){const n=this.value;if(this.double()){const s=this.value;return e.x=t,e.y=i,e.z=n,e.angle=this.fromUnit("angle",s),!0}}}}return!1},mfrotationValue(e){if(e.length=0,this.sfrotationValue(this.Rotation4))return e.push(this.Rotation4),!0;if(Ur.OpenBracket.parse(this)){if(this.sfrotationValues(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfrotationValues(e){e.length=0,e=e.getTarget();const t=this.Rotation4;for(;this.sfrotationValue(t);)e.push(t)},sfstringValue(e){return!!this.string()&&(e.setValue(this.value),!0)},mfstringValue(e){if(e.length=0,this.string())return e.push(this.value),!0;if(Ur.OpenBracket.parse(this)){if(this.sfstringValues(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfstringValues(e){for(e.length=0,e=e.getTarget();this.string();)e.push(this.value)},sfvec2Value(e,t){if(this.double()){const i=this.value;if(this.double()){const n=this.value;return e.x=this.fromUnit(t,i),e.y=this.fromUnit(t,n),!0}}return!1},mfvec2Value(e){if(e.length=0,this.sfvec2Value(this.Vector2,e.getUnit()))return e.push(this.Vector2),!0;if(Ur.OpenBracket.parse(this)){if(this.sfvec2Values(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec2Values(e){e.length=0,e=e.getTarget();const t=this.Vector2,i=e.getUnit();for(;this.sfvec2Value(t,i);)e.push(t)},sfvec3Value(e,t){if(this.double()){const i=this.value;if(this.double()){const n=this.value;if(this.double()){const s=this.value;return e.x=this.fromUnit(t,i),e.y=this.fromUnit(t,n),e.z=this.fromUnit(t,s),!0}}}return!1},mfvec3Value(e){if(e.length=0,this.sfvec3Value(this.Vector3,e.getUnit()))return e.push(this.Vector3),!0;if(Ur.OpenBracket.parse(this)){if(this.sfvec3Values(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec3Values(e){e.length=0,e=e.getTarget();const t=this.Vector3,i=e.getUnit();for(;this.sfvec3Value(t,i);)e.push(t)},sfvec4Value(e,t){if(this.double()){const i=this.value;if(this.double()){const n=this.value;if(this.double()){const s=this.value;if(this.double()){const r=this.value;return e.x=this.fromUnit(t,i),e.y=this.fromUnit(t,n),e.z=this.fromUnit(t,s),e.w=this.fromUnit(t,r),!0}}}}return!1},mfvec4Value(e){if(e.length=0,this.sfvec4Value(this.Vector4,e.getUnit()))return e.push(this.Vector4),!0;if(Ur.OpenBracket.parse(this)){if(this.sfvec4Values(e),Ur.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec4Values(e){e.length=0,e=e.getTarget();const t=this.Vector4,i=e.getUnit();for(;this.sfvec4Value(t,i);)e.push(t)},accessTypeToString(e){switch(e){case d.initializeOnly:return"initializeOnly";case d.inputOnly:return"inputOnly";case d.outputOnly:return"outputOnly";case d.inputOutput:return"inputOutput"}}}),Object.assign(Xr.prototype,{[d.SFBool]:Xr.prototype.sfboolValue,[d.SFColor]:Xr.prototype.sfcolorValue,[d.SFColorRGBA]:Xr.prototype.sfcolorrgbaValue,[d.SFDouble]:Xr.prototype.sfdoubleValue,[d.SFFloat]:Xr.prototype.sfdoubleValue,[d.SFImage]:Xr.prototype.sfimageValue,[d.SFInt32]:Xr.prototype.sfint32Value,[d.SFMatrix3f]:Xr.prototype.sfmatrix3Value,[d.SFMatrix3d]:Xr.prototype.sfmatrix3Value,[d.SFMatrix4f]:Xr.prototype.sfmatrix4Value,[d.SFMatrix4d]:Xr.prototype.sfmatrix4Value,[d.SFNode]:Xr.prototype.sfnodeValue,[d.SFRotation]:Xr.prototype.sfrotationValue,[d.SFString]:Xr.prototype.sfstringValue,[d.SFTime]:Xr.prototype.sfdoubleValue,[d.SFVec2d]:Xr.prototype.sfvec2Value,[d.SFVec2f]:Xr.prototype.sfvec2Value,[d.SFVec3d]:Xr.prototype.sfvec3Value,[d.SFVec3f]:Xr.prototype.sfvec3Value,[d.SFVec4d]:Xr.prototype.sfvec4Value,[d.SFVec4f]:Xr.prototype.sfvec4Value,[d.MFBool]:Xr.prototype.mfboolValue,[d.MFColor]:Xr.prototype.mfcolorValue,[d.MFColorRGBA]:Xr.prototype.mfcolorrgbaValue,[d.MFDouble]:Xr.prototype.mfdoubleValue,[d.MFFloat]:Xr.prototype.mfdoubleValue,[d.MFImage]:Xr.prototype.mfimageValue,[d.MFInt32]:Xr.prototype.mfint32Value,[d.MFMatrix3d]:Xr.prototype.mfmatrix3Value,[d.MFMatrix3f]:Xr.prototype.mfmatrix3Value,[d.MFMatrix4d]:Xr.prototype.mfmatrix4Value,[d.MFMatrix4f]:Xr.prototype.mfmatrix4Value,[d.MFNode]:Xr.prototype.mfnodeValue,[d.MFRotation]:Xr.prototype.mfrotationValue,[d.MFString]:Xr.prototype.mfstringValue,[d.MFTime]:Xr.prototype.mfdoubleValue,[d.MFVec2d]:Xr.prototype.mfvec2Value,[d.MFVec2f]:Xr.prototype.mfvec2Value,[d.MFVec3d]:Xr.prototype.mfvec3Value,[d.MFVec3f]:Xr.prototype.mfvec3Value,[d.MFVec4d]:Xr.prototype.mfvec4Value,[d.MFVec4f]:Xr.prototype.mfvec4Value}),he.prototype.fromString=function(e,t){const i=new Xr(t);if(i.setUnits(!!t),i.setInput(e),!i.fieldValue(this))throw new Error(`Couldn't read value for field '${this.getName()}'.`)};const kr=Xr;i.add("VRMLParser","x_ite/Parser/VRMLParser",kr);const jr=kr;var zr=n(464);const Gr={initializeOnly:d.initializeOnly,inputOnly:d.inputOnly,outputOnly:d.outputOnly,inputOutput:d.inputOutput};function Hr(e){Fr.call(this,e),this.protoDeclarations=[],this.parents=[],this.parser=new jr(e),this.url=new Yn.MFString,this.protoNames=new Map,this.protoFields=new WeakMap}Object.assign(Object.setPrototypeOf(Hr.prototype,Fr.prototype),{getEncoding:()=>"XML",setInput(e){try{"string"==typeof e&&(e=zr.parseXML(e)),this.input=e,this.xml=this.isXML(e),this.xml||Object.assign(this,qr)}catch{this.input=void 0}},isValid(){return this.input instanceof XMLDocument||this.input instanceof HTMLElement||null===this.input},isXML:e=>!(e instanceof HTMLElement),parseIntoScene(e,t){this.resolve=e,this.reject=t,this.getScene().setEncoding("XML"),this.getScene().setProfile(this.getBrowser().getProfile("Full")),this.xmlElement(this.input)},xmlElement(e){if(null===e)return this.resolve?.(this.getScene());switch(e.nodeName){case"#document":{const t=zr(e).children("X3D");if(t.length)for(const e of t)this.x3dElement(e);else this.resolve?this.loadComponents().then((()=>{this.childrenElements(e),this.resolve(this.getScene())})).catch(this.reject):this.childrenElements(e);break}case"X3D":this.x3dElement(e);break;case"Scene":case"SCENE":this.resolve?this.loadComponents().then((()=>{this.sceneElement(e),this.resolve(this.getScene())})).catch(this.reject):this.sceneElement(e);break;default:this.resolve?this.loadComponents().then((()=>{this.childrenElements(e),this.resolve(this.getScene())})).catch(this.reject):this.childrenElements(e)}},x3dElement(e){try{const t=e.getAttribute("profile"),i=this.getBrowser().getProfile(t||"Full");zr.data(this.scene,"X3D",e),this.getScene().setProfile(i)}catch(e){console.error(e)}const t=e.getAttribute("version");t&&this.getScene().setSpecificationVersion(t);for(const t of e.childNodes)this.x3dElementChildHead(t);if(this.xml||this.headElement(e),this.resolve)this.loadComponents().then((()=>{for(const t of e.childNodes)this.x3dElementChildScene(t);this.resolve(this.getScene())})).catch(this.reject);else for(const t of e.childNodes)this.x3dElementChildScene(t)},x3dElementChildHead(e){switch(e.nodeName){case"head":case"HEAD":return void this.headElement(e)}},x3dElementChildScene(e){switch(e.nodeName){case"Scene":case"SCENE":return void this.sceneElement(e)}},headElement(e){for(const t of e.childNodes)this.headElementChild(t)},headElementChild(e){switch(e.nodeName){case"component":case"COMPONENT":return void this.componentElement(e);case"unit":case"UNIT":return void this.unitElement(e);case"meta":case"META":return void this.metaElement(e)}},componentElement(e){try{const t=e.getAttribute("name"),i=parseInt(e.getAttribute("level"));if(null===t)return console.warn("XML Parser Error: Bad component statement. Expected name attribute.");if(null===i)return console.warn("XML Parser Error: Bad component statement. Expected level attribute.");const n=this.getBrowser().getComponent(t,i);this.getScene().updateComponent(n)}catch(e){console.log(e.message)}},unitElement(e){const t=e.getAttribute("category"),i=e.getAttribute("name"),n=e.getAttribute("conversionFactor");return null===t?console.warn("XML Parser Error: Bad unit statement. Expected category attribute."):null===i?console.warn("XML Parser Error: Bad unit statement. Expected name attribute."):null===n?console.warn("XML Parser Error: Bad unit statement. Expected conversionFactor attribute."):void this.getScene().updateUnit(t,i,parseFloat(n))},metaElement(e){const t=e.getAttribute("name"),i=e.getAttribute("content");return null===t?console.warn("XML Parser Error: Bad meta statement. Expected name attribute."):null===i?console.warn("XML Parser Error: Bad meta statement. Expected content attribute."):void this.getScene().addMetaData(t,i)},sceneElement(e){zr.data(e,"node",this.scene),this.childrenElements(e)},childrenElements(e){for(const t of e.childNodes)this.childElement(t)},childElement(e){switch(e.nodeName){case"#comment":case"#text":return;case"#cdata-section":return void this.cdataNode(e);case"ExternProtoDeclare":case"EXTERNPROTODECLARE":return void this.externProtoDeclareElement(e);case"ProtoDeclare":case"PROTODECLARE":return void this.protoDeclareElement(e);case"IS":return void this.isElement(e);case"ProtoInstance":case"PROTOINSTANCE":return void this.protoInstanceElement(e);case"fieldValue":case"FIELDVALUE":return void this.fieldValueElement(e);case"field":case"FIELD":return void this.fieldElement(e);case"ROUTE":return void this.routeElement(e);case"IMPORT":return void this.importElement(e);case"EXPORT":return void this.exportElement(e);default:return void this.nodeElement(e)}},externProtoDeclareElement(e){const t=e.getAttribute("name");if(this.id(t)){const i=e.getAttribute("url");this.parser.setInput(i??""),this.parser.sfstringValues(this.url),this.url.length||console.warn("XML Parser Error: Bad ExternProtoDeclare statement. Expected url attribute with value.");const n=new gh(this.getExecutionContext(),this.url);this.pushParent(n),this.protoInterfaceElement(e),this.popParent(),this.addProtoFieldNames(n),n.setup();try{const e=this.getExecutionContext().getExternProtoDeclaration(t);this.getExecutionContext().updateExternProtoDeclaration(this.getExecutionContext().getUniqueExternProtoName(t),e)}catch{}this.getExecutionContext().updateExternProtoDeclaration(t,n),this.addProtoName(t)}},protoDeclareElement(e){const t=e.getAttribute("name");if(this.id(t)){const i=new Lr(this.getExecutionContext());for(const t of e.childNodes){switch(t.nodeName){case"ProtoInterface":case"PROTOINTERFACE":this.pushParent(i),this.protoInterfaceElement(t),this.popParent(),this.addProtoFieldNames(i);break;default:continue}break}for(const t of e.childNodes){switch(t.nodeName){case"ProtoBody":case"PROTOBODY":this.pushPrototype(i),this.pushExecutionContext(i.getBody()),this.pushParent(i),this.protoBodyElement(t),this.popParent(),this.popExecutionContext(),this.popPrototype();break;default:continue}break}i.setup();try{const e=this.getExecutionContext().getProtoDeclaration(t);this.getExecutionContext().updateProtoDeclaration(this.getExecutionContext().getUniqueProtoName(t),e)}catch{}this.getExecutionContext().updateProtoDeclaration(t,i),this.addProtoName(t)}},protoInterfaceElement(e){for(const t of e.childNodes)this.protoInterfaceElementChild(t)},protoInterfaceElementChild(e){switch(e.nodeName){case"field":case"FIELD":return void this.fieldElement(e)}},fieldElement(e){try{if(0===this.getParents().length)return;const t=this.getParent();if(!(t instanceof ds))return;if(!t.canUserDefinedFields())return;const i=Gr[e.getAttribute("accessType")]||d.initializeOnly,n=Yn[e.getAttribute("type")];if(!n)return;const s=e.getAttribute("name");if(!this.id(s))return;const r=new n;i&d.initializeOnly&&(this.fieldValue(r,e.getAttribute("value")),this.pushParent(r),this.childrenElements(e),this.popParent()),t.addUserDefinedField(i,s,r)}catch(e){console.error(e)}},protoBodyElement(e){this.childrenElements(e)},isElement(e){if(this.isInsideProtoDefinition())for(const t of e.childNodes)this.isElementChild(t)},isElementChild(e){switch(e.nodeName){case"connect":case"CONNECT":return void this.connectElement(e)}},connectElement(e){const t=e.getAttribute("nodeField"),i=e.getAttribute("protoField");if(null===t)return console.warn("XML Parser Error: Bad connect statement. Expected nodeField attribute.");if(null===i)return console.warn("XML Parser Error: Bad connect statement. Expected protoField attribute.");try{if(0===this.getParents().length)return;const e=this.getParent(),n=this.getPrototype();if(!(e instanceof bs))return;const s=e.getField(t),r=n.getField(i);if(s.getType()!==r.getType())throw new Error(`Field '${s.getName()}' and '${r.getName()}' in PROTO ${this.proto.getName()} have different types.`);if(!r.isReference(s.getAccessType()))throw new Error(`Field '${s.getName()}' and '${r.getName()}' in PROTO ${n.getName()} are incompatible as an IS mapping.`);s.addReference(r)}catch(e){console.warn(`XML Parser Error: Couldn't create IS reference. ${e.message}`)}},protoInstanceElement(e){try{if(this.useAttribute(e))return;const t=e.getAttribute("name");if(this.id(t)){const i=this.getExecutionContext().createProto(t,!1);if(!i)throw new Error(`Unknown proto or externproto type '${t}'.`);zr.data(e,"node",i),this.defAttribute(e,i),this.addNode(e,i),this.pushParent(i),this.childrenElements(e),this.isInsideProtoDefinition()||i.setup(),this.popParent()}}catch(e){console.warn("XML Parser Error: ",e.message)}},fieldValueElement(e){try{if(0===this.getParents().length)return;const t=this.getParent(),i=e.getAttribute("name");if(!(t instanceof Yh))return;if(!this.id(i))return;const n=t.getField(i);n.getAccessType()&d.initializeOnly&&(n.getType()===d.MFNode&&(n.length=0),this.fieldValue(n,e.getAttribute("value")),this.pushParent(n),this.childrenElements(e),this.popParent())}catch(e){console.warn(`XML Parser Error: Couldn't assign field value. ${e.message}`)}},nodeElement(e){try{if(this.useAttribute(e))return;const t=this.getExecutionContext().createNode(this.nodeNameToCamelCase(e.nodeName),!1)??this.getExecutionContext().createProto(this.protoNameToCamelCase(e.nodeName),!1);if(!t)throw new Error(`Unknown node type '${e.nodeName}', you probably have insufficient component/profile statements and/or an inappropriate specification version.`);zr.data(e,"node",t),"SCRIPT"===e.nodeName&&this.scriptElement(e),this.defAttribute(e,t),this.addNode(e,t),this.pushParent(t),this.nodeAttributes(e,t),this.childrenElements(e),this.isInsideProtoDefinition()||t.setup(),this.popParent()}catch(t){if("NULL"==e.nodeName)return void this.addNode(e,null);console.error(`XML Parser Error: ${t.message}`)}},scriptElement(e){const t=(new DOMParser).parseFromString(e.outerHTML,"application/xml").children[0].childNodes;e.textContent="// Content moved into childNodes.";for(const i of t)1!==i.nodeType&&4!==i.nodeType||e.appendChild(i)},routeElement(e){try{const t=e.getAttribute("fromNode"),i=e.getAttribute("fromField"),n=e.getAttribute("toNode"),s=e.getAttribute("toField");if(null===t)throw new Error("Bad ROUTE statement: Expected fromNode attribute.");if(null===i)throw new Error("Bad ROUTE statement: Expected fromField attribute.");if(null===n)throw new Error("Bad ROUTE statement: Expected toNode attribute.");if(null===s)throw new Error("Bad ROUTE statement: Expected toField attribute.");const r=this.getExecutionContext(),o=r.getLocalNode(t),a=r.getLocalNode(n),l=r.addRoute(o,i,a,s);zr.data(e,"node",l)}catch(e){console.warn(`XML Parser Error: ${e.message}`)}},importElement(e){try{const t=e.getAttribute("inlineDEF"),i=e.getAttribute("importedDEF")||e.getAttribute("exportedDEF"),n=e.getAttribute("AS")||i;if(null===t)throw new Error("Bad IMPORT statement: Expected inlineDEF attribute.");if(null===i)throw new Error("Bad IMPORT statement: Expected importedDEF attribute.");const s=this.getExecutionContext().getNamedNode(t);this.getExecutionContext().updateImportedNode(s,i,n)}catch(e){console.warn(`XML Parser Error: ${e.message}`)}},exportElement(e){try{if(this.getScene()!==this.getExecutionContext())return void console.warn("XML Parser Error: Export statement not allowed here.");const t=e.getAttribute("localDEF"),i=e.getAttribute("AS")||t;if(null===t)throw new Error("Bad EXPORT statement: Expected localDEF attribute.");const n=this.getExecutionContext().getLocalNode(t);this.getScene().updateExportedNode(i,n)}catch(e){console.warn(`XML Parser Error: ${e.message}`)}},cdataNode(e){if(0===this.getParents().length)return;const t=this.getParent();t instanceof bs&&t.getSourceText()?.push(e.data)},useAttribute(e){try{const t=e.getAttribute("USE");if(this.id(t)){const i=this.getExecutionContext().getNamedNode(t);return this.addNode(e,i.getValue()),!0}}catch(e){console.warn(`Invalid USE name: ${e.message}`)}return!1},defAttribute(e,t){try{const i=e.getAttribute("DEF");if(i){try{const e=this.getExecutionContext().getNamedNode(i);this.getExecutionContext().updateNamedNode(this.getExecutionContext().getUniqueName(i),e)}catch{}this.getExecutionContext().updateNamedNode(i,t)}}catch(e){console.warn(`Invalid DEF name: ${e.message}`)}},nodeAttributes(e,t){for(const i of e.attributes)this.nodeAttribute(i,t)},nodeAttribute(e,t){try{const i=t.getPredefinedField(this.attributeToCamelCase(t,e.name));i.isInitializable()&&this.fieldValue(i,e.value)}catch(e){}},fieldValue(e,t){null!==t&&(this.parser.pushExecutionContext(this.getExecutionContext()),this.parser.setInput(t),this[e.getType()].call(this.parser,e,e.getUnit()),this.parser.popExecutionContext())},id:e=>null!==e&&0!==e.length,getParents(){return this.parents},getParent(){return this.parents.at(-1)},pushParent(e){return this.parents.push(e)},popParent(){this.parents.pop()},addNode(e,t){if(0===this.parents.length||this.getParent()instanceof Lr)return void this.getExecutionContext().rootNodes.push(t);const i=this.getParent();if(i instanceof he)switch(i.getType()){case d.SFNode:return void i.setValue(t);case d.MFNode:return void i.push(t)}else try{const n=e.getAttribute("containerField")||t?.getContainerField(!0);if(!n)return void console.warn("Node must have a container field attribute.");const s=i.getField(n);switch(s.getType()){case d.SFNode:return void s.setValue(t);case d.MFNode:return void s.push(t)}}catch(i){t?.getType().includes(d.X3DMetadataObject)&&(e.setAttribute("containerField","metadata"),this.addNode(e,t))}},addProtoName(e){},addProtoFieldNames(e){},protoNameToCamelCase:e=>e,nodeNameToCamelCase:e=>e,attributeToCamelCase:(e,t)=>t}),Object.assign(Hr.prototype,{[d.SFBool]:jr.prototype.sfboolValue,[d.SFColor]:jr.prototype.sfcolorValue,[d.SFColorRGBA]:jr.prototype.sfcolorrgbaValue,[d.SFDouble]:jr.prototype.sfdoubleValue,[d.SFFloat]:jr.prototype.sfdoubleValue,[d.SFImage]:jr.prototype.sfimageValue,[d.SFInt32]:jr.prototype.sfint32Value,[d.SFMatrix3f]:jr.prototype.sfmatrix3Value,[d.SFMatrix3d]:jr.prototype.sfmatrix3Value,[d.SFMatrix4f]:jr.prototype.sfmatrix4Value,[d.SFMatrix4d]:jr.prototype.sfmatrix4Value,[d.SFNode](e){e.setValue(null)},[d.SFRotation]:jr.prototype.sfrotationValue,[d.SFString](e){e.setValue(Yn.SFString.unescape(this.input))},[d.SFTime]:jr.prototype.sfdoubleValue,[d.SFVec2d]:jr.prototype.sfvec2Value,[d.SFVec2f]:jr.prototype.sfvec2Value,[d.SFVec3d]:jr.prototype.sfvec3Value,[d.SFVec3f]:jr.prototype.sfvec3Value,[d.SFVec4d]:jr.prototype.sfvec4Value,[d.SFVec4f]:jr.prototype.sfvec4Value,[d.MFBool]:jr.prototype.sfboolValues,[d.MFColor]:jr.prototype.sfcolorValues,[d.MFColorRGBA]:jr.prototype.sfcolorrgbaValues,[d.MFDouble]:jr.prototype.sfdoubleValues,[d.MFFloat]:jr.prototype.sfdoubleValues,[d.MFImage]:jr.prototype.sfimageValues,[d.MFInt32]:jr.prototype.sfint32Values,[d.MFMatrix3d]:jr.prototype.sfmatrix3Values,[d.MFMatrix3f]:jr.prototype.sfmatrix3Values,[d.MFMatrix4d]:jr.prototype.sfmatrix4Values,[d.MFMatrix4f]:jr.prototype.sfmatrix4Values,[d.MFNode](e){e.length=0},[d.MFRotation]:jr.prototype.sfrotationValues,[d.MFString]:jr.prototype.sfstringValues,[d.MFTime]:jr.prototype.sfdoubleValues,[d.MFVec2d]:jr.prototype.sfvec2Values,[d.MFVec2f]:jr.prototype.sfvec2Values,[d.MFVec3d]:jr.prototype.sfvec3Values,[d.MFVec3f]:jr.prototype.sfvec3Values,[d.MFVec4d]:jr.prototype.sfvec4Values,[d.MFVec4f]:jr.prototype.sfvec4Values});const qr={addProtoName(e){this.protoNames.set(e,e),this.protoNames.set(e.toUpperCase(),e)},addProtoFieldNames:(()=>{const e=new Set;for(const t of["DEF","USE","containerField"])e.add(t).add(t.toLowerCase());return function(t){const i=new Map;this.protoFields.set(t,i);for(const{name:n}of t.getFieldDefinitions())e.has(n)||(i.set(n,n),i.set(n.toLowerCase(),n))}})(),protoNameToCamelCase(e){return this.protoNames.get(e)},nodeNameToCamelCase:e=>Kn.getNodeTypeName(e),attributeToCamelCase(e,t){return e instanceof Yh?this.protoFields.get(e.getProtoNode()).get(t):Kn.getFieldName(t)}},Yr=Hr;i.add("XMLParser","x_ite/Parser/XMLParser",Yr);const Wr=Yr;function $r(e){Fr.call(this,e),this.namespace="http://www.web3d.org/specifications/x3d-namespace"}Object.assign(Object.setPrototypeOf($r.prototype,Fr.prototype),{getEncoding:()=>"JSON",setInput(e){try{"string"==typeof e&&(e=JSON.parse(e)),this.input=e}catch{this.input=void 0}},isValid(){return this.input instanceof Object},parseIntoScene(e,t){const i=this.createElement("X3D");this.convertToDOM(this.input,"",i);const n=new Wr(this.getScene());n.setInput(i),n.parseIntoScene(e,t),this.getScene().setEncoding("JSON")},elementSetAttribute(e,t,i){switch(t){case"SON schema":case"ncoding":break;default:"function"==typeof e.setAttribute&&e.setAttribute(t,i)}},convertChildren(e,t,i){for(const n in t)"object"==typeof t[n]&&(isNaN(parseInt(n))?this.convertObject(n,t,i,e.substr(1)):this.convertToDOM(t[n],n,i,e.substr(1)))},createElement(e,t){if(void 0===this.namespace)var i=document.createElement(e);else null==(i=document.createElementNS(this.namespace,e))&&(console.error("Trouble creating element for",e),i=document.createElement(e));return void 0!==t&&this.elementSetAttribute(i,"containerField",t),i},createCDATA(e,t,i){const n=(new DOMParser).parseFromString("<xml></xml>","application/xml").createCDATASection(i);t.appendChild(n)},convertObject(e,t,i,n){if(null!==t&&"object"==typeof t[e])if("@"===e.substr(0,1))this.convertToDOM(t[e],e,i);else if("-"===e.substr(0,1))this.convertChildren(e,t[e],i);else if("#comment"===e)for(const n in t[e]){const s=document.createComment(this.commentStringToXML(t[e][n]));i.appendChild(s)}else if("#sourceCode"===e||"@sourceCode"===e||"#sourceText"===e)this.createCDATA(document,i,t[e].join("\n"));else if("connect"===e||"fieldValue"===e||"field"===e||"meta"===e||"component"===e||"unit"===e){for(const s in t[e])if("object"==typeof t[e][s]){const r=this.createElement(e,n);this.convertToDOM(t[e][s],s,r),i.appendChild(r),i.appendChild(document.createTextNode("\n"))}}else{const s=this.createElement(e,n);this.convertToDOM(t[e],e,s),i.appendChild(s),i.appendChild(document.createTextNode("\n"))}},commentStringToXML:e=>e.replace(/\\\\/g,"\\"),SFStringToXML:e=>e.replace(/([\\"])/g,"\\$1"),JSONStringToXML:e=>e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n"),convertToDOM(e,t,i,n){let s=!1,r=[],o=!1;for(const t in e)if(s=!isNaN(parseInt(t)),s)switch(typeof e[t]){case"number":case"boolean":r.push(e[t]);break;case"string":r.push(e[t]),o=!0;break;case"object":this.convertToDOM(e[t],t,i);break;case"undefined":break;default:console.error("Unknown type found in array "+typeof e[t])}else switch(typeof e[t]){case"object":"X3D"===t?this.convertToDOM(e[t],t,i):this.convertObject(t,e,i,n);break;case"number":case"boolean":this.elementSetAttribute(i,t.substr(1),e[t]);break;case"string":if("#comment"!==t)this.elementSetAttribute(i,t.substr(1),this.JSONStringToXML(e[t]));else{const n=document.createComment(this.commentStringToXML(e[t]));i.appendChild(n)}break;case"undefined":break;default:console.error("Unknown type found in object "+typeof e[t]),console.error(e)}if(s){if("@"===t.substr(0,1))if(o){o=!1;for(const e in r)r[e]=this.SFStringToXML(r[e]);this.elementSetAttribute(i,t.substr(1),'"'+r.join('" "')+'"')}else this.elementSetAttribute(i,t.substr(1),r.join(" "));s=!1}return i}});const Jr=$r;i.add("JSONParser","x_ite/Parser/JSONParser",Jr);const Kr=Jr;function Zr(){}Object.assign(Zr.prototype,{removeGroups:!1,removeEmptyGroups:!1,combineGroupingNodes:!1,optimizeSceneGraph(e){const t=[];e.setValue(this.optimizeNodes(e,!0,t)),t.forEach((e=>e.dispose()))},optimizeNodes(e,t,i){return[...e].flatMap((e=>this.optimizeNode(e,t,i)))},optimizeNode(e,t,i){if(!e)return[];switch(e.getNodeTypeName()){case"Transform":e.children=this.optimizeNodes(e.children,!0,i);break;case"Anchor":case"Group":if(e.children=this.optimizeNodes(e.children,!0,i),this.removeEmptyGroups&&0===e.children.length)return[];if(this.removeGroups)break;return e;case"Collision":case"LOD":case"Switch":return this.optimizeNodes(e.children,!1,i),e;case"HAnimJoint":case"HAnimSegment":case"HAnimSite":return e.children=this.optimizeNodes(e.children,!0,i),e;case"HAnimHumanoid":return e.skeleton=this.optimizeNodes(e.skeleton,!0,i),e.skin=this.optimizeNodes(e.skin,!0,i),e;default:return e}if(!t)return e;if(this.removeEmptyGroups&&0===e.children.length)return[];if(!this.combineGroupingNodes)return e;if(e.getValue().hasRoutes())return e;if("Transform"===e.getNodeTypeName()){if(!(e=this.combineSingleChild(e,i)).translation.getValue().equals(bt.Zero))return e;if(!e.rotation.getValue().equals(ai.Identity))return e;if(!e.scale.getValue().equals(bt.One))return e}return e.children?(i.push(e),[...e.children]):e},combineSingleChild(e,t){if(1!==e.children.length)return e;const i=e.children[0];if(!i.getNodeTypeName().match(/^(?:Transform|HAnimHumanoid)$/))return e;if(i.getValue().hasRoutes())return e;const n=new bt(0,0,0),s=new ai,r=new bt(1,1,1),o=new ai,a=new ci,l=new ci;if(a.set(e.translation.getValue(),e.rotation.getValue(),e.scale.getValue(),e.scaleOrientation.getValue(),e.center.getValue()),l.set(i.translation.getValue(),i.rotation.getValue(),i.scale.getValue(),i.scaleOrientation.getValue(),i.center.getValue()),a.multLeft(l),a.get(n,s,r,o,i.center.getValue()),i.translation=n,i.rotation=s,i.scale=r,i.scaleOrientation=o,!i.getNodeTypeName()&&e.getNodeTypeName()){const t=i.getExecutionContext();t.addNamedNode(t.getUniqueName(e.getNodeTypeName()),i)}return t.push(e),i}});const Qr=Zr;i.add("X3DOptimizer","x_ite/Parser/X3DOptimizer",Qr);const eo=Qr,to={get ENVIRONMENT(){return"MODULE"}};i.add("Features","x_ite/Features",to);const io=to,no={getScriptURL:(()=>{switch(io.ENVIRONMENT){case"NODE":var e=n.g.require("url").pathToFileURL(__filename).href;break;case"BROWSER":e=document.currentScript?.src??document.location.href;break;case"MODULE":e=import.meta.url}return function(){return e}})(),getProviderURL(e){return e?(this.getScriptURL().match(/\.min\.js$/)&&(e+=".min"),new URL("assets/components/"+e+".js",this.getScriptURL()).href):"https://create3000.github.io/x_ite/"},getFontsURL(e){return new URL("assets/fonts/"+e,this.getScriptURL()).href},getLinetypeURL(){return new URL("assets/linetype/linetypes.png",this.getScriptURL()).href},getHatchingURL(e){return new URL("assets/hatching/"+e+".png",this.getScriptURL()).href},getLibraryURL(e){return new URL("assets/lib/"+e,this.getScriptURL()).href}};i.add("URLs","x_ite/Browser/Networking/URLs",no);const so=no;var ro=n(464);function oo(e){Fr.call(this,e),eo.call(this),this.removeGroups=!1,this.removeEmptyGroups=!0,this.combineGroupingNodes=!0,this.extensions=new Set,this.lights=[],this.usedLights=0,this.buffers=[],this.bufferViews=[],this.accessors=[],this.samplers=[],this.materials=[],this.defaultAppearance=[],this.textureTransformNodes=[],this.meshes=[],this.cameras=[],this.viewpoints=0,this.nodes=[],this.skins=[],this.joints=new Set,this.animations=0}Object.assign(Object.setPrototypeOf(oo.prototype,Fr.prototype),eo.prototype,{getEncoding:()=>"JSON",setInput(e){try{"string"==typeof e&&(e=JSON.parse(e)),this.input=e}catch{this.input=void 0}},isValid:(()=>{const e=new Set(["asset","extra","extensions","extensionsRequired","extensionsUsed","buffers","bufferViews","accessors","samplers","images","textures","materials","meshes","cameras","skins","nodes","scenes","scene","animations"]);return function(){if(!(this.input instanceof Object))return!1;if(!Object.keys(this.input).every((t=>e.has(t))))return!1;const t=this.input.asset;return t instanceof Object&&"2.0"===t.version}})(),setBuffers(e){this.buffers=e},parseIntoScene(e,t){this.rootObject(this.input).then(e).catch(t)},rootObject:async function(e){if(!(e instanceof Object))return;const t=this.getBrowser(),i=this.getScene();i.setEncoding("GLTF"),i.setProfile(t.getProfile("Interchange")),e.skins&&i.addComponent(t.getComponent("HAnim")),this.assetObject(e.asset),this.extensionsArray(e.extensionsUsed,this.extensions),this.extensionsArray(e.extensionsRequired,this.extensions),this.extensionsObject(e.extensions),await this.loadComponents(),await this.buffersArray(e.buffers),this.extensions.has("KHR_draco_mesh_compression")&&(this.draco=await this.createDraco()),this.bufferViewsArray(e.bufferViews),this.accessorsArray(e.accessors),this.samplersArray(e.samplers),await this.imagesArray(e.images),this.texturesArray(e.textures),this.materialsArray(e.materials),this.meshesArray(e.meshes),this.camerasArray(e.cameras),this.skinsArray(e.skins),this.nodesArray(e.nodes),this.scenesArray(e.scenes,e.scene),this.animationsArray(e.animations);try{this.optimizeSceneGraph(this.getExecutionContext().getRootNodes())}catch(e){console.error(e)}return this.getScene()},assetObject(e){if(!(e instanceof Object))return;const t=this.getExecutionContext(),i=t.getWorldURL(),n=t.createNode("WorldInfo",!1);for(const[t,i]of Object.entries(e))"string"==typeof i&&n._info.push(`${t}: ${i}`);if(e.extras instanceof Object)for(const[t,i]of Object.entries(e.extras))"string"==typeof i&&("title"===t?n._title=i:n._info.push(`${t}: ${i}`));n._info.sort(),n._title.getValue()||(n._title=decodeURI(new URL(i).pathname.split("/").at(-1)||i)),n.setup(),t.getRootNodes().push(n)},extensionsArray(e,t){if(!(e instanceof Array))return;const i=this.getBrowser(),n=this.getExecutionContext();for(const s of e)switch(t.add(s),s){case"KHR_texture_transform":{const e=i.getComponent("Texturing3D",2);n.hasComponent(e)||n.addComponent(e);break}}},extensionsObject(e){if(e instanceof Object)for(const[t,i]of Object.entries(e))if("KHR_lights_punctual"===t)return this.khrLightsPunctualObject(i)},khrLightsPunctualObject(e){e instanceof Object&&this.lightsArray(e.lights)},lightsArray(e){e instanceof Array&&(this.lights=e)},lightObject(e){if(!(e instanceof Object))return null;const t=this.lightType(e);if(!t)return null;const i=this.getExecutionContext(),n=this.sanitizeName(e.name),s=new Ce(1,1,1);return this.vectorValue(e.color,s)&&(t._color=s),t._global=!0,t._intensity=this.numberValue(e.intensity,1),t.setup(),n&&(i.addNamedNode(i.getUniqueName(n),t),i.addExportedNode(i.getUniqueExportName(n),t)),t},lightType(e){switch(e.type){case"directional":return this.directionalLight(e);case"spot":return this.spotLight(e);case"point":return this.pointLight(e)}},directionalLight(e){return this.getExecutionContext().createNode("DirectionalLight",!1)},spotLight(e){const t=this.getExecutionContext().createNode("SpotLight",!1);return t._radius=this.numberValue(e.range,0)||1e9,t._cutOffAngle=this.numberValue(e.outerConeAngle,Math.PI/4),t._beamWidth=this.numberValue(e.innerConeAngle,0),t._attenuation=new bt(0,0,1),t},pointLight(e){const t=this.getExecutionContext().createNode("PointLight",!1);return t._radius=this.numberValue(e.range,0)||1e9,t._attenuation=new bt(0,0,1),t},buffersArray:async function(e){e instanceof Array&&(this.buffers=await Promise.all(e.map(((e,t)=>this.bufferObject(e,t)))))},bufferObject:async function(e,t){if(!(e instanceof Object))return;if(!e.uri)return this.buffers[t];const i=new URL(e.uri,this.getExecutionContext().getBaseURL()),n=await fetch(i),s=await n.blob(),r=await s.arrayBuffer();return ro.ungzip(r)},bufferViewsArray(e){if(e instanceof Array){this.bufferViews=e;for(const t of e)t.buffer=this.bufferViewObject(t)}},bufferViewObject(e){if(!(e instanceof Object))return;const t=this.buffers[e.buffer];if(!t)return;const i=e.byteOffset||0,n=e.byteLength;return t.slice(i,i+n)},accessorsArray(e){if(e instanceof Array){this.accessors=e;for(const t of e)this.accessorObject(t)}},accessorObject:(()=>{const e=new Map([[5120,Int8Array],[5121,Uint8Array],[5122,Int16Array],[5123,Uint16Array],[5124,Int32Array],[5125,Uint32Array],[5126,Float32Array]]),t=new Map([["SCALAR",1],["VEC2",2],["VEC3",3],["VEC4",4],["MAT2",4],["MAT3",9],["MAT4",16]]);return function(i){i instanceof Object&&Object.defineProperty(i,"array",{get:()=>{const n=e.get(i.componentType),s=this.bufferViews[i.bufferView||0],r=i.byteOffset||0,o=s.byteStride||0,a=t.get(i.type),l=i.count||0,u=o?o/n.BYTES_PER_ELEMENT:a,h=Math.min(u*l,(s.byteLength-r)/n.BYTES_PER_ELEMENT),d=new n(s.buffer,r,h);if(u===a){const e=this.sparseObject(i.sparse,d,a);return Object.defineProperty(i,"array",{value:e}),e}{const e=l*a,t=new n(e);for(let i=0,n=0;i<e;n+=u)for(let e=0;e<a;++e,++i)t[i]=d[n+e];const s=this.sparseObject(i.sparse,t,a);return Object.defineProperty(i,"array",{value:s}),s}},configurable:!0})}})(),sparseObject:(()=>{const e=new Map([[5121,Uint8Array],[5123,Uint16Array],[5125,Uint32Array]]);return function(t,i,n){if(!(t instanceof Object))return i;if(!(t.indices instanceof Object))return i;if(!(t.values instanceof Object))return i;const s=e.get(t.indices.componentType),r=this.bufferViews[t.indices.bufferView],o=t.indices.byteOffset,a=new s(r.buffer,o,t.count),l=i.constructor,u=this.bufferViews[t.values.bufferView],h=t.values.byteOffset,d=new l(u.buffer,h,t.count*n);i=i.slice();let c=0;for(const e of a)for(let t=0;t<n;++t,++c)i[e*n+t]=d[c];return i}})(),samplersArray(e){if(e instanceof Array){this.samplers=e;for(const t of e)this.samplerObject(t)}},samplerObject:(()=>{const e=new Map([[9728,["NEAREST_PIXEL",!1]],[9729,["AVG_PIXEL",!1]],[9984,["NEAREST_PIXEL_NEAREST_MIPMAP",!0]],[9985,["AVG_PIXEL_NEAREST_MIPMAP",!0]],[9986,["NEAREST_PIXEL_AVG_MIPMAP",!0]],[9987,["AVG_PIXEL_AVG_MIPMAP",!0]]]),t=new Map([[9728,"NEAREST_PIXEL"],[9729,"AVG_PIXEL"]]),i=new Map([[33071,"CLAMP_TO_EDGE"],[33648,"MIRRORED_REPEAT"],[10497,"REPEAT"]]);return function(n){n instanceof Object&&Object.defineProperty(n,"texturePropertiesNode",{get:()=>{const s=this.getExecutionContext(),r=s.createNode("TextureProperties",!1),o=this.sanitizeName(n.name);o&&(s.addNamedNode(s.getUniqueName(o),r),s.addExportedNode(s.getUniqueExportName(o),r));const a=e.get(n.minFilter)??["AVG_PIXEL",!1];return r._minificationFilter=a[0],r._generateMipMaps=a[1],r._magnificationFilter=t.get(n.magFilter)??"AVG_PIXEL",r._boundaryModeS=i.get(n.wrapS)??"REPEAT",r._boundaryModeT=i.get(n.wrapT)??"REPEAT",r.setup(),Object.defineProperty(n,"texturePropertiesNode",{value:r}),r},configurable:!0})}})(),imagesArray:async function(e){e instanceof Array&&(this.images=await Promise.all(e.map((e=>this.imageObject(e)))))},imageObject:async function(e){if(!(e instanceof Object))return;if(e.uri)return e;const t=this.bufferViews[e.bufferView];if(!t)return e;const i=t.buffer,n=new Blob([new Uint8Array(i)],{type:e.mimeType}),s=await this.blobToDataUrl(n);return e.uri=s,e},blobToDataUrl:e=>new Promise(((t,i)=>{const n=new FileReader;n.onload=t,n.onerror=i,n.readAsDataURL(e)})).then((e=>e.target.result)),texturesArray(e){e instanceof Array&&(this.textures=e)},textureObject(e){if(!(e instanceof Object))return;const t=this.images[e.source];if(!t)return null;if(e.textureNode)return e.textureNode;const i=this.getExecutionContext(),n=i.createNode("ImageTexture",!1),s=this.sanitizeName(e.name||t.name);s&&(i.addNamedNode(i.getUniqueName(s),n),i.addExportedNode(i.getUniqueExportName(s),n)),n._url=[t.uri];const r=this.samplers[e.sampler];return r instanceof Object&&(n._textureProperties=r.texturePropertiesNode),n.setup(),e.textureNode=n},materialsArray(e){e instanceof Array&&(this.materials=e)},materialObject({material:e,mode:t=4}){if(!(e instanceof Object))return this.getDefaultAppearance(t);if(e.appearanceNode)return e.appearanceNode;const i=this.texCoordIndices("",e);this.texCoordIndex=[...i].reduce(Math.max,-1),this.textureTransformNodes=[],this.texCoordMappings=new Map,e.texCoordMappings=this.texCoordMappings;const n=this.getExecutionContext(),s=n.createNode("Appearance",!1),r=this.refineMaterial(t,this.createMaterial(e,t)),o=this.sanitizeName(e.name),a=new Ce(0,0,0);this.vectorValue(e.emissiveFactor,a)&&(r._emissiveColor=a),r._emissiveTexture=this.textureInfo(e.emissiveTexture),r._emissiveTextureMapping=this.textureMapping(e.emissiveTexture),this.occlusionTextureInfo(e.occlusionTexture,r),this.normalTextureInfo(e.normalTexture,r),this.materialExtensions(e.extensions,r),r.setup();for(const e of i){const t=`TEXCOORD_${e}`;if(this.textureTransformNodes.length){const e=n.createNode("TextureTransform",!1);e._mapping=t,e._translation.y=-1,e._scale.y=-1,e.setup(),this.textureTransformNodes.push(e)}this.texCoordMappings.set(t,e)}return o&&(n.addNamedNode(n.getUniqueName(o),s),n.addExportedNode(n.getUniqueExportName(o),s)),s._alphaMode=this.stringValue(e.alphaMode,"OPAQUE"),s._alphaCutoff=this.numberValue(e.alphaCutoff,.5),s._material=r,s._textureTransform=this.createMultiTextureTransform(r),s.setup(),e.appearanceNode=s},refineMaterial(e,t){if(e>3)return t;switch(t.getTypeName()){default:return t;case"Material":{const e=this.getExecutionContext().createNode("UnlitMaterial",!1);return e._emissiveColor=t._diffuseColor,e._emissiveTextureMapping=t._diffuseTextureMapping,e._emissiveTexture=t._diffuseTexture,t.dispose(),e}case"PhysicalMaterial":{const e=this.getExecutionContext().createNode("UnlitMaterial",!1);return e._emissiveColor=t._baseColor,e._emissiveTextureMapping=t._baseTextureMapping,e._emissiveTexture=t._baseTexture,t.dispose(),e}}},texCoordIndices(e,t,i=new Set){if(!(t instanceof Object))return i;e.endsWith("Texture")&&!t?.extensions?.KHR_texture_transform&&i.add(t.texCoord||0);for(const[e,n]of Object.entries(t))this.texCoordIndices(e,n,i);return i},createMaterial(e,t){const i=[this.pbrMetallicRoughnessObject.bind(this,e.pbrMetallicRoughness),this.pbrSpecularGlossinessObject.bind(this,e.extensions?.KHR_materials_pbrSpecularGlossiness),this.pbrMetallicRoughnessObject.bind(this,{})];for(const e of i){const i=e(t);if(i)return i}},pbrMetallicRoughnessObject(e,t){if(!(e instanceof Object))return null;const i=this.getExecutionContext().createNode("PhysicalMaterial",!1),n=new qe(0,0,0,0),s=new Ce(0,0,0);return this.vectorValue(e.baseColorFactor,n)&&(i._baseColor=s.set(...n),i._transparency=1-n.a),i._metallic=this.numberValue(e.metallicFactor,1),i._roughness=this.numberValue(e.roughnessFactor,1),i._baseTexture=this.textureInfo(e.baseColorTexture),i._baseTextureMapping=this.textureMapping(e.baseColorTexture),i._metallicRoughnessTexture=this.textureInfo(e.metallicRoughnessTexture),i._metallicRoughnessTextureMapping=this.textureMapping(e.metallicRoughnessTexture),i},pbrSpecularGlossinessObject(e){if(!(e instanceof Object))return null;const t=this.getExecutionContext().createNode("Material",!1),i=new qe(0,0,0,0),n=new Ce(0,0,0),s=new Ce(0,0,0);return this.vectorValue(e.diffuseFactor,i)?(t._diffuseColor=n.set(...i),t._transparency=1-i.a):t._diffuseColor=Ce.White,this.vectorValue(e.specularFactor,s)?t._specularColor=s:t._specularColor=Ce.White,t._shininess=this.numberValue(e.glossinessFactor,1),t._diffuseTexture=this.textureInfo(e.diffuseTexture),t._diffuseTextureMapping=this.textureMapping(e.diffuseTexture),t._specularTexture=this.textureInfo(e.specularGlossinessTexture),t._specularTextureMapping=this.textureMapping(e.specularGlossinessTexture),t._shininessTexture=this.textureInfo(e.specularGlossinessTexture),t._shininessTextureMapping=this.textureMapping(e.specularGlossinessTexture),t},occlusionTextureInfo(e,t){if(!(e instanceof Object))return null;t._occlusionStrength=this.numberValue(e.strength,1),t._occlusionTexture=this.textureInfo(e),t._occlusionTextureMapping=this.textureMapping(e)},normalTextureInfo(e,t){if(!(e instanceof Object))return null;t._normalScale=this.numberValue(e.scale,1),t._normalTexture=this.textureInfo(e),t._normalTextureMapping=this.textureMapping(e)},textureInfo(e){return e instanceof Object?(e.extensions instanceof Object?e.mapping=this.textureTransformObject(e.extensions.KHR_texture_transform,e.texCoord||0):e.mapping=`TEXCOORD_${e.texCoord||0}`,this.textureObject(this.textures[e.index])):null},textureMapping:e=>e instanceof Object?e.mapping:"",materialExtensions(e,t){if(e instanceof Object)for(const[i,n]of Object.entries(e))switch(i){case"KHR_materials_unlit":this.khrMaterialsUnlitObject(t);break;case"KHR_materials_emissive_strength":this.khrMaterialsEmissiveStrengthObject(n,t)}},khrMaterialsUnlitObject(e){switch(e.getTypeName()){case"PhysicalMaterial":e._emissiveColor=e._baseColor,e._emissiveTextureMapping=e._baseTextureMapping,e._emissiveTexture=e._baseTexture,e._baseColor=Ce.Black,e._baseTextureMapping="",e._baseTexture=null;break;case"Material":e._emissiveColor=e._diffuseColor,e._emissiveTextureMapping=e._diffuseTextureMapping,e._emissiveTexture=e._diffuseTexture,e._diffuseColor=Ce.Black,e._diffuseTextureMapping="",e._diffuseTexture=null}},khrMaterialsEmissiveStrengthObject(e,t){if(!(e instanceof Object))return;const i=this.numberValue(e.emissiveStrength,1);t._emissiveColor.r*=i,t._emissiveColor.g*=i,t._emissiveColor.b*=i},textureTransformObject(e,t){if(!(e instanceof Object))return;if(!this.extensions.has("KHR_texture_transform"))return;const i=this.getExecutionContext().createNode("TextureTransformMatrix3D",!1),n=`TEXCOORD_${this.texCoordIndex+this.textureTransformNodes.length+1}`,s=new ft(0,0),r=new ft(1,1),o=new ci;return o.scale(new bt(1,-1,1)),o.translate(new bt(0,-1,0)),this.vectorValue(e.offset,s)&&o.translate(new bt(...s,0)),o.rotate(new ai(0,0,-1,this.numberValue(e.rotation,0))),this.vectorValue(e.scale,r)&&o.scale(new bt(...r,1)),i._mapping=n,i._matrix=o,i.setup(),this.textureTransformNodes.push(i),this.texCoordMappings.set(n,e.texCoord??t),n},meshesArray(e){e instanceof Array&&(this.meshes=e)},meshObject(e,t){if(!(e instanceof Object))return;if(e.shapeNodes){const i=e.primitives;if(!(i instanceof Array))return e.shapeNodes;for(const e of i)this.attributesJointsArray(t,e.attributes?.JOINTS,e.attributes?.WEIGHTS);return e.shapeNodes}const i=this.primitivesArray(e,t),n=this.getExecutionContext(),s=this.sanitizeName(e.name);if(s)for(const e of i)n.addNamedNode(n.getUniqueName(s),e),n.addExportedNode(n.getUniqueExportName(s),e);return e.shapeNodes=i},primitivesArray({primitives:e,weights:t},i){if(!(e instanceof Array))return[];const n=[];for(const s of e)this.primitiveObject(s,t,i,n);return n},primitiveObject(e,t,i,n){e instanceof Object&&(this.attributesObject(e.attributes),this.targetsArray(e.targets),e.indices=this.accessors[e.indices],e.material=this.materials[e.material],this.primitiveExtensionsObject(e.extensions,e),n.push(e.shapeNode=this.createShape(e,t,i)))},attributesObject(e){if(e instanceof Object){for(const t in e)e[t]=this.accessors[e[t]];e.TEXCOORD=[],e.COLOR=[],e.JOINTS=[],e.WEIGHTS=[];for(let t=0;e["TEXCOORD_"+t];++t)e.TEXCOORD.push(e["TEXCOORD_"+t]);for(let t=0;e["COLOR_"+t];++t)e.COLOR.push(e["COLOR_"+t]);for(let t=0;e["JOINTS_"+t];++t)e.JOINTS.push(e["JOINTS_"+t]);for(let t=0;e["WEIGHTS_"+t];++t)e.WEIGHTS.push(e["WEIGHTS_"+t])}},targetsArray(e){},primitiveExtensionsObject(e,t){if(e instanceof Object)for(const[i,n]of Object.entries(e))if("KHR_draco_mesh_compression"===i)return this.khrDracoMeshCompressionObject(n,t)},khrDracoMeshCompressionObject(e,t){if(!(e instanceof Object))return;if(!this.draco)return;const i=t.attributes,n=new Uint8Array(this.bufferViews[e.bufferView].buffer);this.dracoDecodeMesh(this.draco,n,e.attributes,(function(e){Object.defineProperty(t.indices,"array",{value:e})}),(function(e,t){i[e]&&Object.defineProperty(i[e],"array",{value:t})}))},dracoDecodeMesh(e,t,i,n,s){const r=new e.DecoderBuffer,o=new e.Decoder;let a,l;r.Init(t,t.byteLength);try{const t=o.GetEncodedGeometryType(r);switch(t){case e.TRIANGULAR_MESH:a=new e.Mesh,l=o.DecodeBufferToMesh(r,a);break;case e.POINT_CLOUD:a=new e.PointCloud,l=o.DecodeBufferToPointCloud(r,a);break;default:throw new Error(`Invalid geometry type ${t}.`)}if(!l.ok()||!a.ptr)throw new Error(l.error_msg());if(t===e.TRIANGULAR_MESH){const t=3*a.num_faces(),i=4*t,s=e._malloc(i);try{const r=new Uint32Array(t);o.GetTrianglesUInt32Array(a,i,s),r.set(new Uint32Array(e.HEAPF32.buffer,s,t)),n(r)}finally{e._free(s)}}for(const[t,n]of Object.entries(i)){const i=o.GetAttributeByUniqueId(a,n),r=i.num_components(),l=a.num_points()*r,u=l*Float32Array.BYTES_PER_ELEMENT,h=e._malloc(u);try{const n=new Float32Array(l);o.GetAttributeDataArrayForAllPoints(a,i,e.DT_FLOAT32,u,h),n.set(new Float32Array(e.HEAPF32.buffer,h,l)),s(t,n)}finally{e._free(h)}}}finally{a&&e.destroy(a),e.destroy(o),e.destroy(r)}},createDraco:async function(){if(this.constructor.draco)return this.constructor.draco;{const e=await fetch(so.getLibraryURL("draco_decoder_gltf.js")),t=await e.text(),i=await new Function(t)()();return this.constructor.draco=i}},camerasArray(e){e instanceof Array&&(this.cameras=e)},cameraObject(e){if(!(e instanceof Object))return null;if(void 0!==e.viewpointNode)return e.viewpointNode;const t=this.cameraType(e);if(!t)return e.viewpointNode=null;const i=this.getExecutionContext(),n=this.sanitizeName(e.name);return n&&(i.addNamedNode(i.getUniqueName(n),t),i.addExportedNode(i.getUniqueExportName(n),t)),t._description=e.name?this.description(e.name):"Viewpoint "+ ++this.viewpoints,t._position=bt.Zero,t._centerOfRotation=new bt(0,0,-10),e.viewpointNode=t},cameraType(e){switch(e.type){case"orthographic":return this.orthographicCamera(e.orthographic);case"perspective":return this.perspectiveCamera(e.perspective);default:return null}},orthographicCamera(e){const t=this.getExecutionContext().createNode("OrthoViewpoint",!1);return"number"==typeof e.xmag&&(t._fieldOfView[0]=-e.xmag/2,t._fieldOfView[2]=+e.xmag/2),"number"==typeof e.ymag&&(t._fieldOfView[1]=-e.ymag/2,t._fieldOfView[3]=+e.ymag/2),"number"==typeof e.znear&&(t._nearDistance=e.znear),"number"==typeof e.zfar&&(t._farDistance=e.zfar),t.setup(),t},perspectiveCamera(e){const t=this.getExecutionContext().createNode("Viewpoint",!1);return"number"==typeof e.yfov&&(t._fieldOfView=e.yfov),"number"==typeof e.znear&&(t._nearDistance=e.znear),"number"==typeof e.zfar&&(t._farDistance=e.zfar),t.setup(),t},nodesArray(e){e instanceof Array&&(this.nodes=e.map(((e,t)=>this.nodeObject(e,t))),this.nodes.forEach((e=>this.nodeSkeleton(e))),this.nodes.forEach((e=>this.nodeChildren(e))))},nodeObject(e,t){if(!(e instanceof Object))return{};if(e.transformNode)return e;const i=this.getExecutionContext(),n=this.joints.has(t)?"HAnimJoint":"Transform",s=i.createNode(n,!1);e.transformNode=s;const r=this.skins[e.skin];return r&&(r.humanoidNode||(r.humanoidNode=i.createNode("HAnimHumanoid",!1)),e.humanoidNode=r.humanoidNode),e.childNode=e.humanoidNode??e.transformNode,e},nodeSkeleton(e){const t=this.skins[e.skin];if(!t)return;const i=this.nodes[t.skeleton],n=t.humanoidNode;i&&(i.humanoidNode=n,i.childNode=n)},nodeChildren(e){const t=this.getExecutionContext(),i=e.transformNode,n=this.sanitizeName(e.name);n&&(t.addNamedNode(t.getUniqueName(n),i),t.addExportedNode(t.getUniqueExportName(n),i),"HAnimJoint"===i.getTypeName()&&(i._name=e.name));const s=new bt(0,0,0),r=new ai,o=new bt(1,1,1),a=new ai,l=new $t(0,0,0,1),u=new ci;this.vectorValue(e.matrix,u)?(u.get(s,r,o,a),i._translation=s,i._rotation=r,i._scale=o,i._scaleOrientation=a):(this.vectorValue(e.translation,s)&&(i._translation=s),this.vectorValue(e.rotation,l)&&(i._rotation=new ai(l)),this.vectorValue(e.scale,o)&&(i._scale=o));const h=this.skins[e.skin],d=this.meshObject(this.meshes[e.mesh],h),c=this.cameraObject(this.cameras[e.camera]);if(c&&i._children.push(c),this.nodeExtensions(e.extensions,i),i._children.push(...this.nodeChildrenArray(e.children)),d&&i._children.push(...d),i.setup(),!h)return;const p=h.humanoidNode;if(!p.isInitialized()){const n=this.sanitizeName(h.name)||i.getName();n&&(t.addNamedNode(t.getUniqueName(n),p),t.addExportedNode(t.getUniqueExportName(n),p)),p._name=h.name??e.name??"",p._version="2.0",p._skeletalConfiguration="GLTF";const a=this.nodes[h.skeleton]?.transformNode;a&&p._skeleton.push(a);for(const[e,t]of h.joints.entries()){const i=this.nodes[t]?.transformNode,n=h.inverseBindMatrices[e]??ci.Identity;i&&(n.get(s,r,o),p._joints.push(i),p._jointBindingPositions.push(s),p._jointBindingRotations.push(r),p._jointBindingScales.push(o))}p.setup()}d?.length&&(p._skinNormal=d[0]._geometry.normal,p._skinCoord=d[0]._geometry.coord),p._skin.push(i)},nodeExtensions(e,t){e instanceof Object&&this.nodeLight(e.KHR_lights_punctual,t)},nodeLight(e,t){if(!(e instanceof Object))return;const i=this.lightObject(this.lights[e.light]);i&&(++this.usedLights,t._children.push(i))},nodeChildrenArray(e){if(!(e instanceof Array))return[];return[...new Set(e.map((e=>this.nodes[e]?.childNode)).filter((e=>e)).filter((e=>"HAnimHumanoid"!==e.getTypeName()||!e.getCloneCount())))]},skinsArray(e){if(e instanceof Array){this.skins=e;for(const t of e)this.skinObject(t)}},skinObject:function(e){if(!(e instanceof Object))return;const t=this.getScene();e.joints=this.jointsArray(e.joints),e.skeleton=e.skeleton??this.skeleton(e.joints),e.inverseBindMatrices=this.inverseBindMatricesAccessors(this.accessors[e.inverseBindMatrices]),e.textureCoordinateNode=t.createNode("TextureCoordinate",!1),e.normalNode=t.createNode("Normal",!1),e.coordinateNode=t.createNode("Coordinate",!1),e.textureCoordinateNode.setup(),e.normalNode.setup(),e.coordinateNode.setup()},jointsArray:function(e){return e instanceof Array?(e.forEach((e=>this.joints.add(e))),e):[]},skeleton:function(e){const t=new Set(e.map((e=>this.nodes[e])).filter((e=>e instanceof Object)).filter((e=>e.children instanceof Array)).flatMap((e=>e.children)));return e.filter((e=>!t.has(e)))[0]},inverseBindMatricesAccessors:function(e){if(!e)return[];const t=e.array,i=t.length,n=[];for(let e=0;e<i;e+=16)n.push(new ci(...t.subarray(e,e+16)));return n},scenesArray(e,t=0){if(!(e instanceof Array))return;const i=this.getExecutionContext(),n=e.map((e=>this.sceneObject(e))).filter((e=>e));switch(n.length){case 0:return;case 1:if(0===t)return this.usedLights&&i.getRootNodes().push(this.createNavigationInfo()),void i.getRootNodes().push(n[0]);default:{this.usedLights&&i.getRootNodes().push(this.createNavigationInfo());const e=i.createNode("Switch",!1);return i.addNamedNode(i.getUniqueName("Scenes"),e),i.addExportedNode(i.getUniqueExportName("Scenes"),e),e._whichChoice=t,e._children=n,e.setup(),void i.getRootNodes().push(e)}}},sceneObject(e){if(!(e instanceof Object))return null;const t=this.sceneNodesArray(e.nodes);switch(t.length){case 0:return null;case 1:return t[0];default:{const e=this.getExecutionContext(),i=e.createNode("Group",!1),n=this.sanitizeName(e.name);return n&&(e.addNamedNode(e.getUniqueName(n),i),e.addExportedNode(e.getUniqueExportName(n),i)),i._children=t,i.setup(),i}}},sceneNodesArray(e){return this.nodeChildrenArray(e)},animationsArray(e){if(!(e instanceof Array))return;const t=e.map((e=>this.animationObject(e))).filter((e=>e));if(!t.length)return;const i=this.getExecutionContext(),n=i.createNode("Group",!1);i.addNamedNode(i.getUniqueName("Animations"),n),i.addExportedNode(i.getUniqueExportName("Animations"),n),n._children=t,n.setup(),i.getRootNodes().push(n)},animationObject(e){if(!(e instanceof Object))return null;const t=this.getExecutionContext(),i=t.createNode("TimeSensor",!1),n=this.animationChannelsArray(e.channels,e.samplers,i);if(!n.length)return null;const s=t.createNode("Group",!1),r=this.sanitizeName(e.name);return++this.animations,t.addNamedNode(t.getUniqueName(r||`Animation${this.animations}`),s),t.addNamedNode(t.getUniqueName(`Timer${this.animations}`),i),t.addExportedNode(t.getUniqueExportName(r||`Animation${this.animations}`),s),t.addExportedNode(t.getUniqueExportName(`Timer${this.animations}`),i),i._description=this.description(e.name)||`Animation ${this.animations}`,s._children.push(i,...n),i.setup(),s.setup(),s},animationChannelsArray(e,t,i){if(!(e instanceof Array))return[];if(!(t instanceof Array))return[];const n=t.map((e=>this.accessors[e.input])).filter((e=>e?.array.length)).reduce(((e,t)=>Math.max(e,t.array.at(-1))),0);return i._cycleInterval=n,e.flatMap((e=>this.animationChannelObject(e,t,i)))},animationChannelObject(e,t,i){if(!(e instanceof Object))return[];const n=e.target;if(!(n instanceof Object))return[];const s=this.nodes[n.node]?.transformNode;if(!s)return[];const r=t[e.sampler];if(!r)return[];const o=this.accessors[r.input];if(!o)return[];if(!o.array.length)return[];const a=this.accessors[r.output];return a&&a.array.length?this.createInterpolator(i,s,n,r.interpolation,o.array,a.array,i._cycleInterval.getValue()):[]},createNavigationInfo(){const e=this.getExecutionContext().createNode("NavigationInfo",!1);return e._headlight=!1,e.setup(),e},createShape(e,t,i){const n=this.getExecutionContext().createNode("Shape",!1),s=this.materialObject(e),r=this.createGeometry(e,t,i);return n._appearance=s,n._geometry=r,n.setup(),n},getDefaultAppearance(e){if(e=e>3,this.defaultAppearance[e])return this.defaultAppearance[e];const t=this.getExecutionContext(),i=t.createNode("Appearance",!1),n=t.createNode(e?"PhysicalMaterial":"UnlitMaterial",!1);return i._alphaMode="OPAQUE",i._material=n,n.setup(),i.setup(),this.defaultAppearance[e]=i},createMultiTextureTransform(e){if(!+e.getTextureBits())return null;const t=this.textureTransformNodes.sort(((e,t)=>g.cmp(e._mapping.getValue(),t._mapping.getValue())));switch(t.length){case 0:{if(this.textureTransformNode)return this.textureTransformNode;const e=this.getExecutionContext().createNode("TextureTransform",!1);return e._translation.y=-1,e._scale.y=-1,e.setup(),this.textureTransformNode=e}case 1:return t[0];default:{const e=this.getExecutionContext().createNode("MultiTextureTransform",!1);return e._textureTransform=t,e.setup(),e}}},createGeometry(e,t,i){switch(e.mode){case 0:return this.createPointSet(e,t,i);case 1:return e.indices?this.createIndexedLineSet(e,t,i,1):this.createLineSet(e,t,i);case 2:return this.createIndexedLineSet(e,t,i,2);case 3:return this.createIndexedLineSet(e,t,i,3);default:case 4:return e.indices?this.createIndexedTriangleSet(e,t,i):this.createTriangleSet(e,t,i);case 5:return e.indices?this.createIndexedTriangleStripSet(e,t,i):this.createTriangleStripSet(e,t,i);case 6:return e.indices?this.createIndexedTriangleFanSet(e,t,i):this.createTriangleFanSet(e,t,i)}},createPointSet({attributes:e,material:t,targets:i},n,s){const r=this.getExecutionContext().createNode("PointSet",!1);return r._color=this.createColor(e.COLOR[0],t),r._normal=this.createNormal(e.NORMAL,i,n),r._coord=this.createCoordinate(e.POSITION,i,n),this.attributesJointsArray(s,e.JOINTS,e.WEIGHTS),this.skinGeometry(s,r),r.setup(),r},createIndexedLineSet({attributes:e,indices:t,material:i,targets:n},s,r,o){const a=this.getExecutionContext().createNode("IndexedLineSet",!1);switch(a._color=this.createColor(e.COLOR[0],i),a._normal=this.createNormal(e.NORMAL,n,s),a._coord=this.createCoordinate(e.POSITION,n,s),o){case 1:{const e=a._coordIndex,i=t.array,n=i.length;for(let t=0;t<n;t+=2)e.push(i[t],i[t+1],-1);break}case 2:{const e=a._coordIndex;if(t){for(const i of t.array)e.push(i);e.length&&e.push(e[0],-1)}else{const t=a._coord;if(t?.point.length){for(const i of t.point.keys())e.push(i);e.push(0,-1)}}break}case 3:{const e=a._coordIndex;if(t){for(const i of t.array)e.push(i);e.length&&e.push(-1)}else{const t=a._coord;if(t?.point.length){for(const i of t.point.keys())e.push(i);e.push(-1)}}break}}return this.attributesJointsArray(r,e.JOINTS,e.WEIGHTS),this.skinGeometry(r,a),a.setup(),a},createLineSet({attributes:e,material:t,targets:i},n,s){const r=this.getExecutionContext().createNode("LineSet",!1);return r._color=this.createColor(e.COLOR[0],t),r._normal=this.createNormal(e.NORMAL,i,n),r._coord=this.createCoordinate(e.POSITION,i,n),this.attributesJointsArray(s,e.JOINTS,e.WEIGHTS),this.skinGeometry(s,r),r.setup(),r},createIndexedTriangleSet({attributes:e,indices:t,material:i,targets:n},s,r){const o=this.getExecutionContext().createNode("IndexedTriangleSet",!1);return o._solid=!i?.doubleSided,o._index=t.array,o._color=this.createColor(e.COLOR[0],i),o._texCoord=this.createMultiTextureCoordinate(e.TEXCOORD,i),o._normal=this.createNormal(e.NORMAL,n,s),o._coord=this.createCoordinate(e.POSITION,n,s),o._normalPerVertex=!!o._normal.getValue(),this.attributesJointsArray(r,e.JOINTS,e.WEIGHTS),this.skinGeometry(r,o),o.setup(),o},createTriangleSet({attributes:e,material:t,targets:i},n,s){const r=this.getExecutionContext().createNode("TriangleSet",!1);return r._solid=!t?.doubleSided,r._color=this.createColor(e.COLOR[0],t),r._texCoord=this.createMultiTextureCoordinate(e.TEXCOORD,t),r._normal=this.createNormal(e.NORMAL,i,n),r._coord=this.createCoordinate(e.POSITION,i,n),r._normalPerVertex=!!r._normal.getValue(),this.attributesJointsArray(s,e.JOINTS,e.WEIGHTS),this.skinGeometry(s,r),r.setup(),r},createIndexedTriangleStripSet({attributes:e,indices:t,material:i,targets:n},s,r){const o=this.getExecutionContext().createNode("IndexedTriangleStripSet",!1);return o._solid=!i?.doubleSided,o._index=t.array,o._color=this.createColor(e.COLOR[0],i),o._texCoord=this.createMultiTextureCoordinate(e.TEXCOORD,i),o._normal=this.createNormal(e.NORMAL,n,s),o._coord=this.createCoordinate(e.POSITION,n,s),o._normalPerVertex=!!o._normal.getValue(),this.attributesJointsArray(r,e.JOINTS,e.WEIGHTS),this.skinGeometry(r,o),o.setup(),o},createTriangleStripSet({attributes:e,material:t,targets:i},n,s){const r=this.getExecutionContext().createNode("TriangleStripSet",!1);r._solid=!t?.doubleSided,r._color=this.createColor(e.COLOR[0],t),r._texCoord=this.createMultiTextureCoordinate(e.TEXCOORD,t),r._normal=this.createNormal(e.NORMAL,i,n),r._coord=this.createCoordinate(e.POSITION,i,n),r._normalPerVertex=!!r._normal.getValue();const o=r._coord;return o&&o.point.length&&(r._stripCount=[o.point.length]),this.attributesJointsArray(s,e.JOINTS,e.WEIGHTS),this.skinGeometry(s,r),r.setup(),r},createIndexedTriangleFanSet({attributes:e,indices:t,material:i,targets:n},s,r){const o=this.getExecutionContext().createNode("IndexedTriangleFanSet",!1);return o._solid=!i?.doubleSided,o._index=t.array,o._color=this.createColor(e.COLOR[0],i),o._texCoord=this.createMultiTextureCoordinate(e.TEXCOORD,i),o._normal=this.createNormal(e.NORMAL,n,s),o._coord=this.createCoordinate(e.POSITION,n,s),o._normalPerVertex=!!o._normal.getValue(),this.attributesJointsArray(r,e.JOINTS,e.WEIGHTS),this.skinGeometry(r,o),o.setup(),o},createTriangleFanSet({attributes:e,material:t,targets:i},n,s){const r=this.getExecutionContext().createNode("TriangleFanSet",!1);r._solid=!t?.doubleSided,r._color=this.createColor(e.COLOR[0],t),r._texCoord=this.createMultiTextureCoordinate(e.TEXCOORD,t),r._normal=this.createNormal(e.NORMAL,i,n),r._coord=this.createCoordinate(e.POSITION,i,n),r._normalPerVertex=!!r._normal.getValue();const o=r._coord;return o&&o.point.length&&(r._fanCount=[o.point.length]),this.attributesJointsArray(s,e.JOINTS,e.WEIGHTS),this.skinGeometry(s,r),r.setup(),r},createColor:(()=>{const e=new Map([["VEC3","Color"],["VEC4","ColorRGBA"]]);return function(t,i){if(!(t instanceof Object))return null;const n=e.get(t.type);if(!n)return null;if(t.colorNode)return t.colorNode;const s=this.getExecutionContext(),r="OPAQUE"===this.materialObject({material:i})._alphaMode.getValue(),o=s.createNode(r?"Color":n,!1),a=r&&"Color"!==n?t.array.filter(((e,t)=>(t+1)%4)):t.array;switch(t.componentType){case 5120:case 5122:case 5124:break;case 5121:o._color=a.map((e=>e/255));break;case 5123:o._color=a.map((e=>e/65535));break;case 5125:o._color=a.map((e=>e/4294967295));break;case 5126:o._color=a}return o.setup(),t.colorNode=o}})(),createMultiTextureCoordinate(e,t){if(!+this.materialObject({material:t})._material.getValue().getTextureBits())return null;if(e.textureCoordinateNode)return e.textureCoordinateNode;switch(t.texCoordMappings.size){case 0:return null;case 1:return e.textureCoordinateNode=[...t.texCoordMappings.entries()].map((([t,i])=>this.createTextureCoordinate(e[i],t)))[0];default:{const i=[...t.texCoordMappings.entries()].map((([t,i])=>this.createTextureCoordinate(e[i],t))).filter((e=>e)).sort(((e,t)=>g.cmp(e._mapping.getValue(),t._mapping.getValue())));if(!i.length)return null;const n=this.getExecutionContext().createNode("MultiTextureCoordinate",!1);return n._texCoord=i,n.setup(),e.textureCoordinateNode=n}}},createTextureCoordinate(e,t){if("VEC2"!==e?.type)return null;if(e[t])return e[t];const i=this.getExecutionContext().createNode("TextureCoordinate",!1);return i._mapping=t,i._point=e.array,i.setup(),e[t]=i},createNormal(e,t,i){if("VEC3"!==e?.type)return null;if(e.normalNode)return e.normalNode;const n=this.getExecutionContext().createNode("Normal",!1);if(n._vector=e.array,t instanceof Array&&i instanceof Array){e.field=n._vector.copy();const s=this.applyMorphTargets(n._vector,t,"NORMAL",i);n._vector.length=0;for(const e of s)n._vector.push(e)}else e.field=n._vector;return n.setup(),e.normalNode=n},createCoordinate(e,t,i){if("VEC3"!==e?.type)return null;if(e.coordinateNode)return e.coordinateNode;const n=this.getExecutionContext().createNode("Coordinate",!1);if(n._point=e.array,t instanceof Array&&i instanceof Array){e.field=n._point.copy();const s=this.applyMorphTargets(n._point,t,"POSITION",i);n._point.length=0;for(const e of s)n._point.push(e)}else e.field=n._point;return n.setup(),e.coordinateNode=n},attributesJointsArray:function(e,t,i){if(e instanceof Object&&t instanceof Array&&i instanceof Array)for(let n=0,s=t.length;n<s;++n)this.attributesJointsObject(e,t[n],i[n])},attributesJointsObject:function(e,t,i){if("VEC4"!==t?.type)return;if("VEC4"!==i?.type)return;const n=e.coordinateNode._point.length,s=t.array,r=i.array,o=s.length/4;for(let t=0;t<o;++t)for(let i=0;i<4;++i){const o=r[4*t+i];if(0===o)continue;const a=e.joints[s[4*t+i]],l=this.nodes[a]?.transformNode;l&&(l._skinCoordIndex.push(t+n),l._skinCoordWeight.push(o))}},skinGeometry:function(e,t){if(!(e instanceof Object))return;const i=e.textureCoordinateNode,n=e.normalNode,s=e.coordinateNode,r=s._point.length,o=t._texCoord?.getValue(),a=t._normal?.getValue(),l=t._coord?.getValue();if(t._coordIndex&&(t._coordIndex=t._coordIndex.map((e=>e<0?-1:e+r))),t._index&&(t._index=t._index.map((e=>e<0?-1:e+r))),o){const e=i._point;o._point.forEach(((t,i)=>e[i+r]=t)),t._texCoord=i}if(a){const e=n._vector;a._vector.forEach(((t,i)=>e[i+r]=t)),t._normal=n}if(l){const e=s._point;l._point.forEach(((t,i)=>e[i+r]=t)),t._coord=s}},createInterpolator(e,t,i,n,s,r,o){const a=this.getExecutionContext();switch(i.path){case"translation":{const i=this.createPositionInterpolator(n,s,r,o);return a.addNamedNode(a.getUniqueName("TranslationInterpolator"),i),a.addRoute(e,"fraction_changed",i,"set_fraction"),a.addRoute(i,"value_changed",t,"set_translation"),i}case"rotation":{const i=this.createOrientationInterpolator(n,s,r,o);return a.addNamedNode(a.getUniqueName("RotationInterpolator"),i),a.addRoute(e,"fraction_changed",i,"set_fraction"),a.addRoute(i,"value_changed",t,"set_rotation"),i}case"scale":{const i=this.createPositionInterpolator(n,s,r,o);return a.addNamedNode(a.getUniqueName("ScaleInterpolator"),i),a.addRoute(e,"fraction_changed",i,"set_fraction"),a.addRoute(i,"value_changed",t,"set_scale"),i}case"weights":{const t=this.nodes[i.node],l=this.meshes[t.mesh],u=l?.primitives,h=[];if(!(u instanceof Array))return null;for(const{shapeNode:t,targets:i,attributes:l}of u){const u=t._geometry.getValue();if(!u)continue;const d=this.createArrayInterpolator("Coordinate",n,s,r,o,i,l,"POSITION");d&&(h.push(d),a.addRoute(e,"fraction_changed",d,"set_fraction"),a.addRoute(d,"value_changed",u._coord,"set_point"));const c=this.createArrayInterpolator("Normal",n,s,r,o,i,l,"NORMAL");c&&(h.push(c),a.addRoute(e,"fraction_changed",c,"set_fraction"),a.addRoute(c,"value_changed",u._normal,"set_vector"))}return h}default:return[]}},createPositionInterpolator(e,t,i,n){const s=this.getExecutionContext();switch(e){case"STEP":{const e=s.createNode("PositionInterpolator",!1);e._key.push(t[0]/n);for(let i=1,s=t.length;i<s;++i)e._key.push(t[i]/n,t[i]/n);e._keyValue.push(new bt(i[0],i[1],i[2]));for(let t=0,n=i.length-3;t<n;t+=3)e._keyValue.push(new bt(i[t+0],i[t+1],i[t+2]),new bt(i[t+3],i[t+4],i[t+5]));return e.setup(),e}default:case"LINEAR":{const e=s.createNode("PositionInterpolator",!1);return e._key=t.map((e=>e/n)),e._keyValue=i,e.setup(),e}case"CUBICSPLINE":{const e=s.createNode("PositionInterpolator",!1),r=[];for(let e=0,t=i.length;e<t;e+=3)r.push(new bt(i[e+0],i[e+1],i[e+2]));const o=[...Array(Math.floor(30*t.at(-1))).keys()].map(((e,i,n)=>i/(n.length-1)*t.at(-1)));for(const i of o)e._key.push(i/n),e._keyValue.push(this.cubicSplineVector(i,t,r));return e.setup(),e}}},createOrientationInterpolator(e,t,i,n){const s=this.getExecutionContext();switch(e){case"STEP":{const e=s.createNode("OrientationInterpolator",!1);e._key.push(t[0]/n);for(let i=1,s=t.length;i<s;++i)e._key.push(t[i]/n,t[i]/n);e._keyValue.push(new ai(new $t(i[0],i[1],i[2],i[3])));for(let t=0,n=i.length-4;t<n;t+=4)e._keyValue.push(new ai(new $t(i[t+0],i[t+1],i[t+2],i[t+3])),new ai(new $t(i[t+4],i[t+5],i[t+6],i[t+7])));return e.setup(),e}default:case"LINEAR":{const e=s.createNode("OrientationInterpolator",!1);e._key=t.map((e=>e/n));for(let t=0,n=i.length;t<n;t+=4)e._keyValue.push(new ai(new $t(i[t+0],i[t+1],i[t+2],i[t+3])));return e.setup(),e}case"CUBICSPLINE":{const e=s.createNode("OrientationInterpolator",!1),r=[];for(let e=0,t=i.length;e<t;e+=4)r.push(new $t(i[e+0],i[e+1],i[e+2],i[e+3]));const o=[...Array(Math.floor(30*t.at(-1))).keys()].map(((e,i,n)=>i/(n.length-1)*t.at(-1)));for(const i of o){const s=this.cubicSplineVector(i,t,r).normalize();e._key.push(i/n),e._keyValue.push(new ai(s))}return e.setup(),e}}},createArrayInterpolator(e,t,i,n,s,r,o,a){const l=this.getExecutionContext(),u=o[a];if(!u)return null;switch(t){case"STEP":{const t=l.createNode(`${e}Interpolator`,!1);t._key.push(i[0]/s);for(let e=1,n=i.length;e<n;++e)t._key.push(i[e]/s,i[e]/s);const o=Array.from(r.keys(),(e=>n[e]));for(const e of this.applyMorphTargets(u.field,r,a,o))t._keyValue.push(e);for(let e=1,s=i.length;e<s;++e){const i=Array.from(r.keys(),(t=>n[e*r.length+t])),s=this.applyMorphTargets(u.field,r,a,i);for(const e of s)t._keyValue.push(e);for(const e of s)t._keyValue.push(e)}return t.setup(),t}default:case"LINEAR":{const t=l.createNode(`${e}Interpolator`,!1);t._key=i.map((e=>e/s));for(const e of i.keys()){const i=Array.from(r.keys(),(t=>n[e*r.length+t]));for(const e of this.applyMorphTargets(u.field,r,a,i))t._keyValue.push(e)}return t.setup(),t}case"CUBICSPLINE":{const t=l.createNode(`${e}Interpolator`,!1),o=[...Array(Math.floor(30*i.at(-1))).keys()].map(((e,t,n)=>t/(n.length-1)*i.at(-1)));for(const e of o){t._key.push(e/s);const o=Array.from(r.keys(),(t=>this.cubicSplineScalarArray(e,i,n,r.length,t)));for(const e of this.applyMorphTargets(u.field,r,a,o))t._keyValue.push(e)}return t.setup(),t}}},applyMorphTargets:function(){const e=new bt(0,0,0);return function(t,i,n,s){const r=Array.from(t,(e=>e.getValue().copy()));for(const[t,o]of i.entries()){const i=s[t];if(!i)continue;const a=this.accessors[o[n]];if("VEC3"!==a?.type)continue;const l=a.array,u=l.length;for(let t=0,n=0;t<u;t+=3,++n)r[n].add(e.set(l[t],l[t+1],l[t+2]).multiply(i))}return r}}(),cubicSplineVector(e,t,i){const n=g.clamp(g.upperBound(t,0,t.length,e),1,t.length-1),s=n-1,r=t[n]-t[s],o=(e-t[s])/r,a=o*o,l=a*o,u=i[3*s+1].copy(),h=i[3*s+2].copy(),d=i[3*n+1].copy(),c=i[3*n+0].copy();return u.multiply(2*l-3*a+1),h.multiply(r*(l-2*a+o)),d.multiply(-2*l+3*a),c.multiply(r*(l-a)),u.add(h).add(d).add(c)},cubicSplineScalarArray(e,t,i,n,s){const r=g.clamp(g.upperBound(t,0,t.length,e),1,t.length-1),o=r-1,a=t[r]-t[o],l=(e-t[o])/a,u=l*l,h=u*l,d=i[(o+1)*n+s],c=i[(o+2)*n+s],p=i[(r+1)*n+s],f=i[(r+0)*n+s];return d*=2*h-3*u+1,c*=a*(h-2*u+l),p*=-2*h+3*u,f*=a*(h-u),d+c+p+f},vectorValue:(e,t)=>e instanceof Array&&(e.length===t.length&&(t.set(...e),!0)),numberValue:(e,t)=>"number"!=typeof e?t:e,stringValue:(e,t)=>"string"!=typeof e?t:e,description:e=>e?.replace(/_+/g," ").trim()??""});const ao=oo;i.add("GLTF2Parser","x_ite/Parser/GLTF2Parser",ao);const lo=ao;var uo=n(464);function ho(e){Fr.call(this,e),this.json=[],this.buffers=[]}Object.assign(Object.setPrototypeOf(ho.prototype,Fr.prototype),{getEncoding:()=>"ARRAY_BUFFER",setInput(e){this.arrayBuffer=e,this.dataView=new DataView(e)},isValid(){return this.arrayBuffer instanceof ArrayBuffer&&(!(this.dataView.byteLength<12)&&(1179937895===this.dataView.getUint32(0,!0)&&(2===this.dataView.getUint32(4,!0)&&this.dataView.getUint32(8,!0)===this.dataView.byteLength)))},parseIntoScene(e,t){this.glb().then(e).catch(t)},glb:async function(){this.chunks();const e=new lo(this.getScene());e.setBuffers(this.buffers);for(const t of this.json)e.setInput(t),e.isValid()&&await e.rootObject(e.input);return this.getScene()},chunks(){for(let e=12;e<this.dataView.byteLength;){const t=this.dataView.getUint32(e,!0),i=this.dataView.getUint32(e+4,!0);switch(e+=8,i){case 1313821514:this.json.push(uo.decodeText(this.arrayBuffer.slice(e,e+t)));break;case 5130562:this.buffers.push(this.arrayBuffer.slice(e,e+t))}e+=t}return this.getScene()}});const co=ho;i.add("GLB2Parser","x_ite/Parser/GLB2Parser",co);const po=co;var go=n(464);const fo=Pr({whitespaces:/[\x20\n\t\r]+/gy,whitespacesNoLineTerminator:/[\x20\t]+/gy,comment:/#.*?(?=[\n\r])/gy,untilEndOfLine:/([^\r\n]+)/gy,mtllib:/\bmtllib\b/gy,usemtl:/\busemtl\b/gy,newmtl:/\bnewmtl\b/gy,Ka:/\bKa\b/gy,Kd:/\bKd\b/gy,Ks:/\bKs\b/gy,Ns:/\bNs\b/gy,d:/\bd\b/gy,Tr:/\bTr\b/gy,illum:/\billum\b/gy,map_Kd:/\bmap_Kd\b/gy,o:/\bo\b/gy,v:/\bv\b/gy,vt:/\bvt\b/gy,vn:/\bvn\b/gy,g:/\bg\b/gy,s:/\bs\b/gy,off:/\boff\b/gy,f:/\bf\b/gy,slash:/\//gy,int32:/((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/gy,double:/([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/gy,constants:/([+-])((?:NAN|INF|INFINITY))/giy});function mo(e){Fr.call(this,e),eo.call(this),this.removeGroups=!0,this.removeEmptyGroups=!0,this.combineGroupingNodes=!1,this.smoothingGroup=0,this.smoothingGroups=new Map,this.groups=new Map,this.materials=new Map,this.textures=new Map,this.point2=new ft,this.point3=new bt,this.lastIndex=0}function _o(e,t){this.executionContext=e,this.input=t,this.material=e.createNode("Material"),this.materials=new Map,this.textures=new Map,this.color3=new Ce(0,0,0),this.id=""}Object.assign(Object.setPrototypeOf(mo.prototype,Fr.prototype),eo.prototype,{CONSTANTS:new Map([["NAN",NaN],["INF",1/0],["INFINITY",1/0]]),getEncoding:()=>"STRING",setInput(e){this.input=e},isValid(){return"string"==typeof this.input&&!!this.input.match(/^(?:[\x20\n\t\r]+|#.*?[\r\n])*\b(?:mtllib|usemtl|o|g|s|vt|vn|v|f)\b/)},parseIntoScene(e,t){this.obj().then(e).catch(t)},obj:async function(){const e=this.getBrowser(),t=this.getScene();return t.setEncoding("OBJ"),t.setProfile(e.getProfile("Interchange")),await this.loadComponents(),this.object=t.createNode("Transform"),this.group=t.createNode("Group"),this.defaultMaterial=t.createNode("Material"),this.texCoord=t.createNode("TextureCoordinate"),this.normal=t.createNode("Normal"),this.coord=t.createNode("Coordinate"),this.object.children.push(this.group),t.getRootNodes().push(this.object),await this.statements(),this.optimizeSceneGraph(t.getRootNodes()),this.getScene()},comments(){for(;this.comment(););},comment(){return this.whitespaces(),!!fo.comment.parse(this)},whitespaces(){fo.whitespaces.parse(this)},whitespacesNoLineTerminator(){fo.whitespacesNoLineTerminator.parse(this)},statements:async function(){for(;await this.statement(););},statement:async function(){return!!await this.mtllibs()||(!!this.usemtl()||(!!this.o()||(!!this.g()||(!!this.s()||(!!this.vts()||(!!this.vns()||(!!this.vs()||(!!this.fs()||!!fo.untilEndOfLine.parse(this)))))))))},mtllibs:async function(){if(this.comments(),fo.mtllib.parse(this)){if(this.whitespacesNoLineTerminator(),fo.untilEndOfLine.parse(this)){const e=this.result[1].trim().split(/\s+/);await Promise.all(e.map((e=>this.mtllib(e))))}return!0}return!1},mtllib:async function(e){try{const t=this.getExecutionContext(),i=new URL(e,t.getBaseURL()),n=await fetch(i),s=await n.arrayBuffer(),r=new _o(t,go.decodeText(go.ungzip(s)));r.parse();for(const[e,i]of r.materials){const n=this.sanitizeName(e);n&&(t.addNamedNode(t.getUniqueName(n),i),t.addExportedNode(t.getUniqueExportName(n),i)),this.materials.set(e,i)}for(const[e,i]of r.textures){const n=this.sanitizeName(e);n&&(t.addNamedNode(t.getUniqueName(n),i),t.addExportedNode(t.getUniqueExportName(n),i)),this.textures.set(e,i)}}catch(e){console.warn(e)}},usemtl(){if(this.comments(),fo.usemtl.parse(this)){if(this.whitespacesNoLineTerminator(),fo.untilEndOfLine.parse(this)){const e=this.result[1];this.material=this.materials.get(e)||this.defaultMaterial,this.texture=this.textures.get(e);const t=this.smoothingGroups.get(this.group.getNodeName());t&&t.delete(this.smoothingGroup)}return!0}return!1},o(){if(this.comments(),fo.o.parse(this)){if(this.whitespacesNoLineTerminator(),fo.untilEndOfLine.parse(this)){const e=this.getExecutionContext(),t=this.sanitizeName(this.result[1]);this.group.children.length&&(this.object=e.createNode("Transform"),this.group=e.createNode("Group"),this.object.children.push(this.group),e.getRootNodes().push(this.object)),t&&(e.addNamedNode(e.getUniqueName(t),this.object),e.addExportedNode(e.getUniqueExportName(t),this.object))}return!0}return!1},g(){if(this.comments(),fo.g.parse(this)){if(this.whitespacesNoLineTerminator(),fo.untilEndOfLine.parse(this)){const e=this.getExecutionContext(),t=this.result[1],i=this.sanitizeName(t),n=this.groups.get(t);n?this.group=n:this.group.children.length&&(this.group=e.createNode("Group"),this.object.children.push(this.group)),this.groups.set(t,this.group),i&&(e.addNamedNode(e.getUniqueName(i),this.group),e.addExportedNode(e.getUniqueExportName(i),this.group)),this.smoothingGroup=0}return!0}return!1},s(){return this.comments(),!!fo.s.parse(this)&&(this.whitespacesNoLineTerminator(),fo.off.parse(this)?(this.smoothingGroup=0,!0):!this.int32()||(this.smoothingGroup=this.value,!0))},vts(){const e=this.texCoord.point;let t=!1;for(;this.vt(e);)t=!0;return t},vt(e){if(this.comments(),fo.vt.parse(this)){if(this.vec2())return e.push(this.point2),!0;throw new Error("Expected a texture coordinate.")}return!1},vns(){const e=this.normal.vector;let t=!1;for(;this.vn(e);)t=!0;return t},vn(e){if(this.comments(),fo.vn.parse(this)){if(this.vec3())return e.push(this.point3),!0;throw new Error("Expected a normal vector.")}return!1},vs(){const e=this.coord.point;let t=!1;for(;this.v(e);)t=!0;return t},v(e){if(this.comments(),fo.v.parse(this)){if(this.vec3())return e.push(this.point3),!0;throw new Error("Expected a vertex coordinate.")}return!1},fs(){if(this.comments(),fo.f.lookahead(this)){try{this.shape=this.smoothingGroups.get(this.group.getNodeName()).get(this.smoothingGroup),this.geometry=this.shape.geometry}catch{const e=this.getExecutionContext(),t=e.createNode("Appearance");this.geometry=e.createNode("IndexedFaceSet"),this.shape=e.createNode("Shape"),t.material=this.material,t.texture=this.texture,this.geometry.creaseAngle=this.smoothingGroup?Math.PI:0,this.shape.appearance=t,this.shape.geometry=this.geometry,this.group.children.push(this.shape),this.smoothingGroups.has(this.group.getNodeName())||this.smoothingGroups.set(this.group.getNodeName(),new Map),this.smoothingGroups.get(this.group.getNodeName()).set(this.smoothingGroup,this.shape)}for(;this.f(););return this.geometry.texCoordIndex.length&&(this.geometry.texCoord=this.texCoord),this.geometry.normalIndex.length&&(this.geometry.normal=this.normal),this.geometry.coord=this.coord,!0}return!1},f(){if(this.comments(),fo.f.parse(this)){const e=this.geometry,t=e.texCoordIndex,i=e.normalIndex,n=e.coordIndex,s=t.length,r=i.length,o=this.texCoord.point.length,a=this.normal.vector.length,l=this.coord.point.length;for(;this.indices(t,i,n,o,a,l););return t.length!==s&&t.push(-1),i.length!==r&&i.push(-1),n.push(-1),!0}return!1},indices(e,t,i,n,s,r){return!!this.int32()&&(i.push(this.index(this.value,r)),fo.slash.parse(this)&&(this.int32()&&e.push(this.index(this.value,n)),fo.slash.parse(this)&&this.int32()&&t.push(this.index(this.value,s))),!0)},index(e,t){if(0===e)throw new Error("Invalid index.");return e<0?t+e:e-1},int32(){return this.whitespaces(),!!fo.int32.parse(this)&&(this.value=parseInt(this.result[1]),!0)},double(){return this.whitespaces(),fo.double.parse(this)?(this.value=parseFloat(this.result[1]),!0):!!fo.constants.parse(this)&&(this.value=this.CONSTANTS.get(this.result[2].toUpperCase()),"-"===this.result[1]&&(this.value=-this.value),!0)},vec2(){return!(!this.double()||(this.point2.x=this.value,!this.double()))&&(this.point2.y=this.value,!0)},vec3(){return!!(this.double()&&(this.point3.x=this.value,this.double()&&(this.point3.y=this.value,this.double())))&&(this.point3.z=this.value,!0)}}),Object.assign(_o.prototype,{CONSTANTS:new Map([["NAN",NaN],["INF",1/0],["INFINITY",1/0]]),parse(){try{this.statements()}catch(e){b}},comments(){for(;this.comment(););},comment(){return this.whitespaces(),!!fo.comment.parse(this)},whitespaces(){fo.whitespaces.parse(this)},whitespacesNoLineTerminator(){fo.whitespacesNoLineTerminator.parse(this)},statements(){for(;this.statement(););},statement(){return!!this.newmtl()||(!!this.Ka()||(!!this.Kd()||(!!this.Ks()||(!!this.Ns()||(!!this.d()||(!!this.Tr()||(!!this.illum()||(!!this.map_Kd()||!!fo.untilEndOfLine.parse(this)))))))))},newmtl(){return this.comments(),!!fo.newmtl.parse(this)&&(this.whitespacesNoLineTerminator(),this.id="",fo.untilEndOfLine.parse(this)?(this.id=this.result[1],this.material=this.executionContext.createNode("Material"),this.materials.set(this.id,this.material),!0):(fo.untilEndOfLine.parse(this),!0))},Ka(){if(this.comments(),fo.Ka.parse(this)){if(this.col3()){const e=this.color3.getHSV([]);return this.material.ambientIntensity=e[2],!0}return fo.untilEndOfLine.parse(this),!0}return!1},Kd(){return this.comments(),!!fo.Kd.parse(this)&&(this.col3()?(this.material.diffuseColor=this.color3,!0):(fo.untilEndOfLine.parse(this),!0))},Ks(){return this.comments(),!!fo.Ks.parse(this)&&(this.col3()?(this.material.specularColor=this.color3,!0):(fo.untilEndOfLine.parse(this),!0))},Ns(){return this.comments(),!!fo.Ns.parse(this)&&(this.double()?(this.material.shininess=this.value/1e3,!0):(fo.untilEndOfLine.parse(this),!0))},d(){return this.comments(),!!fo.d.parse(this)&&(this.double()?(this.material.transparency=1-this.value,!0):(fo.untilEndOfLine.parse(this),!0))},Tr(){return this.comments(),!!fo.Tr.parse(this)&&(this.double()?(this.material.transparency=this.value,!0):(fo.untilEndOfLine.parse(this),!0))},illum(){return this.comments(),!!fo.illum.parse(this)&&(this.int32()||fo.untilEndOfLine.parse(this),!0)},map_Kd(){if(this.comments(),fo.map_Kd.parse(this)){if(this.whitespacesNoLineTerminator(),fo.untilEndOfLine.parse(this)){const e=this.result[1];if(e.length&&this.id.length){const t=e.trim().split(/\s+/);if(t.length){const e=this.executionContext.createNode("ImageTexture"),i=t.at(-1).replace(/\\/g,"/");e.url=[i],this.textures.set(this.id,e)}}return!0}return fo.untilEndOfLine.parse(this),!0}return!1},int32(){return this.whitespaces(),!!fo.int32.parse(this)&&(this.value=parseInt(this.result[1]),!0)},double(){return this.whitespaces(),fo.double.parse(this)?(this.value=parseFloat(this.result[1]),!0):!!fo.constants.parse(this)&&(this.value=this.CONSTANTS.get(this.result[2].toUpperCase()),"-"===this.result[1]&&(this.value=-this.value),!0)},col3(){return!!(this.double()&&(this.color3.r=this.value,this.double()&&(this.color3.g=this.value,this.double())))&&(this.color3.b=this.value,!0)}});const xo=mo;i.add("OBJParser","x_ite/Parser/OBJParser",xo);const yo=xo,wo=Pr({whitespaces:/[\x20\n\t\r]+/gy,whitespacesNoLineTerminator:/[\x20\t]+/gy,comment:/;.*?(?=[\n\r])/gy,untilEndOfLine:/([^\r\n]+)/gy,solid:/solid/gy,facet:/facet/gy,normal:/normal/gy,outer:/outer/gy,loop:/loop/gy,vertex:/vertex/gy,endloop:/endloop/gy,endfacet:/endfacet/gy,endsolid:/endsolid/gy,name:/(\w+)/gy,double:/([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/gy,constants:/([+-])((?:NAN|INF|INFINITY))/giy});function bo(e){Fr.call(this,e),this.vector=[],this.point=[]}Object.assign(Object.setPrototypeOf(bo.prototype,Fr.prototype),{CONSTANTS:new Map([["NAN",NaN],["INF",1/0],["INFINITY",1/0]]),getEncoding:()=>"STRING",setInput(e){this.input=e},isValid(){return"string"==typeof this.input&&!!this.input.match(/^(?:[\x20\n\t\r]+|;.*?[\r\n])*\b(?:solid)\b/)},parseIntoScene(e,t){this.stl().then(e).catch(t)},stl:async function(){const e=this.getBrowser(),t=this.getScene();return t.setEncoding("STL"),t.setProfile(e.getProfile("Interchange")),await this.loadComponents(),this.material=t.createNode("Material"),this.appearance=t.createNode("Appearance"),this.material.diffuseColor=Ce.White,this.appearance.material=this.material,this.statements(),this.getScene()},comments(){for(;this.comment(););},comment(){return this.whitespaces(),!!wo.comment.parse(this)},whitespaces(){wo.whitespaces.parse(this)},whitespacesNoLineTerminator(){wo.whitespacesNoLineTerminator.parse(this)},statements(){for(;this.solid(););},solid(){if(this.comments(),wo.solid.parse(this)){this.whitespacesNoLineTerminator();const e=this.getExecutionContext(),t=e.createNode("Shape"),i=e.createNode("TriangleSet"),n=e.createNode("Normal"),s=e.createNode("Coordinate"),r=this.sanitizeName(wo.name.parse(this)?this.result[1]:"");if(wo.untilEndOfLine.parse(this),this.facets(),t.appearance=this.appearance,t.geometry=i,i.normalPerVertex=!1,i.normal=n,i.coord=s,n.vector=this.vector,s.point=this.point,r&&(e.addNamedNode(e.getUniqueName(r),t),e.addExportedNode(e.getUniqueExportName(r),t)),e.getRootNodes().push(t),this.comments(),wo.endsolid.parse(this))return!0;throw new Error("Expected 'endsolid' statement.")}return!1},facets(){for(this.vector.length=0,this.point.length=0;this.facet(););},facet(){if(this.comments(),wo.facet.parse(this)&&this.normal()&&this.loop()){if(this.comments(),wo.endfacet.parse(this))return!0;throw new Error("Expected 'endfacet' statement.")}return!1},normal(){if(this.whitespacesNoLineTerminator(),wo.normal.parse(this)){if(this.double()){if(this.vector.push(this.value),this.double()){if(this.vector.push(this.value),this.double())return this.vector.push(this.value),!0;throw new Error("Expected a double.")}throw new Error("Expected a double.")}throw new Error("Expected a double.")}throw new Error("Expected 'normal' statement.")},loop(){if(this.comments(),wo.outer.parse(this)){if(this.whitespacesNoLineTerminator(),wo.loop.parse(this)&&this.vertex()&&this.vertex()&&this.vertex()){if(this.comments(),wo.endloop.parse(this))return!0;throw new Error("Expected 'endloop' statement.")}throw new Error("Expected 'loop' statement.")}throw new Error("Expected 'outer' statement.")},vertex(){if(this.comments(),wo.vertex.parse(this)){if(this.double()){if(this.point.push(this.value),this.double()){if(this.point.push(this.value),this.double())return this.point.push(this.value),!0;throw new Error("Expected a double.")}throw new Error("Expected a double.")}throw new Error("Expected a double.")}throw new Error("Expected 'vertex' statement.")},double(){return this.whitespacesNoLineTerminator(),wo.double.parse(this)?(this.value=parseFloat(this.result[1]),!0):!!wo.constants.parse(this)&&(this.value=this.CONSTANTS.get(this.result[2].toUpperCase()),"-"===this.result[1]&&(this.value=-this.value),!0)}});const So=bo;i.add("STLAParser","x_ite/Parser/STLAParser",So);const To=So;function vo(e){Fr.call(this,e)}Object.assign(Object.setPrototypeOf(vo.prototype,Fr.prototype),{getEncoding:()=>"ARRAY_BUFFER",setInput(e){this.arrayBuffer=e,this.dataView=new DataView(e)},isValid(){if(!(this.arrayBuffer instanceof ArrayBuffer))return!1;if(this.dataView.byteLength<84)return!1;return 50*this.dataView.getUint32(80,!0)+84===this.dataView.byteLength},parseIntoScene(e,t){this.stl().then(e).catch(t)},stl:async function(){const e=this.getBrowser(),t=this.getScene();return t.setEncoding("STL"),t.setProfile(e.getProfile("Interchange")),await this.loadComponents(),this.material=t.createNode("Material"),this.appearance=t.createNode("Appearance"),this.material.diffuseColor=Ce.White,this.appearance.material=this.material,this.shape(),this.getScene()},shape(){const e=this.getExecutionContext(),t=e.createNode("Shape"),i=e.createNode("TriangleSet"),n=e.createNode("Normal"),s=e.createNode("Coordinate"),r=this.dataView,o=this.dataView.byteLength,a=[],l=[];for(let e=84;e<o;e+=50){for(let t=0;t<3;++t)a.push(r.getFloat32(e+4*t,!0));for(let t=3;t<12;++t)l.push(r.getFloat32(e+4*t,!0))}t.appearance=this.appearance,t.geometry=i,i.normalPerVertex=!1,i.normal=n,i.coord=s,n.vector=a,s.point=l,e.getRootNodes().push(t)}});const Oo=vo;i.add("STLBParser","x_ite/Parser/STLBParser",Oo);const Eo=Oo,No=Pr({whitespaces:/[\x20\n\t\r]+/gy,whitespacesNoLineTerminator:/[\x20\t]+/gy,untilEndOfLine:/([^\r\n]+)/gy,line:/.*?\r?\n/gy,ply:/ply/gy,format:/format ascii 1.0/gy,comment:/\bcomment\b/gy,element:/\belement\b/gy,elementName:/\b(\S+)\b/gy,property:/\bproperty\b/gy,propertyList:/\blist\b/gy,propertyType:/\b(char|uchar|short|ushort|int|uint|float|double|int8|uint8|int16|uint16|int32|uint32|float32|float64)\b/gy,propertyName:/\b(\S+)\b/gy,endHeader:/\bend_header\b/gy,double:/([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/gy,int32:/((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/gy});function Co(e){Fr.call(this,e),this.comments=[],this.attrib=[],this.typeMapping=new Map([["char",this.int32],["uchar",this.int32],["short",this.int32],["ushort",this.int32],["int",this.int32],["uint",this.int32],["float",this.double],["double",this.double],["int8",this.int32],["uint8",this.int32],["int16",this.int32],["uint16",this.int32],["int32",this.int32],["uint32",this.int32],["float32",this.double],["float64",this.double]])}Object.assign(Object.setPrototypeOf(Co.prototype,Fr.prototype),{getEncoding:()=>"STRING",setInput(e){this.input=e},isValid(){return this.input.match(/^ply\r?\nformat ascii 1.0/)},parseIntoScene(e,t){this.ply().then(e).catch(t)},ply:async function(){const e=this.getBrowser(),t=this.getScene();return t.setEncoding("PLY"),t.setProfile(e.getProfile("Interchange")),await this.loadComponents(),await this.processElements(this.header([])),this.getScene()},whitespacesOrComments(){for(;this.whitespaces()||this.comment(););},whitespaces(){return No.whitespaces.parse(this)},whitespacesNoLineTerminator(){No.whitespacesNoLineTerminator.parse(this)},comment(){return!(!No.comment.parse(this)||!No.untilEndOfLine.parse(this))&&(this.comments.push(this.result[1].trim()),!0)},double(){return this.whitespacesNoLineTerminator(),!!No.double.parse(this)&&(this.value=parseFloat(this.result[1]),!0)},int32(){return this.whitespacesNoLineTerminator(),!!No.int32.parse(this)&&(this.value=parseInt(this.result[1]),!0)},convertColor(e,t){switch(t){case"uchar":case"uint8":return e/255;case"ushort":case"uint16":return e/1048575;case"uint":case"uint32":return e/4294967295;case"float":case"float32":case"double":case"float64":return e}},header(e){No.ply.parse(this),No.whitespaces.parse(this),No.format.parse(this),this.headings(e);const t=this.getScene(),i=t.createNode("WorldInfo");return i.title=new URL(t.worldURL).pathname.split("/").at(-1),i.info=this.comments,t.rootNodes.push(i),e},headings(e){for(;this.head(e););},head(e){return!!this.element(e)||!No.endHeader.parse(this)&&!!No.untilEndOfLine.parse(this)},element(e){if(this.whitespacesOrComments(),No.element.parse(this)&&(this.whitespacesNoLineTerminator(),No.elementName.parse(this))){const t=this.result[1];if(this.int32()){const i={name:t,count:this.value,properties:[]};return this.properties(i.properties),e.push(i),!0}}return!1},properties(e){for(;this.property(e););},property(e){if(this.whitespacesOrComments(),No.property.parse(this)){if(this.whitespacesNoLineTerminator(),No.propertyType.parse(this)){const t=this.result[1],i=this.typeMapping.get(t);if(this.whitespacesNoLineTerminator(),No.propertyName.parse(this)){const n=this.result[1];return e.push({type:t,value:i,name:n}),!0}}if(No.propertyList.parse(this)&&(this.whitespacesNoLineTerminator(),No.propertyType.parse(this))){const t=this.typeMapping.get(this.result[1]);if(this.whitespacesNoLineTerminator(),No.propertyType.parse(this)){const i=this.result[1],n=this.typeMapping.get(i);if(this.whitespacesNoLineTerminator(),No.propertyName.parse(this)){const s=this.result[1];return e.push({count:t,type:i,value:n,name:s}),!0}}}}return!1},async processElements(e){for(const t of e)await this.processElement(t);if(!this.coord)return;const t=this.getScene(),i=t.createNode("Shape"),n=t.createNode("Appearance"),s=t.createNode(this.geometry?"Material":"UnlitMaterial"),r=this.geometry??t.createNode("PointSet");if(n.material=s,this.texCoord){const e=t.createNode("TextureTransform");e.translation.y=-1,e.scale.y=-1,n.textureTransform=e}"PointSet"!==r.getNodeTypeName()&&(r.solid=!1,r.texCoord=this.texCoord),r.attrib=this.attrib,r.color=this.color,r.normal=this.normal,r.coord=this.coord,i.appearance=n,i.geometry=r,t.rootNodes.push(i)},async processElement(e){switch(e.name){case"vertex":await this.parseVertices(e);break;case"face":this.parseFaces(e);break;case"multi_texture_vertex":this.parseMultiTextureVertices(e);break;case"multi_texture_face":this.parseMultiTextureFaces(e);break;default:this.parseUnknown(e)}},async parseVertices({count:e,properties:t}){const i=this.getScene(),n=[],s=i.createNode("TextureCoordinate"),r=[],o=i.createNode("Normal"),a=[],l=i.createNode("Coordinate"),u=[],h=new Map;for(const{name:e}of t)e.match(/^(?:red|green|blue|alpha|r|g|b|a|s|t|u|v|nx|ny|nz|x|y|z)$/)||h.set(e,[]);for(let i=0;i<e;++i){this.whitespaces();for(const{value:e,name:i,type:s}of t){if(!e.call(this))throw new Error(`Couldn't parse value for property ${i}.`);switch(i){default:h.get(i).push(this.value);break;case"red":case"green":case"blue":case"alpha":case"r":case"g":case"b":case"a":n.push(this.convertColor(this.value,s));break;case"s":case"t":case"u":case"v":r.push(this.value);break;case"nx":case"ny":case"nz":a.push(this.value);break;case"x":case"y":case"z":u.push(this.value)}}}if(h.size){i.addComponent(this.getBrowser().getComponent("Shaders",1)),await this.loadComponents();for(const[e,t]of h){const n=i.createNode("FloatVertexAttribute");n.name=e,n.numComponents=1,n.value=t,this.attrib.push(n)}}const d=t.some((e=>e.name.match(/^(?:alpha|a)$/))),c=d&&n.some(((e,t)=>t%4==3&&e<1)),p=i.createNode(c?"ColorRGBA":"Color");p.color=c||!d?n:n.filter(((e,t)=>t%4!=3)),s.point=r,o.vector=a,l.point=u,this.color=n.length?p:null,this.texCoord=r.length?s:null,this.normal=a.length?o:null,this.coord=l},parseFaces({count:e,properties:t}){const i=this.getScene().createNode("IndexedFaceSet"),n=[];for(let i=0;i<e;++i){this.whitespaces();for(const{count:e,value:i,name:s}of t){if(!e.call(this))throw new Error(`Couldn't parse property count for ${s}.`);const t=this.value;for(let e=0;e<t;++e){if(!i.call(this))throw new Error(`Couldn't parse a property value for ${s}.`);n.push(this.value)}n.push(-1)}}i.coordIndex=n,this.geometry=i},parseMultiTextureVertices({count:e,properties:t}){const i=this.getScene().createNode("TextureCoordinate"),n=[];for(let i=0;i<e;++i){this.whitespaces();for(const{value:e,name:i}of t){if(!e.call(this))throw new Error(`Couldn't parse value for property ${i}.`);switch(i){case"s":case"t":case"u":case"v":n.push(this.value)}}}i.point=n,this.texCoord=n.length?i:null},parseMultiTextureFaces({count:e,properties:t}){const i=[];for(let n=0;n<e;++n)for(const{count:e,value:n,name:s}of t)if(e){if(!e.call(this))throw new Error(`Couldn't parse property count for ${s}.`);const t=this.value;for(let e=0;e<t;++e){if(!n.call(this))throw new Error(`Couldn't parse value for property ${s}.`);i.push(this.value)}i.push(-1)}else if(!n.call(this))throw new Error(`Couldn't parse value for property ${s}.`);this.geometry&&(this.geometry.texCoordIndex=i)},parseUnknown({count:e}){this.whitespaces();for(let t=0;t<e;++t)No.line.parse(this)}});const Fo=Co;i.add("PLYAParser","x_ite/Parser/PLYAParser",Fo);const Io=Fo;function Mo(e){Io.call(this,e),this.typeMapping=new Map([["char",this.binaryInt8],["uchar",this.binaryUint8],["short",this.binaryInt16],["ushort",this.binaryUint16],["int",this.binaryInt32],["uint",this.binaryUint32],["float",this.binaryFloat32],["double",this.binaryFloat64],["int8",this.binaryInt8],["uint8",this.binaryUint8],["int16",this.binaryInt16],["uint16",this.binaryUint16],["int32",this.binaryInt32],["uint32",this.binaryUint32],["float32",this.binaryFloat32],["float64",this.binaryFloat64]]),this.binaryInt8.bytes=1,this.binaryUint8.bytes=1,this.binaryInt16.bytes=2,this.binaryUint16.bytes=2,this.binaryInt32.bytes=4,this.binaryUint32.bytes=4,this.binaryFloat32.bytes=4,this.binaryFloat64.bytes=8}Object.assign(Object.setPrototypeOf(Mo.prototype,Io.prototype),{getEncoding:()=>["ARRAY_BUFFER","STRING"],setInput(e){this.arrayBuffer=e[0],this.dataView=new DataView(this.arrayBuffer),this.input=e[1],this.magic=this.input.match(/^ply\r?\nformat (binary_(?:little|big)_endian) 1.0.*?end_header\r?\n/s),this.byteOffset=this.magic?.[0].length,this.littleEndian="binary_little_endian"===this.magic?.[1]},isValid(){return this.arrayBuffer instanceof ArrayBuffer&&!!this.magic},binaryInt8(){return this.value=this.dataView.getInt8(this.byteOffset,this.littleEndian),this.byteOffset+=1,!0},binaryUint8(){return this.value=this.dataView.getUint8(this.byteOffset,this.littleEndian),this.byteOffset+=1,!0},binaryInt16(){return this.value=this.dataView.getInt16(this.byteOffset,this.littleEndian),this.byteOffset+=2,!0},binaryUint16(){return this.value=this.dataView.getUint16(this.byteOffset,this.littleEndian),this.byteOffset+=2,!0},binaryInt32(){return this.value=this.dataView.getInt32(this.byteOffset,this.littleEndian),this.byteOffset+=4,!0},binaryUint32(){return this.value=this.dataView.getUint32(this.byteOffset,this.littleEndian),this.byteOffset+=4,!0},binaryFloat32(){return this.value=this.dataView.getFloat32(this.byteOffset,this.littleEndian),this.byteOffset+=4,!0},binaryFloat64(){return this.value=this.dataView.getFloat64(this.byteOffset,this.littleEndian),this.byteOffset+=8,!0},processElements(e){return this.whitespaces=Function.prototype,Io.prototype.processElements.call(this,e)},parseUnknown({count:e,properties:t}){for(let i=0;i<e;++i)for(const{count:e,type:i}of t)e?(e.call(this),this.byteOffset+=this.value*this.typeMapping.get(i).bytes):this.byteOffset+=this.typeMapping.get(i).bytes}});const Do=Mo;i.add("PLYBParser","x_ite/Parser/PLYBParser",Do);const Po=Do;function Ro(e,t){this.real=e,this.imag=t}Object.assign(Ro.prototype,{*[Symbol.iterator](){yield this.real,yield this.imag},copy(){const e=Object.create(Ro.prototype);return e.real=this.real,e.imag=this.imag,e},assign(e){return this.real=e.real,this.imag=e.imag,this},equals(e){return this.real===e.real&&this.imag===e.imag},set(e,t){return this.real=e,this.imag=t,this},setPolar(e,t){return this.real=e*Math.cos(t),this.imag=e*Math.sin(t),this},conjugate(){return this.imag=-this.imag,this},negate(){return this.real=-this.real,this.imag=-this.imag,this},inverse(){const e=this.real*this.real+this.imag*this.imag;return this.real/=e,this.imag/=-e,this},add(e){return this.real+=e.real,this.imag+=e.imag,this},subtract(e){return this.real-=e.real,this.imag-=e.imag,this},multiply(e){return this.real*=e,this.imag*=e,this},multComp(e){const{real:t,imag:i}=this,{real:n,imag:s}=e;return this.real=t*n-i*s,this.imag=t*s+i*n,this},divide(e){return this.real/=e,this.imag/=e,this},divComp(e){const{real:t,imag:i}=this,{real:n,imag:s}=e,r=n*n+s*s;return this.real=(t*n+i*s)/r,this.imag=(i*n-t*s)/r,this},toString(){let e="";return e+=this.real,this.imag<0?(e+=this.imag,e+="i"):this.imag>0&&(e+="+",e+=this.imag,e+="i"),e}}),Object.defineProperties(Ro.prototype,{length:{value:2},0:{get(){return this.real},set(e){this.real=e}},1:{get(){return this.imag},set(e){this.imag=e}},magnitude:{get(){return this.real?this.imag?Math.hypot(this.real,this.imag):Math.abs(this.real):Math.abs(this.imag)},set(e){this.setPolar(e,this.angle)}},angle:{get(){return Math.atan2(this.imag,this.real)},set(e){this.setPolar(this.magnitude,e)}}}),Object.assign(Ro,{Polar:(e,t)=>Object.create(Ro.prototype).setPolar(e,t),multiply:(e,t)=>e.copy().multiply(t)});const Ao=Ro;i.add("Complex","standard/Math/Numbers/Complex",Ao);const Vo=Ao;function Lo(){this.matrix=new Pt,this.set(...arguments)}Object.assign(Lo.prototype,{copy(){const e=Object.create(Lo.prototype);return e.matrix=this.matrix.copy(),e},assign(e){return this.matrix.assign(e.matrix),this},equals(e){return this.matrix.equals(e.matrix)},set(e,t){switch(arguments.length){case 0:return this.matrix.set(0,0,0,0,0,0,0,0,0),this;case 2:return this.matrix.set(e.x/2,0,0,0,e.y/2,0,t.x,t.y,1),this}},setExtents(e,t){const i=(t.x-e.x)/2,n=(t.y-e.y)/2,s=(t.x+e.x)/2,r=(t.y+e.y)/2;return this.matrix.set(i,0,0,0,n,0,s,r,1),this},isEmpty(){return 0===this.matrix[8]},add:(()=>{const e=new ft(0,0),t=new ft(0,0),i=new ft(0,0),n=new ft(0,0);return function(s){return this.isEmpty()?this.assign(s):s.isEmpty()?this:(this.getExtents(e,t),s.getExtents(i,n),this.setExtents(e.min(i),t.max(n)))}})(),multLeft(e){return this.matrix.multLeft(e),this},multRight(e){return this.matrix.multRight(e),this},getExtents(e,t){this.getAbsoluteExtents(e,t),e.add(this.center),t.add(this.center)},getAbsoluteExtents:(()=>{const e=new ft(0,0);return function(t,i){const n=this.matrix,s=n.xAxis,r=n.yAxis;e.assign(s).add(r);const o=r.subtract(s);t.assign(e).min(o),i.assign(e).max(o),e.negate(),o.negate(),t.min(e,o),i.max(e,o)}})(),containsPoint:(()=>{const e=new ft(0,0),t=new ft(0,0);return function(i){return this.getExtents(e,t),e.x<=i.x&&t.x>=i.x&&e.y<=i.y&&t.y>=i.y}})(),toString(){return`${this.size}, ${this.center}`}}),Object.assign(Lo,{Extents:(e,t)=>(new Lo).setExtents(e,t),Points(e){const t=new ft(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),i=new ft(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const n of e)t.min(n),i.max(n);return(new Lo).setExtents(t,i)}}),Object.defineProperties(Lo.prototype,{size:{get:(()=>{const e=new ft(0,0),t=new ft(0,0);return function(){return this.getAbsoluteExtents(e,t),t.subtract(e)}})(),enumerable:!0},center:{get(){return this.matrix.origin},enumerable:!0}});const Bo=Lo;i.add("Box2","standard/Math/Geometry/Box2",Bo);const Uo=Bo,{interval:Xo}=g,ko={quadric:(()=>{const e=new Pt(1,0,0,-2,2,0,1,-2,1),t=new Pt;return function(i,n,s,r,o,a,l,u,h,d,c){t.set(i,n,s,r,o,a,l,u,h).multLeft(e);for(let e=0,i=d-1;e<d;++e){const n=e/i;c.push(t.multVecMatrix(new bt(1,n,n*n)))}}})(),cubic:(()=>{const e=new jt(0,0,0,0),t=new ci(1,0,0,0,-3,3,0,0,3,-6,3,0,-1,3,-3,1),i=new ci;return function(n,s,r,o,a,l,u,h,d,c,p,g,f,m){i.set(n,s,r,0,o,a,l,0,u,h,d,0,c,p,g,0).multLeft(t);for(let t=0,n=f-1;t<f;++t){const s=t/n;i.multVecMatrix(e.set(1,s,s*s,s*s*s)),m.push(new bt(e.x,e.y,e.z))}}})(),arc(e,t,i,n,s,r,o,a,l,u,h){if(e===a&&t===l)return void h.push(new bt(a,l,0));if(i=Math.abs(i),n=Math.abs(n),0===i||0===n)return void h.push(new bt(e,t,0),new bt(a,l,0));const d=i*i,c=n*n;s=Xo(s,0,2*Math.PI);const p=Math.sin(s),g=Math.cos(s),f=new ft(e-a,t-l).divide(2),m=new ft(g*f.x+p*f.y,-p*f.x+g*f.y),_=m.copy().multVec(m),x=_.x/d+_.y/c;x>1&&(i=Math.sqrt(x)*i,n=Math.sqrt(x)*n);let y=(d*c-d*_.y-c*_.x)/(d*_.y+c*_.x);y=Math.max(0,y);const w=(r!==o?1:-1)*Math.sqrt(y),b=new ft(w*i*m.y/n,-w*n*m.x/i),S=new ft(g*b.x-p*b.y+(e+a)/2,p*b.x+g*b.y+(t+l)/2),T=new ft((m.x-b.x)/i,(m.y-b.y)/n),v=new ft((-m.x-b.x)/i,(-m.y-b.y)/n),O=e=>e>0?e:2*Math.PI+e,E=O(Math.atan2(T.y,T.x));let N=O(Math.atan2(v.y,v.x))-E;r?N<0&&(N+=2*Math.PI):N>0&&(N-=2*Math.PI),o&&N<0?N+=2*Math.PI:!o&&N>0&&(N-=2*Math.PI);const C=Math.max(4,Math.abs(N)*u/(2*Math.PI))-1;h.push(new bt(e,t,0));for(let e=1;e<C;++e){const t=E+N*(e/C),s=i*Math.cos(t),r=n*Math.sin(t);h.push(new bt(g*s-p*r+S.x,p*s+g*r+S.y,0))}h.push(new bt(a,l,0))}},jo=ko;i.add("Bezier","standard/Math/Algorithms/Bezier",jo);const zo=jo;const Go=function(e){return Object.assign([new e],{top:0,set(e){this[this.top].assign(e)},get(){return this[this.top]},push(){const e=++this.top;e<this.length?this[e].assign(this[e-1]):this[e]=this[e-1].copy()},pushMatrix(e){const t=++this.top;t<this.length?this[t].assign(e):this[t]=e.copy()},pop(){--this.top},clear(){this.top=0},size(){return this.top+1},identity(){this[this.top].identity()},multLeft(e){this[this.top].multLeft(e)},translate(e){this[this.top].translate(e)},rotate(e){this[this.top].rotate(e)},scale(e){this[this.top].scale(e)}})};i.add("MatrixStack","standard/Math/Utility/MatrixStack",Go);const Ho=Go;var qo=n(464),Yo=n(602);const Wo=Pr({whitespaces:/[\x20\n\t\r]+/gy,comma:/,/gy,openParenthesis:/\(/gy,closeParenthesis:/\)/gy,length:/(em|ex|px|in|cm|mm|pt|pc|%)/gy,percent:/%/gy,int32:/((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/gy,double:/([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/gy,constants:/([+-])((?:NAN|INF|INFINITY))/giy,matrix:/matrix/gy,translate:/translate/gy,rotate:/rotate/gy,scale:/scale/gy,skewX:/skewX/gy,skewY:/skewY/gy,color:/([a-zA-Z]+|#[\da-fA-F]+|rgba?\(.*?\))/gy,url:/url\("?(.*?)"?\)/gy,path:/([mMlLhHvVqQtTcCsSaAzZ])/gy}),$o=.0254,Jo=$o/90,Ko=16;function Zo(e){Fr.call(this,e),eo.call(this),this.removeGroups=!0,this.removeEmptyGroups=!0,this.combineGroupingNodes=!1,this.solid=!1,this.viewBox=new jt(0,0,100,100),this.modelMatrix=new Ho(ci),this.fillGeometries=new Map,this.strokeGeometries=new Map,this.lineProperties=new Map,this.tessy=this.createTesselator(),this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.styles=[{display:"inline",fillType:"COLOR",fillColor:qe.Black,fillURL:"",fillOpacity:1,fillRule:"nonzero",strokeType:"none",strokeColor:qe.Black,strokeURL:"",strokeOpacity:1,strokeWidth:1,opacity:1,stopColor:qe.Black,stopOpacity:1,vectorEffect:"none"}];const t=e.getBrowser();switch(t.getBrowserOption("PrimitiveQuality")){case"LOW":this.BEZIER_STEPS=6,this.CIRCLE_STEPS=20;break;case"HIGH":this.BEZIER_STEPS=10,this.CIRCLE_STEPS=64;break;default:this.BEZIER_STEPS=8,this.CIRCLE_STEPS=32}switch(t.getBrowserOption("TextureQuality")){case"LOW":this.GRADIENT_SIZE=128;break;case"HIGH":this.GRADIENT_SIZE=512;break;default:this.GRADIENT_SIZE=256}this.canvas.width=this.GRADIENT_SIZE,this.canvas.height=this.GRADIENT_SIZE}Object.assign(Object.setPrototypeOf(Zo.prototype,Fr.prototype),eo.prototype,{CONSTANTS:new Map([["NAN",NaN],["INF",1/0],["INFINITY",1/0]]),getEncoding:()=>"XML",setInput(e){try{"string"==typeof e&&(e=qo.parseXML(e)),this.input=e}catch{this.input=void 0}},isValid(){return this.input instanceof XMLDocument&&(!!qo(this.input).children("svg").length||"svg"===this.input.nodeName)},parseIntoScene(e,t){this.xmlElement(this.input).then(e).catch(t)},xmlElement:async function(e){switch(e.nodeName){case"#document":{const t=qo(e).children("svg");for(const e of t)await this.svgElement(e);break}case"svg":await this.svgElement(e)}return this.getScene()},svgElement:async function(e){const t=this.getBrowser(),i=this.getScene();i.setEncoding("SVG"),i.setProfile(t.getProfile("Interchange")),i.addComponent(t.getComponent("Geometry2D",2)),await this.loadComponents(),this.document=this.input,this.rootTransform=i.createNode("Transform"),this.groupNodes=[this.rootTransform],this.texturePropertiesNode=this.createTextureProperties();const n=i.createNode("Background");n.skyColor=[1,1,1],i.getRootNodes().push(n);const s=i.createNode("NavigationInfo");s.type=["PLANE_create3000.github.io","PLANE","EXAMINE","ANY"],i.getRootNodes().push(s);const r=this.lengthAttribute(e.getAttribute("width"),300,"width"),o=this.lengthAttribute(e.getAttribute("height"),150,"height"),a=this.viewBox.set(0,0,r,o),l=this.viewBoxAttribute(e.getAttribute("viewBox"),a),u=this.lengthAttribute(e.getAttribute("width"),l[2],"width"),h=this.lengthAttribute(e.getAttribute("height"),l[3],"height");{const e=u/h;l[2]/l[3]>e?l[3]+=l[2]/e-l[3]:l[2]+=l[3]*e-l[2]}const d=i.createNode("OrthoViewpoint"),c=(l.x+u/2)*Jo,p=-(l.y+h/2)*Jo;d.position=new bt(c,p,10),d.centerOfRotation=new bt(c,p,0),d.fieldOfView=[-u/2*Jo,-h/2*Jo,u/2*Jo,h/2*Jo],i.getRootNodes().push(d);const g=new bt(u*Jo/l[2],-h*Jo/l[3],1),f=new bt(-l.x,l.y,0).multVec(g);this.rootTransform.translation=f,this.rootTransform.scale=g,this.elements(e),i.addNamedNode(i.getUniqueName("ViewBox"),this.rootTransform),i.addExportedNode(i.getUniqueExportName("ViewBox"),this.rootTransform),i.getRootNodes().push(this.rootTransform),this.optimizeSceneGraph(i.getRootNodes())},elements(e){for(const t of e.childNodes)this.element(t)},element(e){switch(e.nodeName){case"use":return this.useElement(e);case"g":return this.gElement(e);case"switch":return this.switchElement(e);case"a":return this.aElement(e);case"rect":return this.rectElement(e);case"circle":return this.circleElement(e);case"ellipse":return this.ellipseElement(e);case"text":return this.textElement(e);case"image":return this.imageElement(e);case"polyline":return this.polylineElement(e);case"polygon":return this.polygonElement(e);case"path":return this.pathElement(e)}},useElement(e){const t=this.hrefAttribute(e.getAttribute("href")||e.getAttribute("xlink:href"));if(!t)return;if(!this.styleAttributes(e))return;const i=this.lengthAttribute(e.getAttribute("x"),0,"width"),n=this.lengthAttribute(e.getAttribute("y"),0,"height"),s=(this.lengthAttribute(e.getAttribute("width"),0,"width"),this.lengthAttribute(e.getAttribute("height"),0,"height"),this.createTransform(e,new ft(i,n)));this.groupNodes.push(s),this.element(t),this.popAll()},gElement(e){if(!this.styleAttributes(e))return;const t=this.createTransform(e);this.groupNodes.push(t),this.elements(e),this.popAll()},switchElement(e){if(!this.styleAttributes(e))return;const t=this.getExecutionContext(),i=this.createTransform(e),n=t.createNode("Switch");i.children.push(n),n.whichChoice=0,this.groupNodes.push(n),this.elements(e),this.popAll()},aElement(e){if(!this.styleAttributes(e))return;const t=e.getAttribute("href")||e.getAttribute("xlink:href"),i=e.getAttribute("title")||e.getAttribute("xlink:title"),n=e.getAttribute("target"),s=this.getExecutionContext(),r=this.createTransform(e),o=s.createNode("Anchor");r.children.push(o),o.description=i,o.url=[t],n&&(o.parameter=[`target=${n}`]),this.groupNodes.push(o),this.elements(e),this.popAll()},rectElement(e){const t=this.lengthAttribute(e.getAttribute("x"),0,"width"),i=this.lengthAttribute(e.getAttribute("y"),0,"height"),n=this.lengthAttribute(e.getAttribute("width"),0,"width"),s=this.lengthAttribute(e.getAttribute("height"),0,"height");let r=Math.max(0,this.lengthAttribute(e.getAttribute("rx"),0,"width")),o=Math.max(0,this.lengthAttribute(e.getAttribute("ry"),0,"height"));if(0===r&&0===o){if(!this.styleAttributes(e))return;const r=this.getExecutionContext(),o=new ft(n,s),a=new ft(t+n/2,i+s/2),l=new Uo(o,a),u=this.createTransform(e,a);if(this.groupNodes.push(u),"none"!==this.style.fillType){const t=r.createNode("Shape"),i=this.fillGeometries.get(e);if(u.children.push(t),t.appearance=this.createFillAppearance(l),i)t.geometry=i;else{const i=r.createNode("Rectangle2D");this.fillGeometries.set(e,i),t.geometry=i,i.solid=this.solid,i.size=o}}if("none"!==this.style.strokeType){const t=r.createNode("Shape"),i=this.strokeGeometries.get(e);if(u.children.push(t),t.appearance=this.createStrokeAppearance(),i)t.geometry=i;else{const i=r.createNode("Polyline2D"),o=n/2,a=s/2;this.strokeGeometries.set(e,i),t.geometry=i,i.lineSegments=[o,a,-o,a,-o,-a,o,-a,o,a]}}this.popAll()}else{r&&!o&&(o=r),o&&!r&&(r=o),r=Math.min(r,n/2),o=Math.min(o,s/2);const a=[t+n-r,t+r,t+r,t+n-r],l=[i+s-o,i+s-o,i+o,i+o],u=Object.assign([],{closed:!0});for(let e=0;e<4;++e){const t=e*Math.PI/2;for(let i=0,n=this.CIRCLE_STEPS/4;i<n;++i){const s=Vo.Polar(1,t+Math.PI/2*i/(n-1));u.push(new bt(a[e]+s.real*r,l[e]+s.imag*o,0))}}u.pop(),this.pathLikeElement(e,[u])}},circleElement(e){if(!this.styleAttributes(e))return;const t=this.lengthAttribute(e.getAttribute("cx"),0,"width"),i=this.lengthAttribute(e.getAttribute("cy"),0,"height"),n=this.lengthAttribute(e.getAttribute("r"),0),s=this.getExecutionContext(),r=new Uo(new ft(2*n,2*n),new ft(t,i)),o=this.createTransform(e,new ft(t,i));if(this.groupNodes.push(o),"none"!==this.style.fillType){const t=s.createNode("Shape"),i=this.fillGeometries.get(e);if(o.children.push(t),t.appearance=this.createFillAppearance(r),i)t.geometry=i;else{const i=s.createNode("Disk2D");this.fillGeometries.set(e,i),t.geometry=i,i.solid=this.solid,i.outerRadius=n}}if("none"!==this.style.strokeType){const t=s.createNode("Shape"),i=this.strokeGeometries.get(e);if(o.children.push(t),t.appearance=this.createStrokeAppearance(),i)t.geometry=i;else{const i=s.createNode("Circle2D");this.strokeGeometries.set(e,i),t.geometry=i,i.radius=n}}this.popAll()},ellipseElement(e){if(!this.styleAttributes(e))return;const t=this.lengthAttribute(e.getAttribute("cx"),0,"width"),i=this.lengthAttribute(e.getAttribute("cy"),0,"height"),n=this.lengthAttribute(e.getAttribute("rx"),0,"width"),s=this.lengthAttribute(e.getAttribute("ry"),0,"height"),r=this.getExecutionContext(),o=Math.min(n,s),a=new Uo(new ft(2*n,2*s),new ft(t,i)),l=this.createTransform(e,new ft(t,i),new ft(n/o,s/o));if(this.groupNodes.push(l),"none"!==this.style.fillType){const t=r.createNode("Shape"),i=this.fillGeometries.get(e);if(l.children.push(t),t.appearance=this.createFillAppearance(a),i)t.geometry=i;else{const i=r.createNode("Disk2D");this.fillGeometries.set(e,i),t.geometry=i,i.solid=this.solid,i.outerRadius=o}}if("none"!==this.style.strokeType){const t=r.createNode("Shape"),i=this.strokeGeometries.get(e);if(l.children.push(t),t.appearance=this.createStrokeAppearance(),i)t.geometry=i;else{const i=r.createNode("Circle2D");this.strokeGeometries.set(e,i),t.geometry=i,i.radius=o}}this.popAll()},textElement(e){},imageElement(e){const t=this.fillGeometries.get(e);if(t)this.groupNodes.at(-1).children.push(t);else{if(!this.styleAttributes(e))return;const t=this.lengthAttribute(e.getAttribute("x"),0,"width"),i=this.lengthAttribute(e.getAttribute("y"),0,"height"),n=this.lengthAttribute(e.getAttribute("width"),0,"width"),s=this.lengthAttribute(e.getAttribute("height"),0,"height"),r=e.getAttribute("href")||e.getAttribute("xlink:href"),o=this.getExecutionContext(),a=this.createTransform(e,new ft(t+n/2,i+s/2),new ft(1,-1));this.fillGeometries.set(e,a),this.groupNodes.push(a);const l=o.createNode("Shape"),u=o.createNode("Appearance"),h=o.createNode("ImageTexture"),d=o.createNode("Rectangle2D");l.appearance=u,l.geometry=d,u.texture=h,h.url=[r],h.textureProperties=this.texturePropertiesNode,d.solid=this.solid,d.size=new ft(n,s),a.children.push(l),this.popAll()}},polylineElement(e){const t=[];this.pointsAttribute(e.getAttribute("points"),t)&&this.pathLikeElement(e,[t])},polygonElement(e){const t=Object.assign([],{closed:!0});this.pointsAttribute(e.getAttribute("points"),t)&&this.pathLikeElement(e,[t])},pathElement(e){const t=[];this.dAttribute(e.getAttribute("d"),t)&&this.pathLikeElement(e,t)},pathLikeElement(e,t){if(!this.styleAttributes(e))return;t=t.map((e=>e.closed?Object.assign(e.filter(((e,t,i)=>e.distance(i[(t+1)%i.length])>1e-9)),{closed:!0}):e.filter(((e,t,i)=>!t||e.distance(i[t-1])>1e-9)))).filter((e=>e.length>2)),t.forEach(((e,t,i)=>e.index=t?i[t-1].index+i[t-1].length:0));const i=this.getExecutionContext(),n=this.createTransform(e),s=new Uo;for(const e of t)s.add(Uo.Points(e));this.groupNodes.push(n);const r=i.createNode("Coordinate");for(const e of t)r.point.push(...e);if("none"!==this.style.fillType){const o=i.createNode("Shape"),a=this.fillGeometries.get(e);if(n.children.push(o),o.appearance=this.createFillAppearance(s),a)o.geometry=a;else{const n=i.createNode("IndexedTriangleSet");this.fillGeometries.set(e,n),o.geometry=n,n.solid=this.solid,n.index=this.triangulatePolygon(t,r),n.texCoord=this.createTextureCoordinate(r,s,o.appearance),n.coord=r}}if("none"!==this.style.strokeType){const s=i.createNode("Shape"),o=this.strokeGeometries.get(e);if(n.children.push(s),s.appearance=this.createStrokeAppearance(),o)s.geometry=o;else{const n=i.createNode("IndexedLineSet");this.strokeGeometries.set(e,n),s.geometry=n,n.coord=r;const o=n.coordIndex;for(const e of t){for(const t of e.keys())o.push(e.index+t);e.closed&&o.push(e.index),o.push(-1)}}}this.popAll()},linearGradientElementUrl(e,t){const i=this.linearGradientElement(e,t,{stops:[]}),n=this.context.createLinearGradient(i.x1,i.y1,i.x2,i.y2);return this.drawGradient(n,i,t)},linearGradientElement(e,t,i){if("linearGradient"!==e.nodeName)return;const n=this.hrefAttribute(e.getAttribute("href")||e.getAttribute("xlink:href"));n&&this.gradientElement(n,t,i),i.x1=this.lengthAttribute(e.getAttribute("x1"),i.x1||0,"width"),i.y1=this.lengthAttribute(e.getAttribute("y1"),i.y1||0,"height"),i.x2=this.lengthAttribute(e.getAttribute("x2"),i.x2||1,"width"),i.y2=this.lengthAttribute(e.getAttribute("y2"),i.y2||0,"height"),i.units=e.getAttribute("gradientUnits")||"objectBoundingBox",i.transform=this.transformAttribute(e.getAttribute("gradientTransform"));const s=new Pt,r=new ft(i.x1,i.y1);s.translate(r),s.scale(new ft(Ko,Ko)),s.translate(r.negate()),i.spreadMatrix=s;for(const t of e.childNodes)this.gradientChild(t,i);return i},radialGradientElementUrl(e,t){const i=this.radialGradientElement(e,t,{stops:[]}),n=this.context.createRadialGradient(i.fx,i.fy,i.fr,i.cx,i.cy,i.r);return this.drawGradient(n,i,t)},radialGradientElement(e,t,i){const n=this.hrefAttribute(e.getAttribute("href")||e.getAttribute("xlink:href"));n&&this.gradientElement(n,t,i),i.cx=this.lengthAttribute(e.getAttribute("cx"),i.cx||.5,"width"),i.cy=this.lengthAttribute(e.getAttribute("cy"),i.cy||.5,"height"),i.r=this.lengthAttribute(e.getAttribute("r"),i.r||.5),i.fx=this.lengthAttribute(e.getAttribute("fx"),i.fx||i.cx,"width"),i.fy=this.lengthAttribute(e.getAttribute("fy"),i.fy||i.cy,"height"),i.fr=this.lengthAttribute(e.getAttribute("fr"),i.fr||0),i.units=e.getAttribute("gradientUnits")||"objectBoundingBox",i.spreadMethod=e.getAttribute("spreadMethod"),i.transform=this.transformAttribute(e.getAttribute("gradientTransform"));const s=new Pt,r=new ft(i.fx,i.fy);s.translate(r),s.scale(new ft(Ko,Ko)),s.translate(r.negate()),i.spreadMatrix=s;for(const t of e.childNodes)this.gradientChild(t,i);return i},gradientElement(e,t,i){if(e)switch(e.nodeName){case"linearGradient":return this.linearGradientElement(e,t,i);case"radialGradient":return this.radialGradientElement(e,t,i)}},gradientChild(e,t){if("stop"===e.nodeName)return this.stopElement(e,t)},stopElement(e,t){if(!this.styleAttributes(e))return;const i=this.percentAttribute(e.getAttribute("offset"),0);if(i<0||i>1)return;const{stopColor:n,stopOpacity:s}=this.style;t.stops.push([i,n,s]),this.styles.pop()},drawGradient(e,t,i){switch(t.spreadMethod){default:t.spreadMatrix.identity();for(const[i,n,s]of t.stops)e.addColorStop(i,this.cssColor(n,s));break;case"repeat":for(let i=0;i<Ko;++i){const n=i/Ko;for(const[i,s,r]of t.stops)e.addColorStop(n+i/Ko,this.cssColor(s,r))}break;case"reflect":for(let i=0;i<Ko;++i){const n=i/Ko;for(const[s,r,o]of t.stops)e.addColorStop(n+(i%2?1-s:s)/Ko,this.cssColor(r,o))}}const n=new Pt;n.scale(new ft(this.GRADIENT_SIZE/2,this.GRADIENT_SIZE/2)),n.translate(ft.One),n.scale(new ft(1,-1)),"userSpaceOnUse"===t.units?n.multLeft(i.matrix.copy().inverse()):n.multLeft(new Pt(2,0,0,0,2,0,-1,-1,1)),n.multLeft(t.transform),n.multLeft(t.spreadMatrix);const s=this.context;return s.fillStyle=e,s.save(),s.clearRect(0,0,this.GRADIENT_SIZE,this.GRADIENT_SIZE),s.rect(0,0,this.GRADIENT_SIZE,this.GRADIENT_SIZE),s.transform(n[0],n[1],n[3],n[4],n[6],n[7]),s.fill(),s.restore(),this.canvas.toDataURL("image/png")},patternUrl(e){},idAttribute(e,t){if(null===e)return;const i=this.getExecutionContext(),n=this.sanitizeName(e);n&&(i.addNamedNode(i.getUniqueName(n),t),i.addExportedNode(i.getUniqueExportName(n),t))},viewBoxAttribute(e,t){if(null===e)return t;if(this.parseValue(e),this.double()){const e=this.value;if(this.double()){const t=this.value;if(this.double()){const i=this.value;if(this.double()){const n=this.value;return new jt(e,t,i,n)}}}}return t},hrefAttribute(e){if(!e)return;const t=this.getExecutionContext(),i=new URL(e,t.getBaseURL()).hash.slice(1);return this.document.getElementById(i)},lengthAttribute(e,t,i){if(null===e)return t;if(this.parseValue(e),this.double()){let e=this.value;if(Wo.length.parse(this))switch(this.result[1]){case"em":e*=16;break;case"ex":case"px":break;case"in":e*=90;break;case"cm":e*=.01/Jo;break;case"mm":e*=.001/Jo;break;case"pt":e*=1.25;break;case"pc":e*=14.999999999999998;break;case"%":switch(i){case"width":e*=this.viewBox[2]/100;break;case"height":e*=this.viewBox[3]/100;break;default:e*=Math.hypot(this.viewBox[2],this.viewBox[3])/100}}return e}return t},percentAttribute(e,t){if(this.parseValue(e),this.double()){let e=this.value;return Wo.percent.parse(this)&&(e/=100),g.clamp(e,0,1)}return t},pointsAttribute(e,t){if(null===e)return!1;for(this.parseValue(e);;){if(this.double()){const e=this.value;if(this.comma()&&this.double()){const i=this.value;if(t.push(new bt(e,i,0)),this.comma())continue}}break}return!!t.length},dAttribute(e,t){if(null===e)return!1;this.parseValue(e);let i=[],n="",s="",r=!1,o=0,a=0,l=0,u=0;for(;this.whitespaces(),Wo.path.parse(this);){switch(n=s,s=this.result[1],r=s===s.toLowerCase(),s){case"m":case"M":for(i.length>2&&t.push(Object.assign(i,{closed:!1})),i=[];;){if(this.double()){let e=this.value;if(this.comma(),this.double()){let t=this.value;r&&(e+=o,t+=a),i.push(new bt(e,t,0)),o=e,a=t,this.comma();continue}}break}continue;case"l":case"L":for(;;){if(this.double()){let e=this.value;if(this.comma(),this.double()){let t=this.value;r&&(e+=o,t+=a),i.push(new bt(e,t,0)),o=e,a=t,this.comma();continue}}break}continue;case"h":case"H":for(;this.double();){let e=this.value;r&&(e+=o),i.push(new bt(e,a,0)),o=e,this.comma()}continue;case"v":case"V":for(;this&&this.double();){let e=this.value;r&&(e+=a),i.push(new bt(o,e,0)),a=e,this.comma()}continue;case"q":case"Q":for(;;){if(this.double()){let e=this.value;if(this.comma(),this.double()){let t=this.value;if(this.comma(),this.double()){let n=this.value;if(this.comma(),this.double()){let s=this.value;r&&(e+=o,t+=a,n+=o,s+=a),zo.quadric(o,a,0,e,t,0,n,s,0,this.BEZIER_STEPS,i),o=n,a=s,l=e,u=t,this.comma();continue}}}}break}continue;case"t":case"T":for(;;){if(this.double()){let e=this.value;if(this.comma(),this.double()){let t=this.value;switch(r&&(e+=o,t+=a),n){case"Q":case"q":case"T":case"t":h=o+(o-l),d=a+(a-u);break;default:h=o,d=a}zo.quadric(o,a,0,h,d,0,e,t,0,this.BEZIER_STEPS,i),o=e,a=t,this.comma();continue}}break}continue;case"c":case"C":for(;;){if(this.double()){let e=this.value;if(this.comma(),this.double()){let t=this.value;if(this.comma(),this.double()){let n=this.value;if(this.comma(),this.double()){let s=this.value;if(this.comma(),this.double()){let h=this.value;if(this.comma(),this.double()){let d=this.value;r&&(e+=o,t+=a,n+=o,s+=a,h+=o,d+=a),zo.cubic(o,a,0,e,t,0,n,s,0,h,d,0,this.BEZIER_STEPS,i),o=h,a=d,l=n,u=s,this.comma();continue}}}}}}break}continue;case"s":case"S":for(;;){if(this.double()){let e=this.value;if(this.comma(),this.double()){let t=this.value;if(this.comma(),this.double()){let s=this.value;if(this.comma(),this.double()){let c=this.value;switch(r&&(e+=o,t+=a,s+=o,c+=a),n){case"C":case"c":case"S":case"s":var h=o+(o-l),d=a+(a-u);break;default:h=o,d=a}zo.cubic(o,a,0,h,d,0,e,t,0,s,c,0,this.BEZIER_STEPS,i),o=s,a=c,l=e,u=t,this.comma();continue}}}}break}continue;case"a":case"A":for(;;){if(this.double()){let e=this.value;if(this.comma(),this.double()){let t=this.value;if(this.comma(),this.double()){let n=g.radians(this.value);if(this.comma(),this.int32()){let s=this.value;if(this.comma(),this.int32()){let l=this.value;if(this.comma(),this.double()){let u=this.value;if(this.comma(),this.double()){let h=this.value;r&&(u+=o,h+=a),zo.arc(o,a,e,t,n,s,l,u,h,this.CIRCLE_STEPS,i),o=u,a=h,this.comma();continue}}}}}}}break}continue;case"z":case"Z":i.length>2&&(o=i[0].x,a=i[0].y,t.push(Object.assign(i,{closed:!0}))),i=[],this.comma();continue}break}return i.length>2&&t.push(Object.assign(i,{closed:!1})),!!t.length},transformAttribute(e){const t=new Pt;if(null===e)return t;for(this.parseValue(e);;){if(this.comma(),this.whitespaces(),Wo.matrix.parse(this)){if(this.whitespaces(),Wo.openParenthesis.parse(this)&&this.double()){const e=this.value;if(this.comma()&&this.double()){const i=this.value;if(this.comma()&&this.double()){const n=this.value;if(this.comma()&&this.double()){const s=this.value;if(this.comma()&&this.double()){const r=this.value;if(this.comma()&&this.double()){const o=this.value;if(this.whitespaces(),Wo.closeParenthesis.parse(this)){t.multLeft(new Pt(e,i,0,n,s,0,r,o,1));continue}}}}}}}}else if(Wo.translate.parse(this)){if(this.whitespaces(),Wo.openParenthesis.parse(this)&&this.double()){const e=this.value;if(this.comma()){if(this.double())var i=this.value}else i=0;if(this.whitespaces(),Wo.closeParenthesis.parse(this)){t.translate(new ft(e,i));continue}}}else if(Wo.rotate.parse(this)){if(this.whitespaces(),Wo.openParenthesis.parse(this)&&this.double()){const e=this.value;if(this.whitespaces(),Wo.closeParenthesis.parse(this)){t.rotate(g.radians(e));continue}if(this.comma()&&this.double()){const i=this.value;if(this.comma()&&this.double()){const n=this.value;if(this.whitespaces(),Wo.closeParenthesis.parse(this)){t.translate(new ft(i,n)),t.rotate(g.radians(e)),t.translate(new ft(-i,-n));continue}}}}}else if(Wo.scale.parse(this)){if(this.whitespaces(),Wo.openParenthesis.parse(this)&&this.double()){const e=this.value;if(this.comma()){if(this.double())var n=this.value}else n=e;if(this.whitespaces(),Wo.closeParenthesis.parse(this)){t.scale(new ft(e,n));continue}}}else if(Wo.skewX.parse(this)){if(this.whitespaces(),Wo.openParenthesis.parse(this)&&this.double()){const e=this.value;if(this.whitespaces(),Wo.closeParenthesis.parse(this)){t.skewX(g.radians(e));continue}}}else if(Wo.skewY.parse(this)&&(this.whitespaces(),Wo.openParenthesis.parse(this)&&this.double())){const e=this.value;if(this.whitespaces(),Wo.closeParenthesis.parse(this)){t.skewY(g.radians(e));continue}}break}return t},styleAttributes(e){const t=Object.assign({},this.styles.at(-1));if("none"===this.style.display)return!1;this.styles.push(t);for(const t of e.attributes)this.parseStyle(t.name,t.value);return this.styleAttribute(e.getAttribute("style")),!0},styleAttribute(e){if(null===e)return;const t=e.split(";");for(const e of t){const t=e.split(":");2===t.length&&this.parseStyle(t[0].trim(),t[1].trim())}},parseStyle(e,t){if("inherit"!==t&&"unset"!=t)switch(this.parseValue(t),e){case"display":this.displayStyle(t);break;case"fill":this.fillStyle(t);break;case"fill-opacity":this.fillOpacityStyle(t);break;case"fill-rule":this.fillRuleStyle(t);break;case"stroke":this.strokeStyle(t);break;case"stroke-opacity":this.strokeOpacityStyle(t);break;case"stroke-width":this.strokeWidthStyle(t);break;case"opacity":this.opacityStyle(t);break;case"stop-color":this.stopColorStyle(t);break;case"stop-opacity":this.stopOpacityStyle(t);break;case"vector-effect":this.vectorEffectStyle(t)}},displayStyle(e){this.style.display="default"!==e?e:"inline"},fillStyle(e){if("default"===e)return this.style.fillType=this.styles[0].fillType,this.style.fillColor=this.styles[0].fillColor,void(this.style.fillURL=this.styles[0].fillURL);if("transparent"!==e){if("none"!==e)return this.urlValue()?(this.style.fillType="URL",void(this.style.fillURL=this.result[1].trim())):this.colorValue(this.styles.at(-1).fillColor)?(this.style.fillType="COLOR",void(this.style.fillColor=this.value.copy())):void 0;this.style.fillType="none"}else this.style.fillType="none"},fillOpacityStyle(e){"default"!==e?"transparent"!==e?this.double()&&(this.style.fillOpacity=g.clamp(this.value,0,1)):this.style.fillOpacity=0:this.style.fillOpacity=this.styles[0].fillOpacity},fillRuleStyle(e){this.style.fillRule="default"!==e?e:this.styles[0].fillRule},strokeStyle(e){if("default"===e)return this.style.strokeType=this.styles[0].strokeType,this.style.strokeColor=this.styles[0].strokeColor,void(this.style.strokeURL=this.styles[0].strokeURL);if("transparent"!==e){if("none"!==e)return this.urlValue()?(this.style.strokeType="URL",void(this.style.strokeURL=this.result[1].trim())):this.colorValue(this.styles.at(-1).strokeColor)?(this.style.strokeType="COLOR",void(this.style.strokeColor=this.value.copy())):void 0;this.style.strokeType="none"}else this.style.strokeType="none"},strokeOpacityStyle(e){"default"!==e?"transparent"!==e?this.double()&&(this.style.strokeOpacity=g.clamp(this.value,0,1)):this.style.strokeOpacity=0:this.style.strokeOpacity=this.styles[0].strokeOpacity},strokeWidthStyle(e){"default"!==e?"none"!==e?this.double()&&(this.style.strokeWidth=this.lengthAttribute(this.value,1)):this.style.strokeWidth=0:this.style.strokeWidth=this.styles[0].strokeWidth},opacityStyle(e){"default"!==e?"transparent"!==e?this.double()&&(this.style.opacity=g.clamp(this.value,0,1)*this.styles.at(-1).opacity):this.style.opacity=0:this.style.opacity=this.styles[0].opacity},stopColorStyle(e){"default"!==e?this.colorValue(qe.Black)&&(this.style.stopColor=this.value.copy()):this.style.stopColor=this.styles[0].stopColor},stopOpacityStyle(e){"default"!==e?"transparent"!==e?this.double()&&(this.style.stopOpacity=g.clamp(this.value,0,1)):this.style.stopOpacity=0:this.style.stopOpacity=this.styles[0].stopOpacity},vectorEffectStyle(e){this.style.vectorEffect="default"!==e?e:this.styles[0].vectorEffect},parseValue(e){this.input=e,this.lastIndex=0,this.value=void 0},whitespaces(){return Wo.whitespaces.parse(this)},comma(){return!!(this.whitespaces()|Wo.comma.parse(this))},int32(){return this.whitespaces(),!!Wo.int32.parse(this)&&(this.value=parseInt(this.result[1]),!0)},double(){return this.whitespaces(),Wo.double.parse(this)?(this.value=parseFloat(this.result[1]),!0):!!Wo.constants.parse(this)&&(this.value=this.CONSTANTS.get(this.result[2].toUpperCase()),"-"===this.result[1]&&(this.value=-this.value),!0)},colorValue:(()=>{const e=new qe(0,0,0,0);return function(t){if(!Wo.color.parse(this))return!1;const i=this.cssColor(t);return this.value=e.set(...this.convertColor(this.result[1],i)),!0}})(),urlValue(){return Wo.url.parse(this)},cssColor:(e,t=e.a)=>`rgba(${255*e.r},${255*e.g},${255*e.b},${t})`,createTransform(e,t=ft.Zero,i=ft.One){const n=this.getExecutionContext(),s=this.transformAttribute(e.getAttribute("transform"));this.modelMatrix.push(),this.modelMatrix.multLeft(ci.Matrix3(s)),s.translate(t),s.scale(i);const r=n.createNode("Transform"),o=ci.Matrix3(s),a=new bt(0,0,0),l=new ai,u=new bt(1,1,1),h=new ai;return o.get(a,l,u,h),r.translation=a,r.rotation=l,r.scale=u,r.scaleOrientation=h,this.idAttribute(e.getAttribute("id"),r),this.groupNodes.at(-1).children.push(r),r},popAll(){this.groupNodes.pop(),this.modelMatrix.pop(),this.styles.pop()},createFillAppearance(e){const t=this.getExecutionContext(),i=t.createNode("Appearance");switch(this.style.fillType){case"none":return null;case"COLOR":{const e=t.createNode("UnlitMaterial");i.material=e,e.emissiveColor=new Ce(...this.style.fillColor),e.transparency=1-this.style.fillOpacity*this.style.opacity;break}case"URL":{const t=this.getExecutionContext().createNode("ImageTexture"),n=this.getFillUrl(this.style.fillURL,e);if(!n)return null;t.url=[n],t.textureProperties=this.texturePropertiesNode,i.texture=t;break}}return i},getFillUrl(e,t){const i=this.hrefAttribute(e);if(i)switch(i.nodeName){case"linearGradient":return this.linearGradientElementUrl(i,t);case"radialGradient":return this.radialGradientElementUrl(i,t);case"pattern":return this.patternUrl(i)}},createStrokeAppearance(){const e=this.getExecutionContext(),t=e.createNode("Appearance"),i=e.createNode("UnlitMaterial");t.material=i,i.emissiveColor=new Ce(...this.style.strokeColor),i.transparency=1-this.style.strokeOpacity*this.style.opacity;const n="non-scaling-stroke"===this.vectorEffect?this.style.strokeWidth:this.getStokeWidth();return n>1&&(t.lineProperties=this.getLineProperties(n)),t},getStokeWidth(){const e=this.modelMatrix.get().multDirMatrix(new bt(this.style.strokeWidth,this.style.strokeWidth,0));return(e.x+e.y)/2},getLineProperties(e){const t=this.lineProperties.get(e);if(t)return t;{const t=this.getExecutionContext().createNode("LineProperties");return t.linewidthScaleFactor=e,this.lineProperties.set(e,t),t}},createTextureProperties(){const e=this.getExecutionContext().createNode("TextureProperties");return e.generateMipMaps=!0,e.minificationFilter="NICEST",e.magnificationFilter="NICEST",e.boundaryModeS="CLAMP_TO_EDGE",e.boundaryModeT="CLAMP_TO_EDGE",e.boundaryModeR="CLAMP_TO_EDGE",e.textureCompression="DEFAULT",e},createTextureCoordinate(e,t,i){if(!i||!i.texture)return null;const n=this.getExecutionContext().createNode("TextureCoordinate"),s=t.matrix.copy().inverse();for(const t of e.point)n.point.push(s.multVecMatrix(new ft(t.x,t.y)).add(ft.One).divide(2));return n},createTesselator(){const e=new Yo.GluTesselator;return e.gluTessCallback(Yo.gluEnum.GLU_TESS_VERTEX_DATA,(function(e,t){t.push(e)})),e.gluTessNormal(0,0,1),e},triangulatePolygon(e,t){const i=this.tessy,n="evenodd"===this.style.fillRule?"GLU_TESS_WINDING_ODD":"GLU_TESS_WINDING_NONZERO",s=[];i.gluTessProperty(Yo.gluEnum.GLU_TESS_WINDING_RULE,Yo.windingRule[n]),i.gluTessCallback(Yo.gluEnum.GLU_TESS_COMBINE,(function(e,i,n){const s=t.point.length;return t.point.push(new bt(...e)),s})),i.gluTessBeginPolygon(s);for(const t of e){i.gluTessBeginContour();for(const[e,n]of t.entries())i.gluTessVertex(n,t.index+e);i.gluTessEndContour()}return i.gluTessEndPolygon(),s}}),Object.defineProperty(Zo.prototype,"style",{get(){return this.styles.at(-1)}});const Qo=Zo;i.add("SVGParser","x_ite/Parser/SVGParser",Qo);const ea=Qo;var ta=n(464);function ia(e){Fr.call(this,e),this.inputs=new Map}Object.assign(Object.setPrototypeOf(ia.prototype,Fr.prototype),{parseIntoScene(e,t,i){for(const n of ia.Parser)try{const s=new n(this.getScene()),r=this.getInput(s.getEncoding(),e);if(Array.isArray(r)?r.some((e=>void 0===e)):void 0===r)continue;if(s.setInput(r),!s.isValid())continue;return s.pushExecutionContext(this.getExecutionContext()),void s.parseIntoScene(t,i)}catch(e){if(!i)throw e;return void i(e)}throw this.getScene().worldURL.startsWith("data:")?new Error("Couldn't parse X3D. No suitable file handler found for 'data:' URL."):new Error(`Couldn't parse X3D. No suitable file handler found for '${this.getScene().worldURL}'.`)},getInput(e,t){if(Array.isArray(e))return e.map((e=>this.getInput(e)));{if(this.inputs.has(e))return this.inputs.get(e);const i=this.createInput(e,t);return this.inputs.set(e,i),i}},createInput(e,t){try{switch(e){case"STRING":return ta.decodeText(t);case"XML":return ta.parseXML(this.getInput("STRING",t));case"JSON":return JSON.parse(this.getInput("STRING",t));case"ARRAY_BUFFER":return t instanceof ArrayBuffer?t:void 0}}catch{return}}}),ia.Parser=[ea,Wr,lo,po,Kr,jr,yo,To,Eo,Io,Po];const na=ia;i.add("GoldenGate","x_ite/Parser/GoldenGate",na);const sa=na,ra=new bt(0,0,0),oa=new bt(0,0,0),aa=new ci;function la(e,t){this.normal=t.copy(),this.distanceFromOrigin=t.dot(e)}Object.assign(la.prototype,{copy(){const e=Object.create(la.prototype);return e.normal=this.normal.copy(),e.distanceFromOrigin=this.distanceFromOrigin,e},assign(e){return this.normal.assign(e.normal),this.distanceFromOrigin=e.distanceFromOrigin,this},set(e,t){return this.normal.assign(t),this.distanceFromOrigin=t.dot(e),this},multRight(e){return oa.assign(this.normal).multiply(this.distanceFromOrigin),aa.assign(e).inverse(),aa.multMatrixDir(ra.assign(this.normal)).normalize(),e.multVecMatrix(oa),this.normal.assign(ra),this.distanceFromOrigin=ra.dot(oa),this},multLeft(e){return oa.assign(this.normal).multiply(this.distanceFromOrigin),aa.assign(e).inverse(),aa.multDirMatrix(ra.assign(this.normal)).normalize(),e.multMatrixVec(oa),this.normal.assign(ra),this.distanceFromOrigin=ra.dot(oa),this},getDistanceToPoint(e){return e.dot(this.normal)-this.distanceFromOrigin},intersectsLine(e,t){const{point:i,direction:n}=e,s=n.dot(this.normal);if(0===s)return!1;const r=(this.distanceFromOrigin-this.normal.dot(i))/s;return t.x=i.x+n.x*r,t.y=i.y+n.y*r,t.z=i.z+n.z*r,!0},toString(){return`${this.normal} ${this.distanceFromOrigin}`}});const ua=la;i.add("Plane3","standard/Math/Geometry/Plane3",ua);const ha=ua;var da=n(602);const ca={area:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n,s){return e.assign(n).subtract(i).cross(t.assign(s).subtract(i)).magnitude()/2}})(),normal(e,t,i,n){const s=i.x-t.x,r=i.y-t.y,o=i.z-t.z,a=e.x-t.x,l=e.y-t.y,u=e.z-t.z;return n.set(r*u-o*l,o*a-s*u,s*l-r*a),n.normalize()},quadNormal(e,t,i,n,s){const r=i.x-e.x,o=i.y-e.y,a=i.z-e.z,l=n.x-t.x,u=n.y-t.y,h=n.z-t.z;return s.set(o*h-a*u,a*l-r*h,r*u-o*l),s.normalize()},triangulatePolygon:(()=>{const e=new da.GluTesselator;return e.gluTessCallback(da.gluEnum.GLU_TESS_VERTEX_DATA,(function(e,t){t.push(e)})),e.gluTessCallback(da.gluEnum.GLU_TESS_COMBINE,(function(e,t,i){return t[0]})),e.gluTessProperty(da.gluEnum.GLU_TESS_WINDING_RULE,da.windingRule.GLU_TESS_WINDING_ODD),function(t,i){e.gluTessBeginPolygon(i),e.gluTessBeginContour();for(const i of t)e.gluTessVertex(i,i.index);return e.gluTessEndContour(),e.gluTessEndPolygon(),i}})(),triangulateConvexPolygon(e,t){for(let i=1,n=e.length-1;i<n;++i)t.push(e[0],e[i],e[i+1])}},pa=ca;i.add("Triangle3","standard/Math/Geometry/Triangle3",pa);const ga=pa,fa={min:0,max:0},ma={min:0,max:0};function _a(){}function xa(e,t,i){i.min=Number.POSITIVE_INFINITY,i.max=Number.NEGATIVE_INFINITY;for(const n of e){const e=n.dot(t);e<i.min&&(i.min=e),e>i.max&&(i.max=e)}}function ya(e,t,i){return t<=e&&e<=i}_a.isSeparated=function(e,t,i){for(const o of e)if(xa(t,o,fa),xa(i,o,ma),r=ma.max,!ya(s=ma.min,n=fa.min,fa.max)&&!ya(n,s,r))return!0;var n,s,r;return!1};const wa=_a;i.add("SAT","standard/Math/Algorithms/SAT",wa);const ba=wa;function Sa(e,t,i){this.viewport=new jt(0,0,0,0),this.scissor=new jt(0,0,0,0),this.points=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],this.normals=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],this.edges=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],this.planes=[new ha(bt.Zero,bt.Zero),new ha(bt.Zero,bt.Zero),new ha(bt.Zero,bt.Zero),new ha(bt.Zero,bt.Zero),new ha(bt.Zero,bt.Zero),new ha(bt.Zero,bt.Zero)],arguments.length&&this.set(e,t,i)}Object.assign(Sa.prototype,{set:(()=>{const e=new ci;return function(t,i,n){this.viewport.assign(i),this.scissor.assign(n);const[s,r,o,a,l,u,h,d]=this.points,c=n[0],p=c+n[2],g=n[1],f=g+n[3];e.assign(t).inverse(),Sa.unProjectPointMatrix(c,g,0,e,i,s),Sa.unProjectPointMatrix(p,g,0,e,i,r),Sa.unProjectPointMatrix(p,f,0,e,i,o),Sa.unProjectPointMatrix(c,f,0,e,i,a),Sa.unProjectPointMatrix(c,g,1,e,i,l),Sa.unProjectPointMatrix(p,g,1,e,i,u),Sa.unProjectPointMatrix(p,f,1,e,i,h),Sa.unProjectPointMatrix(c,f,1,e,i,d);const m=this.normals;ga.normal(s,r,o,m[0]),ga.normal(d,l,s,m[1]),ga.normal(h,o,r,m[2]),ga.normal(o,h,d,m[3]),ga.normal(r,s,l,m[4]),ga.normal(l,d,h,m[5]);const _=this.planes;return _[0].set(r,m[0]),_[1].set(l,m[1]),_[2].set(o,m[2]),_[3].set(h,m[3]),_[4].set(s,m[4]),_[5].set(d,m[5]),this.edges.tainted=!0,this}})(),getViewport(){return this.viewport},getScissor(){return this.scissor},getEdges(){const e=this.edges;if(e.tainted){const[t,i,n,s,r,o,a,l]=this.points;e[0].assign(t).subtract(i),e[1].assign(i).subtract(n),e[2].assign(n).subtract(s),e[3].assign(s).subtract(t),e[4].assign(t).subtract(r),e[5].assign(i).subtract(o),e[6].assign(n).subtract(a),e[7].assign(s).subtract(l),e.tainted=!1}return e},intersectsSphere(e,t){const[i,n,s,r,o,a,l,u]=this.planes;return!(i.getDistanceToPoint(t)>e)&&(!(n.getDistanceToPoint(t)>e)&&(!(s.getDistanceToPoint(t)>e)&&(!(r.getDistanceToPoint(t)>e)&&(!(o.getDistanceToPoint(t)>e)&&!(a.getDistanceToPoint(t)>e)))))},intersectsBox:(()=>{const e=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],t=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],i=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],n=[];for(let e=0;e<24;++e)n.push(new bt(0,0,0));return function(s){s.getPoints(e);const r=this.points;if(ba.isSeparated(s.getNormals(t),e,r))return!1;if(ba.isSeparated(this.normals,e,r))return!1;s.getAxes(i);const o=this.getEdges();for(let e=0;e<3;++e)for(let t=0;t<8;++t)n[3*e+t].assign(i[e]).cross(o[t]);return!ba.isSeparated(n,e,r)}})()}),Object.assign(Sa,{unProjectPoint:(()=>{const e=new ci;return function(t,i,n,s,r,o,a){return this.unProjectPointMatrix(t,i,n,e.assign(s).multRight(r).inverse(),o,a)}})(),unProjectPointMatrix:(()=>{const e=new jt(0,0,0,0);return function(t,i,n,s,r,o){e.set((t-r[0])/r[2]*2-1,(i-r[1])/r[3]*2-1,2*n-1,1),s.multVecMatrix(e);const a=1/e.w;return o.set(e.x*a,e.y*a,e.z*a,1)}})(),unProjectRay:(()=>{const e=new ci;return function(t,i,n,s,r,o){return this.unProjectRayMatrix(t,i,e.assign(n).multRight(s).inverse(),r,o)}})(),unProjectRayMatrix:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n,s,r,o){return Sa.unProjectPointMatrix(i,n,0,s,r,e),Sa.unProjectPointMatrix(i,n,.9,s,r,t),o.setPoints(e,t)}})(),projectPoint:(()=>{const e=new jt(0,0,0,0);return function(t,i,n,s,r){4===t.length?e.assign(t):e.set(t.x,t.y,t.z,1),n.multVecMatrix(i.multVecMatrix(e));const o=1/(2*e.w);return r.set((e.x*o+.5)*s[2]+s[0],(e.y*o+.5)*s[3]+s[1],e.z*o+.5)}})(),projectPointMatrix:(()=>{const e=new jt(0,0,0,0);return function(t,i,n,s){4===t.length?e.assign(t):e.set(t.x,t.y,t.z,1),i.multVecMatrix(e);const r=1/(2*e.w);return s.set((e.x*r+.5)*n[2]+n[0],(e.y*r+.5)*n[3]+n[1],e.z*r+.5)}})(),projectLine:(()=>{const e=new ci;return function(t,i,n,s,r){return this.projectLineMatrix(t,e.assign(i).multRight(n),s,r)}})(),projectLineMatrix:(()=>{const e=new ft(0,0),t=new ft(0,0),i=new bt(0,0,0);return function(n,s,r,o){return Sa.projectPointMatrix(n.point,s,r,e),Sa.projectPointMatrix(i.assign(n.direction).multiply(1e9).add(n.point),s,r,t),o.setPoints(e,t)}})()});const Ta=Sa;i.add("ViewVolume","standard/Math/Geometry/ViewVolume",Ta);const va=Ta;function Oa(e,t,i,n=!1){const s=e.getContext();if(this.context=s,this.width=t,this.height=i,Object.defineProperty(this,"array",{get(){const e=n?new Float32Array(t*i*4):new Uint8Array(t*i*4);return Object.defineProperty(this,"array",{value:e}),e},configurable:!0}),this.lastBuffer=s.getParameter(s.FRAMEBUFFER_BINDING),this.frameBuffer=s.createFramebuffer(),s.bindFramebuffer(s.FRAMEBUFFER,this.frameBuffer),this.colorTexture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.colorTexture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),n?s.texImage2D(s.TEXTURE_2D,0,s.getVersion()>1?s.RGBA32F:s.RGBA,t,i,0,s.RGBA,s.FLOAT,null):s.texImage2D(s.TEXTURE_2D,0,s.RGBA,t,i,0,s.RGBA,s.UNSIGNED_BYTE,null),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.colorTexture,0),s.HAS_FEATURE_DEPTH_TEXTURE){this.depthTexture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.depthTexture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST);const e=s.getVersion()>=2?s.DEPTH_COMPONENT24:s.DEPTH_COMPONENT;s.texImage2D(s.TEXTURE_2D,0,e,t,i,0,s.DEPTH_COMPONENT,s.UNSIGNED_INT,null),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,this.depthTexture,0)}else this.depthBuffer=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,this.depthBuffer),s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,t,i),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,this.depthBuffer);const r=s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE;if(s.bindTexture(s.TEXTURE_2D,null),s.bindFramebuffer(s.FRAMEBUFFER,this.lastBuffer),!r)throw new Error("Couldn't create frame buffer.")}Object.assign(Oa.prototype,{getWidth(){return this.width},getHeight(){return this.height},getColorTexture(){return this.colorTexture},getDepthTexture(){return this.depthTexture},readPixels(){const{context:e,array:t,width:i,height:n}=this;return e.readPixels(0,0,i,n,e.RGBA,e.UNSIGNED_BYTE,t),t},readDepth:(()=>{const e=new ci,t=new bt(0,0,0);return function(i,n){const{context:s,array:r,width:o,height:a}=this;s.readPixels(0,0,o,a,s.RGBA,s.FLOAT,r);let l=0,u=0,h=Number.POSITIVE_INFINITY;for(let e=0,t=0;e<a;++e)for(let i=0;i<o;++i,t+=4){const n=r[t];n<h&&(l=i,u=e,h=n)}return e.assign(i).inverse(),va.unProjectPointMatrix(l,u,h,e,n,t),t.z}})(),bind(){const e=this.context;this.lastBuffer=e.getParameter(e.FRAMEBUFFER_BINDING),e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer)},unbind(){const e=this.context;e.bindFramebuffer(e.FRAMEBUFFER,this.lastBuffer)},delete(){const e=this.context;e.deleteFramebuffer(this.frameBuffer),e.deleteTexture(this.colorTexture),e.HAS_FEATURE_DEPTH_TEXTURE?e.deleteTexture(this.depthTexture):e.deleteRenderbuffer(this.depthBuffer)}});for(const e of Object.keys(Oa.prototype))Object.defineProperty(Oa.prototype,e,{enumerable:!1});const Ea=Oa;i.add("TextureBuffer","x_ite/Rendering/TextureBuffer",Ea);const Na=Ea;let Ca=0;const Fa={POINTER:Ca++,CAMERA:Ca++,PICKING:Ca++,COLLISION:Ca++,SHADOW:Ca++,DISPLAY:Ca++};i.add("TraverseType","x_ite/Rendering/TraverseType",Fa);const Ia=Fa;function Ma(e,t){this.array=e,this.auxiliary=[],t&&(this.compare=t)}Object.assign(Ma.prototype,{compare:(e,t)=>e<t,sort(e,t){this.mergeSort(e,t-1)},mergeSort(e,t){if(e<t){const i=e+t>>>1;this.mergeSort(e,i),this.mergeSort(i+1,t),this.merge(e,i,t)}},merge(e,t,i){const{array:n,auxiliary:s,compare:r}=this;let o,a,l;for(o=0,a=e;a<=t;)s[o++]=n[a++];for(o=0,l=e;l<a&&a<=i;)r(n[a],s[o])?n[l++]=n[a++]:n[l++]=s[o++];for(;l<a;)n[l++]=s[o++]}});const Da=Ma;i.add("MergeSort","standard/Math/Algorithms/MergeSort",Da);const Pa=Da,Ra={frustum(e,t,i,n,s,r,o){const a=t-e,l=n-i,u=r-s,h=2*s,d=(t+e)/a,c=(n+i)/l,p=-(r+s)/u,g=-h*r/u,f=h/a,m=h/l;return o.set(f,0,0,0,0,m,0,0,d,c,p,-1,0,0,g,0)},perspective(e,t,i,n,s,r){const o=Math.tan(e/2)*t;if(n>s){const e=n*o/s;return this.frustum(-e,e,-o,o,t,i,r)}{const e=s*o/n;return this.frustum(-o,o,-e,e,t,i,r)}},perspective2(e,t,i,n,s,r){const o=Math.tan(e/2)*t;return this.frustum(-o,o,-o,o,t,i,r)},ortho(e,t,i,n,s,r,o){const a=t-e,l=n-i,u=r-s,h=2/a,d=2/l,c=-2/u,p=-(t+e)/a,g=-(n+i)/l,f=-(r+s)/u;return o.set(h,0,0,0,0,d,0,0,0,0,c,0,p,g,f,1)},orthoBox:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n){return i.getExtents(e,t),this.ortho(e.x,t.x,e.y,t.y,-t.z,-e.z,n)}})()},Aa=Ra;i.add("Camera","standard/Math/Geometry/Camera",Aa);const Va=Aa;function La(){this.matrix=new ci,this.set(...arguments)}Object.assign(La.prototype,{copy(){const e=Object.create(La.prototype);return e.matrix=this.matrix.copy(),e},assign(e){return this.matrix.assign(e.matrix),this},equals(e){return this.matrix.equals(e.matrix)},getMatrix(){return this.matrix},set(e,t){switch(arguments.length){case 0:return this.matrix.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),this;case 2:return this.matrix.set(e.x/2,0,0,0,0,e.y/2,0,0,0,0,e.z/2,0,t.x,t.y,t.z,1),this}},setExtents(e,t){const i=(t.x-e.x)/2,n=(t.y-e.y)/2,s=(t.z-e.z)/2,r=(t.x+e.x)/2,o=(t.y+e.y)/2,a=(t.z+e.z)/2;return this.matrix.set(i,0,0,0,0,n,0,0,0,0,s,0,r,o,a,1),this},getExtents(e,t){this.getAbsoluteExtents(e,t),e.add(this.center),t.add(this.center)},getAbsoluteExtents:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0);return function(n,s){const r=this.matrix,o=r.xAxis,a=r.yAxis,l=r.zAxis;e.assign(a).add(l);const u=l.subtract(a);t.assign(o).add(e),i.assign(o).add(u);const h=e.subtract(o),d=u.subtract(o);n.assign(t).min(h,d,i),s.assign(t).max(h,d,i),t.negate(),h.negate(),d.negate(),i.negate(),n.min(t,h,d,i),s.max(t,h,d,i)}})(),getPoints:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0);return function(s){const r=this.matrix;e.assign(r.xAxis),t.assign(r.yAxis),i.assign(r.zAxis),n.assign(t).add(i);const o=i.subtract(t);s[0].assign(e).add(n),s[1].assign(n).subtract(e),s[2].assign(o).subtract(e),s[3].assign(e).add(o),s[4].assign(s[2]).negate(),s[5].assign(s[3]).negate(),s[6].assign(s[0]).negate(),s[7].assign(s[1]).negate();const a=this.center;return s[0].add(a),s[1].add(a),s[2].add(a),s[3].add(a),s[4].add(a),s[5].add(a),s[6].add(a),s[7].add(a),s}})(),getAxes(e){const t=this.matrix;return e[0].assign(t.xAxis),e[1].assign(t.yAxis),e[2].assign(t.zAxis),e},getNormals:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=[bt.xAxis,bt.yAxis,bt.zAxis];return function(s){const r=this.matrix;if(e.assign(r.xAxis),t.assign(r.yAxis),i.assign(r.zAxis),0===e.norm()&&(e.assign(t).cross(i),0===e.norm())){for(const i of n)if(e.assign(i).cross(t),0!==e.norm())break;if(0===e.norm()){for(const t of n)if(e.assign(t).cross(i),0!==e.norm())break;0===e.norm()&&e.assign(bt.xAxis)}}if(0===t.norm()&&(t.assign(i).cross(e),0===t.norm())){for(const e of n)if(t.assign(e).cross(i),0!==t.norm())break;if(0===t.norm()){for(const i of n)if(t.assign(i).cross(e),0!==t.norm())break;0===t.norm()&&t.assign(bt.yAxis)}}if(0===i.norm()&&(i.assign(e).cross(t),0===i.norm())){for(const t of n)if(i.assign(t).cross(e),0!==i.norm())break;if(0===i.norm()){for(const e of n)if(i.assign(e).cross(t),0!==i.norm())break;0===i.norm()&&i.assign(bt.zAxis)}}return s[0].assign(t).cross(i).normalize(),s[1].assign(i).cross(e).normalize(),s[2].assign(e).cross(t).normalize(),s}})(),isEmpty(){return 0===this.matrix[15]},add:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0);return function(s){return this.isEmpty()?this.assign(s):s.isEmpty()?this:(this.getExtents(e,t),s.getExtents(i,n),this.setExtents(e.min(i),t.max(n)))}})(),multLeft(e){return this.matrix.multLeft(e),this},multRight(e){return this.matrix.multRight(e),this},containsPoint:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i){return this.getExtents(e,t),e.x<=i.x&&t.x>=i.x&&e.y<=i.y&&t.y>=i.y&&e.z<=i.z&&t.z>=i.z}})(),intersectsBox:(()=>{const e=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],t=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],i=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],n=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],s=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],r=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)];return function(o){if(this.isEmpty())return!1;if(o.isEmpty())return!1;if(this.getPoints(e),o.getPoints(t),ba.isSeparated(this.getNormals(r),e,t))return!1;if(ba.isSeparated(o.getNormals(r),e,t))return!1;this.getAxes(i),o.getAxes(n);for(let e=0;e<3;++e)for(let t=0;t<3;++t)s[3*e+t].assign(i[e]).cross(n[t]);return!ba.isSeparated(s,e,t)}})(),intersectsTriangle:(()=>{const e=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],t=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],i=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],n=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)],s=[],r=[new bt(0,0,0)],o=[new bt(0,0,0),new bt(0,0,0),new bt(0,0,0)];return function(a,l,u){if(this.isEmpty())return!1;if(this.getPoints(e),s[0]=a,s[1]=l,s[2]=u,ba.isSeparated(this.getNormals(n),e,s))return!1;if(ga.normal(a,l,u,r[0]),ba.isSeparated(r,e,s))return!1;this.getAxes(t),o[0].assign(a).subtract(l),o[1].assign(l).subtract(u),o[2].assign(u).subtract(a);for(let e=0;e<3;++e)for(let n=0;n<3;++n)i[3*e+n].assign(t[e]).cross(o[n]);return!ba.isSeparated(i,e,s)}})(),toString(){return`${this.size}, ${this.center}`}}),Object.assign(La,{Extents:(e,t)=>(new La).setExtents(e,t),Points(e){const t=new bt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),i=new bt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const n of e)t.min(n),i.max(n);return(new La).setExtents(t,i)}}),Object.defineProperties(La.prototype,{size:{get:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(){return this.getAbsoluteExtents(e,t),t.subtract(e)}})(),enumerable:!0},center:{get(){return this.matrix.origin},enumerable:!0}});const Ba=La;i.add("Box3","standard/Math/Geometry/Box3",Ba);const Ua=Ba;function Xa(e,t){this.point=e.copy(),this.direction=t.copy()}Object.assign(Xa.prototype,{copy(){const e=Object.create(Xa.prototype);return e.point=this.point.copy(),e.direction=this.direction.copy(),e},assign(e){return this.point.assign(e.point),this.direction.assign(e.direction),this},set(e,t){return this.point.assign(e),this.direction.assign(t),this},setPoints(e,t){return this.point.assign(e),this.direction.assign(t).subtract(e).normalize(),this},multMatrixLine(e){return e.multMatrixVec(this.point),e.multMatrixDir(this.direction).normalize(),this},multLineMatrix(e){return e.multVecMatrix(this.point),e.multDirMatrix(this.direction).normalize(),this},getClosestPointToPoint(e,t){const i=t.assign(e).subtract(this.point).dot(this.direction);return t.assign(this.direction).multiply(i).add(this.point)},getClosestPointToLine:(()=>{const e=new bt(0,0,0);return function(t,i){const{point:n,direction:s}=this,{point:r,direction:o}=t;let a=s.dot(o);return!(Math.abs(a)>=1)&&(e.assign(r).subtract(n),a=(e.dot(s)-a*e.dot(o))/(1-a*a),i.assign(s).multiply(a).add(n),!0)}})(),getPerpendicularVectorToPoint:(()=>{const e=new bt(0,0,0);return function(t,i){return i.assign(this.point).subtract(t),i.subtract(e.assign(this.direction).multiply(i.dot(this.direction)))}})(),getPerpendicularVectorToLine:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n){const s=n;e.assign(this.point).subtract(i.point);const r=e.dot(this.direction),o=e.dot(i.direction),a=this.direction.dot(i.direction),l=a*a,u=(r-o*a)/(1-l),h=-(o-r*a)/(1-l);return t.assign(this.direction).multiply(u),s.assign(i.direction).multiply(h),s.subtract(t).add(e)}})(),intersectsTriangle:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n,s,r){const o=n.subtract(i),a=s.subtract(i);e.assign(this.direction).cross(a);const l=o.dot(e);if(0===l)return!1;const u=1/l;t.assign(this.point).subtract(i);const h=t.dot(e)*u;if(h<0||h>1)return!1;const d=t.cross(o),c=this.direction.dot(d)*u;return!(c<0||h+c>1)&&(r.u=h,r.v=c,r.t=1-h-c,!0)}})(),toString(){return`${this.point}, ${this.direction}`}}),Object.assign(Xa,{Points(e,t){const i=Object.create(Xa.prototype);return i.point=e.copy(),i.direction=t.copy().subtract(e).normalize(),i}});const ka=Xa;i.add("Line3","standard/Math/Geometry/Line3",ka);const ja=ka;const za=class{#e=0;#t=0;cycles=0;elapsedTime=0;start(){this.#e=Date.now()}stop(){this.#e<=this.#t||(this.#t=Date.now(),this.cycles+=1,this.elapsedTime+=this.#t-this.#e)}reset(){this.#e=0,this.#t=0,this.cycles=0,this.elapsedTime=0}get averageTime(){return this.cycles?this.elapsedTime/this.cycles:0}};i.add("StopWatch","standard/Time/StopWatch",za);const Ga=za;let Ha=0;function qa(e){const t=e.getBrowser();this.renderCount=0,this.viewVolumes=[],this.cameraSpaceMatrix=new Ho(ci),this.viewMatrix=new Ho(ci),this.projectionMatrix=new Ho(ci),this.modelViewMatrix=new Ho(ci),this.viewportArray=new Int32Array(4),this.projectionMatrixArray=new Float32Array(16),this.cameraSpaceMatrixArray=new Float32Array(16),this.hitRay=new ja(bt.Zero,bt.Zero),this.sensors=[[]],this.viewpointGroups=[],this.localObjectsCount=[0,0,0],this.globalObjects=[],this.localObjects=[],this.lights=[],this.globalShadows=[!1],this.localShadows=[!1],this.localFogs=[null],this.layouts=[],this.humanoids=[],this.textureProjectors=[],this.generatedCubeMapTextures=[],this.collisions=[],this.collisionTime=new Ga,this.numPointingShapes=0,this.numCollisionShapes=0,this.numShadowShapes=0,this.numOpaqueShapes=0,this.numTransparentShapes=0,this.pointingShapes=[],this.collisionShapes=[],this.activeCollisions=[],this.shadowShapes=[],this.opaqueShapes=[],this.transparentShapes=[],this.transparencySorter=new Pa(this.transparentShapes,((e,t)=>e.distance<t.distance)),this.speed=0,this.depthBuffer=new Na(t,16,16,!0)}function Ya(e,t){for(var i=0,n=t.length;i<n;++i)e[i]=t[i];e.length=n}Object.assign(qa.prototype,{initialize(){},isIndependent:()=>!0,getRenderCount(){return this.renderCount},getViewVolumes(){return this.viewVolumes},getViewVolume(){return this.viewVolumes.at(-1)},getCameraSpaceMatrix(){return this.cameraSpaceMatrix},getViewMatrix(){return this.viewMatrix},getProjectionMatrix(){return this.projectionMatrix},getModelViewMatrix(){return this.modelViewMatrix},getViewportArray(){return this.viewportArray},getProjectionMatrixArray(){return this.projectionMatrixArray},getCameraSpaceMatrixArray(){return this.cameraSpaceMatrixArray},getLogarithmicDepthBuffer(){return this.logarithmicDepthBuffer},getHitRay(){return this.hitRay},getSensors(){return this.sensors},getViewpointGroups(){return this.viewpointGroups},getGlobalObjects(){return this.globalObjects},getLocalObjects(){return this.localObjects},getLocalObjectsCount(){return this.localObjectsCount},getLights(){return this.lights},pushGlobalShadows(e){this.globalShadows.push(e||this.globalShadows.at(-1))},getGlobalShadows(){return this.globalShadows},pushLocalShadows(e){this.localShadows.push(e||this.localShadows.at(-1))},popLocalShadows(){this.localShadows.pop()},setGlobalFog:(()=>{const e=new ci;return function(t){if(t.getFogType()){const i=this.localFogs[0]||t.getFogs().pop();e.assign(t.getModelMatrix()).multRight(this.getViewMatrix().get()),i.set(t,e),this.localFogs[0]=i}else this.localFogs[0]=null}})(),getLocalFogs(){return this.localFogs},getLayouts(){return this.layouts},getParentLayout(){return this.layouts.at(-1)},getHumanoids(){return this.humanoids},getTextureProjectors(){return this.textureProjectors},getGeneratedCubeMapTextures(){return this.generatedCubeMapTextures},getCollisions(){return this.collisions},getCollisionTime(){return this.collisionTime},setNumPointingShapes(e){this.numPointingShapes=e},getNumPointingShapes(){return this.numPointingShapes},getPointingShapes(){return this.pointingShapes},setNumCollisionShapes(e){this.numCollisionShapes=e},getNumCollisionShapes(){return this.numCollisionShapes},getCollisionShapes(){return this.collisionShapes},setNumShadowShapes(e){this.numShadowShapes=e},getNumShadowShapes(){return this.numShadowShapes},getShadowShapes(){return this.shadowShapes},setNumOpaqueShapes(e){this.numOpaqueShapes=e},getNumOpaqueShapes(){return this.numOpaqueShapes},getOpaqueShapes(){return this.opaqueShapes},setNumTransparentShapes(e){this.numTransparentShapes=e},getNumTransparentShapes(){return this.numTransparentShapes},getTransparentShapes(){return this.transparentShapes},constrainTranslation(e,t){const i=this.getDistance(e)-this.getNavigationInfo().getCollisionRadius();if(i>0){return e.magnitude()>i?e.normalize().multiply(i):e}return t?this.constrainTranslation(e.normalize().multiply(i),!1):e.assign(bt.Zero)},getDistance:(()=>{const e=new ci,t=new ci,i=new ai,n=new bt(0,0,0),s=new ai;return function(r){this.collisionTime.start();const o=this.getViewpoint(),a=this.getNavigationInfo(),l=a.getCollisionRadius(),u=a.getStepHeight()-a.getAvatarHeight(),h=a.getNearValue(),d=a.getAvatarHeight();Va.ortho(-l,l,Math.min(u,-l),l,h,Math.max(2*l,2*d),e),i.assign(o._orientation.getValue()).inverse().multRight(o.getOrientation()),s.setFromToVec(bt.zAxis,n.assign(r).negate()).multRight(i),o.straightenHorizon(s),t.assign(o.getModelMatrix()),t.translate(o.getUserPosition()),t.rotate(s),t.inverse(),t.multRight(e),t.multLeft(o.getCameraSpaceMatrix()),this.getProjectionMatrix().pushMatrix(t);const c=this.getDepth(e);return this.getProjectionMatrix().pop(),this.collisionTime.stop(),-c}})(),getDepth:(()=>{const e=new jt(0,0,16,16),t=new va;return t.set(ci.Identity,e,e),function(i){this.depthBuffer.bind(),this.viewVolumes.push(t),this.depth(this.collisionShapes,this.numCollisionShapes);const n=this.depthBuffer.readDepth(i,e);return this.viewVolumes.pop(),this.depthBuffer.unbind(),n}})(),render(e,t,i){switch(e){case Ia.POINTER:this.numPointingShapes=0,t.call(i,e,this),this.pointing(this.pointingShapes,this.numPointingShapes);break;case Ia.COLLISION:this.numCollisionShapes=0,t.call(i,e,this),this.collide(),this.gravite();break;case Ia.SHADOW:this.numShadowShapes=0,t.call(i,e,this),this.depth(this.shadowShapes,this.numShadowShapes);break;case Ia.DISPLAY:this.lightIndex=0,this.numOpaqueShapes=0,this.numTransparentShapes=0,this.setGlobalFog(this.getFog()),t.call(i,e,this),this.draw()}},setHitRay(e,t,i){va.unProjectRay(i.x,i.y,ci.Identity,e,t,this.hitRay)},addPointingShape:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.magnitude()/2,r=this.viewVolumes.at(-1);if(r.intersectsSphere(s,t)){const e=this.numPointingShapes++;e===this.pointingShapes.length&&this.pointingShapes.push({renderObject:this,modelViewMatrix:new Float32Array(16),clipPlanes:[],sensors:[]});const t=this.pointingShapes[e];return t.modelViewMatrix.set(n),t.shapeNode=i,t.scissor=r.getScissor(),t.humanoidNode=this.humanoids.at(-1),Ya(t.clipPlanes,this.localObjects),Ya(t.sensors,this.sensors.at(-1)),!0}return!1}})(),addCollisionShape:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.magnitude()/2,r=this.viewVolumes.at(-1);if(r.intersectsSphere(s,t)){const e=this.numCollisionShapes++;e===this.collisionShapes.length&&this.collisionShapes.push({renderObject:this,modelViewMatrix:new Float32Array(16),collisions:[],clipPlanes:[]});const t=this.collisionShapes[e];return t.modelViewMatrix.set(n),t.shapeNode=i,t.scissor=r.getScissor(),Ya(t.collisions,this.collisions),Ya(t.clipPlanes,this.localObjects),!0}return!1}})(),addShadowShape:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.magnitude()/2,r=this.viewVolumes.at(-1);if(r.intersectsSphere(s,t)){const e=this.numShadowShapes++;e===this.shadowShapes.length&&this.shadowShapes.push({renderObject:this,modelViewMatrix:new Float32Array(16),clipPlanes:[]});const t=this.shadowShapes[e];return t.modelViewMatrix.set(n),t.shapeNode=i,t.scissor=r.getScissor(),t.humanoidNode=this.humanoids.at(-1),Ya(t.clipPlanes,this.localObjects),!0}return!1}})(),addDisplayShape:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.magnitude()/2,r=this.viewVolumes.at(-1);if(r.intersectsSphere(s,t)){if(i.isTransparent()){const e=this.numTransparentShapes++;e===this.transparentShapes.length&&this.transparentShapes.push(this.createRenderContext(!0)),(o=this.transparentShapes[e]).distance=t.z}else{const e=this.numOpaqueShapes++;e===this.opaqueShapes.length&&this.opaqueShapes.push(this.createRenderContext(!1));var o=this.opaqueShapes[e]}return o.modelViewMatrix.set(n),o.scissor.assign(r.getScissor()),o.shadows=this.localShadows.at(-1),o.fogNode=this.localFogs.at(-1),o.shapeNode=i,o.appearanceNode=i.getAppearance(),o.humanoidNode=this.humanoids.at(-1),Ya(o.localObjects,this.localObjects),Ya(o.objectsCount,this.localObjectsCount),!0}return!1}})(),createRenderContext(e){return{renderObject:this,transparent:e,modelViewMatrix:new Float32Array(16),scissor:new jt(0,0,0,0),localObjects:[],objectsCount:[0,0,0]}},pointing:(()=>{const e=new Float32Array(16);return function(t,i){const n=this.getBrowser(),s=n.getContext(),r=this.getViewVolume().getViewport(),[o,a]=n.getPointer();e.set(this.getProjectionMatrix().get()),s.viewport(r[0]-o,r[1]-a,r[2],r[3]),s.scissor(0,0,1,1),s.clear(s.DEPTH_BUFFER_BIT),s.disable(s.CULL_FACE);for(let r=0;r<i;++r){const i=t[r],{scissor:l,clipPlanes:u,modelViewMatrix:h,shapeNode:d,humanoidNode:c}=i,p=d.getAppearance(),g=d.getGeometryContext(),f=p.getStyleProperties(g.geometryType),m=n.getPointingShader(u.length,d,c),_=n.addPointingShape(i);s.scissor(l.x-o,l.y-a,l.z,l.w),m.enable(s),m.setClipPlanes(s,u),s.uniformMatrix4fv(m.x3d_ProjectionMatrix,!1,e),s.uniformMatrix4fv(m.x3d_ModelViewMatrix,!1,h),s.uniform1f(m.x3d_Id,_),f?.setShaderUniforms(s,m),c?.setShaderUniforms(s,m),d.displaySimple(s,i,m),n.resetTextureUnits()}}})(),collide:(()=>{const e=new ci,t=new ci,i=new Ua(bt.Zero,bt.Zero),n=new bt(0,0,0);return function(){const s=[],r=2.2*this.getNavigationInfo().getCollisionRadius();n.set(r,r,r);for(let r=0,o=this.numCollisionShapes;r<o;++r){const o=this.collisionShapes[r],a=o.collisions;if(a.length&&(i.set(n,bt.Zero),i.multRight(e.assign(o.modelViewMatrix).inverse()),o.shapeNode.intersectsBox(i,o.clipPlanes,t.assign(o.modelViewMatrix))))for(const e of a)s.push(e)}if(this.activeCollisions.length){const e=s.length?this.activeCollisions.filter((e=>!s.includes(e))):this.activeCollisions;for(const t of e)t.set_active(!1)}this.activeCollisions=s;for(const e of s)e.set_active(!0)}})(),gravite:(()=>{const e=new ci,t=new ci,i=new bt(0,0,0),n=new ai;return function(){const s=this.getBrowser();if(s.getActiveLayer()===this){if("WALK"!==s.getCurrentViewer())return}else if("WALK"!==this.getNavigationInfo().getViewer())return;const r=this.getNavigationInfo(),o=this.getViewpoint(),a=r.getCollisionRadius(),l=r.getNearValue(),u=r.getAvatarHeight(),h=r.getStepHeight();Va.ortho(-a,a,-a,a,l,Math.max(2*a,2*u),e);const d=o.getUpVector(),c=n.setFromToVec(bt.zAxis,d);t.assign(o.getModelMatrix()),t.translate(o.getUserPosition()),t.rotate(c),t.inverse(),t.multRight(e),t.multLeft(o.getCameraSpaceMatrix()),this.getProjectionMatrix().pushMatrix(t);let p=-this.getDepth(e);this.getProjectionMatrix().pop(),p-=u;const g=n.setFromToVec(bt.yAxis,d);if(p>0){const e=this.speed?s.getCurrentFrameRate():1e6;this.speed-=s.getBrowserOptions()._Gravity.getValue()/e;let t=this.speed/e;t<-p&&(t=-p,this.speed=0),o._positionOffset=o._positionOffset.getValue().add(g.multVecRot(i.set(0,t,0)))}else this.speed=0,p=-p,p>.01&&p<h&&(this.constrainTranslation(g.multVecRot(i.set(0,p,0)),!1),o._positionOffset=i.add(o._positionOffset.getValue()))}})(),depth:(()=>{const e=new Float32Array(16);return function(t,i){const n=this.getBrowser(),s=n.getContext(),r=this.getViewVolume().getViewport();e.set(this.getProjectionMatrix().get()),s.viewport(...r),s.scissor(...r),s.clearColor(1,0,0,0),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.disable(s.CULL_FACE);for(let r=0;r<i;++r){const i=t[r],{scissor:o,clipPlanes:a,modelViewMatrix:l,shapeNode:u,humanoidNode:h}=i,d=u.getAppearance(),c=u.getGeometryContext(),p=d.getStyleProperties(c.geometryType),g=n.getDepthShader(a.length,u,h);s.scissor(...o),g.enable(s),g.setClipPlanes(s,a),s.uniformMatrix4fv(g.x3d_ProjectionMatrix,!1,e),s.uniformMatrix4fv(g.x3d_ModelViewMatrix,!1,l),p?.setShaderUniforms(s,g),h?.setShaderUniforms(s,g),u.displaySimple(s,i,g),n.resetTextureUnits()}}})(),draw(){const e=this.getBrowser(),t=e.getContext(),i=this.getViewVolume().getViewport(),n=this.globalObjects,s=this.lights,r=this.textureProjectors,o=this.generatedCubeMapTextures,a=this.globalShadows,l=a.at(-1),u=this.getNavigationInfo()._headlight.getValue(),h=n.reduce(((e,t)=>e+!!t.lightNode),0),d=n.reduce(((e,t)=>e+!!t.textureProjectorNode),0),c=e.getFrameBuffer().getOrderIndependentTransparency();if(this.renderCount=++Ha,this.logarithmicDepthBuffer=e.getBrowserOption("LogarithmicDepthBuffer")||this.getViewpoint().getLogarithmicDepthBuffer(),this.isIndependent()){for(const e of s)e.renderShadowMap(this);for(const e of o)e.renderTexture(this)}u&&e.getHeadlight().setGlobalVariables(this);for(const e of s)e.setGlobalVariables(this);for(const e of r)e.setGlobalVariables(this);this.viewportArray.set(i),this.cameraSpaceMatrixArray.set(this.getCameraSpaceMatrix().get()),this.projectionMatrixArray.set(this.getProjectionMatrix().get()),t.viewport(...i),t.scissor(...i),t.clear(t.DEPTH_BUFFER_BIT),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),this.getBackground().display(t,this,i);const p=this.opaqueShapes;for(let i=0,n=this.numOpaqueShapes;i<n;++i){const n=p[i];t.scissor(...n.scissor),n.shadows=n.shadows||l,n.objectsCount[1]+=h,n.objectsCount[2]+=d,n.shapeNode.display(t,n),e.resetTextureUnits()}const g=this.transparentShapes;c?e.getFrameBuffer().bindForOrderIndependentTransparency():this.transparencySorter.sort(0,this.numTransparentShapes),t.depthMask(!1),t.enable(t.BLEND);for(let i=0,n=this.numTransparentShapes;i<n;++i){const n=g[i];t.scissor(...n.scissor),n.shadows=n.shadows||l,n.objectsCount[1]+=h,n.objectsCount[2]+=d,n.shapeNode.display(t,n),e.resetTextureUnits()}if(t.depthMask(!0),t.disable(t.BLEND),c&&(e.getFrameBuffer().compose(),e.getFrameBuffer().unbind()),this.isIndependent()){const t=e.getLocalObjects();for(const e of t)e.dispose();t.length=0;for(const e of n)e.dispose()}n.length=0,s.length=0,a.length=1,r.length=0,o.length=0}});const Wa=qa;i.add("X3DRenderObject","x_ite/Rendering/X3DRenderObject",Wa);const $a=Wa;function Ja(e,t){ds.call(this,e),this.nodes=[t]}Object.assign(Object.setPrototypeOf(Ja.prototype,ds.prototype),{get(){return this.nodes},top(){return this.nodes.at(-1)},pushOnTop(e){e!==this.nodes[0]&&(this.nodes.at(-1)._isBound=!1,this.nodes.push(e)),e._isBound=!0,e._bindTime=this.getBrowser().getCurrentTime(),this.addNodeEvent()},update(e,t,i){if(!t.length&&!i.length)return;const n=this.top(),s=this.nodes.at(-1);for(const e of t){const t=this.nodes.indexOf(e);t>0&&this.nodes.splice(t,1)}s!==this.nodes[0]&&i.some((e=>!e._set_bind.getValue()&&e===s))&&this.nodes.pop();for(const e of i)if(e._set_bind.getValue()){const t=this.nodes.indexOf(e);t>-1&&this.nodes.splice(t,1),this.nodes.push(e)}const r=this.nodes.at(-1);r!==s&&(s._isBound=!1,r._isBound=!0,r._bindTime=this.getBrowser().getCurrentTime()),r.transitionStart(e,n),this.addNodeEvent()}});for(const e of Object.keys(Ja.prototype))Object.defineProperty(Ja.prototype,e,{enumerable:!1});Object.defineProperties(Ja,{typeName:{value:"BindableStack",enumerable:!0}});const Ka=Ja;i.add("BindableStack","x_ite/Execution/BindableStack",Ka);const Za=Ka;function Qa(e,t){ds.call(this,e),this.modificationCount=0,this.nodes=[t],this.collectedNodes=[t],this.changedNodes=[],this.removedNodes=[]}Object.assign(Object.setPrototypeOf(Qa.prototype,ds.prototype),{get(){return this.nodes},getBound(e){const t=this.nodes.length;if(1===t)return this.nodes[0];if(e)for(let i=1;i<t;++i){const t=this.nodes[i];if((t.getExecutionContext().getOuterNode()?.getScene()??t.getScene()).isMainScene()&&t.getName()==e)return t}for(let e=1;e<t;++e){const t=this.nodes[e];if((t.getExecutionContext().getOuterNode()?.getScene()??t.getScene()).isMainScene()&&t._isBound.getValue())return t}for(let e=1;e<t;++e){const t=this.nodes[e];if((t.getExecutionContext().getOuterNode()?.getScene()??t.getScene()).isMainScene())return t}return this.nodes[0]},push(e){return this.collectedNodes.push(e)},update(e,t){const{collectedNodes:i,changedNodes:n,removedNodes:s}=this;for(const e of i)e.getModificationCount()>this.modificationCount&&n.push(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}(i,this.nodes)){for(const e of this.nodes)i.includes(e)||s.push(e);const e=this.nodes;this.nodes=i,this.collectedNodes=e}this.collectedNodes.length=1,t.update(e,s,n),n.length=0,s.length=0,this.modificationCount=tr.getModificationCount()}});for(const e of Object.keys(Qa.prototype))Object.defineProperty(Qa.prototype,e,{enumerable:!1});Object.defineProperties(Qa,{typeName:{value:"BindableList",enumerable:!0}});const el=Qa;i.add("BindableList","x_ite/Execution/BindableList",el);const tl=el,il={TELEPORT:!0,LINEAR:!0,ANIMATE:!0};function nl(e){tr.call(this,e),this.addType(d.NavigationInfo),this.addChildObjects(d.outputOnly,"transitionStart",new Yn.SFBool,d.outputOnly,"transitionActive",new Yn.SFBool,d.outputOnly,"availableViewers",new Yn.MFString,d.outputOnly,"viewer",new Yn.SFString("EXAMINE")),this._avatarSize.setUnit("length"),this._speed.setUnit("speed"),this._visibilityLimit.setUnit("speed")}Object.assign(Object.setPrototypeOf(nl.prototype,tr.prototype),{initialize(){tr.prototype.initialize.call(this),this._type.addInterest("set_type__",this),this._headlight.addInterest("set_headlight__",this),this._transitionStart.addInterest("set_transitionStart__",this),this._transitionComplete.addInterest("set_transitionComplete__",this),this._isBound.addInterest("set_isBound__",this),this.set_type__(),this.set_headlight__()},getViewer(){return this._viewer.getValue()},getCollisionRadius(){return this._avatarSize.length>0&&this._avatarSize[0]>0?this._avatarSize[0]:.25},getAvatarHeight(){return this._avatarSize.length>1?this._avatarSize[1]:1.6},getStepHeight(){return this._avatarSize.length>2?this._avatarSize[2]:.75},getNearValue(){const e=this.getCollisionRadius();return 0===e?1e-5:e/2},getFarValue(e){return this._visibilityLimit.getValue()?this._visibilityLimit.getValue():e.getMaxFarValue()},getTransitionType(){for(const e of this._transitionType){if(il[e])return e}return"LINEAR"},set_type__(){this._viewer="EXAMINE";for(const e of this._type){switch(e){case"EXAMINE":case"WALK":case"FLY":case"LOOKAT":case"PLANE":case"NONE":this._viewer=e;break;case"PLANE_create3000.github.io":case"PLANE_create3000.de":this._viewer="PLANE";break;default:continue}break}let e=!1,t=!1,i=!1,n=!1,s=!1,r=!1;if(this._type.length)for(const o of this._type){switch(o){case"EXAMINE":default:e=!0;continue;case"WALK":t=!0;continue;case"FLY":i=!0;continue;case"LOOKAT":r=!0;continue;case"PLANE":n=!0;continue;case"NONE":s=!0;continue;case"ANY":e=!0,t=!0,i=!0,n=!0,s=!0,r=!0}break}else e=!0,t=!0,i=!0,n=!0,s=!0,r=!0;this._availableViewers.length=0,e&&this._availableViewers.push("EXAMINE"),t&&this._availableViewers.push("WALK"),i&&this._availableViewers.push("FLY"),n&&this._availableViewers.push("PLANE"),r&&this._availableViewers.push("LOOKAT"),s&&this._availableViewers.push("NONE")},set_headlight__(){this._headlight.getValue()?delete this.enable:this.enable=Function.prototype},set_transitionStart__(){this._transitionActive.getValue()||(this._transitionActive=!0)},set_transitionComplete__(){this._transitionActive.getValue()&&(this._transitionActive=!1)},set_isBound__(){this._isBound.getValue()||this._transitionActive.getValue()&&(this._transitionActive=!1)},enable(e,t){e===Ia.DISPLAY&&this._headlight.getValue()&&t.getGlobalObjects().push(this.getBrowser().getHeadlight())},traverse(e,t){e===Ia.CAMERA&&t.getLayer().getNavigationInfos().push(this)}}),Object.defineProperties(nl,{typeName:{value:"NavigationInfo",enumerable:!0},componentName:{value:"Navigation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_bind",new Yn.SFBool),new X(d.inputOutput,"type",new Yn.MFString("EXAMINE","ANY")),new X(d.inputOutput,"avatarSize",new Yn.MFFloat(.25,1.6,.75)),new X(d.inputOutput,"speed",new Yn.SFFloat(1)),new X(d.inputOutput,"headlight",new Yn.SFBool(!0)),new X(d.inputOutput,"visibilityLimit",new Yn.SFFloat),new X(d.inputOutput,"transitionType",new Yn.MFString("LINEAR")),new X(d.inputOutput,"transitionTime",new Yn.SFTime(1)),new X(d.outputOnly,"transitionComplete",new Yn.SFBool),new X(d.outputOnly,"isBound",new Yn.SFBool),new X(d.outputOnly,"bindTime",new Yn.SFTime)]),enumerable:!0}});const sl=nl;i.add("NavigationInfo","x_ite/Components/Navigation/NavigationInfo",sl);const rl=sl;const ol=function(e){return Object.assign([],{top:0,pop(){return 0!==this.top?this[--this.top]:new e},push(e){this[this.top++]=e},clear(){this.length=0,this.top=0}})};i.add("ObjectCache","standard/Utility/ObjectCache",ol);const al=ol,ll=al(ul);function ul(){this.fogMatrix=new Float32Array(9)}function hl(e){this.addType(d.X3DFogObject),this.addChildObjects(d.inputOutput,"hidden",new Yn.SFBool),this._visibilityRange.setUnit("length"),this.colorArray=new Float32Array(3)}Object.assign(ul.prototype,{set(e,t){this.fogNode=e,this.fogMatrix.set(t.submatrix.inverse())},getFogType(){return this.fogNode.getFogType()},setShaderUniforms(e,t){if(t.hasFog(this))return;const i=this.fogNode;e.uniform3fv(t.x3d_FogColor,i.colorArray),e.uniform1f(t.x3d_FogVisibilityRange,i.visibilityRange),e.uniformMatrix3fv(t.x3d_FogMatrix,!1,this.fogMatrix)},dispose(){ll.push(this)}}),Object.assign(hl.prototype,{initialize(){this._hidden.addInterest("set_fogType__",this),this._fogType.addInterest("set_fogType__",this),this._color.addInterest("set_color__",this),this._visibilityRange.addInterest("set_visibilityRange__",this),this.set_color__(),this.set_visibilityRange__()},isHidden(){return this._hidden.getValue()},setHidden(e){e!==this._hidden.getValue()&&(this._hidden=e)},getFogType(){return this.fogType},getFogs:()=>ll,set_fogType__:(()=>{const e=new Map([["LINEAR",1],["EXPONENTIAL",2]]);return function(){this._hidden.getValue()||0===this.visibilityRange?this.fogType=0:this.fogType=e.get(this._fogType.getValue())||1}})(),set_color__(){const e=this._color.getValue(),t=this.colorArray;t[0]=e.r,t[1]=e.g,t[2]=e.b},set_visibilityRange__(){this.visibilityRange=Math.max(0,this._visibilityRange.getValue()),this.set_fogType__()},dispose(){}}),Object.defineProperties(hl,{typeName:{value:"X3DFogObject",enumerable:!0},componentName:{value:"EnvironmentalEffects",enumerable:!0}});const dl=hl;i.add("X3DFogObject","x_ite/Components/EnvironmentalEffects/X3DFogObject",dl);const cl=dl;function pl(e){tr.call(this,e),cl.call(this,e),this.addType(d.Fog),this.modelMatrix=new ci}Object.assign(Object.setPrototypeOf(pl.prototype,tr.prototype),cl.prototype,{initialize(){tr.prototype.initialize.call(this),cl.prototype.initialize.call(this)},getModelMatrix(){return this.modelMatrix},traverse(e,t){e===Ia.CAMERA&&(t.getLayer().getFogs().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get()))},dispose(){cl.prototype.dispose.call(this),tr.prototype.dispose.call(this)}}),Object.defineProperties(pl,{typeName:{value:"Fog",enumerable:!0},componentName:{value:"EnvironmentalEffects",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_bind",new Yn.SFBool),new X(d.inputOutput,"fogType",new Yn.SFString("LINEAR")),new X(d.inputOutput,"color",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"visibilityRange",new Yn.SFFloat),new X(d.outputOnly,"isBound",new Yn.SFBool),new X(d.outputOnly,"bindTime",new Yn.SFTime)]),enumerable:!0}});const gl=pl;i.add("Fog","x_ite/Components/EnvironmentalEffects/Fog",gl);const fl=gl;function ml(e){this.gl=e,this.vertexArrays=new Map}Object.assign(ml.prototype,{update(e=!0){return e&&this.delete(),this},enable(e){const t=this.vertexArrays.get(e);if(t)return this.gl.bindVertexArray(t),!1;{const t=this.gl.createVertexArray();return this.vertexArrays.set(e,t),this.gl.bindVertexArray(t),!0}},delete(){for(const e of this.vertexArrays.values())this.gl.deleteVertexArray(e);this.vertexArrays.clear()}});const _l=ml;i.add("VertexArray","x_ite/Rendering/VertexArray",_l);const xl=_l;let yl=0;const wl={POINT:yl++,WIREFRAME:yl++,FLAT:yl++,GOURAUD:yl++,PHONG:yl++};i.add("Shading","x_ite/Browser/Core/Shading",wl);const bl=wl,Sl=[new bt(0,0,1),new bt(0,0,-1),new bt(0,1,0),new bt(0,-1,0),new bt(1,0,0)];function Tl(e){bs.call(this,e),this.addType(d.X3DGeometryNode),this.addChildObjects(d.outputOnly,"transparent",new Yn.SFBool,d.outputOnly,"bbox_changed",new Yn.SFTime,d.outputOnly,"rebuild",new Yn.SFTime);const t=this.getBrowser();this.min=new bt(0,0,0),this.max=new bt(0,0,0),this.bbox=Ua.Extents(this.min,this.max),this.solid=!0,this.primitiveMode=t.getContext().TRIANGLES,this.geometryType=3,this.flatShading=void 0,this.colorMaterial=!1,this.attribNodes=[],this.attribArrays=[],this.textureCoordinateMapping=new Map,this.multiTexCoords=[],this.coordIndices=new Yn.MFFloat,this.texCoords=new Yn.MFFloat,this.fogDepths=new Yn.MFFloat,this.colors=new Yn.MFFloat,this.normals=new Yn.MFFloat,this.flatNormals=new Yn.MFFloat,this.vertices=new Yn.MFFloat,this.hasFogCoords=!1,this.hasNormals=!1,this.geometryKey="",this.vertexCount=0,this.planes=[];for(let e=0;e<5;++e)this.planes[e]=new ha(bt.Zero,bt.zAxis)}Object.assign(Object.setPrototypeOf(Tl.prototype,bs.prototype),{setup(){bs.prototype.setup.call(this),this.rebuild()},initialize(){bs.prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();this.getLive().addInterest("set_live__",this),this.addInterest("requestRebuild",this),this._rebuild.addInterest("rebuild",this),this.frontFace=t.CCW,this.backFace=new Map([[t.CCW,t.CW],[t.CW,t.CCW]]),this.coordIndexBuffer=t.createBuffer(),this.attribBuffers=[],this.textureCoordinateNode=e.getDefaultTextureCoordinate(),this.texCoordBuffers=Array.from({length:e.getMaxTexCoords()},(()=>t.createBuffer())),this.fogDepthBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.normalBuffer=t.createBuffer(),this.vertexBuffer=t.createBuffer(),this.vertexArrayObject=new xl(t),this.set_live__()},setGeometryType(e){this.geometryType=e},getGeometryType(){return this.geometryType},setTransparent(e){e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()},getBBox(){return this.bbox},setBBox(e){if(!e.equals(this.bbox)){e.getExtents(this.min,this.max),this.bbox.assign(e);for(let e=0;e<5;++e)this.planes[e].set(e%2?this.min:this.max,Sl[e]);this._bbox_changed.addEvent()}},getMin(){return this.min},getMax(){return this.max},getMatrix:()=>ci.Identity,setPrimitiveMode(e){this.primitiveMode=e},getPrimitiveMode(){return this.primitiveMode},setSolid(e){this.solid=e},setCCW(e){const t=this.getBrowser().getContext();this.frontFace=e?t.CCW:t.CW},getCoordIndices(){return this.coordIndices},getAttrib(){return this.attribNodes},getAttribs(){return this.attribArrays},getAttribBuffers(){return this.attribBuffers},setFogDepths(e){this.fogDepths.assign(e)},getFogDepths(){return this.fogDepths},setColors(e){this.colors.assign(e)},getColors(){return this.colors},setMultiTexCoords(e){const t=this.multiTexCoords,i=e.length;for(let n=0;n<i;++n)t[n]=e[n];t.length=i},getMultiTexCoords(){return this.multiTexCoords},getTexCoords(){return this.texCoords},getTextureCoordinate(){return this.textureCoordinateNode},setTextureCoordinate(e){this.textureCoordinateNode.removeInterest("updateTextureCoordinateMapping",this),this.textureCoordinateNode=e??this.getBrowser().getDefaultTextureCoordinate(),this.textureCoordinateNode.addInterest("updateTextureCoordinateMapping",this),this.updateTextureCoordinateMapping()},getTextureCoordinateMapping(){return this.textureCoordinateMapping},updateTextureCoordinateMapping(){this.textureCoordinateMapping.clear(),this.textureCoordinateNode.getTextureCoordinateMapping(this.textureCoordinateMapping)},setNormals(e){this.normals.assign(e)},getNormals(){return this.normals},setVertices(e){this.vertices.assign(e)},getVertices(){return this.vertices},updateVertexArrays(){this.vertexArrayObject.update(),this.updateParticles=!0},buildTexCoords(){const e=this.texCoords;if(0===e.length){const t=this.getTexCoordParams(),i=t.min,n=t.Sindex,s=t.Tindex,r=t.Ssize,o=i[n],a=i[s],l=this.vertices.getValue();for(let t=0,i=l.length;t<i;t+=4)e.push((l[t+n]-o)/r,(l[t+s]-a)/r,0,1);e.shrinkToFit()}this.getMultiTexCoords().push(e)},getTexCoordParams:(()=>{const e={min:new bt(0,0,0),Ssize:0,Sindex:0,Tindex:0};return function(){const t=this.getBBox(),i=t.size,n=i.x,s=i.y,r=i.z;return e.min.assign(t.center).subtract(i.divide(2)),n>=s&&n>=r?(e.Ssize=n,e.Sindex=0,e.Tindex=s>=r?1:2):s>=n&&s>=r?(e.Ssize=s,e.Sindex=1,e.Tindex=n>=r?0:2):(e.Ssize=r,e.Sindex=2,e.Tindex=n>=s?0:1),e}})(),refineNormals(e,t,i){if(0===i)return t;const n=Math.cos(g.clamp(i,0,Math.PI)),s=[];for(const i of e.values())for(const e of i){const r=t[e],o=new bt(0,0,0);for(const e of i){const i=t[e];i.dot(r)>=n&&o.add(i)}s[e]=o.normalize()}return s},transformLine(e){},transformMatrix(e){},isClipped:(e,t)=>t.some((t=>t.isClipped(e))),intersectsLine:(()=>{const e=new ci,t={u:0,v:0,t:0},i=new bt(0,0,0),n=new bt(0,0,0),s=new bt(0,0,0),r=new bt(0,0,0);return function(o,a,l,u){if(this.intersectsBBox(o)){this.transformLine(o),this.transformMatrix(e.assign(a));const h=this.multiTexCoords[0].getValue(),d=this.normals.getValue(),c=this.vertices.getValue(),p=this.vertexCount;for(let a=0;a<p;a+=3){const p=4*a;if(i.x=c[p],i.y=c[p+1],i.z=c[p+2],n.x=c[p+4],n.y=c[p+5],n.z=c[p+6],s.x=c[p+8],s.y=c[p+9],s.z=c[p+10],o.intersectsTriangle(i,n,s,t)){const i=t.u,n=t.v,s=t.t,o=new bt(s*c[p]+i*c[p+4]+n*c[p+8],s*c[p+1]+i*c[p+5]+n*c[p+9],s*c[p+2]+i*c[p+6]+n*c[p+10]);if(l.length&&this.isClipped(e.multVecMatrix(r.assign(o)),l))continue;const g=new ft(s*h[p]+i*h[p+4]+n*h[p+8],s*h[p+1]+i*h[p+5]+n*h[p+9]),f=3*a,m=new bt(s*d[f]+i*d[f+3]+n*d[f+6],s*d[f+1]+i*d[f+4]+n*d[f+7],s*d[f+2]+i*d[f+5]+n*d[f+8]);u.push({texCoord:g,normal:m,point:this.getMatrix().multVecMatrix(o)})}}}return u.length}})(),getPlanesWithOffset:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=[];for(let e=0;e<5;++e)i[e]=new ha(bt.Zero,bt.zAxis);return function(n,s,r,o,a,l){e.set(n,s,r),t.set(o,a,l);for(let n=0;n<5;++n)i[n].set(n%2?e:t,Sl[n]);return i}})(),intersectsBBox:(()=>{const e=new bt(0,0,0);return function(t,i){if(i)var n=this.min,s=this.max,r=n.x-i.x,o=s.x+i.x,a=n.y-i.y,l=s.y+i.y,u=n.z-i.z,h=s.z+i.z,d=this.getPlanesWithOffset(r,a,u,o,l,h);else n=this.min,s=this.max,r=n.x,o=s.x,a=n.y,l=s.y,u=n.z,h=s.z,d=this.planes;return!!(d[0].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.y>=a&&e.y<=l)||(!!(d[1].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.y>=a&&e.y<=l)||(!!(d[2].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.z>=u&&e.z<=h)||(!!(d[3].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.z>=u&&e.z<=h)||!!(d[4].intersectsLine(t,e)&&e.y>=a&&e.y<=l&&e.z>=u&&e.z<=h))))}})(),intersectsBox:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new ci,s=new bt(0,0,0);return function(r,o,a){if(r.intersectsBox(this.bbox)){r.multRight(n.assign(this.getMatrix()).inverse()),this.transformMatrix(a);const l=this.vertices.getValue();for(let n=0,u=this.vertexCount;n<u;n+=3){const u=4*n;if(e.x=l[u],e.y=l[u+1],e.z=l[u+2],t.x=l[u+4],t.y=l[u+5],t.z=l[u+6],i.x=l[u+8],i.y=l[u+9],i.z=l[u+10],r.intersectsTriangle(e,t,i)){if(o.length){if(this.isClipped(a.multVecMatrix(s.assign(e)),o))continue;if(this.isClipped(a.multVecMatrix(s.assign(t)),o))continue;if(this.isClipped(a.multVecMatrix(s.assign(i)),o))continue}return!0}}}return!1}})(),set_live__(){this.getLive().getValue()?this.getBrowser().getBrowserOptions()._Shading.addInterest("set_shading__",this):this.getBrowser().getBrowserOptions()._Shading.removeInterest("set_shading__",this)},set_shading__:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0);return function(s){const r=this.getBrowser(),o=r.getContext();if(this.geometryType<2)o.bindBuffer(o.ARRAY_BUFFER,this.normalBuffer),o.bufferData(o.ARRAY_BUFFER,this.normals.getValue(),o.DYNAMIC_DRAW);else{const s=r.getBrowserOptions().getShading()===bl.FLAT;if(s===this.flatShading)return;if(this.flatShading=s,s&&!this.flatNormals.length){const s=this.frontFace===o.CW,r=this.flatNormals,a=this.vertices.getValue();for(let o=0,l=a.length;o<l;o+=12)ga.normal(e.set(a[o],a[o+1],a[o+2]),t.set(a[o+4],a[o+5],a[o+6]),i.set(a[o+8],a[o+9],a[o+10]),n),s&&n.negate(),r.push(n.x,n.y,n.z,n.x,n.y,n.z,n.x,n.y,n.z);r.shrinkToFit()}o.bindBuffer(o.ARRAY_BUFFER,this.normalBuffer),o.bufferData(o.ARRAY_BUFFER,s?this.flatNormals.getValue():this.normals.getValue(),o.DYNAMIC_DRAW)}}})(),requestRebuild(){this._rebuild.addEvent()},rebuild:(()=>{const e=new bt(0,0,0);return function(){this.clear(),this.build();for(const e of this.attribArrays)e.shrinkToFit();for(const e of this.multiTexCoords)e.shrinkToFit();this.coordIndices.shrinkToFit(),this.fogDepths.shrinkToFit(),this.colors.shrinkToFit(),this.normals.shrinkToFit(),this.vertices.shrinkToFit();const t=this.vertices.getValue(),i=this.min,n=this.max;if(t.length){if(i.x===Number.POSITIVE_INFINITY)for(let s=0,r=t.length;s<r;s+=4)e.set(t[s],t[s+1],t[s+2]),i.min(e),n.max(e);this.bbox.setExtents(i,n)}else this.bbox.setExtents(i.set(0,0,0),n.set(0,0,0));this._bbox_changed.addEvent();for(let e=0;e<5;++e)this.planes[e].set(e%2?i:n,Sl[e]);0===this.multiTexCoords.length&&this.buildTexCoords(),this.transfer(),this.updateGeometryKey(),this.updateRenderFunctions()}})(),clear(){this.min.set(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.max.set(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);{const e=this.attribArrays;for(const t of e)t.length=0;const t=this.attribNodes.length;for(let i=e.length;i<t;++i)e[i]=new Yn.MFFloat;e.length=t}this.flatShading=void 0,this.coordIndices.length=0,this.fogDepths.length=0,this.colors.length=0,this.multiTexCoords.length=0,this.texCoords.length=0,this.normals.length=0,this.flatNormals.length=0,this.vertices.length=0},transfer(){const e=this.getBrowser().getContext();e.bindBuffer(e.ARRAY_BUFFER,this.coordIndexBuffer),e.bufferData(e.ARRAY_BUFFER,this.coordIndices.getValue(),e.DYNAMIC_DRAW);for(let t=this.attribBuffers.length,i=this.attribArrays.length;t<i;++t)this.attribBuffers.push(e.createBuffer());for(let t=0,i=this.attribArrays.length;t<i;++t)e.bindBuffer(e.ARRAY_BUFFER,this.attribBuffers[t]),e.bufferData(e.ARRAY_BUFFER,this.attribArrays[t].getValue(),e.DYNAMIC_DRAW);const t=this.hasFogCoords;e.bindBuffer(e.ARRAY_BUFFER,this.fogDepthBuffer),e.bufferData(e.ARRAY_BUFFER,this.fogDepths.getValue(),e.DYNAMIC_DRAW),this.hasFogCoords=!!this.fogDepths.length,this.hasFogCoords!==t&&this.updateVertexArrays();const i=this.colorMaterial;e.bindBuffer(e.ARRAY_BUFFER,this.colorBuffer),e.bufferData(e.ARRAY_BUFFER,this.colors.getValue(),e.DYNAMIC_DRAW),this.colorMaterial=!!this.colors.length,this.colorMaterial!==i&&this.updateVertexArrays();for(let t=0,i=this.multiTexCoords.length;t<i;++t)e.bindBuffer(e.ARRAY_BUFFER,this.texCoordBuffers[t]),e.bufferData(e.ARRAY_BUFFER,this.multiTexCoords[t].getValue(),e.DYNAMIC_DRAW);const n=this.hasNormals;this.set_shading__(this.getBrowser().getBrowserOptions()._Shading),this.hasNormals=!!this.normals.length,this.hasNormals!==n&&this.updateVertexArrays(),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices.getValue(),e.DYNAMIC_DRAW),this.vertexCount=this.vertices.length/4},updateGeometryKey(){this.geometryKey="",this.geometryKey+=this.geometryType,this.geometryKey+=this.hasFogCoords?"1":"0",this.geometryKey+=this.colorMaterial?"1":"0",this.geometryKey+=this.hasNormals?"1":"0"},updateRenderFunctions(){this.vertexCount?(delete this.displaySimple,delete this.display,delete this.displaySimpleParticles,delete this.displayParticles):(this.displaySimple=Function.prototype,this.display=Function.prototype,this.displaySimpleParticles=Function.prototype,this.displayParticles=Function.prototype)},traverse(e,t){},displaySimple(e,t,i){this.vertexArrayObject.enable(i)&&(this.coordIndices.length&&i.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0),this.multiTexCoords.length&&i.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),this.hasNormals&&i.enableNormalAttribute(e,this.normalBuffer,0,0),i.enableVertexAttribute(e,this.vertexBuffer,0,0)),e.drawArrays(this.primitiveMode,0,this.vertexCount)},display(e,t){const i=this.getBrowser(),n=t.appearanceNode,s=n.getShader(this,t);if(this.solid||!n.getBackMaterial()||i.getWireframe())this.displayGeometry(e,t,n,s,!0,!0);else{const i=n.getBackShader(this,t);this.displayGeometry(e,t,n,i,!0,!1),this.displayGeometry(e,t,n,s,!1,!0)}},displayGeometry(e,t,i,n,s,r){const o=this.getBrowser(),a=i.getBlendMode(),l=this.attribNodes,u=this.attribBuffers,h=o.getPrimitiveMode(this.primitiveMode);if(a?.enable(e),n.enable(e),n.setUniforms(e,this,t,r),this.vertexArrayObject.enable(n)){this.coordIndices.length&&n.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0);for(let t=0,i=l.length;t<i;++t)l[t].enable(e,n,u[t]);this.hasFogCoords&&n.enableFogDepthAttribute(e,this.fogDepthBuffer,0,0),this.colorMaterial&&n.enableColorAttribute(e,this.colorBuffer,0,0),n.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),n.enableNormalAttribute(e,this.normalBuffer,0,0),n.enableVertexAttribute(e,this.vertexBuffer,0,0)}if(o.getWireframe())for(let t=0,i=this.vertexCount;t<i;t+=3)e.drawArrays(h,t,3);else{const i=ci.prototype.determinant3.call(t.modelViewMatrix)>0;e.frontFace(i?this.frontFace:this.backFace.get(this.frontFace)),t.transparent||s!==r?(e.enable(e.CULL_FACE),s&&!this.solid&&(e.cullFace(e.FRONT),e.drawArrays(h,0,this.vertexCount)),r&&(e.cullFace(e.BACK),e.drawArrays(h,0,this.vertexCount))):(this.solid?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),e.drawArrays(h,0,this.vertexCount))}a?.disable(e)},displaySimpleParticles(e,t,i){const n=i.outputParticles;if(n.vertexArrayObject.update(this.updateParticles).enable(t)){const{particleStride:s,particleOffset:r,matrixOffset:o}=i;t.enableParticleAttribute(e,n,s,r,1),t.enableParticleMatrixAttribute(e,n,s,o,1),t.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),t.enableNormalAttribute(e,this.normalBuffer,0,0),t.enableVertexAttribute(e,this.vertexBuffer,0,0),this.updateParticles=!1}e.drawArraysInstanced(this.primitiveMode,0,this.vertexCount,i.numParticles)},displayParticles(e,t,i){const n=this.getBrowser(),s=t.appearanceNode,r=s.getShader(this,t);if(this.solid||!s.getBackMaterial()||n.getWireframe())this.displayParticlesGeometry(e,t,s,r,!0,!0,i);else{const n=s.getBackShader(this,t);this.displayParticlesGeometry(e,t,s,n,!0,!1,i),this.displayParticlesGeometry(e,t,s,r,!1,!0,i)}},displayParticlesGeometry(e,t,i,n,s,r,o){const a=this.getBrowser(),l=i.getBlendMode(),u=this.attribNodes,h=this.attribBuffers,d=a.getPrimitiveMode(this.primitiveMode);l?.enable(e),n.enable(e),n.setUniforms(e,this,t,r);const c=o.outputParticles;if(c.vertexArrayObject.update(this.updateParticles).enable(n)){const{particleStride:t,particleOffset:i,matrixOffset:s}=o;n.enableParticleAttribute(e,c,t,i,1),n.enableParticleMatrixAttribute(e,c,t,s,1);for(let t=0,i=u.length;t<i;++t)u[t].enable(e,n,h[t]);this.hasFogCoords&&n.enableFogDepthAttribute(e,this.fogDepthBuffer,0,0),this.colorMaterial&&n.enableColorAttribute(e,this.colorBuffer,0,0),n.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),n.enableNormalAttribute(e,this.normalBuffer,0,0),n.enableVertexAttribute(e,this.vertexBuffer,0,0),this.updateParticles=!1}const p=ci.prototype.determinant3.call(t.modelViewMatrix)>0;e.frontFace(p?this.frontFace:this.backFace.get(this.frontFace)),t.transparent||s!==r?(e.enable(e.CULL_FACE),s&&!this.solid&&(e.cullFace(e.FRONT),e.drawArraysInstanced(d,0,this.vertexCount,o.numParticles)),r&&(e.cullFace(e.BACK),e.drawArraysInstanced(d,0,this.vertexCount,o.numParticles))):(this.solid?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),e.drawArraysInstanced(d,0,this.vertexCount,o.numParticles)),l?.disable(e)}}),Object.defineProperties(Tl,{typeName:{value:"X3DGeometryNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const vl=Tl;i.add("X3DGeometryNode","x_ite/Components/Rendering/X3DGeometryNode",vl);const Ol=vl;let El=0;const Nl={AUTO:El++,OPAQUE:El++,MASK:El++,BLEND:El++};i.add("AlphaMode","x_ite/Browser/Shape/AlphaMode",Nl);const Cl=Nl;function Fl(e={}){Object.assign(this,{alphaMode:Cl.OPAQUE,geometryType:3,hasFogCoords:!1,colorMaterial:!1,hasNormals:!1,textureNode:!1,objectsCount:[0,0,0],textureCoordinateMapping:new Map,textureCoordinateNode:null},e),this.updateGeometryKey()}Object.assign(Fl.prototype,{updateGeometryKey:Ol.prototype.updateGeometryKey,getTextureCoordinateMapping(){return this.textureCoordinateMapping},getTextureCoordinate(){return this.textureCoordinateNode}});const Il=Fl;i.add("GeometryContext","x_ite/Browser/Rendering/GeometryContext",Il);const Ml=Il;function Dl(e=0){this.value=e}Object.assign(Dl.prototype,{*[Symbol.iterator](){let e=this.value,t=0;for(;e;)1&e&&(yield t),e>>>=1,t+=1},get(e){const t=1<<e;return!!(this.value&t)},set(e,t){const i=1<<e;t?this.value|=i:this.value&=~i},clear(){this.value=0},*entries(){for(const e of this)yield[e,e]},valueOf(){return this.value},toString(e){return this.value.toString(e)}}),Dl.prototype.keys=Dl.prototype[Symbol.iterator],Dl.prototype.values=Dl.prototype[Symbol.iterator],Object.defineProperty(Dl.prototype,"size",{get(){return g.bitCount(this.value)}});const Pl=Dl;i.add("BitSet","standard/Utility/BitSet",Pl);const Rl=Pl,Al=Math.SQRT2/2;function Vl(e){tr.call(this,e),this.addType(d.X3DBackgroundNode),this.addChildObjects(d.inputOutput,"hidden",new Yn.SFBool),this._skyAngle.setUnit("angle"),this._groundAngle.setUnit("angle"),this.projectionMatrixArray=new Float32Array(16),this.modelMatrix=new ci,this.modelViewMatrixArray=new Float32Array(16),this.clipPlanes=[],this.colors=[],this.sphere=[],this.textureNodes=new Array(6),this.textureBits=new Rl,this.sphereContext=new Ml({colorMaterial:!0}),this.sphereAlphaContext=new Ml({colorMaterial:!0,alphaMode:Cl.BLEND}),this.texturesContext=new Ml({textureNode:!0}),this.texturesAlphaContext=new Ml({textureNode:!0,alphaMode:Cl.BLEND})}Object.assign(Object.setPrototypeOf(Vl.prototype,tr.prototype),{initialize(){tr.prototype.initialize.call(this);const e=this.getBrowser().getContext();this.colorBuffer=e.createBuffer(),this.sphereBuffer=e.createBuffer(),this.texCoordBuffers=[e.createBuffer()],this.textureBuffers=Array.from({length:6},(()=>e.createBuffer())),this.sphereArrayObject=new xl(e),this.textureArrayObjects=Array.from({length:6},(()=>new xl(e))),this._groundAngle.addInterest("build",this),this._groundColor.addInterest("build",this),this._skyAngle.addInterest("build",this),this._skyColor.addInterest("build",this),this.build(),this.transferRectangle()},isHidden(){return this._hidden.getValue()},setHidden(e){e!==this._hidden.getValue()&&(this._hidden=e)},isTransparent(){if(this._hidden.getValue())return!0;if(this._transparency.getValue()<=0)return!1;if(6!==this.textureBits.size)return!0;for(const e of this.textureBits)if(this.textureNodes[e]._transparent.getValue())return!0;return!1},set_texture__(e,t){this.textureNodes[t]?._loadState.removeInterest("set_loadState__",this),this.textureNodes[t]=e,e?._loadState.addInterest("set_loadState__",this,e,t),this.set_loadState__(e,t)},set_loadState__(e,t){this.setTextureBit(t,e,e?.checkLoadState()??d.NOT_STARTED)},setTextureBit(e,t,i){this.textureBits.set(e,i===d.COMPLETE_STATE||t?.getWidth())},getColor:(e,t,i)=>t[g.upperBound(i,0,i.length,e)],build(){const e=Al;if(this.colors.length=0,this.sphere.length=0,0===this._groundColor.length&&1==this._skyColor.length){this.sphere.vertices=36,this.sphere.push(e,e,-e,1,-e,e,-e,1,-e,-e,-e,1,e,e,-e,1,-e,-e,-e,1,e,-e,-e,1,-e,e,e,1,e,e,e,1,-e,-e,e,1,-e,-e,e,1,e,e,e,1,e,-e,e,1,-e,e,-e,1,-e,e,e,1,-e,-e,e,1,-e,e,-e,1,-e,-e,e,1,-e,-e,-e,1,e,e,e,1,e,e,-e,1,e,-e,e,1,e,-e,e,1,e,e,-e,1,e,-e,-e,1,e,e,e,1,-e,e,e,1,-e,e,-e,1,e,e,e,1,-e,e,-e,1,e,e,-e,1,-e,-e,e,1,e,-e,e,1,-e,-e,-e,1,-e,-e,-e,1,e,-e,e,1,e,-e,-e,1);const t=this._skyColor[0];for(let e=0,i=this.sphere.vertices;e<i;++e)this.colors.push(...t,1)}else{if(this._skyColor.length>this._skyAngle.length){const e=this._skyAngle.slice();(0===e.length||e[0]>0)&&e.unshift(0),e.at(-1)<Math.PI&&e.push(Math.PI),2===e.length&&e.splice(1,0,(e[0]+e[1])/2),this.buildSphere(1,e,this._skyAngle,this._skyColor,!1)}if(this._groundColor.length>this._groundAngle.length){const e=this._groundAngle.slice().reverse();(0===e.length||e[0]<Math.PI/2)&&e.unshift(Math.PI/2),e.at(-1)>0&&e.push(0),this.buildSphere(1,e,this._groundAngle,this._groundColor,!0)}}this.transferSphere()},buildSphere:(()=>{const e=new Vo(0,0),t=new Vo(0,0),i=new Vo(0,0),n=new Vo(0,0),s=new Vo(0,0),r=new Vo(0,0);return function(o,a,l,u,h){const d=h?Math.PI/2:Math.PI,c=a.length-1;for(let p=0;p<c;++p){let c=g.clamp(a[p],0,d),f=g.clamp(a[p+1],0,d);h&&(c=Math.PI-c,f=Math.PI-f),e.setPolar(o,c),t.setPolar(o,f);const m=this.getColor(a[p],u,l),_=this.getColor(a[p+1],u,l);for(let o=0;o<20;++o){const a=o<19?o+1:0;let l=2*Math.PI*(o/20);i.setPolar(-e.imag,l),n.setPolar(-t.imag,l),l=2*Math.PI*(a/20),s.setPolar(-t.imag,l),r.setPolar(-e.imag,l),this.colors.push(...m,1,..._,1,..._,1,...m,1,...m,1,..._,1),this.sphere.push(i.imag,e.real,i.real,1,s.imag,t.real,s.real,1,n.imag,t.real,n.real,1,i.imag,e.real,i.real,1,r.imag,e.real,r.real,1,s.imag,t.real,s.real,1)}}}})(),transferSphere(){const e=this.getBrowser().getContext();e.bindBuffer(e.ARRAY_BUFFER,this.colorBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colors),e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.sphereBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.sphere),e.DYNAMIC_DRAW),this.sphereCount=this.sphere.length/4},transferRectangle:(()=>{const e=Al,t=new Float32Array([1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1]),i=[new Float32Array([e,e,-e,1,-e,e,-e,1,-e,-e,-e,1,e,e,-e,1,-e,-e,-e,1,e,-e,-e,1]),new Float32Array([-e,e,e,1,e,e,e,1,e,-e,e,1,-e,e,e,1,e,-e,e,1,-e,-e,e,1]),new Float32Array([-e,e,-e,1,-e,e,e,1,-e,-e,e,1,-e,e,-e,1,-e,-e,e,1,-e,-e,-e,1]),new Float32Array([e,e,e,1,e,e,-e,1,e,-e,-e,1,e,e,e,1,e,-e,-e,1,e,-e,e,1]),new Float32Array([e,e,e,1,-e,e,e,1,-e,e,-e,1,e,e,e,1,-e,e,-e,1,e,e,-e,1]),new Float32Array([e,-e,-e,1,-e,-e,-e,1,-e,-e,e,1,e,-e,-e,1,-e,-e,e,1,e,-e,e,1])];return function(){const e=this.getBrowser().getContext();e.bindBuffer(e.ARRAY_BUFFER,this.texCoordBuffers[0]),e.bufferData(e.ARRAY_BUFFER,t,e.DYNAMIC_DRAW);for(let t=0;t<6;++t)e.bindBuffer(e.ARRAY_BUFFER,this.textureBuffers[t]),e.bufferData(e.ARRAY_BUFFER,i[t],e.DYNAMIC_DRAW)}})(),traverse(e,t){switch(e){case Ia.CAMERA:return t.getLayer().getBackgrounds().push(this),void this.modelMatrix.assign(t.getModelViewMatrix().get());case Ia.DISPLAY:{const e=t.getLocalObjects(),i=this.clipPlanes;let n=0;for(let t=0,s=e.length;t<s;++t)e[t].isClipped&&(i[n++]=e[t]);return i.length=n,this.sphereContext.objectsCount[0]=i.length,void(this.texturesContext.objectsCount[0]=i.length)}}},display:(()=>{const e=new ci,t=new ai,i=new bt(0,0,0);return function(n,s,r){this._hidden.getValue()||(n.disable(n.DEPTH_TEST),n.depthMask(!1),n.enable(n.CULL_FACE),n.frontFace(n.CCW),this.projectionMatrixArray.set(s.getViewpoint().getProjectionMatrixWithLimits(.125,2e5,r)),e.assign(this.modelMatrix),e.multRight(s.getViewMatrix().get()),e.get(null,t),e.identity(),e.rotate(t),e.scale(i.set(1e5,1e5,1e5)),this.modelViewMatrixArray.set(e),this.drawSphere(s),+this.textureBits&&this.drawCube(s),n.depthMask(!0),n.enable(n.DEPTH_TEST),n.disable(n.BLEND))}})(),drawSphere(e){const t=g.clamp(this._transparency.getValue(),0,1);if(1===t)return;const i=this.getBrowser(),n=i.getContext(),s=i.getDefaultMaterial().getShader(t?this.sphereAlphaContext:this.sphereContext);s.enable(n),s.setClipPlanes(n,this.clipPlanes),n.uniformMatrix4fv(s.x3d_ProjectionMatrix,!1,this.projectionMatrixArray),n.uniformMatrix4fv(s.x3d_ModelViewMatrix,!1,this.modelViewMatrixArray),n.uniform1f(s.x3d_Transparency,t),n.uniform1i(s.x3d_TextureCoordinateGeneratorMode[0],0),this.sphereArrayObject.enable(s)&&(s.enableColorAttribute(n,this.colorBuffer,0,0),s.enableVertexAttribute(n,this.sphereBuffer,0,0)),t?n.enable(n.BLEND):n.disable(n.BLEND),n.drawArrays(n.TRIANGLES,0,this.sphereCount)},drawCube:(()=>{const e=new Float32Array(ci.Identity);return function(t){const i=this.getBrowser(),n=i.getContext(),s=i.getDefaultMaterial().getShader(this.texturesContext),r=i.getDefaultMaterial().getShader(this.texturesAlphaContext);s.enable(n),s.setClipPlanes(n,this.clipPlanes),n.uniformMatrix4fv(s.x3d_ProjectionMatrix,!1,this.projectionMatrixArray),n.uniformMatrix4fv(s.x3d_ModelViewMatrix,!1,this.modelViewMatrixArray),n.uniformMatrix4fv(s.x3d_TextureMatrix[0],!1,e),n.uniform3f(s.x3d_EmissiveColor,1,1,1),n.uniform1f(s.x3d_Transparency,0),n.uniform1i(s.x3d_TextureCoordinateGeneratorMode[0],0);for(const e of this.textureBits){const o=this.textureNodes[e];this.drawRectangle(n,i,o._transparent.getValue()?r:s,t,o,this.textureBuffers[e],this.textureArrayObjects[e])}}})(),drawRectangle(e,t,i,n,s,r,o){s.setShaderUniforms(e,i,n),o.enable(e,i)&&(i.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),i.enableVertexAttribute(e,r,0,0)),s._transparent.getValue()?e.enable(e.BLEND):e.disable(e.BLEND),e.drawArrays(e.TRIANGLES,0,6),t.resetTextureUnits()}}),Object.defineProperties(Vl,{typeName:{value:"X3DBackgroundNode",enumerable:!0},componentName:{value:"EnvironmentalEffects",enumerable:!0}});const Ll=Vl;i.add("X3DBackgroundNode","x_ite/Components/EnvironmentalEffects/X3DBackgroundNode",Ll);const Bl=Ll;function Ul(e){bs.call(this,e),this.addType(d.X3DAppearanceChildNode)}Object.setPrototypeOf(Ul.prototype,bs.prototype),Object.defineProperties(Ul,{typeName:{value:"X3DAppearanceChildNode",enumerable:!0},componentName:{value:"Shape",enumerable:!0}});const Xl=Ul;i.add("X3DAppearanceChildNode","x_ite/Components/Shape/X3DAppearanceChildNode",Xl);const kl=Xl;function jl(e){kl.call(this,e),this.addType(d.X3DTextureNode),this.addChildObjects(d.outputOnly,"transparent",new Yn.SFBool)}Object.assign(Object.setPrototypeOf(jl.prototype,kl.prototype),{setTransparent(e){e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()}}),Object.defineProperties(jl,{typeName:{value:"X3DTextureNode",enumerable:!0},componentName:{value:"Texturing",enumerable:!0}});const zl=jl;i.add("X3DTextureNode","x_ite/Components/Texturing/X3DTextureNode",zl);const Gl=zl;const Hl=function(e,t,i=!0){try{if(t&&(t instanceof Yn.SFNode&&(t=t.getValue()),t&&(i&&(t=t.getInnerNode()),t.getType().includes(e))))return t}catch{}return null};i.add("X3DCast","x_ite/Base/X3DCast",Hl);const ql=Hl;function Yl(e){Gl.call(this,e),this.addType(d.X3DSingleTextureNode)}Object.assign(Object.setPrototypeOf(Yl.prototype,Gl.prototype),{initialize(){Gl.prototype.initialize.call(this),this._textureProperties.addInterest("set_textureProperties__",this,!0);const e=this.getBrowser().getContext();this.texture=e.createTexture(),this.set_textureProperties__(!1)},set_textureProperties__(e){this.texturePropertiesNode&&this.texturePropertiesNode.removeInterest("updateTextureParameters",this),this.texturePropertiesNode=ql(d.TextureProperties,this._textureProperties),this.texturePropertiesNode||(this.texturePropertiesNode=this.getBrowser().getDefaultTextureProperties()),this.texturePropertiesNode.addInterest("updateTextureParameters",this),e&&this.updateTextureParameters()},getCount:()=>1,getTexture(){return this.texture},updateTextureParameters:(()=>{const e=["EXT_texture_filter_anisotropic","MOZ_EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"];return function(t,i,n,s,r,o,a,l){const u=this.getBrowser().getContext();u.bindTexture(t,this.getTexture()),Math.max(s,r)<this.getBrowser().getMinTextureSize()&&!i?(u.texParameteri(t,u.TEXTURE_MIN_FILTER,u.NEAREST),u.texParameteri(t,u.TEXTURE_MAG_FILTER,u.NEAREST)):(n._generateMipMaps.getValue()&&u.generateMipmap(t),u.texParameteri(t,u.TEXTURE_MIN_FILTER,u[n.getMinificationFilter()]),u.texParameteri(t,u.TEXTURE_MAG_FILTER,u[n.getMagnificationFilter()])),i?(u.texParameteri(t,u.TEXTURE_WRAP_S,u[n.getBoundaryModeS()]),u.texParameteri(t,u.TEXTURE_WRAP_T,u[n.getBoundaryModeT()]),u.getVersion()>=2&&u.texParameteri(t,u.TEXTURE_WRAP_R,u[n.getBoundaryModeR()])):(u.texParameteri(t,u.TEXTURE_WRAP_S,o?u.REPEAT:u.CLAMP_TO_EDGE),u.texParameteri(t,u.TEXTURE_WRAP_T,a?u.REPEAT:u.CLAMP_TO_EDGE),u.getVersion()>=2&&u.texParameteri(t,u.TEXTURE_WRAP_R,l?u.REPEAT:u.CLAMP_TO_EDGE));for(const i of e){const e=u.getExtension(i);if(e){u.texParameterf(t,e.TEXTURE_MAX_ANISOTROPY_EXT,n._anisotropicDegree.getValue());break}}}})(),updateTextureBits(e,t=0){const i=this.getTextureType()-1;e.set(2*t+0,1&i),e.set(2*t+1,2&i)},getShaderOptions:(()=>{const e={2:"2D",3:"3D",4:"CUBE"};return function(t,i=0){t.push(`X3D_TEXTURE${i}_${e[this.getTextureType()]}`)}})()}),Object.defineProperties(Yl,{typeName:{value:"X3DSingleTextureNode",enumerable:!0},componentName:{value:"Texturing",enumerable:!0}});const Wl=Yl;i.add("X3DSingleTextureNode","x_ite/Components/Texturing/X3DSingleTextureNode",Wl);const $l=Wl,Jl=new Uint8Array([255,255,255,255]);function Kl(e){$l.call(this,e),this.addType(d.X3DTexture2DNode);const t=this.getBrowser().getContext();this.target=t.TEXTURE_2D,this.width=0,this.height=0}Object.assign(Object.setPrototypeOf(Kl.prototype,$l.prototype),{initialize(){$l.prototype.initialize.call(this),this._repeatS.addInterest("updateTextureParameters",this),this._repeatT.addInterest("updateTextureParameters",this);const e=this.getBrowser().getContext();e.bindTexture(e.TEXTURE_2D,this.getTexture()),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,Jl)},getTarget(){return this.target},getTextureType:()=>2,getTextureTypeString:()=>"2D",getWidth(){return this.width},getHeight(){return this.height},clearTexture(){this.setTexture(1,1,!1,Jl,!1)},setTexture(e,t,i,n,s){this.width=e,this.height=t;const r=this.getBrowser().getContext();r.bindTexture(r.TEXTURE_2D,this.getTexture()),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,s),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,t,0,r.RGBA,r.UNSIGNED_BYTE,n),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),this.setTransparent(i),this.updateTextureParameters(),this.addNodeEvent()},updateTexture(e,t){const i=this.getBrowser().getContext();i.bindTexture(i.TEXTURE_2D,this.getTexture()),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,t),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,e),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),this.texturePropertiesNode._generateMipMaps.getValue()&&i.generateMipmap(i.TEXTURE_2D),this.addNodeEvent()},updateTextureParameters(){$l.prototype.updateTextureParameters.call(this,this.target,this._textureProperties.getValue(),this.texturePropertiesNode,this.width,this.height,this._repeatS.getValue(),this._repeatT.getValue(),!1)},setShaderUniforms(e,t,i,n=t.x3d_Texture[0]){const s=this.getBrowser().getTexture2DUnit();e.activeTexture(e.TEXTURE0+s),e.bindTexture(e.TEXTURE_2D,this.getTexture()),e.uniform1i(n.texture2D,s)}}),Object.defineProperties(Kl,{typeName:{value:"X3DTexture2DNode",enumerable:!0},componentName:{value:"Texturing",enumerable:!0}});const Zl=Kl;i.add("X3DTexture2DNode","x_ite/Components/Texturing/X3DTexture2DNode",Zl);const Ql=Zl;var eu=n(464);function tu(e){Ql.call(this,e),Sr.call(this,e),this.addType(d.ImageTexture),this.image=eu("<img></img>"),this.urlStack=new Yn.MFString}Object.assign(Object.setPrototypeOf(tu.prototype,Ql.prototype),Sr.prototype,{initialize(){Ql.prototype.initialize.call(this),Sr.prototype.initialize.call(this),this.image.on("load",this.setImage.bind(this)),this.image.on("abort error",this.setError.bind(this)),this.image.prop("crossOrigin","Anonymous"),this.requestImmediateLoad().catch(Function.prototype)},getElement(){return this.image[0]},unloadData(){this.clearTexture()},loadData(){this.urlStack.setValue(this._url),this.loadNext()},loadNext(){if(0===this.urlStack.length)return this.clearTexture(),void this.setLoadState(d.FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getBaseURL()),"data:"!==this.URL.protocol&&(this.getCache()||this.URL.searchParams.set("_",Date.now())),this.image.attr("src",this.URL.href)},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading image '${decodeURI(this.URL.href)}'`,e.type),this.loadNext()},setImage:async function(){try{const e=this.getBrowser().getContext(),t=this.image[0];if(1!==e.getVersion()||g.isPowerOfTwo(t.width)&&g.isPowerOfTwo(t.height)){const e=await this.getImageData(t),i=this.isImageTransparent(e),n=t.width,s=t.height;this.flipImage(e,n,s,4),this.setTexture(n,s,i,e,!1),this.setLoadState(d.COMPLETE_STATE)}else{const e=document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0}),n=g.nextPowerOfTwo(t.width),s=g.nextPowerOfTwo(t.height);e.width=n,e.height=s,i.clearRect(0,0,n,s),i.save(),i.translate(0,s),i.scale(1,-1),i.drawImage(t,0,0,t.width,t.height,0,0,n,s),i.restore();const r=i.getImageData(0,0,n,s).data,o=this.isImageTransparent(r);this.setTexture(n,s,o,r,!1),this.setLoadState(d.COMPLETE_STATE)}}catch(e){this.setError({type:e.message})}},getImageData:async function(e,t=!0){const i=this.getBrowser().getContext(),n=i.createFramebuffer(),s=i.createTexture(),r=new Uint8Array(e.width*e.height*4);return i.bindFramebuffer(i.FRAMEBUFFER,n),i.bindTexture(i.TEXTURE_2D,s),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,t?i.BROWSER_DEFAULT_WEBGL:i.NONE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,s,0),await i.readPixelsAsync(0,0,e.width,e.height,i.RGBA,i.UNSIGNED_BYTE,r),i.deleteFramebuffer(n),i.deleteTexture(s),r},isImageTransparent(e){for(let t=3,i=e.length;t<i;t+=4)if(255!==e[t])return!0;return!1},flipImage(e,t,i,n){const s=i>>>1,r=t*n,o=new Uint8Array(r);for(let t=0;t<s;++t){const n=t*r,s=(i-t-1)*r;o.set(e.subarray(n,n+r)),e.copyWithin(n,s,s+r),e.set(o,s)}return e},dispose(){Sr.prototype.dispose.call(this),Ql.prototype.dispose.call(this)}}),Object.defineProperties(tu,{typeName:{value:"ImageTexture",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600)),new X(d.initializeOnly,"repeatS",new Yn.SFBool(!0)),new X(d.initializeOnly,"repeatT",new Yn.SFBool(!0)),new X(d.initializeOnly,"textureProperties",new Yn.SFNode)]),enumerable:!0}});const iu=tu;i.add("ImageTexture","x_ite/Components/Texturing/ImageTexture",iu);const nu=iu;function su(e){Bl.call(this,e),this.addType(d.Background)}Object.assign(Object.setPrototypeOf(su.prototype,Bl.prototype),{initialize(){Bl.prototype.initialize.call(this);const e=new nu(this.getExecutionContext()),t=new nu(this.getExecutionContext()),i=new nu(this.getExecutionContext()),n=new nu(this.getExecutionContext()),s=new nu(this.getExecutionContext()),r=new nu(this.getExecutionContext()),o=this.getBrowser().getBackgroundTextureProperties();this._frontUrl.addFieldInterest(e._url),this._backUrl.addFieldInterest(t._url),this._leftUrl.addFieldInterest(i._url),this._rightUrl.addFieldInterest(n._url),this._topUrl.addFieldInterest(s._url),this._bottomUrl.addFieldInterest(r._url),e._url=this._frontUrl,t._url=this._backUrl,i._url=this._leftUrl,n._url=this._rightUrl,s._url=this._topUrl,r._url=this._bottomUrl,e._textureProperties=o,t._textureProperties=o,i._textureProperties=o,n._textureProperties=o,s._textureProperties=o,r._textureProperties=o,e.setup(),t.setup(),i.setup(),n.setup(),s.setup(),r.setup(),this.set_texture__(e,0),this.set_texture__(t,1),this.set_texture__(i,2),this.set_texture__(n,3),this.set_texture__(s,4),this.set_texture__(r,5)}}),Object.defineProperties(su,{typeName:{value:"Background",enumerable:!0},componentName:{value:"EnvironmentalEffects",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_bind",new Yn.SFBool),new X(d.inputOutput,"frontUrl",new Yn.MFString),new X(d.inputOutput,"backUrl",new Yn.MFString),new X(d.inputOutput,"leftUrl",new Yn.MFString),new X(d.inputOutput,"rightUrl",new Yn.MFString),new X(d.inputOutput,"topUrl",new Yn.MFString),new X(d.inputOutput,"bottomUrl",new Yn.MFString),new X(d.inputOutput,"skyAngle",new Yn.MFFloat),new X(d.inputOutput,"skyColor",new Yn.MFColor(new Yn.SFColor)),new X(d.inputOutput,"groundAngle",new Yn.MFFloat),new X(d.inputOutput,"groundColor",new Yn.MFColor),new X(d.inputOutput,"transparency",new Yn.SFFloat),new X(d.outputOnly,"isBound",new Yn.SFBool),new X(d.outputOnly,"bindTime",new Yn.SFTime)]),enumerable:!0}});const ru=su;i.add("Background","x_ite/Components/EnvironmentalEffects/Background",ru);const ou=ru;function au(e,t,i){bs.call(this,e),$a.call(this,e),this.addType(d.X3DLayerNode),this.addChildObjects(d.inputOutput,"hidden",new Yn.SFBool,d.outputOnly,"display",new Yn.SFBool(!0)),e.getSpecificationVersion()<=3.3&&this.addAlias("isPickable",this._pickable),this.groupNode=i,this.viewportNode=null,this.defaultNavigationInfo=new rl(e),this.defaultViewpoint=t,this.defaultBackground=new ou(e),this.defaultFog=new fl(e),this.navigationInfoStack=new Za(e,this.defaultNavigationInfo),this.viewpointStack=new Za(e,this.defaultViewpoint),this.backgroundStack=new Za(e,this.defaultBackground),this.fogStack=new Za(e,this.defaultFog),this.navigationInfos=new tl(e,this.defaultNavigationInfo),this.viewpoints=new tl(e,this.defaultViewpoint),this.backgrounds=new tl(e,this.defaultBackground),this.fogs=new tl(e,this.defaultFog),this.defaultBackground.setHidden(!0),this.defaultFog.setHidden(!0)}Object.assign(Object.setPrototypeOf(au.prototype,bs.prototype),$a.prototype,{layer0:!1,initialize(){bs.prototype.initialize.call(this),$a.prototype.initialize.call(this),this.defaultNavigationInfo.setup(),this.defaultViewpoint.setup(),this.defaultBackground.setup(),this.defaultFog.setup(),this.navigationInfoStack.setup(),this.viewpointStack.setup(),this.backgroundStack.setup(),this.fogStack.setup(),this.navigationInfos.setup(),this.viewpoints.setup(),this.backgrounds.setup(),this.fogs.setup(),this._hidden.addInterest("set_visible_and_hidden__",this),this._visible.addInterest("set_visible_and_hidden__",this),this._viewport.addInterest("set_viewport__",this),this.set_visible_and_hidden__(),this.set_viewport__()},isHidden(){return this._hidden.getValue()},setHidden(e){e!==this._hidden.getValue()&&(this._hidden=e)},getBBox(e,t){return this.groupNode.getBBox(e,t)},setLayer0(e){this.layer0=e,this.defaultBackground.setHidden(!e)},getLayer(){return this},getGroup(){return this.groupNode},getViewport(){return this.viewportNode},getBackground(){return this.backgroundStack.top()},getFog(){return this.fogStack.top()},getNavigationInfo(){return this.navigationInfoStack.top()},getViewpoint(){return this.viewpointStack.top()},getBackgrounds(){return this.backgrounds},getFogs(){return this.fogs},getNavigationInfos(){return this.navigationInfos},getViewpoints(){return this.viewpoints},getUserViewpoints(){const e=[];for(const t of this.viewpoints.get())t._description.length&&e.push(t);return e},getBackgroundStack(){return this.backgroundStack},getFogStack(){return this.fogStack},getNavigationInfoStack(){return this.navigationInfoStack},getViewpointStack(){return this.viewpointStack},getCollisionTime(){return this.collisionTime},viewAll(e=1,t=1,i=!1){const n=this.getViewpoint(),s=this.getBBox(new Ua).multRight(n.getModelMatrix().copy().inverse());n.lookAt(this,s.center,n.getLookAtDistance(s),e,t,i)},straightenView(){this.getViewpoint().straightenView(this)},set_visible_and_hidden__(){const e=this._visible.getValue()&&!this._hidden.getValue();e!==this._display.getValue()&&(this._display=e)},set_viewport__(){this.viewportNode=ql(d.X3DViewportNode,this._viewport),this.viewportNode||(this.viewportNode=this.getBrowser().getDefaultViewport())},bindBindables(e){this.traverse(Ia.CAMERA,this);const t=this.navigationInfos.getBound(),i=this.backgrounds.getBound(),n=this.fogs.getBound(),s=this.viewpoints.getBound(e);this.navigationInfoStack.pushOnTop(t),this.viewpointStack.pushOnTop(s),this.backgroundStack.pushOnTop(i),this.fogStack.pushOnTop(n),s.resetUserOffsets(),s._viewAll.getValue()&&s.viewAll(this.getBBox(new Ua))},traverse(e,t=this){const i=this.getViewpoint();switch(this.getProjectionMatrix().pushMatrix(i.getProjectionMatrix(this)),this.getCameraSpaceMatrix().pushMatrix(i.getCameraSpaceMatrix()),this.getViewMatrix().pushMatrix(i.getViewMatrix()),e){case Ia.POINTER:this.pointer(e,t);break;case Ia.CAMERA:this.camera(e,t);break;case Ia.PICKING:this.picking(e,t);break;case Ia.COLLISION:this.collision(e,t);break;case Ia.SHADOW:case Ia.DISPLAY:this.display(e,t)}this.getViewMatrix().pop(),this.getCameraSpaceMatrix().pop(),this.getProjectionMatrix().pop()},pointer(e,t){const i=this.getBrowser(),n=this.viewportNode.getRectangle();if(i.getPointingLayer()){if(i.getPointingLayer()!==this)return}else if(!i.isPointerInRectangle(n))return;this.setHitRay(this.getProjectionMatrix().get(),n,i.getPointer()),this.getNavigationInfo().enable(e,t),this.getModelViewMatrix().pushMatrix(this.getViewMatrix().get()),this.viewportNode.push(this),t.render(e,this.groupNode.traverse,this.groupNode),this.viewportNode.pop(this),this.getModelViewMatrix().pop()},camera(e,t){this._display.getValue()&&(this.getModelViewMatrix().pushMatrix(ci.Identity),this.viewportNode.push(this),this.groupNode.traverse(e,t),this.viewportNode.pop(this),this.getModelViewMatrix().pop(),this.navigationInfos.update(this,this.navigationInfoStack),this.viewpoints.update(this,this.viewpointStack),this.backgrounds.update(this,this.backgroundStack),this.fogs.update(this,this.fogStack),this.getViewpoint().update())},picking(e,t){this._pickable.getValue()&&(this.getModelViewMatrix().pushMatrix(ci.Identity),this.viewportNode.push(this),this.groupNode.traverse(e,t),this.viewportNode.pop(this),this.getModelViewMatrix().pop())},collision:(()=>{const e=new ci;return function(t,i){if(this._display.getValue()){const n=this.getNavigationInfo();if(n._transitionActive.getValue())return;const s=n.getCollisionRadius(),r=n.getAvatarHeight(),o=Math.max(2*s,2*r);Va.ortho(-o,o,-o,o,-o,o,e),this.getProjectionMatrix().pushMatrix(e),this.getModelViewMatrix().pushMatrix(this.getViewMatrix().get()),this.viewportNode.push(this),i.render(t,this.groupNode.traverse,this.groupNode),this.viewportNode.pop(this),this.getModelViewMatrix().pop(),this.getProjectionMatrix().pop()}}})(),display(e,t){this._display.getValue()&&(this.getNavigationInfo().enable(e,t),this.getModelViewMatrix().pushMatrix(this.getViewMatrix().get()),this.viewportNode.push(this),t.render(e,this.groupNode.traverse,this.groupNode),this.viewportNode.pop(this),this.getModelViewMatrix().pop())}}),Object.defineProperties(au,{typeName:{value:"X3DLayerNode",enumerable:!0},componentName:{value:"Layering",enumerable:!0}});const lu=au;i.add("X3DLayerNode","x_ite/Components/Layering/X3DLayerNode",lu);const uu=lu;function hu(e){Hs.call(this,e),this.addType(d.X3DSensorNode)}Object.setPrototypeOf(hu.prototype,Hs.prototype),Object.defineProperties(hu,{typeName:{value:"X3DSensorNode",enumerable:!0},componentName:{value:"Core",enumerable:!0}});const du=hu;i.add("X3DSensorNode","x_ite/Components/Core/X3DSensorNode",du);const cu=du;function pu(e){this.addType(d.X3DTimeDependentNode),this.addChildObjects(d.outputOnly,"initialized",new Yn.SFTime,d.inputOutput,"isEvenLive",new Yn.SFBool),this.startTimeValue=0,this.pauseTimeValue=0,this.resumeTimeValue=0,this.stopTimeValue=0,this.start=0,this.pause=0,this.pauseInterval=0,this.timeouts=new Map,this.disabled=!1}Object.assign(Object.setPrototypeOf(pu.prototype,Hs.prototype),{initialize(){this.getLive().addInterest("set_live__",this),this._isEvenLive.addInterest("set_live__",this),this._initialized.addInterest("set_loop__",this),this._enabled.addInterest("set_enabled__",this),this._loop.addInterest("set_loop__",this),this._startTime.addInterest("set_startTime__",this),this._pauseTime.addInterest("set_pauseTime__",this),this._resumeTime.addInterest("set_resumeTime__",this),this._stopTime.addInterest("set_stopTime__",this),this.startTimeValue=this._startTime.getValue(),this.pauseTimeValue=this._pauseTime.getValue(),this.resumeTimeValue=this._resumeTime.getValue(),this.stopTimeValue=this._stopTime.getValue(),this._initialized=this.getBrowser().getCurrentTime()},getLiveState(){return this.isLive()&&(this.getExecutionContext().getLive().getValue()||this._isEvenLive.getValue())},getElapsedTime(){return this.getBrowser().getCurrentTime()-this.start-this.pauseInterval},resetElapsedTime(){this.start=this.getBrowser().getCurrentTime(),this.pause=this.getBrowser().getCurrentTime(),this.pauseInterval=0},set_live__(){this.getLive().getValue()||this._isEvenLive.getValue()?this.disabled&&(this.disabled=!1,this._isActive.getValue()&&!this._isPaused.getValue()&&this.real_resume()):this.disabled||!this._isActive.getValue()||this._isPaused.getValue()||(this.disabled=!0,this.real_pause())},set_enabled__(){this._enabled.getValue()?this.set_loop__():this.stop()},set_loop__(){this._enabled.getValue()&&this._loop.getValue()&&this.stopTimeValue<=this.startTimeValue&&this.startTimeValue<=this.getBrowser().getCurrentTime()&&this.do_start(),this.set_loop()},set_startTime__(){this.startTimeValue=this._startTime.getValue(),this._enabled.getValue()&&(this.removeTimeout("start"),this.startTimeValue<=this.getBrowser().getCurrentTime()?this.do_start():this.addTimeout("start","do_start",this.startTimeValue))},set_pauseTime__(){if(this.pauseTimeValue=this._pauseTime.getValue(),this._enabled.getValue()){if(this.removeTimeout("pause"),this.pauseTimeValue<=this.resumeTimeValue)return;this.pauseTimeValue<=this.getBrowser().getCurrentTime()?this.do_pause():this.addTimeout("pause","do_pause",this.pauseTimeValue)}},set_resumeTime__(){if(this.resumeTimeValue=this._resumeTime.getValue(),this._enabled.getValue()){if(this.removeTimeout("resume"),this.resumeTimeValue<=this.pauseTimeValue)return;this.resumeTimeValue<=this.getBrowser().getCurrentTime()?this.do_resume():this.addTimeout("resume","do_resume",this.resumeTimeValue)}},set_stopTime__(){if(this.stopTimeValue=this._stopTime.getValue(),this._enabled.getValue()){if(this.removeTimeout("stop"),this.stopTimeValue<=this.startTimeValue)return;this.stopTimeValue<=this.getBrowser().getCurrentTime()?this.do_stop():this.addTimeout("stop","do_stop",this.stopTimeValue)}},do_start(){this._isActive.getValue()||(this.resetElapsedTime(),this._isActive=!0,this._elapsedTime=0,this.set_start(),this.getLive().getValue()?this.getBrowser().timeEvents().addInterest("set_time",this):(this.disabled=!0,this.real_pause()))},do_pause(){this._isActive.getValue()&&!this._isPaused.getValue()&&(this._isPaused=!0,this.pauseTimeValue!==this.getBrowser().getCurrentTime()&&(this.pauseTimeValue=this.getBrowser().getCurrentTime()),this.getLive().getValue()&&this.real_pause())},real_pause(){this.pause=Date.now(),this.set_pause(),this.getBrowser().timeEvents().removeInterest("set_time",this)},do_resume(){this._isActive.getValue()&&this._isPaused.getValue()&&(this._isPaused=!1,this.resumeTimeValue!==this.getBrowser().getCurrentTime()&&(this.resumeTimeValue=this.getBrowser().getCurrentTime()),this.getLive().getValue()&&this.real_resume())},real_resume(){const e=(Date.now()-this.pause)/1e3;this.pauseInterval+=e,this.set_resume(e),this.getBrowser().timeEvents().addInterest("set_time",this),this.getBrowser().addBrowserEvent()},do_stop(){this.stop()},stop(){this._isActive.getValue()&&(this.set_stop(),this._elapsedTime=this.getElapsedTime(),this._isPaused.getValue()&&(this._isPaused=!1),this._isActive=!1,this.getBrowser().timeEvents().removeInterest("set_time",this))},addTimeout(e,t,i){this.removeTimeout(e),this.timeouts.set(e,setTimeout(this.processTimeout.bind(this,t),1e3*(i-this.getBrowser().getCurrentTime())))},removeTimeout(e){clearTimeout(this.timeouts.get(e)),this.timeouts.delete(e)},processTimeout(e){this._enabled.getValue()&&(this.getLive().getValue()||this._isEvenLive.getValue())&&(this.getBrowser().advanceTime(),this[e]())},set_loop:Function.prototype,set_start:Function.prototype,set_pause:Function.prototype,set_resume:Function.prototype,set_stop:Function.prototype,set_time:Function.prototype,dispose(){for(const e of[...this.timeouts.keys()])this.removeTimeout(e)}}),Object.defineProperties(pu,{typeName:{value:"X3DTimeDependentNode",enumerable:!0},componentName:{value:"Time",enumerable:!0}});const gu=pu;i.add("X3DTimeDependentNode","x_ite/Components/Time/X3DTimeDependentNode",gu);const fu=gu;function mu(e){cu.call(this,e),fu.call(this,e),this.addType(d.TimeSensor),this.addChildObjects(d.inputOutput,"range",new Yn.MFFloat(0,0,1)),this.cycle=0,this.interval=0,this.fraction=0,this.first=0,this.last=1,this.scale=1}Object.assign(Object.setPrototypeOf(mu.prototype,cu.prototype),fu.prototype,{initialize(){cu.prototype.initialize.call(this),fu.prototype.initialize.call(this),this._cycleInterval.addInterest("set_cycleInterval__",this),this._range.addInterest("set_range__",this)},setRange(e,t,i,n){const s=this.getBrowser().getCurrentTime(),r=this._startTime.getValue(),o=this._cycleInterval.getValue();this.first=g.clamp(t,0,1),this.last=g.clamp(i,0,1),this.scale=this.last-this.first,this.interval=o*this.scale,this.offset=n&&this.interval?(s-r)/this.interval:0,this.fraction=g.fract(e+this.offset),this.cycle=s-(this.fraction-this.first)*o},set_cycleInterval__(){this._isActive.getValue()&&this.setRange(this.fraction,this._range[1],this._range[2],!1)},set_range__(){this._isActive.getValue()&&(this.setRange(this._range[0],this._range[1],this._range[2],!1),this._isPaused.getValue()||this.set_fraction(this.getBrowser().getCurrentTime()))},set_start(){this.setRange(this._range[0],this._range[1],this._range[2],!0);const e=this.getBrowser().getCurrentTime();this._cycleTime=e,this._fraction_changed=this.fraction,this._time=e},set_resume(e){this.setRange(this.fraction,this._range[1],this._range[2],!1)},set_fraction(e){this._fraction_changed=this.fraction=this.first+(this.interval?g.fract((e-this.cycle)/this.interval):0)*this.scale},set_time(){const e=this.getBrowser().getCurrentTime();e-this.cycle>=this.interval?this._loop.getValue()?this.interval&&(this.cycle+=this.interval*Math.floor((e-this.cycle)/this.interval),this._elapsedTime=this.getElapsedTime(),this._cycleTime=e,this.set_fraction(e)):(this._fraction_changed=this.fraction=this.last,this.stop()):(this._elapsedTime=this.getElapsedTime(),this.set_fraction(e)),this._time=e},dispose(){fu.prototype.dispose.call(this),cu.prototype.dispose.call(this)}}),Object.defineProperties(mu,{typeName:{value:"TimeSensor",enumerable:!0},componentName:{value:"Time",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"cycleInterval",new Yn.SFTime(1)),new X(d.inputOutput,"loop",new Yn.SFBool),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"cycleTime",new Yn.SFTime),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.outputOnly,"fraction_changed",new Yn.SFFloat),new X(d.outputOnly,"time",new Yn.SFTime)]),enumerable:!0}});const _u=mu;i.add("TimeSensor","x_ite/Components/Time/TimeSensor",_u);const xu=_u;function yu(e){Hs.call(this,e),this.addType(d.X3DInterpolatorNode)}Object.assign(Object.setPrototypeOf(yu.prototype,Hs.prototype),{setup(){this.set_key__(),this._key.length&&this.interpolate(0,0,0),Hs.prototype.setup.call(this)},initialize(){Hs.prototype.initialize.call(this),this._set_fraction.addInterest("set_fraction__",this),this._key.addInterest("set_key__",this)},set_fraction__(){const e=this._key,t=e.length,i=this._set_fraction.getValue();switch(t){case 0:return;case 1:return this.interpolate(0,0,0);default:{if(i<=e[0])return this.interpolate(0,1,0);const n=g.upperBound(e,0,t,i);if(n!==t){const t=n-1,s=(i-e[t])/(e[n]-e[t]);this.interpolate(t,n,g.clamp(s,0,1))}else this.interpolate(t-2,t-1,1)}}},set_key__(){this.set_keyValue__()},set_keyValue__(){},interpolate(){}}),Object.defineProperties(yu,{typeName:{value:"X3DInterpolatorNode",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0}});const wu=yu;i.add("X3DInterpolatorNode","x_ite/Components/Interpolation/X3DInterpolatorNode",wu);const bu=wu;function Su(e){bu.call(this,e),this.addType(d.EaseInEaseOut)}Object.assign(Object.setPrototypeOf(Su.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._easeInEaseOut.addInterest("set_keyValue__",this)},set_keyValue__(){this._easeInEaseOut.length<this._key.length&&this._easeInEaseOut.resize(this._key.length,this._easeInEaseOut.length?this._easeInEaseOut[this._easeInEaseOut.length-1]:new Yn.SFVec2f)},interpolate(e,t,i){let n=this._easeInEaseOut[e].y,s=this._easeInEaseOut[t].x;const r=n+s;if(r<0)this._modifiedFraction_changed=i;else{r>1&&(s/=r,n/=r);const e=1/(2-n-s);if(i<n)this._modifiedFraction_changed=e/n*i*i;else if(i<=1-s)this._modifiedFraction_changed=e*(2*i-n);else{const t=1-i;this._modifiedFraction_changed=1-e*t*t/s}}}}),Object.defineProperties(Su,{typeName:{value:"EaseInEaseOut",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"easeInEaseOut",new Yn.MFVec2f),new X(d.outputOnly,"modifiedFraction_changed",new Yn.SFFloat)]),enumerable:!0}});const Tu=Su;i.add("EaseInEaseOut","x_ite/Components/Interpolation/EaseInEaseOut",Tu);const vu=Tu;function Ou(e){bu.call(this,e),this.addType(d.PositionInterpolator)}Object.assign(Object.setPrototypeOf(Ou.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:new Yn.SFVec3f)},interpolate:(()=>{const e=new bt(0,0,0);return function(t,i,n){this._value_changed=e.assign(this._keyValue[t].getValue()).lerp(this._keyValue[i].getValue(),n)}})()}),Object.defineProperties(Ou,{typeName:{value:"PositionInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFVec3f),new X(d.outputOnly,"value_changed",new Yn.SFVec3f)]),enumerable:!0}});const Eu=Ou;i.add("PositionInterpolator","x_ite/Components/Interpolation/PositionInterpolator",Eu);const Nu=Eu;function Cu(e){bu.call(this,e),this.addType(d.OrientationInterpolator),this._keyValue.setUnit("angle"),this._value_changed.setUnit("angle")}Object.assign(Object.setPrototypeOf(Cu.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:new Yn.SFRotation)},interpolate:(()=>{const e=new ai,t=new ai;return function(i,n,s){e.assign(this._keyValue[i].getValue()),t.assign(this._keyValue[n].getValue()),this._value_changed=e.slerp(t,s)}})()}),Object.defineProperties(Cu,{typeName:{value:"OrientationInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFRotation),new X(d.outputOnly,"value_changed",new Yn.SFRotation)]),enumerable:!0}});const Fu=Cu;i.add("OrientationInterpolator","x_ite/Components/Interpolation/OrientationInterpolator",Fu);const Iu=Fu;function Mu(e){bu.call(this,e),this.addType(d.ScalarInterpolator)}Object.assign(Object.setPrototypeOf(Mu.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:0)},interpolate(e,t,i){this._value_changed=g.lerp(this._keyValue[e],this._keyValue[t],i)}}),Object.defineProperties(Mu,{typeName:{value:"ScalarInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFFloat),new X(d.outputOnly,"value_changed",new Yn.SFFloat)]),enumerable:!0}});const Du=Mu;i.add("ScalarInterpolator","x_ite/Components/Interpolation/ScalarInterpolator",Du);const Pu=Du;function Ru(e){tr.call(this,e),this.addType(d.X3DViewpointNode),this.addChildObjects(d.inputOutput,"positionOffset",new Yn.SFVec3f,d.inputOutput,"orientationOffset",new Yn.SFRotation,d.inputOutput,"scaleOffset",new Yn.SFVec3f(1,1,1),d.inputOutput,"scaleOrientationOffset",new Yn.SFRotation,d.inputOutput,"centerOfRotationOffset",new Yn.SFVec3f,d.inputOutput,"fieldOfViewScale",new Yn.SFFloat(1)),this.descriptions=[],this.userPosition=new bt(0,1,0),this.userOrientation=new ai,this.userCenterOfRotation=new bt(0,0,0),this.modelMatrix=new ci,this.cameraSpaceMatrix=new ci(1,0,0,0,0,1,0,0,0,0,1,0,0,0,10,1),this.viewMatrix=new ci(1,0,0,0,0,1,0,0,0,0,1,0,0,0,-10,1);const t=this.getBrowser();this.timeSensor=new xu(t.getPrivateScene()),this.easeInEaseOut=new vu(t.getPrivateScene()),this.positionInterpolator=new Nu(t.getPrivateScene()),this.orientationInterpolator=new Iu(t.getPrivateScene()),this.scaleInterpolator=new Nu(t.getPrivateScene()),this.scaleOrientationInterpolator=new Iu(t.getPrivateScene()),this.fieldOfViewScaleInterpolator=new Pu(t.getPrivateScene())}Object.assign(Object.setPrototypeOf(Ru.prototype,tr.prototype),{initialize(){tr.prototype.initialize.call(this),this.timeSensor._stopTime=1,this.timeSensor.setup(),this.easeInEaseOut._key=new Yn.MFFloat(0,1),this.easeInEaseOut._easeInEaseOut=new Yn.MFVec2f(new Yn.SFVec2f(0,0),new Yn.SFVec2f(0,0)),this.easeInEaseOut.setup(),this.positionInterpolator._key=new Yn.MFFloat(0,1),this.orientationInterpolator._key=new Yn.MFFloat(0,1),this.scaleInterpolator._key=new Yn.MFFloat(0,1),this.scaleOrientationInterpolator._key=new Yn.MFFloat(0,1),this.fieldOfViewScaleInterpolator._key=new Yn.MFFloat(0,1),this.positionInterpolator.setup(),this.orientationInterpolator.setup(),this.scaleInterpolator.setup(),this.scaleOrientationInterpolator.setup(),this.fieldOfViewScaleInterpolator.setup(),this.timeSensor._fraction_changed.addFieldInterest(this.easeInEaseOut._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.positionInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.orientationInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.scaleInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.scaleOrientationInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.fieldOfViewScaleInterpolator._set_fraction),this.positionInterpolator._value_changed.addFieldInterest(this._positionOffset),this.orientationInterpolator._value_changed.addFieldInterest(this._orientationOffset),this.scaleInterpolator._value_changed.addFieldInterest(this._scaleOffset),this.scaleOrientationInterpolator._value_changed.addFieldInterest(this._scaleOrientationOffset),this.fieldOfViewScaleInterpolator._value_changed.addFieldInterest(this._fieldOfViewScale),this._nearDistance.addInterest("set_nearDistance__",this),this._farDistance.addInterest("set_farDistance__",this),this._viewAll.addInterest("set_viewAll__",this),this._navigationInfo.addInterest("set_navigationInfo__",this),this._isBound.addInterest("set_bound__",this),this.set_nearDistance__(),this.set_farDistance__(),this.set_navigationInfo__()},set_nearDistance__(){const e=this._nearDistance.getValue();this.nearDistance=e>=0?e:void 0},set_farDistance__(){const e=this._farDistance.getValue();this.farDistance=e>=0?e:void 0},set_viewAll__(){this._viewAll.getValue()&&this._isBound.getValue()&&(this._set_bind=!0)},set_navigationInfo__(){this.navigationInfoNode&&this._isBound.removeFieldInterest(this.navigationInfoNode._set_bind),this.navigationInfoNode=ql(d.NavigationInfo,this._navigationInfo),this.navigationInfoNode&&this._isBound.addFieldInterest(this.navigationInfoNode._set_bind)},set_bound__(){const e=this.getBrowser();this._isBound.getValue()?e.getNotification()._string=this._description:this.timeSensor._stopTime=e.getCurrentTime()},set_active__(e,t){t.getValue()||(this.timeSensor._isActive.removeInterest("set_active__",this),this._isBound.getValue()&&1===this.timeSensor._fraction_changed.getValue()&&(e._transitionComplete=!0))},getDescriptions(){return this.descriptions},setInterpolators(){},getPosition(){return this._position.getValue()},getUserPosition(){return this.userPosition.assign(this.getPosition()).add(this._positionOffset.getValue())},getOrientation(){return this._orientation.getValue()},getUserOrientation(){return this.userOrientation.assign(this.getOrientation()).multRight(this._orientationOffset.getValue())},getCenterOfRotation(){return this._centerOfRotation.getValue()},getUserCenterOfRotation(){return this.userCenterOfRotation.assign(this.getCenterOfRotation()).add(this._centerOfRotationOffset.getValue())},getProjectionMatrix(e){const t=e.getNavigationInfo();return this.getProjectionMatrixWithLimits(this.nearDistance??t.getNearValue(),this.farDistance??t.getFarValue(this),e.getLayer().getViewport().getRectangle())},getCameraSpaceMatrix(){return this.cameraSpaceMatrix},getViewMatrix(){return this.viewMatrix},getModelMatrix(){return this.modelMatrix},getMaxFarValue(){return this.getBrowser().getRenderingProperty("LogarithmicDepthBuffer")?1e10:1e5},getUpVector:()=>bt.yAxis,getSpeedFactor:()=>1,setVRMLTransition(e){this.VRMLTransition=e},getVRMLTransition(){return this.VRMLTransition},transitionStart(e,t){if(this._jump.getValue()){const i=this.getRelativeTransformation(t);this._retainUserOffsets.getValue()||this.resetUserOffsets(),this._viewAll.getValue()&&this.viewAll(e.getBBox(new Ua));const n=e.getNavigationInfo(),s=n._transitionTime.getValue();let r=n.getTransitionType();switch(2==this.getExecutionContext().getSpecificationVersion()&&(r=this.getVRMLTransition()?"LINEAR":"TELEPORT"),this.setVRMLTransition(!1),s<=0&&(r="TELEPORT"),this.constructor!==t.constructor&&(r="TELEPORT"),r){case"TELEPORT":return void(n._transitionComplete=!0);case"ANIMATE":this.easeInEaseOut._easeInEaseOut=new Yn.MFVec2f(new Yn.SFVec2f(0,1),new Yn.SFVec2f(1,0));break;default:this.easeInEaseOut._easeInEaseOut=new Yn.MFVec2f(new Yn.SFVec2f(0,0),new Yn.SFVec2f(0,0))}n._transitionStart=!0,this.timeSensor._cycleInterval=s,this.timeSensor._stopTime=this.getBrowser().getCurrentTime(),this.timeSensor._startTime=this.getBrowser().getCurrentTime(),this.timeSensor._isActive.addInterest("set_active__",this,n),this.positionInterpolator._keyValue=new Yn.MFVec3f(i.position,this._positionOffset),this.orientationInterpolator._keyValue=new Yn.MFRotation(i.orientation,this._orientationOffset),this.scaleInterpolator._keyValue=new Yn.MFVec3f(i.scale,this._scaleOffset),this.scaleOrientationInterpolator._keyValue=new Yn.MFRotation(i.scaleOrientation,this._scaleOrientationOffset),this._positionOffset=i.position,this._orientationOffset=i.orientation,this._scaleOffset=i.scale,this._scaleOrientationOffset=i.scaleOrientation,this.setInterpolators(t,i)}else{e.getNavigationInfo()._transitionComplete=!0;const i=this.getRelativeTransformation(t);this._positionOffset=i.position,this._orientationOffset=i.orientation,this._scaleOffset=i.scale,this._scaleOrientationOffset=i.scaleOrientation,this.setInterpolators(t,i)}},transitionStop(){this.timeSensor._stopTime=this.getBrowser().getCurrentTime(),this.timeSensor._isActive.removeInterest("set_active__",this)},resetUserOffsets(){this._positionOffset=bt.Zero,this._orientationOffset=ai.Identity,this._scaleOffset=bt.One,this._scaleOrientationOffset=ai.Identity,this._centerOfRotationOffset=bt.Zero,this._fieldOfViewScale=1,this.set_nearDistance__(),this.set_farDistance__()},getRelativeTransformation:(()=>{const e=new bt(0,0,0),t=new ai,i=new bt(0,0,0),n=new ai;return function(s){return this.modelMatrix.copy().multRight(s.getViewMatrix()).inverse().get(e,t,i,n),e.subtract(this.getPosition()),t.multLeft(this.getOrientation().copy().inverse()),{position:e,orientation:t,scale:i,scaleOrientation:n}}})(),getLookAtRotation:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new Pt,s=new ai;return function(r,o){const a=this.getUpVector(!0);return i.assign(r).subtract(o).normalize(),e.assign(a).cross(i).normalize(),t.assign(i).cross(e).normalize(),n.set(...e,...t,...i),s.setMatrix(n),s}})(),lookAtPoint(e,t,i=1,n=1,s=!1){this.getCameraSpaceMatrix().multVecMatrix(t),this.getModelMatrix().copy().inverse().multVecMatrix(t);const r=2*e.getNavigationInfo().getNearValue();this.lookAt(e,t,r,1,1,!1)},lookAtBBox(e,t,i=1,n,s){t=t.copy().multRight(this.getModelMatrix().copy().inverse());const r=Math.max(2*e.getNavigationInfo().getNearValue(),this.getLookAtDistance(t));this.lookAt(e,t.center,r,i,n,s)},lookAt(e,t,i,n=1,s=1,r=!1){const o=t.copy().add(this.getUserOrientation().multVecRot(new bt(0,0,i))).subtract(this.getPosition());e.getNavigationInfo()._transitionStart=!0,this.timeSensor._cycleInterval=n,this.timeSensor._stopTime=this.getBrowser().getCurrentTime(),this.timeSensor._startTime=this.getBrowser().getCurrentTime(),this.timeSensor._isActive.addInterest("set_active__",this,e.getNavigationInfo()),this.easeInEaseOut._easeInEaseOut=new Yn.MFVec2f(new Yn.SFVec2f(0,1),new Yn.SFVec2f(1,0));const a=this._positionOffset.getValue().copy().lerp(o,s),l=this.getPosition().copy().add(a).subtract(t);let u=this._orientationOffset.getValue().copy().multRight(new ai(this.getUserOrientation().multVecRot(new bt(0,0,1)),l));r&&(u=this.getOrientation().copy().inverse().multRight(this.straightenHorizon(this.getOrientation().copy().multRight(u)))),this.positionInterpolator._keyValue=new Yn.MFVec3f(this._positionOffset,a),this.orientationInterpolator._keyValue=new Yn.MFRotation(this._orientationOffset,u),this.scaleInterpolator._keyValue=new Yn.MFVec3f(this._scaleOffset,bt.One),this.scaleOrientationInterpolator._keyValue=new Yn.MFRotation(this._scaleOrientationOffset,this._scaleOrientationOffset);const h=this.getRelativeTransformation(this);this._fieldOfViewScale=1,this._centerOfRotationOffset=t.copy().subtract(this.getCenterOfRotation()),this.nearDistance=Math.min(i/2,.125),this.farDistance=this.nearDistance*this.getMaxFarValue()/.125,this.setInterpolators(this,h)},straightenView(e){e.getNavigationInfo()._transitionStart=!0,this.timeSensor._cycleInterval=1,this.timeSensor._stopTime=this.getBrowser().getCurrentTime(),this.timeSensor._startTime=this.getBrowser().getCurrentTime(),this.timeSensor._isActive.addInterest("set_active__",this,e.getNavigationInfo()),this.easeInEaseOut._easeInEaseOut=new Yn.MFVec2f(new Yn.SFVec2f(0,1),new Yn.SFVec2f(1,0));const t=this.getOrientation().copy().inverse().multRight(this.straightenHorizon(this.getUserOrientation()));this.positionInterpolator._keyValue=new Yn.MFVec3f(this._positionOffset,this._positionOffset),this.orientationInterpolator._keyValue=new Yn.MFRotation(this._orientationOffset,t),this.scaleInterpolator._keyValue=new Yn.MFVec3f(this._scaleOffset,this._scaleOffset),this.scaleOrientationInterpolator._keyValue=new Yn.MFRotation(this._scaleOrientationOffset,this._scaleOrientationOffset);const i=this.getRelativeTransformation(this);this._fieldOfViewScale=1,this.setInterpolators(this,i)},straightenHorizon:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new ai;return function(n,s=this.getUpVector(!0)){n.multVecRot(e.assign(bt.xAxis).negate()),n.multVecRot(t.assign(bt.zAxis));const r=t.cross(s);return Math.abs(t.dot(s))>=1||Math.abs(r.dot(e))>=1?n:(i.setFromToVec(e,r),n.multRight(i))}})(),viewAll(e){e.multRight(this.modelMatrix.copy().inverse());const t=this.getUserPosition().copy().subtract(e.center).normalize(),i=this.getLookAtDistance(e),n=e.center.copy().add(t.multiply(i)),s=this.getLookAtRotation(n,e.center);this._positionOffset=n.subtract(this.getPosition()),this._orientationOffset=this.getOrientation().copy().inverse().multRight(s),this._centerOfRotationOffset=e.center.copy().subtract(this.getCenterOfRotation()),this._fieldOfViewScale=1,this.nearDistance=Math.min((i-e.size.magnitude())/2,.125),this.farDistance=this.nearDistance*this.getMaxFarValue()/.125},traverse(e,t){if(e===Ia.CAMERA){if(this.navigationInfoNode&&this.navigationInfoNode.traverse(e,t),this.descriptions.length=0,this._description.getValue()&&t.getViewpointGroups().every((e=>e._displayed.getValue()))){for(const e of t.getViewpointGroups())e._description.getValue()&&this.descriptions.push(e._description.getValue());this.descriptions.push(this._description.getValue())}t.getLayer().getViewpoints().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get())}},update(){this.cameraSpaceMatrix.set(this.getUserPosition(),this.getUserOrientation(),this._scaleOffset.getValue(),this._scaleOrientationOffset.getValue()),this.cameraSpaceMatrix.multRight(this.modelMatrix),this.viewMatrix.assign(this.cameraSpaceMatrix).inverse()}}),Object.defineProperties(Ru,{typeName:{value:"X3DViewpointNode",enumerable:!0},componentName:{value:"Navigation",enumerable:!0}});const Au=Ru;i.add("X3DViewpointNode","x_ite/Components/Navigation/X3DViewpointNode",Au);const Vu=Au;function Lu(e){Vu.call(this,e),this.addType(d.Viewpoint),this._position.setUnit("length"),this._centerOfRotation.setUnit("length"),this._fieldOfView.setUnit("angle"),this.projectionMatrix=new ci}Object.assign(Object.setPrototypeOf(Lu.prototype,Vu.prototype),{getRelativeTransformation(e){const t=Vu.prototype.getRelativeTransformation.call(this,e);return e.constructor===this.constructor&&(t.fieldOfView=e.getFieldOfView()),t},setInterpolators(e,t){if(e.constructor===this.constructor){const e=t.fieldOfView/this.getFieldOfView();this.fieldOfViewScaleInterpolator._keyValue=new Yn.MFFloat(e,this._fieldOfViewScale.getValue()),this._fieldOfViewScale=e}else this.fieldOfViewScaleInterpolator._keyValue=new Yn.MFFloat(this._fieldOfViewScale.getValue(),this._fieldOfViewScale.getValue()),this._fieldOfViewScale=this._fieldOfViewScale.getValue()},getLogarithmicDepthBuffer:()=>!1,getFieldOfView(){const e=this._fieldOfView.getValue()*this._fieldOfViewScale.getValue();return e>0&&e<Math.PI?e:Math.PI/4},getScreenScale(e,t,i){const n=t[2],s=t[3];let r=Math.abs(e.z)*Math.tan(this.getFieldOfView()/2)*2;return r/=n>s?s:n,i.set(r,r,r)},getViewportSize:(()=>{const e=new ft(0,0);return function(t,i){const n=t[2],s=t[3],r=i*Math.tan(this.getFieldOfView()/2)*2,o=n/s;return o>1?e.set(r*o,r):e.set(r,r/o)}})(),getLookAtDistance(e){return e.size.magnitude()/2/Math.tan(this.getFieldOfView()/2)},getProjectionMatrixWithLimits(e,t,i){return Va.perspective(this.getFieldOfView(),e,t,i[2],i[3],this.projectionMatrix)}}),Object.defineProperties(Lu,{typeName:{value:"Viewpoint",enumerable:!0},componentName:{value:"Navigation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_bind",new Yn.SFBool),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"position",new Yn.SFVec3f(0,0,10)),new X(d.inputOutput,"orientation",new Yn.SFRotation),new X(d.inputOutput,"centerOfRotation",new Yn.SFVec3f),new X(d.inputOutput,"fieldOfView",new Yn.SFFloat(.785398)),new X(d.inputOutput,"nearDistance",new Yn.SFFloat(-1)),new X(d.inputOutput,"farDistance",new Yn.SFFloat(-1)),new X(d.inputOutput,"viewAll",new Yn.SFBool),new X(d.inputOutput,"jump",new Yn.SFBool(!0)),new X(d.inputOutput,"retainUserOffsets",new Yn.SFBool),new X(d.outputOnly,"isBound",new Yn.SFBool),new X(d.outputOnly,"bindTime",new Yn.SFTime),new X(d.inputOutput,"navigationInfo",new Yn.SFNode)]),enumerable:!0}});const Bu=Lu;i.add("Viewpoint","x_ite/Components/Navigation/Viewpoint",Bu);const Uu=Bu;function Xu(e){this.addType(d.X3DBoundedObject),this.addChildObjects(d.inputOutput,"hidden",new Yn.SFBool,d.outputOnly,"display",new Yn.SFBool(!0),d.outputOnly,"transformSensors_changed",new Yn.SFTime),this._bboxSize.setUnit("length"),this._bboxCenter.setUnit("length"),this.childBBox=new Ua,this.transformSensorNodes=new Set}Object.assign(Xu.prototype,{initialize(){this._hidden.addInterest("set_visible_and_hidden__",this),this._visible.addInterest("set_visible_and_hidden__",this),this.set_visible_and_hidden__()},isHidden(){return this._hidden.getValue()},setHidden(e){e!==this._hidden.getValue()&&(this._hidden=e)},getDefaultBBoxSize:(()=>{const e=new bt(-1,-1,-1);return function(){return e}})(),getBBox(e,t,i){const n=this.childBBox;t.set();for(const s of e)s.getBBox&&t.add(s.getBBox(n,i));return t},displayBBox:(()=>{const e=new Ua,t=new ci;return function(i,n){const s=n.getModelViewMatrix();this.getBBox(e),t.set(e.center,null,e.size),s.push(),s.multLeft(t),this.getBrowser().getBBoxNode().traverse(i,n),s.pop()}})(),addTransformSensor(e){this.transformSensorNodes.add(e),this._transformSensors_changed=this.getBrowser().getCurrentTime()},removeTransformSensor(e){this.transformSensorNodes.delete(e),this._transformSensors_changed=this.getBrowser().getCurrentTime()},getTransformSensors(){return this.transformSensorNodes},set_visible_and_hidden__(){const e=this._visible.getValue()&&!this._hidden.getValue();e!==this._display.getValue()&&(this._display=e)},dispose(){}}),Object.defineProperties(Xu,{typeName:{value:"X3DBoundedObject",enumerable:!0},componentName:{value:"Grouping",enumerable:!0}});const ku=Xu;i.add("X3DBoundedObject","x_ite/Components/Grouping/X3DBoundedObject",ku);const ju=ku;function zu(e){Hs.call(this,e),ju.call(this,e),this.addType(d.X3DGroupingNode),this.allowedTypes=new Set,this.clipPlaneNodes=[],this.localFogNodes=[],this.lightNodes=[],this.textureProjectorNodes=[],this.pointingDeviceSensorNodes=[],this.maybeCameraObjects=[],this.cameraObjects=[],this.maybePickableSensorNodes=[],this.pickableSensorNodes=[],this.pickableObjects=[],this.childNodes=[],this.displayNodes=[],this.visibleNodes=[],this.boundedObjects=[],this.sensors=[]}function Gu(e,t){const i=new Set(t);return e.filter((e=>!i.has(e)))}Object.assign(Object.setPrototypeOf(zu.prototype,Hs.prototype),ju.prototype,{initialize(){Hs.prototype.initialize.call(this),ju.prototype.initialize.call(this),this._transformSensors_changed.addInterest("set_transformSensors__",this),this._addChildren.addInterest("set_addChildren__",this),this._removeChildren.addInterest("set_removeChildren__",this),this._children.addInterest("set_children__",this),this.set_children__()},getBBox(e,t){return this.getSubBBox(e,t)},getSubBBox(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?ju.prototype.getBBox.call(this,this.visibleNodes,e,t):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},setAllowedTypes(){const e=this.allowedTypes;e.clear();for(const t of arguments)e.add(t)},set_addChildren__(){0!==this._addChildren.length&&(this._addChildren.setTainted(!0),this._addChildren.assign(Gu(this._addChildren,this._children)),this._children.isTainted()||(this._children.removeInterest("set_children__",this),this._children.addInterest("connectChildren",this)),this._children.splice(this._children.length,0,...this._addChildren),this.add(this._addChildren),this._addChildren.length=0,this._addChildren.setTainted(!1))},set_removeChildren__(){0!==this._removeChildren.length&&(this._removeChildren.setTainted(!0),this._children.length>0&&(this._children.isTainted()||(this._children.removeInterest("set_children__",this),this._children.addInterest("connectChildren",this)),this._children.assign(Gu(this._children,this._removeChildren)),this.remove(this._removeChildren)),this._removeChildren.length=0,this._removeChildren.setTainted(!1))},set_children__(){this.clear(),this.add(this._children)},connectChildren(){this._children.removeInterest("connectChildren",this),this._children.addInterest("set_children__",this)},clear(){for(const e of this.maybePickableSensorNodes)e._isPickableObject.removeInterest("set_pickableObjects__",this);for(const e of this.childNodes)e._isCameraObject.removeInterest("set_cameraObjects__",this),e._isPickableObject.removeInterest("set_pickableObjects__",this),ql(d.X3DBoundedObject,e)&&(e._display.removeInterest("set_displays_",this),e._bboxDisplay.removeInterest("set_bboxDisplays__",this));this.clipPlaneNodes.length=0,this.localFogNodes.length=0,this.lightNodes.length=0,this.textureProjectorNodes.length=0,this.pointingDeviceSensorNodes.length=0,this.maybeCameraObjects.length=0,this.maybePickableSensorNodes.length=0,this.childNodes.length=0},add(e){for(const t of e){const e=ql(d.X3DChildNode,t);if(!e)continue;const i=e.getType();for(let t=i.length-1;t>=0;--t){switch(i[t]){case d.X3DPointingDeviceSensorNode:this.pointingDeviceSensorNodes.push(e);break;case d.ClipPlane:this.clipPlaneNodes.push(e);break;case d.LocalFog:this.localFogNodes.push(e);break;case d.X3DTextureProjectorNode:this.textureProjectorNodes.push(e);break;case d.X3DLightNode:this.lightNodes.push(e);break;case d.X3DBindableNode:this.maybeCameraObjects.push(e);break;case d.TransformSensor:case d.X3DPickSensorNode:e._isPickableObject.addInterest("set_pickableObjects__",this),this.maybePickableSensorNodes.push(e);break;case d.Sound:case d.SpatialSound:case d.X3DBackgroundNode:case d.X3DChildNode:e._isCameraObject.addInterest("set_cameraObjects__",this),e._isPickableObject.addInterest("set_pickableObjects__",this),ql(d.X3DBoundedObject,e)&&(e._display.addInterest("set_displays_",this),e._bboxDisplay.addInterest("set_bboxDisplays__",this)),this.maybeCameraObjects.push(e),this.childNodes.push(e);break;case d.BooleanFilter:case d.BooleanToggle:case d.HAnimMotion:case d.NurbsOrientationInterpolator:case d.NurbsPositionInterpolator:case d.NurbsSurfaceInterpolator:case d.TimeSensor:case d.X3DFollowerNode:case d.X3DInfoNode:case d.X3DInterpolatorNode:case d.X3DKeyDeviceSensorNode:case d.X3DLayoutNode:case d.X3DScriptNode:case d.X3DSequencerNode:case d.X3DSoundNode:case d.X3DTriggerNode:break;default:continue}break}e.getMustDisplay()&&(this.childNodes.includes(e)||this.childNodes.push(e))}this.set_pickableObjects__(),this.set_displayNodes__(),this.set_displays_(),this.set_bboxDisplays__()},remove(e){for(const i of e){const e=ql(d.X3DChildNode,i);if(!e)continue;if(e.getMustDisplay()){const t=this.childNodes.indexOf(e);t>=0&&this.childNodes.splice(t,1)}const n=e.getType();for(let i=n.length-1;i>=0;--i){switch(n[i]){case d.X3DPointingDeviceSensorNode:{const t=this.pointingDeviceSensorNodes.indexOf(e);t>=0&&this.pointingDeviceSensorNodes.splice(t,1);break}case d.ClipPlane:{const t=this.clipPlaneNodes.indexOf(e);t>=0&&this.clipPlaneNodes.splice(t,1);break}case d.LocalFog:{const t=this.localFogNodes.indexOf(e);t>=0&&this.localFogNodes.splice(t,1);break}case d.X3DTextureProjectorNode:{const t=this.textureProjectorNodes.indexOf(e);t>=0&&this.textureProjectorNodes.splice(t,1);break}case d.X3DLightNode:{const t=this.lightNodes.indexOf(e);t>=0&&this.lightNodes.splice(t,1);break}case d.X3DBindableNode:{const t=this.maybeCameraObjects.indexOf(e);t>=0&&this.maybeCameraObjects.splice(t,1);break}case d.TransformSensor:case d.X3DPickSensorNode:{e._isPickableObject.removeInterest("set_pickableObjects__",this);const t=this.maybePickableSensorNodes.indexOf(e);t>=0&&this.maybePickableSensorNodes.splice(t,1);break}case d.Sound:case d.SpatialSound:case d.X3DBackgroundNode:case d.X3DChildNode:var t;e._isCameraObject.removeInterest("set_cameraObjects__",this),e._isPickableObject.removeInterest("set_pickableObjects__",this),ql(d.X3DBoundedObject,e)&&(e._display.removeInterest("set_displays_",this),e._bboxDisplay.removeInterest("set_bboxDisplays__",this)),(t=this.maybeCameraObjects.indexOf(e))>=0&&this.maybeCameraObjects.splice(t,1),(t=this.childNodes.indexOf(e))>=0&&this.childNodes.splice(t,1);break;case d.BooleanFilter:case d.BooleanToggle:case d.HAnimMotion:case d.NurbsOrientationInterpolator:case d.NurbsPositionInterpolator:case d.NurbsSurfaceInterpolator:case d.TimeSensor:case d.X3DFollowerNode:case d.X3DInfoNode:case d.X3DInterpolatorNode:case d.X3DKeyDeviceSensorNode:case d.X3DLayoutNode:case d.X3DScriptNode:case d.X3DSequencerNode:case d.X3DSoundNode:case d.X3DTriggerNode:break;default:continue}break}}this.set_displayNodes__(),this.set_displays_(),this.set_bboxDisplays__()},set_cameraObjects__(){const e=this.cameraObjects;e.length=0;for(const t of this.maybeCameraObjects)t.isCameraObject()&&(ql(d.X3DBoundedObject,t)?t._display.getValue()&&e.push(t):e.push(t));this.setCameraObject(!!e.length)},set_pickableObjects__(){const e=this.pickableSensorNodes,t=this.pickableObjects;e.length=0,t.length=0;for(const t of this.maybePickableSensorNodes)t.isPickableObject()&&e.push(t);for(const e of this.visibleNodes)e.isPickableObject()&&t.push(e);this.set_transformSensors__()},set_transformSensors__(){this.setPickableObject(!!(this.getTransformSensors().size||this.pickableSensorNodes.length||this.pickableObjects.length))},set_displayNodes__(){const e=this.displayNodes;e.length=0;for(const t of this.clipPlaneNodes)e.push(t);for(const t of this.localFogNodes)e.push(t);for(const t of this.lightNodes)e.push(t);for(const t of this.textureProjectorNodes)e.push(t)},set_displays_(){const e=this.visibleNodes;e.length=0;for(const t of this.childNodes)ql(d.X3DBoundedObject,t)?t._display.getValue()&&e.push(t):e.push(t);this.set_cameraObjects__(),this.set_pickableObjects__()},set_bboxDisplays__(){const e=this.boundedObjects;e.length=0;for(const t of this.childNodes)ql(d.X3DBoundedObject,t)&&t._bboxDisplay.getValue()&&e.push(t)},traverse(e,t){switch(e){case Ia.POINTER:{const i=this.pointingDeviceSensorNodes,n=this.clipPlaneNodes,s=this.sensors;if(s.length=0,i.length){for(const e of i)e.push(t,s);s.length&&t.getSensors().push(s)}for(const e of n)e.push(t);for(const i of this.visibleNodes)i.traverse(e,t);for(const e of n)e.pop(t);return void(s.length&&t.getSensors().pop())}case Ia.CAMERA:for(const i of this.cameraObjects)i.traverse(e,t);return;case Ia.PICKING:{if(this.getTransformSensors().size){const e=t.getModelViewMatrix().get();for(const t of this.getTransformSensors())t.collect(e)}for(const i of this.pickableSensorNodes)i.traverse(e,t);const i=this.getBrowser(),n=i.getPickingHierarchy();if(n.push(this),i.getPickable().at(-1))for(const i of this.visibleNodes)i.traverse(e,t);else for(const i of this.pickableObjects)i.traverse(e,t);return void n.pop()}case Ia.COLLISION:{const i=this.clipPlaneNodes;for(const e of i)e.push(t);for(const i of this.visibleNodes)i.traverse(e,t);for(const e of i)e.pop(t);return}case Ia.SHADOW:{const i=this.clipPlaneNodes;for(const e of i)e.push(t);for(const i of this.visibleNodes)i.traverse(e,t);for(const e of i)e.push(t);return}case Ia.DISPLAY:{const i=this.displayNodes;for(const e of i)e.push(t,this);for(const i of this.visibleNodes)i.traverse(e,t);for(const i of this.boundedObjects)i.displayBBox(e,t);for(const e of i)e.pop(t);return}}},dispose(){ju.prototype.dispose.call(this),Hs.prototype.dispose.call(this)}}),Object.defineProperties(zu,{typeName:{value:"X3DGroupingNode",enumerable:!0},componentName:{value:"Grouping",enumerable:!0}});const Hu=zu;i.add("X3DGroupingNode","x_ite/Components/Grouping/X3DGroupingNode",Hu);const qu=Hu;function Yu(e){qu.call(this,e),this.addType(d.Group)}Object.setPrototypeOf(Yu.prototype,qu.prototype),Object.defineProperties(Yu,{typeName:{value:"Group",enumerable:!0},componentName:{value:"Grouping",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Wu=Yu;i.add("Group","x_ite/Components/Grouping/Group",Wu);const $u=Wu;function Ju(e){uu.call(this,e,new Uu(e),new $u(e)),this.addType(d.Layer)}Object.assign(Object.setPrototypeOf(Ju.prototype,uu.prototype),{initialize(){uu.prototype.initialize.call(this),this._addChildren.addFieldInterest(this.getGroup()._addChildren),this._removeChildren.addFieldInterest(this.getGroup()._removeChildren),this._children.addFieldInterest(this.getGroup()._children),this.getGroup()._children=this._children,this.getGroup().setPrivate(!0),this.getGroup().setup()}}),Object.defineProperties(Ju,{typeName:{value:"Layer",enumerable:!0},componentName:{value:"Layering",enumerable:!0},containerField:{value:"layers",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"pickable",new Yn.SFBool(!0)),new X(d.inputOutput,"objectType",new Yn.MFString("ALL")),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"viewport",new Yn.SFNode),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Ku=Ju;i.add("Layer","x_ite/Components/Layering/Layer",Ku);const Zu=Ku;function Qu(e){bs.call(this,e),this.addType(d.LayerSet),this.layerNodes=[new Zu(e)],this.layerNode0=this.layerNodes[0],this.activeLayerNode=null}Object.assign(Object.setPrototypeOf(Qu.prototype,bs.prototype),{initialize(){bs.prototype.initialize.call(this),this.layerNode0.setPrivate(!0),this.layerNode0.setup(),this.layerNode0.setLayer0(!0),this._activeLayer.addInterest("set_activeLayer__",this),this._order.addInterest("set_layers__",this),this._layers.addInterest("set_layers__",this),this.set_layers__()},getActiveLayer(){return this.activeLayerNode},setLayer0(e){this.layerNode0=e,this.set_layers__()},getLayer0(){return this.layerNode0},getLayers(){return this.layerNodes},set_activeLayer__(){if(0===this._activeLayer.getValue())this.activeLayerNode!==this.layerNode0&&(this.activeLayerNode=this.layerNode0);else{const e=this._activeLayer-1;e>=0&&e<this._layers.length?this.activeLayerNode!==this._layers[e].getValue()&&(this.activeLayerNode=ql(d.X3DLayerNode,this._layers[e])):null!==this.activeLayerNode&&(this.activeLayerNode=null)}},set_layers__(){const e=this._layers.getValue();this.layerNodes.length=0;for(let t of this._order)if(0===t)this.layerNodes.push(this.layerNode0);else if(--t,t>=0&&t<e.length){const i=ql(d.X3DLayerNode,e[t]);i&&this.layerNodes.push(i)}this.set_activeLayer__()},bindBindables(e){const t=this._layers.getValue();this.layerNode0.bindBindables(e);for(let i=0,n=t.length;i<n;++i){const n=ql(d.X3DLayerNode,t[i]);n&&n.bindBindables(e)}},traverse(e,t){for(const i of this.layerNodes)i.traverse(e,t)}}),Object.defineProperties(Qu,{typeName:{value:"LayerSet",enumerable:!0},componentName:{value:"Layering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"activeLayer",new Yn.SFInt32),new X(d.inputOutput,"order",new Yn.MFInt32(0)),new X(d.inputOutput,"layers",new Yn.MFNode)]),enumerable:!0}});const eh=Qu;i.add("LayerSet","x_ite/Components/Layering/LayerSet",eh);const th=eh;function ih(e){ds.call(this,e),this.addType(d.X3DWorld),this.addChildObjects(d.outputOnly,"activeLayer",new Oi(this.layer0)),this.defaultLayerSet=new th(e),this.layerSet=this.defaultLayerSet,this.layer0=new Zu(e)}Object.assign(Object.setPrototypeOf(ih.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this),this.layerSet.setPrivate(!0),this.layerSet.setup(),this.layerSet.setLayer0(this.layer0),this.layerSet._activeLayer.addInterest("set_rootNodes__",this),this.getExecutionContext().getRootNodes().addInterest("set_rootNodes__",this),this.set_rootNodes__(),this.layer0.setPrivate(!0),this.layer0.setLayer0(!0),this.layer0.setup(),this.set_activeLayer__()},getCache(){return this.getBrowser().getBrowserOption("Cache")},getLayerSet(){return this.layerSet},getActiveLayer(){return this._activeLayer.getValue()},set_rootNodes__(){const e=this.layerSet,t=this.getExecutionContext().getRootNodes();this.layerSet=this.defaultLayerSet,this.layer0._children=t;for(const e of t){const t=ql(d.LayerSet,e);t&&(this.layerSet=t)}this.layerSet!==e&&(this.layerSet.setLayer0(this.layer0),e._activeLayer.removeInterest("set_activeLayer__",this),this.layerSet._activeLayer.addInterest("set_activeLayer__",this),this.set_activeLayer__())},set_activeLayer__(){this._activeLayer=this.layerSet.getActiveLayer()},bindBindables(){const e=this.getExecutionContext().getWorldURL();this.layerSet.bindBindables(decodeURIComponent(new URL(e).hash.substring(1)))},traverse(e,t){this.layerSet.traverse(e,t)}});for(const e of Object.keys(ih.prototype))Object.defineProperty(ih.prototype,e,{enumerable:!1});Object.defineProperties(ih,{typeName:{value:"X3DWorld",enumerable:!0}}),d.addNode(ih);const nh=ih;i.add("X3DWorld","x_ite/Execution/X3DWorld",nh);const sh=nh;var rh=n(464);const oh=new Set(["text/html","application/xhtml+xml"]);function ah(e){C.call(this),this.node=e,this.browser=e.getBrowser(),this.external=this.browser.isExternal(),this.executionContext=this.external?e.getExecutionContext():this.browser.currentScene,this.target="",this.url=[],this.URL=new URL(this.getBaseURL()),this.controller=new AbortController}Object.assign(Object.setPrototypeOf(ah.prototype,C.prototype),{abort(){this.url.length=0,this.controller.abort()},getURL(){return this.URL},getBaseURL(){return this.node instanceof sh&&this.external?this.browser.getBaseURL():this.executionContext.getBaseURL()},getTarget(e){for(const t of e){const e=t.split("=");if(2===e.length&&"target"===e[0])return e[1]}return""},createX3DFromString(e,t="",i,n){try{const s=this.browser.createScene();return this.node instanceof sh?s.loader=this:s.setExecutionContext(this.executionContext),s.setWorldURL(new URL(e,this.getBaseURL()).href),i&&(i=this.setScene.bind(this,s,i,n)),new sa(s).parseIntoScene(t,i,n),s}catch(e){if(!n)throw e;n(e)}},setScene(e,t,i){e._initLoadCount.addInterest("set_initLoadCount__",this,e,t,i),e._initLoadCount.addEvent()},set_initLoadCount__(e,t,i,n){n.getValue()||(e._initLoadCount.removeInterest("set_initLoadCount__",this),delete e.loader,setTimeout((()=>{try{t(e)}catch(e){if(!i)throw e;i(e)}})))},createX3DFromURL(e,t,i,n,s){return this.bindViewpoint=n,this.foreign=s,this.target=this.getTarget(t||new Yn.MFString),this.loadDocument(e,this.createX3DFromURLAsync.bind(this,i))},createX3DFromURLAsync(e,t){null===t?e(null):this.createX3DFromString(this.URL,t,e,this.loadDocumentError.bind(this))},loadDocument(e,t){if(this.url=e.copy(),this.callback=t,0===e.length)return this.loadDocumentError(new Error("No URL given."));this.loadDocumentAsync(this.url.shift()).catch(this.loadDocumentError.bind(this))},loadDocumentAsync:async function(e){if(0===e.length)return void this.loadDocumentError(new Error("URL is empty."));{const t=e.match(/^\s*(?:vrmlscript|javascript|ecmascript)\:(.*)$/s);if(t)return void this.callback(t[1])}this.URL=new URL(e,this.getBaseURL());{const t=e.match(/^data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/s);if(t&&"base64"!==t[3]){let i=e.substring(t[0].length);return i=unescape(i),i=i.replace(/^/,""),void this.callback(i)}}if("data:"!==this.URL.protocol&&this.bindViewpoint){const e=new URL(this.getBaseURL());if(this.URL.protocol===e.protocol&&this.URL.hostname===e.hostname&&this.URL.port===e.port&&this.URL.pathname===e.pathname&&this.URL.hash)return void this.bindViewpoint(decodeURIComponent(this.URL.hash.substr(1)))}if(this.foreign){if(this.target.length&&"_self"!==this.target)return this.foreign(this.URL.href,this.target);if("data:"!==this.URL.protocol&&this.URL.href.match(/\.(?:html|htm|xhtml)$/))return this.foreign(this.URL.href,this.target)}const t={cache:this.node.getCache()?"default":"reload",signal:this.controller.signal},i=this.checkResponse(await fetch(this.URL,t)),n=i.headers.get("content-type")?.replace(/;.*$/,"");if(this.foreign&&oh.has(n))return this.foreign(this.URL.href,this.target);this.callback(rh.ungzip(await i.arrayBuffer()),this.URL)},checkResponse(e){if(e.ok)return e;throw Error(e.statusText||e.status)},loadDocumentError(e){this.printError(e),this.url.length?this.loadDocumentAsync(this.url.shift()).catch(this.loadDocumentError.bind(this)):this.callback(null)},printError(e){"data:"===this.URL.protocol?console.error("Couldn't load data URL.",e):console.error(`Couldn't load URL '${decodeURI(this.URL.href)}'.`,e)}});for(const e of Object.keys(ah.prototype))Object.defineProperty(ah.prototype,e,{enumerable:!1});const lh=ah;i.add("FileLoader","x_ite/InputOutput/FileLoader",lh);const uh=lh,hh=Symbol(),dh=Symbol();function ch(e,t){Or.call(this,e),Sr.call(this,e),this.addType(d.X3DExternProtoDeclaration),this.addChildObjects(d.inputOutput,"load",new Yn.SFBool(!0),d.inputOutput,"url",t.copy(),d.inputOutput,"autoRefresh",new Yn.SFTime,d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600))}Object.assign(Object.setPrototypeOf(ch.prototype,Or.prototype),Sr.prototype,{initialize(){Or.prototype.initialize.call(this),Sr.prototype.initialize.call(this)},set_live__(){Sr.prototype.set_live__.call(this),this.checkLoadState()===d.COMPLETE_STATE&&this[dh].setLive(this.getLive().getValue())},canUserDefinedFields:()=>!0,setProtoDeclaration(e){if(this[hh]=e,e){for(const e of[...this.getUserDefinedFields()])this.removeUserDefinedField(e.getName());for(const t of e.getUserDefinedFields())this.addUserDefinedField(t.getAccessType(),t.getName(),t)}this.updateInstances()},getProtoDeclaration(){return this[hh]},loadData(){this.getScene().addInitLoadCount(this),new uh(this).createX3DFromURL(this._url,null,this.setInternalSceneAsync.bind(this))},setInternalSceneAsync(e){e?this.setInternalScene(e):this.setError(new Error("File could not be loaded.")),this.getScene().removeInitLoadCount(this)},setInternalScene(e){this[dh]=e;const t=decodeURIComponent(new URL(this[dh].getWorldURL()).hash.substring(1)),i=t?this[dh].protos.get(t):this[dh].protos[0];if(!i)throw new Error("PROTO not found");this[dh].setLive(this.getLive().getValue()),this[dh].setExecutionContext(this.getExecutionContext()),this.setLoadState(d.COMPLETE_STATE),this.setProtoDeclaration(i)},getInternalScene(){return this[dh]},setError(e){console.error(`Error loading extern prototype '${this.getName()}':`,e),this[dh]=this.getBrowser().getPrivateScene(),this.setLoadState(d.FAILED_STATE),this.setProtoDeclaration(null)},toVRMLStream(e){e.string+=e.Indent(),e.string+="EXTERNPROTO",e.string+=e.Space(),e.string+=this.getName(),e.string+=e.TidySpace(),e.string+="[";const t=this.getUserDefinedFields();if(0===t.length)e.string+=e.TidySpace();else{let i=0,n=0;for(const s of t)i=Math.max(i,s.getTypeName().length),n=Math.max(n,e.AccessType(s.getAccessType()).length);e.string+=e.TidyBreak(),e.IncIndent();for(const s of t)this.toVRMLStreamUserDefinedField(e,s,i,n),e.string+=e.Break();e.DecIndent(),e.string+=e.Indent()}e.string+="]",e.string+=e.TidyBreak(),e.string+=e.Indent(),this._url.toVRMLStream(e)},toVRMLStreamUserDefinedField(e,t,i,n){e.string+=e.Indent(),e.string+=e.AccessType(t.getAccessType()).padEnd(n," "),e.string+=e.Space(),e.string+=t.getTypeName().padEnd(i," "),e.string+=e.Space(),e.string+=t.getName()},toXMLStream(e){e.string+=e.Indent(),e.string+="<ExternProtoDeclare",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(this.getName()),e.string+="'",e.string+=e.Space(),e.string+="url='",this._url.toXMLStream(e),e.string+="'",e.string+=">",e.string+=e.TidyBreak(),e.IncIndent();const t=this.getUserDefinedFields();for(const i of t)e.string+=e.Indent(),e.string+="<field",e.string+=e.Space(),e.string+="accessType='",e.string+=e.AccessType(i.getAccessType()),e.string+="'",e.string+=e.Space(),e.string+="type='",e.string+=i.getTypeName(),e.string+="'",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(i.getName()),e.string+="'",e.string+=e.closingTags?"></field>":"/>",e.string+=e.TidyBreak();e.DecIndent(),e.string+=e.Indent(),e.string+="</ExternProtoDeclare>"},toJSONStream(e){e.string+=e.Indent(),e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="ExternProtoDeclare",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+='"',e.string+=e.JSONEncode(this.getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak();const t=this.getUserDefinedFields();if(t.length){e.string+=e.Indent(),e.string+='"',e.string+="field",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();for(const i of t)e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@accessType",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.AccessType(i.getAccessType()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@type",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=i.getTypeName(),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i.getName()),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",i!==t.at(-1)&&(e.string+=","),e.string+=e.TidyBreak();e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=",",e.string+=e.TidyBreak()}e.string+=e.Indent(),e.string+='"',e.string+="@url",e.string+='"',e.string+=":",e.string+=e.TidySpace(),this._url.toJSONStream(e),e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}});for(const e of Object.keys(ch.prototype))Object.defineProperty(ch.prototype,e,{enumerable:!1});Object.defineProperties(ch.prototype,{name:{get:ch.prototype.getName,enumerable:!0},fields:{get:ch.prototype.getFieldDefinitions,enumerable:!0},isExternProto:{value:!0,enumerable:!0},urls:{get(){return this._url},enumerable:!0},loadState:{get:ch.prototype.checkLoadState,enumerable:!0}}),Object.defineProperties(ch,{typeName:{value:"X3DExternProtoDeclaration",enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode)]),enumerable:!0}}),d.addNode(ch);const ph=ch;i.add("X3DExternProtoDeclaration","x_ite/Prototype/X3DExternProtoDeclaration",ph);const gh=ph;function fh(e=[]){return Y.call(this,Array.from(e,(e=>[e.name,e])),gh)}Object.setPrototypeOf(fh.prototype,Y.prototype);for(const e of Object.keys(fh.prototype))Object.defineProperty(fh.prototype,e,{enumerable:!1});Object.defineProperties(fh,{typeName:{value:"ExternProtoDeclarationArray",enumerable:!0}});const mh=fh;i.add("ExternProtoDeclarationArray","x_ite/Prototype/ExternProtoDeclarationArray",mh);const _h=mh;function xh(e=[]){return Y.call(this,Array.from(e,(e=>[e.name,e])),Lr)}Object.setPrototypeOf(xh.prototype,Y.prototype);for(const e of Object.keys(xh.prototype))Object.defineProperty(xh.prototype,e,{enumerable:!1});Object.defineProperties(xh,{typeName:{value:"ProtoDeclarationArray",enumerable:!0}});const yh=xh;i.add("ProtoDeclarationArray","x_ite/Prototype/ProtoDeclarationArray",yh);const wh=yh,bh=Symbol(),Sh=Symbol(),Th=Symbol(),vh=Symbol(),Oh=Symbol();function Eh(e,t,i,n,s){C.call(this,e),this[bh]=e,this[Sh]=t,this[Th]=i,this[vh]=n,this[Oh]=s,i.addFieldInterest(s),i.addOutputRoute(this),s.addInputRoute(this)}Object.assign(Object.setPrototypeOf(Eh.prototype,C.prototype),{getExecutionContext(){return this[bh]},getRouteId(){return Eh.getRouteId(this[Th],this[Oh])},getSourceNode(){return this[Sh]},getSourceField(){return this[Th]},getDestinationNode(){return this[vh]},getDestinationField(){return this[Oh]},disconnect(){this[Th].removeFieldInterest(this[Oh]),this[Th].removeOutputRoute(this),this[Oh].removeInputRoute(this)},toVRMLStream(e){const t=e.LocalName(this[Sh]),i=e.LocalName(this[vh]);e.string+=e.Indent(),e.string+="ROUTE",e.string+=e.Space(),e.string+=t,e.string+=".",e.string+=this[Th].getName(),this[Th].getAccessType()===d.inputOutput&&(e.string+="_changed"),e.string+=e.Space(),e.string+="TO",e.string+=e.Space(),e.string+=i,e.string+=".",this[Oh].getAccessType()===d.inputOutput&&(e.string+="set_"),e.string+=this[Oh].getName()},toXMLStream(e){const t=e.LocalName(this[Sh]),i=e.LocalName(this[vh]);e.string+=e.Indent(),e.string+="<ROUTE",e.string+=e.Space(),e.string+="fromNode='",e.string+=e.XMLEncode(t),e.string+="'",e.string+=e.Space(),e.string+="fromField='",e.string+=e.XMLEncode(this[Th].getName()),this[Th].getAccessType()===d.inputOutput&&(e.string+="_changed"),e.string+="'",e.string+=e.Space(),e.string+="toNode='",e.string+=e.XMLEncode(i),e.string+="'",e.string+=e.Space(),e.string+="toField='",this[Oh].getAccessType()===d.inputOutput&&(e.string+="set_"),e.string+=e.XMLEncode(this[Oh].getName()),e.string+="'",e.string+=e.closingTags?"></ROUTE>":"/>"},toJSONStream(e){const t=e.LocalName(this[Sh]),i=e.LocalName(this[vh]);e.string+=e.Indent(),e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="ROUTE",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@fromNode",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@fromField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this[Th].getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@toNode",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@toField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this[Oh].getName()),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"},dispose(){this.disconnect(),this[bh].deleteRoute(this),C.prototype.dispose.call(this)}});for(const e of Object.keys(Eh.prototype))Object.defineProperty(Eh.prototype,e,{enumerable:!1});Object.defineProperties(Eh.prototype,{sourceNode:{get(){return yi.get(this[Sh])},enumerable:!0},sourceField:{get(){return this[Th].getName()},enumerable:!0},destinationNode:{get(){return yi.get(this[vh])},enumerable:!0},destinationField:{get(){return this[Oh].getName()},enumerable:!0}}),Object.defineProperties(Eh,{typeName:{value:"X3DRoute",enumerable:!0}}),Object.assign(Eh,{getRouteId:(e,t)=>`${e.getId()}.${t.getId()}`});const Nh=Eh;i.add("X3DRoute","x_ite/Routing/X3DRoute",Nh);const Ch=Nh;function Fh(e=[]){return Y.call(this,Array.from(e,(e=>[e.getId(),e])),Ch)}Object.setPrototypeOf(Fh.prototype,Y.prototype);for(const e of Object.keys(Fh.prototype))Object.defineProperty(Fh.prototype,e,{enumerable:!1});Object.defineProperties(Fh,{typeName:{value:"RouteArray",enumerable:!0}});const Ih=Fh;i.add("RouteArray","x_ite/Routing/RouteArray",Ih);const Mh=Ih,Dh=Symbol(),Ph=Symbol(),Rh=Symbol(),Ah=Symbol(),Vh=Symbol(),Lh=Symbol();function Bh(e,t=null,i=e.getBrowser()){ds.call(this,e,i),this.addType(d.X3DExecutionContext),this.addChildObjects(d.initializeOnly,"rootNodes",new Yn.MFNode,d.outputOnly,"worldInfos",new Yn.MFNode,d.outputOnly,"sceneGraph_changed",new Yn.SFTime),this._rootNodes.collectCloneCount=()=>1,this[Lh]=t,this[Dh]=new rr,this[Ph]=new fr,this[Rh]=new wh,this[Ah]=new _h,this[Vh]=new Mh,this[Dh].addParent(this),this[Ph].addParent(this),this[Rh].addParent(this),this[Ah].addParent(this),this[Vh].addParent(this)}Object.assign(Object.setPrototypeOf(Bh.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this),this.isScene()||this._sceneGraph_changed.addInterest("set_sceneGraph",this)},set_sceneGraph(){this.getExecutionContext()._sceneGraph_changed=this.getBrowser().getCurrentTime()},isScene:()=>!1,getOuterNode(){return this[Lh]},getSpecificationVersion(){return this.getExecutionContext().getSpecificationVersion()},getEncoding(){return this.getExecutionContext().getEncoding()},getWorldURL(){return this.getExecutionContext().getWorldURL()},getBaseURL(){return this.getExecutionContext().getBaseURL()},getProfile(){return this.getExecutionContext().getProfile()},hasComponent(e,t){return this.getExecutionContext().hasComponent(e,t)},getComponents(){return this.getExecutionContext().getComponents()},fromUnit(e,t){return this.getExecutionContext().fromUnit(e,t)},toUnit(e,t){return this.getExecutionContext().toUnit(e,t)},getUnits(){return this.getExecutionContext().getUnits()},createNode(e,t=!0){if(e=String(e),!1===t){const t=this.getBrowser().getConcreteNodes().get(e);if(!t)return null;const i=t.specificationRange;return this.getSpecificationVersion()<i[0]||this.getSpecificationVersion()>i[1]?null:(this.hasComponent(t.componentName)||console.warn(`Node type '${e}' does not match component/profile statements in '${this.getWorldURL()}'.`),new t(this))}{const t=this.getBrowser().getConcreteNodes().get(e);if(!t)throw new Error(`Unknown node type '${e}'.`);const i=t.specificationRange;if(this.getSpecificationVersion()<i[0])throw new Error(`Node type '${e}' does not match specification version in '${this.getWorldURL()}.`);if(this.getSpecificationVersion()>i[1])throw new Error(`Node type '${e}' does not match specification version in '${this.getWorldURL()}.`);this.hasComponent(t.componentName)||console.warn(`Node type '${e}' does not match component/profile statements in '${this.getWorldURL()}'.`);const n=new t(this);return n.setup(),yi.get(n)}},createProto(e,t=!0){e=String(e);for(let i=this;;){const n=i.protos.get(e)??i.externprotos.get(e);if(n)return n.createInstance(this,t);if(i.isScene())break;i=i.getExecutionContext()}if(!1===t)return null;throw new Error(`Unknown proto or externproto type '${e}'.`)},addNamedNode(e,t){if(e=String(e),!(t=ql(d.X3DNode,t,!1)))throw new Error("Couldn't add named node: node must be of type X3DNode.");if(t.getExecutionContext()!==this)throw new Error("Couldn't add named node: node does not belong to this execution context.");if(0===e.length)throw new Error("Couldn't add named node: node name is empty.");if(this[Dh].has(e))throw new Error(`Couldn't add named node: node named '${e}' is already in use.`);if(this[Dh].get(t.getName())?.getValue()===t)throw new Error(`Couldn't add named node: node named '${t.getName()}' is already added.`);t.setName(e),this[Dh].add(e,yi.get(t))},updateNamedNode(e,t){if(e=String(e),!(t=ql(d.X3DNode,t,!1)))throw new Error("Couldn't update named node: node must be of type X3DNode.");if(t.getExecutionContext()!==this)throw new Error("Couldn't update named node: node does not belong to this execution context.");if(0===e.length)throw new Error("Couldn't update named node: node name is empty.");this.removeNamedNode(t.getName()),this.removeNamedNode(e),t.setName(e),this[Dh].add(e,yi.get(t)),this._namedNodes_changed=this.getBrowser().getCurrentTime()},removeNamedNode(e){e=String(e);const t=this[Dh].get(e);t&&t.getValue()&&(t.getValue().setName(""),this[Dh].remove(e),this._namedNodes_changed=this.getBrowser().getCurrentTime())},getNamedNode(e){e=String(e);const t=this[Dh].get(e);if(t)return t;throw new Error(`Named node '${e}' not found.`)},getNamedNodes(){return this[Dh]},getUniqueName(e){return ir(this[Dh],e)},addImportedNode(e,t,i=t){if(t=String(t),i=String(i),this[Ph].has(i))throw new Error(`Couldn't add imported node: imported name '${i}' already in use.`);this.updateImportedNode(e,t,i)},updateImportedNode(e,t,i){if(e=ql(d.Inline,e,!1),t=String(t),i=void 0===i?t:String(i),!e)throw new Error("Node must be of type Inline node.");if(e.getExecutionContext()!==this)throw new Error("Couldn't update imported node: Inline node does not belong to this execution context.");if(0===t.length)throw new Error("Couldn't update imported node: exported name is empty.");if(0===i.length)throw new Error("Couldn't update imported node: imported name is empty.");this.removeImportedNode(i);const n=new cr(this,e,t,i);this[Ph].add(i,n),this._importedNodes_changed=this.getBrowser().getCurrentTime()},removeImportedNode(e){e=String(e);const t=this[Ph].get(e);t&&(t.dispose(),this[Ph].remove(e),this._importedNodes_changed=this.getBrowser().getCurrentTime())},getImportedNode(e){e=String(e);const t=this[Ph].get(e);if(t)return yi.get(t.getExportedNode());throw new Error(`Imported node '${e}' not found.`)},getImportedNodes(){return this[Ph]},getLocalNode(e){e=String(e);try{return this.getNamedNode(e)}catch{const t=this[Ph].get(e);if(t)return yi.get(t);throw new Error(`Unknown named or imported node '${e}'.`)}},getLocalName(e){if(!(e=ql(d.X3DNode,e,!1)))throw new Error("Couldn't get local name: node must be of type X3DNode.");if(e.getExecutionContext()===this)return e.getName();for(const t of this[Ph])try{if(t.getExportedNode()===e)return t.getImportedName()}catch{}throw new Error("Couldn't get local name: node is shared.")},setRootNodes(){},getRootNodes(){return this._rootNodes},getProtoDeclaration(e){e=String(e);const t=this[Rh].get(e);if(t)return t;throw new Error(`Proto declaration '${e}' not found.`)},addProtoDeclaration(e,t){if(e=String(e),!(t instanceof Lr))throw new Error("Couldn't add proto declaration: proto must be of type X3DProtoDeclaration.");if(t.getExecutionContext()!==this)throw new Error("Couldn't add proto declaration: proto does not belong to this execution context.");if(this[Rh].get(e))throw new Error(`Couldn't add proto declaration: proto '${e}' already in use.`);if(this[Rh].get(t.getName())===t)throw new Error(`Couldn't add proto declaration: proto '${t.getName()}' already added.`);if(0===(e=String(e)).length)throw new Error("Couldn't add proto declaration: proto name is empty.");this[Rh].add(e,t),t.setName(e),this._protos_changed=this.getBrowser().getCurrentTime()},updateProtoDeclaration(e,t){if(e=String(e),!(t instanceof Lr))throw new Error("Couldn't update proto declaration: proto must be of type X3DProtoDeclaration.");if(t.getExecutionContext()!==this)throw new Error("Couldn't update proto declaration: proto does not belong to this execution context.");if(0===(e=String(e)).length)throw new Error("Couldn't update proto declaration: proto name is empty.");this[Rh].update(t.getName(),e,t),t.setName(e),this._protos_changed=this.getBrowser().getCurrentTime()},removeProtoDeclaration(e){e=String(e),this[Rh].remove(e),this._protos_changed=this.getBrowser().getCurrentTime()},getProtoDeclarations(){return this[Rh]},getUniqueProtoName(e){return ir(this[Rh],e)},getExternProtoDeclaration(e){e=String(e);const t=this[Ah].get(e);if(t)return t;throw new Error(`Extern proto declaration '${e}' not found.`)},addExternProtoDeclaration(e,t){if(e=String(e),!(t instanceof gh))throw new Error("Couldn't add extern proto declaration: extern proto must be of type X3DExternProtoDeclaration.");if(t.getExecutionContext()!==this)throw new Error("Couldn't add extern proto declaration: extern proto does not belong to this execution context.");if(this[Ah].get(e))throw new Error(`Couldn't add extern proto declaration: extern proto '${e}' already in use.`);if(this[Ah].get(t.getName())===t)throw new Error(`Couldn't add extern proto declaration: extern proto '${t.getName()}' already added.`);if(0===(e=String(e)).length)throw new Error("Couldn't add extern proto declaration: extern proto name is empty.");this[Ah].add(e,t),t.setName(e),this._externprotos_changed=this.getBrowser().getCurrentTime()},updateExternProtoDeclaration(e,t){if(e=String(e),!(t instanceof gh))throw new Error("Couldn't update extern proto declaration: extern proto must be of type X3DExternProtoDeclaration.");if(t.getExecutionContext()!==this)throw new Error("Couldn't update extern proto declaration: extern proto does not belong to this execution context.");if(0===(e=String(e)).length)throw new Error("Couldn't update extern proto declaration: extern proto name is empty.");this[Ah].update(t.getName(),e,t),t.setName(e),this._externprotos_changed=this.getBrowser().getCurrentTime()},removeExternProtoDeclaration(e){e=String(e),this[Ah].remove(e),this._externprotos_changed=this.getBrowser().getCurrentTime()},getExternProtoDeclarations(){return this[Ah]},getUniqueExternProtoName(e){return ir(this[Ah],e)},addRoute(e,t,i,n){if(e=ql(d.X3DNode,e,!1),t=String(t),i=ql(d.X3DNode,i,!1),n=String(n),!e)throw new Error("Bad ROUTE specification: source node must be of type X3DNode.");if(!i)throw new Error("Bad ROUTE specification: destination node must be of type X3DNode.");let s=e instanceof cr?e:null,r=i instanceof cr?i:null;try{e.getExecutionContext()!==this&&(s=this.getLocalNode(this.getLocalName(e)).getValue())}catch{}try{i.getExecutionContext()!==this&&(r=this.getLocalNode(this.getLocalName(i)).getValue())}catch{}if(s instanceof cr&&r instanceof cr?(s.addRoute(s,t,r,n),r.addRoute(s,t,r,n)):s instanceof cr?s.addRoute(s,t,i,n):r instanceof cr&&r.addRoute(e,t,r,n),s!==e&&r!==i)return this.addSimpleRoute(e,t,i,n)},addSimpleRoute(e,t,i,n){try{if(t=e.getField(t),n=i.getField(n),!t.isOutput())throw new Error(`Field named '${t.getName()}' in node named '${e.getName()}' of type ${e.getTypeName()} is not an output field.`);if(!n.isInput())throw new Error(`Field named '${n.getName()}' in node named '${i.getName()}' of type ${i.getTypeName()} is not an input field.`);if(t.getType()!==n.getType())throw new Error(`ROUTE types ${t.getTypeName()} and ${n.getTypeName()} do not match.`);const s=Ch.getRouteId(t,n);let r=this[Vh].get(s);return r||(r=new Ch(this,e,t,i,n),this[Vh].add(s,r),this._routes_changed=this.getBrowser().getCurrentTime(),r)}catch(e){throw new Error(`Bad ROUTE specification: ${e.message}`)}},deleteRoute(e){4===arguments.length&&(e=this.getRoute(...arguments)),e instanceof Ch&&e.getExecutionContext()===this&&(this.deleteSimpleRoute(e),this.deleteImportedRoute(e.sourceNode,e.destinationNode,e))},deleteSimpleRoute(e){this[Vh].remove(e.getRouteId()),e.disconnect(),this._routes_changed=this.getBrowser().getCurrentTime()},deleteImportedRoute(e,t,i){let n=null,s=null;try{e.getValue().getExecutionContext()!==this&&(n=this.getLocalNode(this.getLocalName(e)).getValue())}catch{}try{t.getValue().getExecutionContext()!==this&&(s=this.getLocalNode(this.getLocalName(t)).getValue())}catch{}n instanceof cr&&s instanceof cr?(n.deleteRoute(i),s.deleteRoute(i)):n instanceof cr?n.deleteRoute(i):s instanceof cr&&s.deleteRoute(i)},getRoute(e,t,i,n){if(e=ql(d.X3DNode,e,!1),t=String(t),i=ql(d.X3DNode,i,!1),n=String(n),!e)throw new Error("Bad ROUTE specification: sourceNode must be of type X3DNode.");if(!i)throw new Error("Bad ROUTE specification: destinationNode must be of type X3DNode.");return t=e.getField(t),n=i.getField(n),this[Vh].get(Ch.getRouteId(t,n))},getRoutes(){return this[Vh]},getWorldInfos(){return this._worldInfos},addWorldInfo(e){this._worldInfos.push(e)},removeWorldInfo(e){for(let t=this._worldInfos.length-1;t>=0;--t)this._worldInfos[t].getValue()===e&&this._worldInfos.splice(t,1)},toVRMLStream(e){e.PushExecutionContext(this),e.EnterScope(),e.NamedNodes(this.getNamedNodes()),e.ImportedNodes(this.getImportedNodes()),this.getExternProtoDeclarations().toVRMLStream(e),this.getProtoDeclarations().toVRMLStream(e);const t=this.getRootNodes();for(let i=0,n=t.length;i<n;++i){const s=t[i];e.string+=e.Indent(),s?s.toVRMLStream(e):e.string+="NULL",e.string+=e.TidyBreak(),i!==n-1&&(e.string+=e.TidyBreak())}const i=this.getImportedNodes();i.length&&(e.string+=e.TidyBreak(),i.toVRMLStream(e));const n=this.getRoutes();n.length&&(e.string+=e.TidyBreak(),n.toVRMLStream(e)),e.LeaveScope(),e.PopExecutionContext()},toXMLStream(e){e.PushExecutionContext(this),e.EnterScope(),e.NamedNodes(this.getNamedNodes()),e.ImportedNodes(this.getImportedNodes()),this.getExternProtoDeclarations().toXMLStream(e),this.getProtoDeclarations().toXMLStream(e);const t=this.getRootNodes();t.length&&(t.toXMLStream(e),e.string+=e.TidyBreak()),this.getImportedNodes().toXMLStream(e),this.getRoutes().toXMLStream(e),e.LeaveScope(),e.PopExecutionContext()},toJSONStream(e){if(e.PushExecutionContext(this),e.EnterScope(),e.NamedNodes(this.getNamedNodes()),e.ImportedNodes(this.getImportedNodes()),this.getExternProtoDeclarations().toJSONStream(e,!0),this.getProtoDeclarations().toJSONStream(e,!0),this.getRootNodes().length)for(const t of this.getRootNodes())e.string+=e.Indent(),t?t.toJSONStream(e):(e.string+=e.Indent(),e.string+="null"),e.string+=",",e.string+=e.TidyBreak();this.getImportedNodes().toJSONStream(e,!0),this.getRoutes().toJSONStream(e,!0),e.LeaveScope(),e.PopExecutionContext()},dispose(){for(const e of[...this[Vh]])this.deleteRoute(e);ds.prototype.dispose.call(this)}});for(const e of Object.keys(Bh.prototype))Object.defineProperty(Bh.prototype,e,{enumerable:!1});Object.defineProperties(Bh.prototype,{specificationVersion:{get:Bh.prototype.getSpecificationVersion,enumerable:!0},encoding:{get:Bh.prototype.getEncoding,enumerable:!0},profile:{get:Bh.prototype.getProfile,enumerable:!0},components:{get:Bh.prototype.getComponents,enumerable:!0},worldURL:{get:Bh.prototype.getWorldURL,enumerable:!0},baseURL:{get:Bh.prototype.getBaseURL,enumerable:!0},units:{get:Bh.prototype.getUnits,enumerable:!0},namedNodes:{get:Bh.prototype.getNamedNodes,enumerable:!0},importedNodes:{get:Bh.prototype.getImportedNodes,enumerable:!0},rootNodes:{get:Bh.prototype.getRootNodes,set:Bh.prototype.setRootNodes,enumerable:!0},protos:{get:Bh.prototype.getProtoDeclarations,enumerable:!0},externprotos:{get:Bh.prototype.getExternProtoDeclarations,enumerable:!0},routes:{get:Bh.prototype.getRoutes,enumerable:!0}}),Object.defineProperties(Bh,{typeName:{value:"X3DExecutionContext",enumerable:!0}}),d.addNode(Bh);const Uh=Bh;i.add("X3DExecutionContext","x_ite/Execution/X3DExecutionContext",Uh);const Xh=Uh,kh=Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions"),jh=Symbol(),zh=Symbol(),Gh=Symbol();function Hh(e,t){this[jh]=t,this[kh]=new J(t.getFieldDefinitions()),this[Gh]=null,bs.call(this,e),this.addType(d.X3DPrototypeInstance)}Object.assign(Object.setPrototypeOf(Hh.prototype,bs.prototype),{create(e){return new Hh(e,this[jh])},getTypeName(){return this[jh].getName()},initialize(){bs.prototype.initialize.call(this),this.setProtoNode(this[jh])},construct(){this[Gh]?.dispose();const e=this[jh],t=e.getProtoDeclaration();if(this[kh].assign(e.getFieldDefinitions()),e.isExternProto){if(e.checkLoadState()!==d.COMPLETE_STATE)return this[Gh]=null,this.isInitialized()&&R.prototype.addEvent.call(this),e._updateInstances.addInterest("construct",this),void e.requestImmediateLoad().catch(Function.prototype);for(const e of t.getUserDefinedFields())try{const t=this.getField(e.getName());if(t.getAccessType()!==e.getAccessType())continue;if(t.getType()!==e.getType())continue;if(!t.isInitializable())continue;if(t.getModificationTime())continue;if(t.hasReferences())continue;if(t.equals(e))continue;t.assign(e)}catch{this.addPredefinedField(t.getFieldDefinitions().get(e.getName()))}}this[Gh]=new Xh(t.getExecutionContext(),this),this.importExternProtos(t.getBody().externprotos),this.importProtos(t.getBody().protos),this.copyRootNodes(t.getBody().rootNodes),this.copyImportedNodes(t.getBody(),t.getBody().getImportedNodes()),this.copyRoutes(t.getBody(),t.getBody().routes),this[Gh].setup(),this.isInitialized()&&R.prototype.addEvent.call(this),e._updateInstances.removeInterest("construct",this),e._updateInstances.addInterest("update",this)},update(){const e=this[zh],t=new Map(Array.from(this.getPredefinedFields(),(e=>[e.getName(),e])));for(const e of t.values())this.removePredefinedField(e.getName());this[zh]=new Map(Array.from(this[jh].getUserDefinedFields(),(e=>[e,e.getName()])));for(const e of this[jh].getFieldDefinitions())this.addPredefinedField(e);for(const i of this[zh].keys()){const n=e.get(i);if(!n)continue;const s=this.getPredefinedFields().get(i.getName()),r=t.get(n);r&&(r.addParent(this),r.setAccessType(s.getAccessType()),r.setName(s.getName()),this.getPredefinedFields().update(s.getName(),s.getName(),r),t.delete(n),s.dispose())}for(const e of t.values())e.dispose();this.construct()},getExtendedEventHandling:()=>!1,getProtoNode(){return this[jh]},setProtoNode(e){const t=this[jh];t._name_changed.removeFieldInterest(this._typeName_changed),t._updateInstances.removeInterest("construct",this),t._updateInstances.removeInterest("update",this),this[jh]=e,this[zh]=new Map(Array.from(e.getUserDefinedFields(),(e=>[e,e.getName()]))),e._name_changed.addFieldInterest(this._typeName_changed),e===t?this.construct():this.update()},getBody(){return this[Gh]},getInnerNode(){if(this[Gh]){const e=this[Gh].getRootNodes();if(e.length){const t=e[0];if(t)return t.getValue().getInnerNode()}}throw new Error("Root node not available.")},importExternProtos(e){const t=this[Gh].externprotos;for(const i of e)t.add(i.getName(),i)},importProtos(e){const t=this[Gh].protos;for(const i of e)t.add(i.getName(),i)},copyRootNodes(e){const t=this[Gh].getRootNodes();for(const i of e)t.push(i.copy(this))},copyImportedNodes(e,t){for(const e of t)try{const t=this[Gh].getNamedNode(e.getInlineNode().getName()),i=e.getImportedName(),n=e.getExportedName();this[Gh].addImportedNode(t,n,i)}catch(e){console.error("Bad IMPORT specification in copy: ",e)}},copyRoutes(e,t){for(const i of t)try{const t=this[Gh].getLocalNode(e.getLocalName(i.sourceNode)),n=this[Gh].getLocalNode(e.getLocalName(i.destinationNode));this[Gh].addRoute(t,i.sourceField,n,i.destinationField)}catch(e){console.error(e)}},toXMLStream(e){const t=e.IsSharedNode(this);e.EnterScope();const i=e.Name(this);if(i.length&&e.ExistsNode(this)){e.string+=e.Indent(),e.string+="<ProtoInstance",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(this.getTypeName()),e.string+="'",e.string+=e.Space(),e.string+="USE='",e.string+=e.XMLEncode(i),e.string+="'";const t=e.ContainerField();return t&&t.getName()!==this.getContainerField()&&(e.string+=e.Space(),e.string+="containerField='",e.string+=e.XMLEncode(t.getName()),e.string+="'"),e.string+=e.closingTags?"></ProtoInstance>":"/>",void e.LeaveScope()}e.string+=e.Indent(),e.string+="<ProtoInstance",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(this.getTypeName()),e.string+="'",i.length&&(e.AddNode(this),e.string+=e.Space(),e.string+="DEF='",e.string+=e.XMLEncode(i),e.string+="'");const n=e.ContainerField();n&&n.getName()!==this.getContainerField()&&(e.string+=e.Space(),e.string+="containerField='",e.string+=e.XMLEncode(n.getName()),e.string+="'");const s=this.getChangedFields();if(0===s.length)e.string+=e.closingTags?"></ProtoInstance>":"/>";else{e.string+=">",e.string+=e.TidyBreak(),e.IncIndent();const i=[];for(const n of s){let s=!1;if(e.ExecutionContext()&&n.getAccessType()===d.inputOutput&&0!==n.getReferences().size&&([...n.getReferences()].some((e=>e.isInitializable()))||(s=!this.isDefaultValue(n))),0===n.getReferences().size||!e.ExecutionContext()||t||s)switch(s&&i.push(n),n.getType()){case d.MFNode:e.string+=e.Indent(),e.string+="<fieldValue",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(n.getName()),e.string+="'",0===n.length?(e.string+=e.closingTags?"></fieldValue>":"/>",e.string+=e.TidyBreak()):(e.PushContainerField(n),e.string+=">",e.string+=e.TidyBreak(),e.IncIndent(),n.toXMLStream(e),e.string+=e.TidyBreak(),e.DecIndent(),e.string+=e.Indent(),e.string+="</fieldValue>",e.string+=e.TidyBreak(),e.PopContainerField());break;case d.SFNode:if(null!==n.getValue()){e.PushContainerField(null),e.string+=e.Indent(),e.string+="<fieldValue",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(n.getName()),e.string+="'",e.string+=">",e.string+=e.TidyBreak(),e.IncIndent(),n.toXMLStream(e),e.string+=e.TidyBreak(),e.DecIndent(),e.string+=e.Indent(),e.string+="</fieldValue>",e.string+=e.TidyBreak(),e.PopContainerField();break}default:e.string+=e.Indent(),e.string+="<fieldValue",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(n.getName()),e.string+="'",e.string+=e.Space(),e.string+="value='",n.toXMLStream(e),e.string+="'",e.string+=e.closingTags?"></fieldValue>":"/>",e.string+=e.TidyBreak()}else i.push(n)}if(i.length&&!t){e.string+=e.Indent(),e.string+="<IS>",e.string+=e.TidyBreak(),e.IncIndent();for(const t of i){const i=t.getReferences();for(const n of i)e.string+=e.Indent(),e.string+="<connect",e.string+=e.Space(),e.string+="nodeField='",e.string+=e.XMLEncode(t.getName()),e.string+="'",e.string+=e.Space(),e.string+="protoField='",e.string+=e.XMLEncode(n.getName()),e.string+="'",e.string+=e.closingTags?"></connect>":"/>",e.string+=e.TidyBreak()}e.DecIndent(),e.string+=e.Indent(),e.string+="</IS>",e.string+=e.TidyBreak()}e.DecIndent(),e.string+=e.Indent(),e.string+="</ProtoInstance>"}e.LeaveScope()},toJSONStream(e){const t=e.IsSharedNode(this);e.EnterScope();const i=e.Name(this);if(i.length&&e.ExistsNode(this))return e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="ProtoInstance",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this.getTypeName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@USE",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",void e.LeaveScope();e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="ProtoInstance",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),i.length&&(e.AddNode(this),e.string+=e.Indent(),e.string+='"',e.string+="@DEF",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i),e.string+='"',e.string+=",",e.string+=e.TidyBreak()),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this.getTypeName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak();const n=this.getChangedFields(),s=[];if(n.length){e.string+=e.Indent(),e.string+='"',e.string+="fieldValue",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();const i=[];for(const r of n){let n=!1;e.ExecutionContext()&&r.getAccessType()===d.inputOutput&&0!==r.getReferences().size&&([...r.getReferences()].some((e=>e.isInitializable()))||(n=!this.isDefaultValue(r))),0===r.getReferences().size||!e.ExecutionContext()||t||n?(n&&s.push(r),i.push(r)):s.push(r)}for(const t of i){switch(t.getType()){case d.SFNode:e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t.getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),t.toJSONStream(e),e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}";break;case d.MFNode:e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t.getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),t.toJSONStream(e),e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}";break;default:e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t.getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@value",e.string+='"',e.string+=":",e.string+=e.TidySpace(),t.toJSONStream(e),e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}t!==i.at(-1)&&(e.string+=","),e.string+=e.TidyBreak()}if(e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=",",e.string+=e.TidyBreak(),s.length&&!t){e.string+=e.Indent(),e.string+='"',e.string+="IS",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="connect",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();for(const t of s){const i=[...t.getReferences()];for(const n of i)e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@nodeField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t.getName()),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@protoField",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(n.getName()),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",t===s.at(-1)&&n===i.at(-1)||(e.string+=","),e.string+=e.TidyBreak()}e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=",",e.string+=e.TidyBreak()}}e.JSONRemoveComma(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.LeaveScope()},dispose(){const e=this[jh];e._name_changed.removeFieldInterest(this._typeName_changed),e._updateInstances.removeInterest("construct",this),e._updateInstances.removeInterest("update",this),this[Gh]?.dispose(),bs.prototype.dispose.call(this)}}),Object.defineProperties(Hh,{typeName:{value:"X3DPrototypeInstance",enumerable:!0},componentName:{value:"Core",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0}});const qh=Hh;i.add("X3DPrototypeInstance","x_ite/Components/Core/X3DPrototypeInstance",qh);const Yh=qh,Wh={name:"Core",concreteNodes:[Ns,Is,Ps,Vs,Us,js,Ks],abstractNodes:[tr,Hs,Ws,vs,bs,Yh,cu]};i.add("Core","x_ite/Components/Core",Wh);const $h=Wh;function Jh(e){bs.call(this,e),this.addType(d.X3DGeometricPropertyNode)}Object.setPrototypeOf(Jh.prototype,bs.prototype),Object.defineProperties(Jh,{typeName:{value:"X3DGeometricPropertyNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const Kh=Jh;i.add("X3DGeometricPropertyNode","x_ite/Components/Rendering/X3DGeometricPropertyNode",Kh);const Zh=Kh;function Qh(e){Zh.call(this,e),this.addType(d.FogCoordinate),this._depth.setUnit("length")}Object.assign(Object.setPrototypeOf(Qh.prototype,Zh.prototype),{initialize(){Zh.prototype.initialize.call(this),this._depth.addInterest("set_depth__",this),this.set_depth__()},set_depth__(){this.depth=this._depth.getValue(),this.length=this._depth.length},isEmpty(){return 0===this.length},getSize(){return this.length},addDepth(e,t){if(e>=0&&this.length)return t.push(this.depth[e%this.length]);t.push(0)},addDepths(e,t=this.length){const i=this.length;if(i){const n=this.depth;for(let s=0;s<t;++s)e.push(n[s%i])}else for(let i=0;i<t;++i)e.push(0);return e}}),Object.defineProperties(Qh,{typeName:{value:"FogCoordinate",enumerable:!0},componentName:{value:"EnvironmentalEffects",enumerable:!0},containerField:{value:"fogCoord",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"depth",new Yn.MFFloat)]),enumerable:!0}});const ed=Qh;i.add("FogCoordinate","x_ite/Components/EnvironmentalEffects/FogCoordinate",ed);const td=ed;function id(e){Hs.call(this,e),cl.call(this,e),this.addType(d.LocalFog)}Object.assign(Object.setPrototypeOf(id.prototype,Hs.prototype),cl.prototype,{initialize(){Hs.prototype.initialize.call(this),cl.prototype.initialize.call(this)},push(e){if(this._enabled.getValue()&&this.getFogType()){const t=this.getFogs().pop();t.set(this,e.getModelViewMatrix().get()),e.getLocalFogs().push(t)}},pop(e){this._enabled.getValue()&&this.getFogType()&&this.getBrowser().getLocalObjects().push(e.getLocalFogs().pop())},dispose(){cl.prototype.dispose.call(this),Hs.prototype.dispose.call(this)}}),Object.defineProperties(id,{typeName:{value:"LocalFog",enumerable:!0},componentName:{value:"EnvironmentalEffects",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"fogType",new Yn.SFString("LINEAR")),new X(d.inputOutput,"color",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"visibilityRange",new Yn.SFFloat)]),enumerable:!0}});const nd=id;i.add("LocalFog","x_ite/Components/EnvironmentalEffects/LocalFog",nd);const sd=nd;function rd(e){Bl.call(this,e),this.addType(d.TextureBackground)}Object.assign(Object.setPrototypeOf(rd.prototype,Bl.prototype),{initialize(){Bl.prototype.initialize.call(this),this._frontTexture.addInterest("set_texture__",this,0),this._backTexture.addInterest("set_texture__",this,1),this._leftTexture.addInterest("set_texture__",this,2),this._rightTexture.addInterest("set_texture__",this,3),this._topTexture.addInterest("set_texture__",this,4),this._bottomTexture.addInterest("set_texture__",this,5),this.set_texture__(0,this._frontTexture),this.set_texture__(1,this._backTexture),this.set_texture__(2,this._leftTexture),this.set_texture__(3,this._rightTexture),this.set_texture__(4,this._topTexture),this.set_texture__(5,this._bottomTexture)},set_texture__(e,t){Bl.prototype.set_texture__.call(this,ql(d.X3DTextureNode,t),e)}}),Object.defineProperties(rd,{typeName:{value:"TextureBackground",enumerable:!0},componentName:{value:"EnvironmentalEffects",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_bind",new Yn.SFBool),new X(d.inputOutput,"skyAngle",new Yn.MFFloat),new X(d.inputOutput,"skyColor",new Yn.MFColor(new Yn.SFColor)),new X(d.inputOutput,"groundAngle",new Yn.MFFloat),new X(d.inputOutput,"groundColor",new Yn.MFColor),new X(d.inputOutput,"transparency",new Yn.SFFloat),new X(d.outputOnly,"isBound",new Yn.SFBool),new X(d.outputOnly,"bindTime",new Yn.SFTime),new X(d.inputOutput,"frontTexture",new Yn.SFNode),new X(d.inputOutput,"backTexture",new Yn.SFNode),new X(d.inputOutput,"leftTexture",new Yn.SFNode),new X(d.inputOutput,"rightTexture",new Yn.SFNode),new X(d.inputOutput,"topTexture",new Yn.SFNode),new X(d.inputOutput,"bottomTexture",new Yn.SFNode)]),enumerable:!0}});const od=rd;i.add("TextureBackground","x_ite/Components/EnvironmentalEffects/TextureBackground",od);const ad={name:"EnvironmentalEffects",concreteNodes:[ou,fl,td,sd,od],abstractNodes:[Bl,cl]};i.add("EnvironmentalEffects","x_ite/Components/EnvironmentalEffects",ad);const ld=ad;function ud(e){cu.call(this,e),this.addType(d.X3DEnvironmentalSensorNode),this.addChildObjects(d.outputOnly,"traversed",new Yn.SFBool(!0)),this._size.setUnit("length"),this._center.setUnit("length"),this.zeroTest=!1,this.currentTraversed=!0}Object.assign(Object.setPrototypeOf(ud.prototype,cu.prototype),{initialize(){cu.prototype.initialize.call(this),this.getLive().addInterest("set_live__",this),this._enabled.addInterest("set_live__",this),this._size.addInterest("set_live__",this),this._traversed.addInterest("set_live__",this),this.set_live__()},set_live__(){!(this._traversed.getValue()&&this.getLive().getValue()&&this._enabled.getValue())||this.zeroTest&&this._size.getValue().equals(bt.Zero)?(this.getBrowser().sensorEvents().removeInterest("update",this),this._isActive.getValue()&&(this._isActive=!1,this._exitTime=this.getBrowser().getCurrentTime())):this.getBrowser().sensorEvents().addInterest("update",this)},setZeroTest(e){this.zeroTest=e},getZeroTest(){return this.zeroTest},setTraversed(e){e?!1===this._traversed.getValue()&&(this._traversed=!0):this.currentTraversed!==this._traversed.getValue()&&(this._traversed=this.currentTraversed),this.currentTraversed=e},getTraversed(){return this.currentTraversed},update(){}}),Object.defineProperties(ud,{typeName:{value:"X3DEnvironmentalSensorNode",enumerable:!0},componentName:{value:"EnvironmentalSensor",enumerable:!0}});const hd=ud;i.add("X3DEnvironmentalSensorNode","x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode",hd);const dd=hd;function cd(e){dd.call(this,e),this.addType(d.ProximitySensor),this.setCameraObject(!0),this._centerOfRotation_changed.setUnit("length"),this._position_changed.setUnit("length"),this.setZeroTest(!0),this.min=new bt(0,0,0),this.max=new bt(0,0,0),this.layerNode=null,this.modelMatrix=new ci,this.inside=!1}Object.assign(Object.setPrototypeOf(cd.prototype,dd.prototype),{initialize(){dd.prototype.initialize.call(this),this._enabled.addInterest("set_enabled__",this),this._size.addInterest("set_extents__",this),this._center.addInterest("set_extents__",this),this._traversed.addFieldInterest(this._isCameraObject),this.set_enabled__(),this.set_extents__()},set_enabled__(){this.setCameraObject(this._enabled.getValue()),this._enabled.getValue()?delete this.traverse:this.traverse=Function.prototype},set_extents__(){const e=this._size.getValue(),t=this._center.getValue(),i=e.x/2,n=e.y/2,s=e.z/2,r=t.x,o=t.y,a=t.z;this.min.set(r-i,o-n,a-s),this.max.set(r+i,o+n,a+s)},update:(()=>{const e=new bt(0,0,0),t=new ai,i=new bt(0,0,0),n=new ci;return function(){if(this.inside&&this.getTraversed()){if(this.layerNode){const s=this.layerNode.getViewpoint(),r=this.modelMatrix.inverse();n.assign(s.getModelMatrix()).translate(s.getUserCenterOfRotation()).multRight(r).get(i),r.multLeft(s.getCameraSpaceMatrix()).get(e,t),this._isActive.getValue()?(this._position_changed.getValue().equals(e)||(this._position_changed=e),this._orientation_changed.getValue().equals(t)||(this._orientation_changed=t),this._centerOfRotation_changed.getValue().equals(i)||(this._centerOfRotation_changed=i)):(this._isActive=!0,this._enterTime=this.getBrowser().getCurrentTime(),this._position_changed=e,this._orientation_changed=t,this._centerOfRotation_changed=i)}}else this._isActive.getValue()&&(this._isActive=!1,this._exitTime=this.getBrowser().getCurrentTime());this.inside=!1,this.layerNode=null,this.setTraversed(!1)}})(),traverse:(()=>{const e=new ci,t=new bt(-1,-1,-1);return function(i,n){switch(i){case Ia.CAMERA:return this.layerNode=n.getLayer(),void this.modelMatrix.assign(n.getModelViewMatrix().get());case Ia.DISPLAY:if(this.setTraversed(!0),this.inside)return;return void(this._size.getValue().equals(t)?this.inside=!0:(e.assign(n.getModelViewMatrix().get()).inverse(),this.inside=this.containsPoint(e.origin)))}}})(),containsPoint(e){const t=this.min,i=this.max;return t.x<=e.x&&i.x>=e.x&&t.y<=e.y&&i.y>=e.y&&t.z<=e.z&&i.z>=e.z}}),Object.defineProperties(cd,{typeName:{value:"ProximitySensor",enumerable:!0},componentName:{value:"EnvironmentalSensor",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"size",new Yn.SFVec3f),new X(d.inputOutput,"center",new Yn.SFVec3f),new X(d.outputOnly,"enterTime",new Yn.SFTime),new X(d.outputOnly,"exitTime",new Yn.SFTime),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"position_changed",new Yn.SFVec3f),new X(d.outputOnly,"orientation_changed",new Yn.SFRotation),new X(d.outputOnly,"centerOfRotation_changed",new Yn.SFVec3f)]),enumerable:!0}});const pd=cd;i.add("ProximitySensor","x_ite/Components/EnvironmentalSensor/ProximitySensor",pd);const gd=pd,fd=al(ci),md=al(ci);function _d(e){dd.call(this,e),this.addType(d.TransformSensor),this._position_changed.setUnit("length"),this.setZeroTest(!0),this.min=new bt,this.max=new bt,this.targetObjectNode=null,this.modelMatrices=[],this.targetMatrices=[]}Object.assign(Object.setPrototypeOf(_d.prototype,dd.prototype),{initialize(){dd.prototype.initialize.call(this),this.getLive().addInterest("set_enabled__",this),this._enabled.addInterest("set_enabled__",this),this._size.addInterest("set_enabled__",this),this._size.addInterest("set_extents__",this),this._center.addInterest("set_extents__",this),this._targetObject.addInterest("set_targetObject__",this),this.set_extents__(),this.set_targetObject__()},set_live__(){},set_enabled__(){this.getLive().getValue()&&this.targetObjectNode&&this._enabled.getValue()&&!this._size.getValue().equals(bt.Zero)?(this.setPickableObject(!0),this.getBrowser().addTransformSensor(this),this.targetObjectNode.addTransformSensor(this)):(this.setPickableObject(!1),this.getBrowser().removeTransformSensor(this),this.targetObjectNode&&this.targetObjectNode.removeTransformSensor(this),this._isActive.getValue()&&(this._isActive=!1,this._exitTime=this.getBrowser().getCurrentTime()))},set_extents__(){const e=this._size.getValue(),t=this._center.getValue(),i=e.x/2,n=e.y/2,s=e.z/2,r=t.x,o=t.y,a=t.z;this.min.set(r-i,o-n,a-s),this.max.set(r+i,o+n,a+s)},set_targetObject__(){this.targetObjectNode=null;try{const e=this._targetObject.getValue().getInnerNode(),t=e.getType();for(let i=t.length-1;i>=0;--i){switch(t[i]){case d.X3DGroupingNode:case d.X3DShapeNode:this.targetObjectNode=e;break;default:continue}break}}catch{}this.set_enabled__()},traverse(e,t){e===Ia.PICKING&&this.isPickableObject()&&this.modelMatrices.push(fd.pop().assign(t.getModelViewMatrix().get()))},collect(e){this.targetMatrices.push(md.pop().assign(e))},process:(()=>{const e=new bt(0,0,0),t=new ai;return function(){const i=this.modelMatrices,n=this.targetMatrices,s=this.intersects();s?(s.get(e,t),this._isActive.getValue()?(this._position_changed.getValue().equals(e)||(this._position_changed=e),this._orientation_changed.getValue().equals(t)||(this._orientation_changed=t)):(this._isActive=!0,this._enterTime=this.getBrowser().getCurrentTime(),this._position_changed=e,this._orientation_changed=t)):this._isActive.getValue()&&(this._isActive=!1,this._exitTime=this.getBrowser().getCurrentTime());for(const e of i)fd.push(e);for(const e of n)md.push(e);i.length=0,n.length=0}})(),intersects:(()=>{const e=new bt(-1,-1,-1);return function(){const t=this.modelMatrices,i=this.targetMatrices,n=this._size.getValue().equals(e);for(const e of t){const t=e.inverse();for(const e of i){const i=e.multRight(t);if(n||this.containsPoint(i.origin))return i}}return null}})(),containsPoint(e){const t=this.min,i=this.max;return t.x<=e.x&&i.x>=e.x&&t.y<=e.y&&i.y>=e.y&&t.z<=e.z&&i.z>=e.z}}),Object.defineProperties(_d,{typeName:{value:"TransformSensor",enumerable:!0},componentName:{value:"EnvironmentalSensor",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"size",new Yn.SFVec3f),new X(d.inputOutput,"center",new Yn.SFVec3f),new X(d.outputOnly,"enterTime",new Yn.SFTime),new X(d.outputOnly,"exitTime",new Yn.SFTime),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"position_changed",new Yn.SFVec3f),new X(d.outputOnly,"orientation_changed",new Yn.SFRotation),new X(d.inputOutput,"targetObject",new Yn.SFNode)]),enumerable:!0}});const xd=_d;i.add("TransformSensor","x_ite/Components/EnvironmentalSensor/TransformSensor",xd);const yd=xd;function wd(e){dd.call(this,e),this.addType(d.VisibilitySensor),this.setZeroTest(!1),this.visible=!1}Object.assign(Object.setPrototypeOf(wd.prototype,dd.prototype),{initialize(){dd.prototype.initialize.call(this),this._enabled.addInterest("set_enabled__",this),this.set_enabled__()},set_enabled__(){this._enabled.getValue()?delete this.traverse:this.traverse=Function.prototype},update(){this.visible&&this.getTraversed()?(this._isActive.getValue()||(this._isActive=!0,this._enterTime=this.getBrowser().getCurrentTime()),this.visible=!1):this._isActive.getValue()&&(this._isActive=!1,this._exitTime=this.getBrowser().getCurrentTime()),this.setTraversed(!1)},traverse:(()=>{const e=new Ua,t=new bt(-1,-1,-1);return function(i,n){i===Ia.DISPLAY&&(this.setTraversed(!0),this.visible||(this._size.getValue().equals(t)?this.visible=!0:(e.set(this._size.getValue(),this._center.getValue()).multRight(n.getModelViewMatrix().get()),this.visible=n.getViewVolume().intersectsBox(e))))}})()}),Object.defineProperties(wd,{typeName:{value:"VisibilitySensor",enumerable:!0},componentName:{value:"EnvironmentalSensor",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"size",new Yn.SFVec3f),new X(d.inputOutput,"center",new Yn.SFVec3f),new X(d.outputOnly,"enterTime",new Yn.SFTime),new X(d.outputOnly,"exitTime",new Yn.SFTime),new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const bd=wd;i.add("VisibilitySensor","x_ite/Components/EnvironmentalSensor/VisibilitySensor",bd);const Sd={name:"EnvironmentalSensor",concreteNodes:[gd,yd,bd],abstractNodes:[dd]};i.add("EnvironmentalSensor","x_ite/Components/EnvironmentalSensor",Sd);const Td=Sd;function vd(e){Hs.call(this,e),this.addType(d.X3DFollowerNode),this.buffer=[],this.a=this.getVector(),this.vector=this.getVector()}Object.assign(Object.setPrototypeOf(vd.prototype,Hs.prototype),{initialize(){Hs.prototype.initialize.call(this),this.getLive().addInterest("set_live__",this)},getBuffer(){return this.buffer},getValue(){return this._set_value.getValue()},getDestination(){return this._set_destination.getValue()},getInitialValue(){return this._initialValue.getValue()},getInitialDestination(){return this._initialDestination.getValue()},setValue(e){this._value_changed=e},setDestination(e){this.destination.assign(e)},duplicate:e=>e.copy(),assign(e,t,i){e[t].assign(i)},equals(e,t,i){return this.a.assign(e).subtract(t).magnitude()<i},interpolate(e,t,i){return this.vector.assign(e).lerp(t,i)},set_live__(){this.getLive().getValue()&&this._isActive.getValue()?(this.getBrowser().prepareEvents().addInterest("prepareEvents",this),this.getBrowser().addBrowserEvent()):this.getBrowser().prepareEvents().removeInterest("prepareEvents",this)},set_active(e){e!==this._isActive.getValue()&&(this._isActive=e,this.set_live__())}}),Object.defineProperties(vd,{typeName:{value:"X3DFollowerNode",enumerable:!0},componentName:{value:"Followers",enumerable:!0}});const Od=vd;i.add("X3DFollowerNode","x_ite/Components/Followers/X3DFollowerNode",Od);const Ed=Od;function Nd(e){Ed.call(this,e),this.addType(d.X3DChaserNode),this.destination=null,this.previousValue=null,this.bufferEndTime=0,this.stepTime=0,this.deltaOut=this.getVector()}Object.assign(Object.setPrototypeOf(Nd.prototype,Ed.prototype),{initialize(){Ed.prototype.initialize.call(this),this._set_value.addInterest("set_value__",this),this._set_destination.addInterest("set_destination__",this),this._duration.addInterest("set_duration__",this),this.set_duration__();var e=this.getBuffer(),t=this.getInitialValue(),i=this.getInitialDestination(),n=this.getNumBuffers();this.bufferEndTime=this.getBrowser().getCurrentTime(),this.previousValue=this.duplicate(t),e[0]=this.duplicate(i);for(var s=1;s<n;++s)e[s]=this.duplicate(t);this.destination=this.duplicate(i),this.equals(i,t,this.getTolerance())?this.setValue(i):this.set_active(!0)},getNumBuffers:()=>60,getTolerance:()=>1e-8,getArray(){return this.getVector()},setPreviousValue(e){this.previousValue.assign(e)},step(e,t,i){this.output.add(this.deltaOut.assign(e).subtract(t).multiply(i))},stepResponse(e){if(e<=0)return 0;var t=this._duration.getValue();return e>=t?1:.5-.5*Math.cos(e/t*Math.PI)},set_value__(){this._isActive.getValue()||(this.bufferEndTime=this.getBrowser().getCurrentTime());for(var e=this.getBuffer(),t=this.getValue(),i=0,n=e.length;i<n;++i)this.assign(e,i,t);this.setPreviousValue(t),this.setValue(t),this.set_active(!0)},set_destination__(){this.setDestination(this.getDestination()),this._isActive.getValue()||(this.bufferEndTime=this.getBrowser().getCurrentTime()),this.set_active(!0)},set_duration__(){this.stepTime=this._duration.getValue()/this.getNumBuffers()},prepareEvents(){var e=this.getBuffer(),t=e.length,i=this.updateBuffer();this.output=this.interpolate(this.previousValue,e[t-1],this.stepResponse((t-1+i)*this.stepTime));for(var n=t-2;n>=0;--n)this.step(e[n],e[n+1],this.stepResponse((n+i)*this.stepTime));this.setValue(this.output),this.equals(this.output,this.destination,this.getTolerance())&&this.set_active(!1)},updateBuffer(){var e=this.getBuffer(),t=e.length,i=(this.getBrowser().getCurrentTime()-this.bufferEndTime)/this.stepTime;if(i>=1){var n=Math.floor(i);if(i-=n,n<t){this.setPreviousValue(e[t-n]);for(var s=t-1;s>=n;--s)this.assign(e,s,e[s-n]);for(s=0;s<n;++s){var r=s/n;this.assign(e,s,this.interpolate(this.destination,e[n],r))}}else{this.setPreviousValue(n==t?e[0]:this.destination);for(s=0;s<t;++s)this.assign(e,s,this.destination)}this.bufferEndTime+=n*this.stepTime}return i}}),Object.defineProperties(Nd,{typeName:{value:"X3DChaserNode",enumerable:!0},componentName:{value:"Followers",enumerable:!0}});const Cd=Nd;i.add("X3DChaserNode","x_ite/Components/Followers/X3DChaserNode",Cd);const Fd=Cd;var Id=new bt(0,0,0),Md=new bt(0,0,0),Dd=new bt(0,0,0),Pd=new bt(0,0,0);function Rd(e){Fd.call(this,e),this.addType(d.ColorChaser)}Object.assign(Object.setPrototypeOf(Rd.prototype,Fd.prototype),{getVector:()=>new bt(0,0,0),getValue(){return this._set_value.getValue().getHSV(Pd)},getDestination(){return this._set_destination.getValue().getHSV(Pd)},getInitialValue(){return this._initialValue.getValue().getHSV(Id)},getInitialDestination(){return this._initialDestination.getValue().getHSV(Md)},setValue(e){this._value_changed.setHSV(e.x,e.y,e.z)},interpolate:(e,t,i)=>Ce.lerp(e,t,i,Pd),step(e,t,i){Dd.assign(this.output).add(e).subtract(t),Ce.lerp(this.output,Dd,i,this.output)}}),Object.defineProperties(Rd,{typeName:{value:"ColorChaser",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFColor),new X(d.inputOnly,"set_destination",new Yn.SFColor),new X(d.initializeOnly,"initialValue",new Yn.SFColor(.8,.8,.8)),new X(d.initializeOnly,"initialDestination",new Yn.SFColor(.8,.8,.8)),new X(d.initializeOnly,"duration",new Yn.SFTime(1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFColor)]),enumerable:!0}});const Ad=Rd;i.add("ColorChaser","x_ite/Components/Followers/ColorChaser",Ad);const Vd=Ad;function Ld(e){Ed.call(this,e),this.addType(d.X3DDamperNode)}Object.assign(Object.setPrototypeOf(Ld.prototype,Ed.prototype),{initialize(){Ed.prototype.initialize.call(this),this._order.addInterest("set_order__",this),this._set_value.addInterest("set_value__",this),this._set_destination.addInterest("set_destination__",this);var e=this.getBuffer(),t=this.getInitialValue(),i=this.getInitialDestination();e[0]=this.duplicate(i);for(var n=1,s=this.getOrder()+1;n<s;++n)e[n]=this.duplicate(t);this.equals(i,t,this.getTolerance())?this.setValue(i):this.set_active(!0)},getOrder(){return g.clamp(this._order.getValue(),0,5)},getTolerance(){return this._tolerance.getValue()<0?1e-4:this._tolerance.getValue()},prepareEvents(){var e=this.getBuffer(),t=e.length-1;if(this._tau.getValue()){for(var i=1/this.getBrowser().currentFrameRate,n=Math.exp(-i/this._tau.getValue()),s=0;s<t;++s)this.assign(e,s+1,this.interpolate(e[s],e[s+1],n));if(this.setValue(e[t]),!this.equals(e[t],e[0],this.getTolerance()))return}else this.setValue(e[0]),t=0;s=1;for(var r=e.length;s<r;++s)this.assign(e,s,e[t]);this.set_active(!1)},set_value__(){for(var e=this.getBuffer(),t=this.getValue(),i=1,n=e.length;i<n;++i)this.assign(e,i,t);this.setValue(t),this.set_active(!0)},set_destination__(){this.assign(this.getBuffer(),0,this.getDestination()),this.set_active(!0)},set_order__(){for(var e=this.getBuffer(),t=e[e.length-1],i=e.length,n=this.getOrder()+1;i<n;++i)e[i]=this.duplicate(t);e.length=n}}),Object.defineProperties(Ld,{typeName:{value:"X3DDamperNode",enumerable:!0},componentName:{value:"Followers",enumerable:!0}});const Bd=Ld;i.add("X3DDamperNode","x_ite/Components/Followers/X3DDamperNode",Bd);const Ud=Bd;var Xd=new bt(0,0,0),kd=new bt(0,0,0),jd=new bt(0,0,0),zd=new bt(0,0,0);function Gd(e){Ud.call(this,e),this.addType(d.ColorDamper)}Object.assign(Object.setPrototypeOf(Gd.prototype,Ud.prototype),{getVector:()=>new bt(0,0,0),getValue(){return this._set_value.getValue().getHSV(zd)},getDestination(){return this._set_destination.getValue().getHSV(zd)},getInitialValue(){return this._initialValue.getValue().getHSV(kd)},getInitialDestination(){return this._initialDestination.getValue().getHSV(jd)},setValue(e){this._value_changed.setHSV(e.x,e.y,e.z)},equals:(e,t,i)=>Xd.assign(e).subtract(t).magnitude()<i,interpolate:(e,t,i)=>Ce.lerp(e,t,i,zd)}),Object.defineProperties(Gd,{typeName:{value:"ColorDamper",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFColor),new X(d.inputOnly,"set_destination",new Yn.SFColor),new X(d.initializeOnly,"initialValue",new Yn.SFColor(.8,.8,.8)),new X(d.initializeOnly,"initialDestination",new Yn.SFColor(.8,.8,.8)),new X(d.initializeOnly,"order",new Yn.SFInt32(3)),new X(d.inputOutput,"tau",new Yn.SFTime(.3)),new X(d.inputOutput,"tolerance",new Yn.SFFloat(-1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFColor)]),enumerable:!0}});const Hd=Gd;i.add("ColorDamper","x_ite/Components/Followers/ColorDamper",Hd);const qd=Hd;const Yd=function(e){function t(){this.array=this.getArray(),this.zero=this.getVector()}return Object.assign(t.prototype,{getArray(){const e=[];return e.assign=function(e){if(Array.isArray(e)){for(var t=0,i=Math.min(this.length,e.length);t<i;++t)this[t].assign(e[t]);for(t=i,i=e.length;t<i;++t)this[t]=e[t].copy();this.length=i}else{for(t=0,i=Math.min(this.length,e.length);t<i;++t)this[t].assign(e[t].getValue());for(t=i,i=e.length;t<i;++t)this[t]=e[t].getValue().copy();this.length=i}},e},getValue(){return this._set_value},getDestination(){return this._set_destination},getInitialValue(){return this._initialValue},getInitialDestination(){return this._initialDestination},setValue(e){if(Array.isArray(e)){const n=this._value_changed;for(var t=0,i=e.length;t<i;++t)n[t]=e[t];n.length=i}else this._value_changed=e},duplicate(e){const t=this.getArray();return t.assign(e),t},equals(e,t,i){if(e.length!==t.length)return!1;const n=this.a;let s=0;for(let i=0,r=e.length;i<r;++i)s=Math.max(n.assign(e[i]).subtract(t[i]).magnitude());return s<i},interpolate(e,t,i){const n=this.array;n.assign(e);for(let e=0,s=n.length;e<s;++e)n[e].lerp(t[e]||this.zero,i);return n},set_destination__(){const t=this.getBuffer(),i=this._set_destination.length;for(let e=0,n=t.length;e<n;++e){const n=t[e];for(let e=n.length;e<i;++e)n[e]=this.getVector();n.length=i}e.prototype.set_destination__.call(this)}}),t};i.add("X3DArrayFollowerTemplate","x_ite/Browser/Followers/X3DArrayFollowerTemplate",Yd);const Wd=Yd;const $d=function(e){const t=Wd(e);function i(){t.call(this),this.array=this.getArray()}return Object.assign(i.prototype,t.prototype,{step(e,t,i){const n=this.output,s=this.deltaOut;for(let r=0,o=n.length;r<o;++r)n[r].add(s.assign(e[r]||this.zero).subtract(t[r]||this.zero).multiply(i))}}),i};i.add("X3DArrayChaserTemplate","x_ite/Browser/Followers/X3DArrayChaserTemplate",$d);const Jd=$d;var Kd=Jd(Fd);function Zd(e){Fd.call(this,e),Kd.call(this,e),this.addType(d.CoordinateChaser)}Object.assign(Object.setPrototypeOf(Zd.prototype,Fd.prototype),Kd.prototype,{getVector:()=>new bt(0,0,0)}),Object.defineProperties(Zd,{typeName:{value:"CoordinateChaser",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.MFVec3f),new X(d.inputOnly,"set_destination",new Yn.MFVec3f),new X(d.initializeOnly,"initialValue",new Yn.MFVec3f(new bt(0,0,0))),new X(d.initializeOnly,"initialDestination",new Yn.MFVec3f(new bt(0,0,0))),new X(d.initializeOnly,"duration",new Yn.SFTime(1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.MFVec3f)]),enumerable:!0}});const Qd=Zd;i.add("CoordinateChaser","x_ite/Components/Followers/CoordinateChaser",Qd);const ec=Qd;var tc=Wd(Ud);function ic(e){Ud.call(this,e),tc.call(this,e),this.addType(d.CoordinateDamper)}Object.assign(Object.setPrototypeOf(ic.prototype,Ud.prototype),tc.prototype,{getVector:()=>new bt(0,0,0)}),Object.defineProperties(ic,{typeName:{value:"CoordinateDamper",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.MFVec3f),new X(d.inputOnly,"set_destination",new Yn.MFVec3f),new X(d.initializeOnly,"initialValue",new Yn.MFVec3f(new bt(0,0,0))),new X(d.initializeOnly,"initialDestination",new Yn.MFVec3f(new bt(0,0,0))),new X(d.initializeOnly,"order",new Yn.SFInt32(3)),new X(d.inputOutput,"tau",new Yn.SFTime(.3)),new X(d.inputOutput,"tolerance",new Yn.SFFloat(-1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.MFVec3f)]),enumerable:!0}});const nc=ic;i.add("CoordinateDamper","x_ite/Components/Followers/CoordinateDamper",nc);const sc=nc;var rc=new ai,oc=new ai;function ac(e){Fd.call(this,e),this.addType(d.OrientationChaser),this._set_value.setUnit("angle"),this._set_destination.setUnit("angle"),this._initialValue.setUnit("angle"),this._initialDestination.setUnit("angle"),this._value_changed.setUnit("angle")}Object.assign(Object.setPrototypeOf(ac.prototype,Fd.prototype),{getVector:()=>new ai,equals:(e,t,i)=>(rc.assign(e).inverse().multRight(t),Math.abs(rc.angle)<i),interpolate:(e,t,i)=>oc.assign(e).slerp(t,i),step(e,t,i){this.deltaOut.assign(t).inverse().multRight(e).multLeft(this.output),this.output.slerp(this.deltaOut,i)}}),Object.defineProperties(ac,{typeName:{value:"OrientationChaser",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFRotation),new X(d.inputOnly,"set_destination",new Yn.SFRotation),new X(d.initializeOnly,"initialValue",new Yn.SFRotation),new X(d.initializeOnly,"initialDestination",new Yn.SFRotation),new X(d.initializeOnly,"duration",new Yn.SFTime(1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFRotation)]),enumerable:!0}});const lc=ac;i.add("OrientationChaser","x_ite/Components/Followers/OrientationChaser",lc);const uc=lc;var hc=new ai,dc=new ai;function cc(e){Ud.call(this,e),this.addType(d.OrientationDamper),this._set_value.setUnit("angle"),this._set_destination.setUnit("angle"),this._initialValue.setUnit("angle"),this._initialDestination.setUnit("angle"),this._value_changed.setUnit("angle")}Object.assign(Object.setPrototypeOf(cc.prototype,Ud.prototype),{getVector:()=>new ai,equals:(e,t,i)=>(hc.assign(e).inverse().multRight(t),Math.abs(hc.angle)<i),interpolate:(e,t,i)=>dc.assign(e).slerp(t,i)}),Object.defineProperties(cc,{typeName:{value:"OrientationDamper",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFRotation),new X(d.inputOnly,"set_destination",new Yn.SFRotation),new X(d.initializeOnly,"initialValue",new Yn.SFRotation),new X(d.initializeOnly,"initialDestination",new Yn.SFRotation),new X(d.initializeOnly,"order",new Yn.SFInt32(3)),new X(d.inputOutput,"tau",new Yn.SFTime(.3)),new X(d.inputOutput,"tolerance",new Yn.SFFloat(-1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFRotation)]),enumerable:!0}});const pc=cc;i.add("OrientationDamper","x_ite/Components/Followers/OrientationDamper",pc);const gc=pc;function fc(e){Fd.call(this,e),this.addType(d.PositionChaser)}Object.assign(Object.setPrototypeOf(fc.prototype,Fd.prototype),{getVector:()=>new bt(0,0,0)}),Object.defineProperties(fc,{typeName:{value:"PositionChaser",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFVec3f),new X(d.inputOnly,"set_destination",new Yn.SFVec3f),new X(d.initializeOnly,"initialValue",new Yn.SFVec3f),new X(d.initializeOnly,"initialDestination",new Yn.SFVec3f),new X(d.initializeOnly,"duration",new Yn.SFTime(1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFVec3f)]),enumerable:!0}});const mc=fc;i.add("PositionChaser","x_ite/Components/Followers/PositionChaser",mc);const _c=mc;function xc(e){Fd.call(this,e),this.addType(d.PositionChaser2D)}Object.assign(Object.setPrototypeOf(xc.prototype,Fd.prototype),{getVector:()=>new ft(0,0)}),Object.defineProperties(xc,{typeName:{value:"PositionChaser2D",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFVec2f),new X(d.inputOnly,"set_destination",new Yn.SFVec2f),new X(d.initializeOnly,"initialValue",new Yn.SFVec2f),new X(d.initializeOnly,"initialDestination",new Yn.SFVec2f),new X(d.initializeOnly,"duration",new Yn.SFTime(1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFVec2f)]),enumerable:!0}});const yc=xc;i.add("PositionChaser2D","x_ite/Components/Followers/PositionChaser2D",yc);const wc=yc;function bc(e){Ud.call(this,e),this.addType(d.PositionDamper)}Object.assign(Object.setPrototypeOf(bc.prototype,Ud.prototype),{getVector:()=>new bt(0,0,0)}),Object.defineProperties(bc,{typeName:{value:"PositionDamper",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFVec3f),new X(d.inputOnly,"set_destination",new Yn.SFVec3f),new X(d.initializeOnly,"initialValue",new Yn.SFVec3f),new X(d.initializeOnly,"initialDestination",new Yn.SFVec3f),new X(d.initializeOnly,"order",new Yn.SFInt32(3)),new X(d.inputOutput,"tolerance",new Yn.SFFloat(-1)),new X(d.inputOutput,"tau",new Yn.SFTime(.3)),new X(d.outputOnly,"value_changed",new Yn.SFVec3f),new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const Sc=bc;i.add("PositionDamper","x_ite/Components/Followers/PositionDamper",Sc);const Tc=Sc;function vc(e){Ud.call(this,e),this.addType(d.PositionDamper2D)}Object.assign(Object.setPrototypeOf(vc.prototype,Ud.prototype),{getVector:()=>new ft(0,0)}),Object.defineProperties(vc,{typeName:{value:"PositionDamper2D",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFVec2f),new X(d.inputOnly,"set_destination",new Yn.SFVec2f),new X(d.initializeOnly,"initialValue",new Yn.SFVec2f),new X(d.initializeOnly,"initialDestination",new Yn.SFVec2f),new X(d.initializeOnly,"order",new Yn.SFInt32(3)),new X(d.inputOutput,"tau",new Yn.SFTime(.3)),new X(d.inputOutput,"tolerance",new Yn.SFFloat(-1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFVec2f)]),enumerable:!0}});const Oc=vc;i.add("PositionDamper2D","x_ite/Components/Followers/PositionDamper2D",Oc);const Ec=Oc;function Nc(e){Fd.call(this,e),this.addType(d.ScalarChaser)}Object.assign(Object.setPrototypeOf(Nc.prototype,Fd.prototype),{getVector:()=>0,setPreviousValue(e){this.previousValue=e},setDestination(e){this.destination=e},duplicate:e=>e,assign(e,t,i){e[t]=i},equals:(e,t,i)=>Math.abs(e-t)<i,interpolate:(e,t,i)=>g.lerp(e,t,i),step(e,t,i){this.output+=(e-t)*i}}),Object.defineProperties(Nc,{typeName:{value:"ScalarChaser",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFFloat),new X(d.inputOnly,"set_destination",new Yn.SFFloat),new X(d.initializeOnly,"initialValue",new Yn.SFFloat),new X(d.initializeOnly,"initialDestination",new Yn.SFFloat),new X(d.initializeOnly,"duration",new Yn.SFTime(1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFFloat)]),enumerable:!0}});const Cc=Nc;i.add("ScalarChaser","x_ite/Components/Followers/ScalarChaser",Cc);const Fc=Cc;function Ic(e){Ud.call(this,e),this.addType(d.ScalarDamper)}Object.assign(Object.setPrototypeOf(Ic.prototype,Ud.prototype),{getVector:()=>0,duplicate:e=>e,assign(e,t,i){e[t]=i},equals:(e,t,i)=>Math.abs(e-t)<i,interpolate:(e,t,i)=>g.lerp(e,t,i)}),Object.defineProperties(Ic,{typeName:{value:"ScalarDamper",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.SFFloat),new X(d.inputOnly,"set_destination",new Yn.SFFloat),new X(d.initializeOnly,"initialValue",new Yn.SFFloat),new X(d.initializeOnly,"initialDestination",new Yn.SFFloat),new X(d.initializeOnly,"order",new Yn.SFInt32(3)),new X(d.inputOutput,"tau",new Yn.SFTime(.3)),new X(d.inputOutput,"tolerance",new Yn.SFFloat(-1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFFloat)]),enumerable:!0}});const Mc=Ic;i.add("ScalarDamper","x_ite/Components/Followers/ScalarDamper",Mc);const Dc=Mc;var Pc=Jd(Fd);function Rc(e){Fd.call(this,e),Pc.call(this,e),this.addType(d.TexCoordChaser2D)}Object.assign(Object.setPrototypeOf(Rc.prototype,Fd.prototype),Pc.prototype,{getVector:()=>new ft(0,0)}),Object.defineProperties(Rc,{typeName:{value:"TexCoordChaser2D",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.MFVec2f),new X(d.inputOnly,"set_destination",new Yn.MFVec2f),new X(d.initializeOnly,"initialValue",new Yn.MFVec2f),new X(d.initializeOnly,"initialDestination",new Yn.MFVec2f),new X(d.initializeOnly,"duration",new Yn.SFTime(1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.MFVec2f)]),enumerable:!0}});const Ac=Rc;i.add("TexCoordChaser2D","x_ite/Components/Followers/TexCoordChaser2D",Ac);const Vc=Ac;var Lc=Wd(Ud);function Bc(e){Ud.call(this,e),Lc.call(this,e),this.addType(d.TexCoordDamper2D)}Object.assign(Object.setPrototypeOf(Bc.prototype,Ud.prototype),Lc.prototype,{getVector:()=>new ft(0,0,0)}),Object.defineProperties(Bc,{typeName:{value:"TexCoordDamper2D",enumerable:!0},componentName:{value:"Followers",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_value",new Yn.MFVec2f),new X(d.inputOnly,"set_destination",new Yn.MFVec2f),new X(d.initializeOnly,"initialValue",new Yn.MFVec2f),new X(d.initializeOnly,"initialDestination",new Yn.MFVec2f),new X(d.initializeOnly,"order",new Yn.SFInt32(3)),new X(d.inputOutput,"tau",new Yn.SFTime(.3)),new X(d.inputOutput,"tolerance",new Yn.SFFloat(-1)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.MFVec2f)]),enumerable:!0}});const Uc=Bc;i.add("TexCoordDamper2D","x_ite/Components/Followers/TexCoordDamper2D",Uc);const Xc={name:"Followers",concreteNodes:[Vd,qd,ec,sc,uc,gc,_c,wc,Tc,Ec,Fc,Dc,Vc,Uc],abstractNodes:[Fd,Ud,Ed]};i.add("Followers","x_ite/Components/Followers",Xc);const kc=Xc;function jc(e){Ol.call(this,e),this.addType(d.Box),this._size.setUnit("length")}Object.assign(Object.setPrototypeOf(jc.prototype,Ol.prototype),{build:(()=>{const e=new bt(2,2,2);return function(){const t=this.getBrowser().getBoxOptions().getGeometry(),i=this._size.getValue();if(this.setMultiTexCoords(t.getMultiTexCoords()),this.setNormals(t.getNormals()),i.equals(e))this.setVertices(t.getVertices()),this.getMin().assign(t.getMin()),this.getMax().assign(t.getMax());else{const e=Math.abs(i.x/2),n=Math.abs(i.y/2),s=Math.abs(i.z/2),r=t.getVertices().getValue(),o=this.getVertices();for(let t=0,i=r.length;t<i;t+=4)o.push(e*r[t],n*r[t+1],s*r[t+2],1);this.getMin().set(-e,-n,-s),this.getMax().set(e,n,s)}this.setSolid(this._solid.getValue())}})()}),Object.defineProperties(jc,{typeName:{value:"Box",enumerable:!0},componentName:{value:"Geometry3D",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"size",new Yn.SFVec3f(2,2,2)),new X(d.initializeOnly,"solid",new Yn.SFBool(!0))]),enumerable:!0}});const zc=jc;i.add("Box","x_ite/Components/Geometry3D/Box",zc);const Gc=zc;function Hc(e){Ol.call(this,e),this.addType(d.Cone),this._height.setUnit("length"),this._bottomRadius.setUnit("length")}Object.assign(Object.setPrototypeOf(Hc.prototype,Ol.prototype),{set_live__(){Ol.prototype.set_live__.call(this),this.getLive().getValue()?this.getBrowser().getConeOptions().addInterest("requestRebuild",this):this.getBrowser().getConeOptions().removeInterest("requestRebuild",this)},build(){const e=this.getBrowser().getConeOptions()._xDimension.getValue(),t=this._height.getValue(),i=this._bottomRadius.getValue(),n=this.getTexCoords(),s=this.getNormals(),r=this.getVertices();this.getMultiTexCoords().push(n);const o=t/2,a=-o,l=Vo.Polar(1,-Math.PI/2+Math.atan(i/t));if(this._side.getValue())for(let t=0;t<e;++t){const u=(t+.5)/e,h=2*Math.PI*u,d=Vo.Polar(l.imag,h),c=t/e,p=2*Math.PI*c,g=Vo.Polar(-i,p),f=Vo.Polar(l.imag,p),m=(t+1)/e,_=2*Math.PI*m,x=Vo.Polar(-i,_),y=Vo.Polar(l.imag,_);n.push(u,1,0,1),s.push(d.imag,l.real,d.real),r.push(0,o,0,1),n.push(c,0,0,1),s.push(f.imag,l.real,f.real),r.push(g.imag,a,g.real,1),n.push(m,0,0,1),s.push(y.imag,l.real,y.real),r.push(x.imag,a,x.real,1)}if(this._bottom.getValue()){const t=[],o=[];for(let n=e-1;n>-1;--n){const s=n/e,r=2*Math.PI*s,l=Vo.Polar(-1,r),u=l.copy().multiply(i);t.push(new ft((l.imag+1)/2,(l.real+1)/2)),o.push(new bt(u.imag,a,u.real))}const l=t[0],u=o[0];for(let e=1,i=o.length-1;e<i;++e){const i=t[e],a=t[e+1],h=o[e],d=o[e+1];n.push(l.x,l.y,0,1),s.push(0,-1,0),r.push(u.x,u.y,u.z,1),n.push(i.x,i.y,0,1),s.push(0,-1,0),r.push(h.x,h.y,h.z,1),n.push(a.x,a.y,0,1),s.push(0,-1,0),r.push(d.x,d.y,d.z,1)}}this.setSolid(this._solid.getValue()),this.setExtents()},setExtents(){const e=this._bottomRadius.getValue(),t=this._height.getValue()/2,i=-t;this._side.getValue()||this._bottom.getValue()?this._side.getValue()?(this.getMin().set(-e,i,-e),this.getMax().set(e,t,e)):(this.getMin().set(-e,i,-e),this.getMax().set(e,i,e)):(this.getMin().set(0,0,0),this.getMax().set(0,0,0))}}),Object.defineProperties(Hc,{typeName:{value:"Cone",enumerable:!0},componentName:{value:"Geometry3D",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"side",new Yn.SFBool(!0)),new X(d.inputOutput,"bottom",new Yn.SFBool(!0)),new X(d.initializeOnly,"height",new Yn.SFFloat(2)),new X(d.initializeOnly,"bottomRadius",new Yn.SFFloat(1)),new X(d.initializeOnly,"solid",new Yn.SFBool(!0))]),enumerable:!0}});const qc=Hc;i.add("Cone","x_ite/Components/Geometry3D/Cone",qc);const Yc=qc;function Wc(e){Ol.call(this,e),this.addType(d.Cylinder),this._height.setUnit("length"),this._radius.setUnit("length")}Object.assign(Object.setPrototypeOf(Wc.prototype,Ol.prototype),{set_live__(){Ol.prototype.set_live__.call(this),this.getLive().getValue()?this.getBrowser().getCylinderOptions().addInterest("requestRebuild",this):this.getBrowser().getCylinderOptions().removeInterest("requestRebuild",this)},build(){const e=this.getBrowser().getCylinderOptions()._xDimension.getValue(),t=this.getTexCoords(),i=this.getNormals(),n=this.getVertices();this.getMultiTexCoords().push(t);const s=this._radius.getValue(),r=this._height.getValue()/2,o=-r;if(this._side.getValue())for(let a=0;a<e;++a){const l=a/e,u=2*Math.PI*l,h=Vo.Polar(-1,u),d=h.copy().multiply(s),c=(a+1)/e,p=2*Math.PI*c,g=Vo.Polar(-1,p),f=g.copy().multiply(s);t.push(l,1,0,1),i.push(h.imag,0,h.real),n.push(d.imag,r,d.real,1),t.push(l,0,0,1),i.push(h.imag,0,h.real),n.push(d.imag,o,d.real,1),t.push(c,0,0,1),i.push(g.imag,0,g.real),n.push(f.imag,o,f.real,1),t.push(l,1,0,1),i.push(h.imag,0,h.real),n.push(d.imag,r,d.real,1),t.push(c,0,0,1),i.push(g.imag,0,g.real),n.push(f.imag,o,f.real,1),t.push(c,1,0,1),i.push(g.imag,0,g.real),n.push(f.imag,r,f.real,1)}if(this._top.getValue()){const o=[],a=[];for(let t=0;t<e;++t){const i=t/e,n=2*Math.PI*i,l=Vo.Polar(-1,n);o.push(new ft((l.imag+1)/2,-(l.real-1)/2)),a.push(new bt(l.imag*s,r,l.real*s))}const l=o[0],u=a[0];for(let e=1,s=a.length-1;e<s;++e){const s=o[e],r=o[e+1],h=a[e],d=a[e+1];t.push(l.x,l.y,0,1),i.push(0,1,0),n.push(u.x,u.y,u.z,1),t.push(s.x,s.y,0,1),i.push(0,1,0),n.push(h.x,h.y,h.z,1),t.push(r.x,r.y,0,1),i.push(0,1,0),n.push(d.x,d.y,d.z,1)}}if(this._bottom.getValue()){const r=[],a=[];for(let t=e-1;t>-1;--t){const i=t/e,n=2*Math.PI*i,l=Vo.Polar(-1,n);r.push(new ft((l.imag+1)/2,(l.real+1)/2)),a.push(new bt(l.imag*s,o,l.real*s))}const l=r[0],u=a[0];for(let e=1,s=a.length-1;e<s;++e){const s=r[e],o=r[e+1],h=a[e],d=a[e+1];t.push(l.x,l.y,0,1),i.push(0,-1,0),n.push(u.x,u.y,u.z,1),t.push(s.x,s.y,0,1),i.push(0,-1,0),n.push(h.x,h.y,h.z,1),t.push(o.x,o.y,0,1),i.push(0,-1,0),n.push(d.x,d.y,d.z,1)}}this.setSolid(this._solid.getValue()),this.setExtents()},setExtents(){const e=this._radius.getValue(),t=this._height.getValue()/2,i=-t;this._top.getValue()||this._side.getValue()||this._bottom.getValue()?this._top.getValue()||this._side.getValue()?this._bottom.getValue()||this._side.getValue()?(this.getMin().set(-e,i,-e),this.getMax().set(e,t,e)):(this.getMin().set(-e,t,-e),this.getMax().set(e,t,e)):(this.getMin().set(-e,i,-e),this.getMax().set(e,i,e)):(this.getMin().set(0,0,0),this.getMax().set(0,0,0))}}),Object.defineProperties(Wc,{typeName:{value:"Cylinder",enumerable:!0},componentName:{value:"Geometry3D",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"top",new Yn.SFBool(!0)),new X(d.inputOutput,"side",new Yn.SFBool(!0)),new X(d.inputOutput,"bottom",new Yn.SFBool(!0)),new X(d.initializeOnly,"height",new Yn.SFFloat(2)),new X(d.initializeOnly,"radius",new Yn.SFFloat(1)),new X(d.initializeOnly,"solid",new Yn.SFBool(!0))]),enumerable:!0}});const $c=Wc;i.add("Cylinder","x_ite/Components/Geometry3D/Cylinder",$c);const Jc=$c;function Kc(e){Ol.call(this,e),this.addType(d.ElevationGrid),this._xSpacing.setUnit("length"),this._zSpacing.setUnit("length"),this._creaseAngle.setUnit("angle"),this._height.setUnit("length"),this.fogCoordNode=null,this.colorNode=null,this.texCoordNode=null,this.normalNode=null,this.coordNode=null}Object.assign(Object.setPrototypeOf(Kc.prototype,Ol.prototype),{initialize(){Ol.prototype.initialize.call(this),this._set_height.addFieldInterest(this._height),this._attrib.addInterest("set_attrib__",this),this._fogCoord.addInterest("set_fogCoord__",this),this._color.addInterest("set_color__",this),this._texCoord.addInterest("set_texCoord__",this),this._normal.addInterest("set_normal__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_texCoord__(),this.set_normal__()},set_attrib__(){const e=this.getAttrib();for(const t of e)t.removeInterest("requestRebuild",this),t._attribute_changed.removeInterest("updateVertexArrays",this);e.length=0;for(const t of this._attrib){const i=ql(d.X3DVertexAttributeNode,t);i&&e.push(i)}for(const t of e)t.addInterest("requestRebuild",this),t._attribute_changed.addInterest("updateVertexArrays",this);this.updateVertexArrays()},set_fogCoord__(){this.fogCoordNode?.removeInterest("requestRebuild",this),this.fogCoordNode=ql(d.FogCoordinate,this._fogCoord),this.fogCoordNode?.addInterest("requestRebuild",this)},set_color__(){this.colorNode?.removeInterest("requestRebuild",this),this.colorNode=ql(d.X3DColorNode,this._color),this.colorNode?.addInterest("requestRebuild",this),this.setTransparent(this.colorNode?.isTransparent()??!1)},set_texCoord__(){this.texCoordNode?.removeInterest("requestRebuild",this),this.texCoordNode=ql(d.X3DTextureCoordinateNode,this._texCoord),this.texCoordNode?.addInterest("requestRebuild",this),this.setTextureCoordinate(this.texCoordNode)},set_normal__(){this.normalNode?.removeInterest("requestRebuild",this),this.normalNode=ql(d.X3DNormalNode,this._normal),this.normalNode?.addInterest("requestRebuild",this)},getColor(){return this.colorNode},getTexCoord(){return this.texCoordNode},getNormal(){return this.normalNode},getHeight(e){return e<this._height.length?this._height[e]:0},createTexCoords(){const e=[],t=this._xDimension.getValue(),i=this._zDimension.getValue(),n=t-1,s=i-1;for(let r=0;r<i;++r)for(let i=0;i<t;++i)e.push(new ft(i/n,r/s));return e},createNormals(e,t,i){const n=!this._ccw.getValue(),s=new Map,r=[];for(let t=0,i=e.length;t<i;++t)s.set(t,[]);for(let i=0,o=t.length;i<o;i+=3){const o=t[i],a=t[i+1],l=t[i+2];s.get(o).push(r.length),s.get(a).push(r.length+1),s.get(l).push(r.length+2);const u=ga.normal(e[o],e[a],e[l],new bt(0,0,0));n&&u.negate(),r.push(u),r.push(u),r.push(u)}return this._normalPerVertex.getValue()?this.refineNormals(s,r,this._creaseAngle.getValue()):r},createCoordIndex(){const e=[],t=this._xDimension.getValue(),i=t-1,n=this._zDimension.getValue()-1;for(let s=0;s<n;++s)for(let n=0;n<i;++n){const i=s*t+n,r=(s+1)*t+n,o=(s+1)*t+(n+1),a=s*t+(n+1);e.push(i),e.push(r),e.push(o),e.push(i),e.push(o),e.push(a)}return e},createPoints(){const e=[],t=this._xDimension.getValue(),i=this._zDimension.getValue(),n=this._xSpacing.getValue(),s=this._zSpacing.getValue();for(let r=0;r<i;++r)for(let i=0;i<t;++i)e.push(new bt(n*i,this.getHeight(i+r*t),s*r));return e},build(){if(this._xDimension.getValue()<2||this._zDimension.getValue()<2)return;const e=this._colorPerVertex.getValue(),t=this._normalPerVertex.getValue(),i=this.createCoordIndex(),n=this.getCoordIndices(),s=this.getAttrib(),r=s.length,o=this.getAttribs(),a=this.fogCoordNode,l=this.getColor(),u=this.getTexCoord(),h=this.getNormal(),d=this.createPoints(),c=this.getFogDepths(),p=this.getColors(),g=this.getMultiTexCoords(),f=this.getNormals(),m=this.getVertices();let _=0;if(u)u.init(g);else{var x=this.createTexCoords(),y=this.getTexCoords();g.push(y)}for(let w=0,b=i.length;w<b;++_)for(let b=0;b<6;++b,++w){const b=i[w],S=d[b];n.push(b);for(let e=0;e<r;++e)s[e].addValue(b,o[e]);if(a?.addDepth(b,c),l&&(e?l.addColor(b,p):l.addColor(_,p)),u)u.addPoint(b,g);else{const e=x[b];y.push(e.x,e.y,0,1)}h&&(t?h.addVector(b,f):h.addVector(_,f)),m.push(S.x,S.y,S.z,1)}if(!h){const e=this.createNormals(d,i);for(const t of e)f.push(t.x,t.y,t.z)}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}}),Object.defineProperties(Kc,{typeName:{value:"ElevationGrid",enumerable:!0},componentName:{value:"Geometry3D",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_height",new Yn.MFFloat),new X(d.initializeOnly,"xDimension",new Yn.SFInt32),new X(d.initializeOnly,"zDimension",new Yn.SFInt32),new X(d.initializeOnly,"xSpacing",new Yn.SFFloat(1)),new X(d.initializeOnly,"zSpacing",new Yn.SFFloat(1)),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"creaseAngle",new Yn.SFFloat),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.initializeOnly,"height",new Yn.MFFloat)]),enumerable:!0}});const Zc=Kc;i.add("ElevationGrid","x_ite/Components/Geometry3D/ElevationGrid",Zc);const Qc=Zc;function ep(e){Ol.call(this,e),this.addType(d.Extrusion),this._creaseAngle.setUnit("angle"),this._crossSection.setUnit("length"),this._spine.setUnit("length")}Object.assign(Object.setPrototypeOf(ep.prototype,Ol.prototype),{initialize(){Ol.prototype.initialize.call(this),this._set_crossSection.addFieldInterest(this._crossSection),this._set_orientation.addFieldInterest(this._orientation),this._set_scale.addFieldInterest(this._scale),this._set_spine.addFieldInterest(this._spine)},getClosedOrientation(){const e=this._orientation;if(e.length){const t=e[0].getValue(),i=e[e.length-1].getValue();return t.equals(i)}return!0},createPoints:(()=>{const e=new bt(1,1,1);return function(){const t=this._crossSection,i=this._orientation,n=this._scale,s=this._spine,r=[],o=this.createRotations();for(let a=0,l=s.length;a<l;++a){const s=o[a];if(i.length&&s.rotate(i[Math.min(a,i.length-1)].getValue()),n.length){const t=n[Math.min(a,n.length-1)].getValue();s.scale(e.set(t.x,1,t.y))}for(let e=0,i=t.length;e<i;++e){const i=t[e].getValue();r.push(s.multVecMatrix(new bt(i.x,0,i.y)))}}return r}})(),createRotations:(()=>{const e=[],t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0),s=new bt(0,0,0),r=new bt(0,0,0),o=new bt(0,0,0),a=new ai;return function(){const l=this._spine,u=l.length,h=l[0].getValue(),d=l[l.length-1].getValue(),c=h.equals(d)&&this.getClosedOrientation();for(let t=e.length;t<u;++t)e[t]=new ci;if(e.length=u,t.set(0,0,0),i.set(0,0,0),n.set(0,0,0),c){const e=h;for(let t=1,n=u-2;t<n&&(i.assign(l[t].getValue()).subtract(e).normalize().subtract(o.assign(l[n].getValue()).subtract(e).normalize()).normalize(),i.equals(bt.Zero));++t);for(let e=0,t=u-2;e<t&&(n.assign(l[e+1].getValue()).subtract(l[e].getValue()).cross(o.assign(l[t].getValue()).subtract(l[e].getValue())).normalize(),n.equals(bt.Zero));++e);}else{for(let e=0,t=u-1;e<t&&(i.assign(l[e+1].getValue()).subtract(l[e].getValue()).normalize(),i.equals(bt.Zero));++e);for(let e=1,t=u-1;e<t&&(n.assign(l[e+1].getValue()).subtract(l[e].getValue()).cross(o.assign(l[e-1].getValue()).subtract(l[e].getValue())).normalize(),n.equals(bt.Zero));++e);}i.equals(bt.Zero)&&i.set(0,1,0),n.equals(bt.Zero)&&a.setFromToVec(bt.yAxis,i).multVecRot(n.assign(bt.zAxis)),t.assign(i).cross(n);const p=h;e[0].set(t.x,t.y,t.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,p.x,p.y,p.z,1),s.assign(i),r.assign(n);for(let a=1,h=u-1;a<h;++a){const u=l[a].getValue();i.assign(l[a+1].getValue()).subtract(u).normalize().subtract(o.assign(l[a-1].getValue()).subtract(u).normalize()).normalize(),n.assign(l[a+1].getValue()).subtract(u).cross(o.assign(l[a-1].getValue()).subtract(u)).normalize(),r.dot(n)<0&&n.negate(),i.equals(bt.Zero)?i.assign(s):s.assign(i),n.equals(bt.Zero)?n.assign(r):r.assign(n),t.assign(i).cross(n),e[a].set(t.x,t.y,t.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,u.x,u.y,u.z,1)}if(c)e[u-1].assign(e[0]);else{const a=d;i.assign(a).subtract(l[u-2].getValue()).normalize(),u>2&&n.assign(a).subtract(l[u-2].getValue()).cross(o.assign(l[u-3].getValue()).subtract(l[u-2].getValue())).normalize(),r.dot(n)<0&&n.negate(),i.equals(bt.Zero)&&i.assign(s),n.equals(bt.Zero)&&n.assign(r),t.assign(i).cross(n),e[u-1].set(t.x,t.y,t.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,a.x,a.y,a.z,1)}return e}})(),build:(()=>{const e=new ft(0,0,0),t=new ft(0,0,0),i=new ft(0,0,0);return function(){const n=!this._ccw.getValue(),s=this._crossSection,r=this._spine,o=r.length,a=this.getCoordIndices(),l=this.getTexCoords();if(o<2||s.length<2)return;this.getMultiTexCoords().push(l);const u=s.length;function h(e,t){return e*u+t}const d=r[0].getValue(),c=r[o-1].getValue(),p=d.equals(c)&&this.getClosedOrientation(),g=s[0].getValue(),f=s[s.length-1].getValue(),m=g.equals(f);e.assign(s[0].getValue()),t.assign(s[0].getValue());for(let i=1,n=s.length;i<n;++i)e.min(s[i].getValue()),t.max(s[i].getValue());const _=i.assign(t).subtract(e),x=Math.max(_.x,_.y),y=m?s.length-1:s.length,w=new Map,b=[],S=this.createPoints();for(let e=0,t=S.length;e<t;++e)w.set(e,[]);const T=this.getNormals(),v=this.getVertices(),O=s.length-1,E=o-1;let N=h(0,0),C=h(0,m?0:O);for(let e=0;e<E;++e)for(let t=0;t<O;++t){const i=p&&e===o-2?0:e+1,r=m&&t===s.length-2?0:t+1;let u=h(e,t),d=h(e,r),c=h(i,r),g=h(i,t),f=S[u],_=S[d],x=S[c],y=S[g],T=_.distance(x)>=1e-7,M=y.distance(f)>=1e-7;if(n)var F=ga.normal(x,_,f,new bt(0,0,0)),I=ga.normal(y,x,f,new bt(0,0,0));else F=ga.normal(f,_,x,new bt(0,0,0)),I=ga.normal(f,x,y,new bt(0,0,0));if(0==t&&(M?N=u:(u=N,f=S[u])),t==s.length-2&&(T?C=d:(c=C,x=S[c])),T){if(a.push(u,d,c),M)l.push(t/O,e/E,0,1);else{const i=(e/E+(e+1)/E)/2;l.push(t/O,i,0,1)}w.get(u).push(b.length),b.push(F),v.push(f.x,f.y,f.z,1),l.push((t+1)/O,e/E,0,1),w.get(d).push(b.length),b.push(F),v.push(_.x,_.y,_.z,1),l.push((t+1)/O,(e+1)/E,0,1),w.get(c).push(b.length),b.push(F),v.push(x.x,x.y,x.z,1)}if(M){if(a.push(u,c,g),l.push(t/O,e/E,0,1),w.get(u).push(b.length),b.push(I),v.push(f.x,f.y,f.z,1),T)l.push((t+1)/O,(e+1)/E,0,1);else{const i=((e+1)/E+e/E)/2;l.push((t+1)/O,i,0,1)}w.get(c).push(b.length),b.push(I),v.push(x.x,x.y,x.z,1),l.push(t/O,(e+1)/E,0,1),w.get(g).push(b.length),b.push(I),v.push(y.x,y.y,y.z,1)}}const M=this.refineNormals(w,b,this._creaseAngle.getValue());for(const e of M)T.push(e.x,e.y,e.z);if(x&&y>2){if(this._beginCap.getValue()){const t=0,i=this._convex.getValue(),r={},o=[],a=[];for(let n=0;n<y;++n){const a=h(t,y-1-n),l=S[a].copy();l.index=a,r[a]=s[y-1-n].getValue().copy().subtract(e).divide(x),o.push(i?a:l)}if(i?ga.triangulateConvexPolygon(o,a):ga.triangulatePolygon(o,a),a.length>=3){const e=ga.normal(S[a[0]],S[a[1]],S[a[2]],new bt(0,0,0));n&&e.negate(),this.addCap(l,r,e,S,a)}}if(this._endCap.getValue()){const t=o-1,i=this._convex.getValue(),r={},a=[],u=[];for(let n=0;n<y;++n){const o=h(t,n),l=S[o].copy();l.index=o,r[o]=s[n].getValue().copy().subtract(e).divide(x),a.push(i?o:l)}if(i?ga.triangulateConvexPolygon(a,u):ga.triangulatePolygon(a,u),u.length>=3){const e=ga.normal(S[u[0]],S[u[1]],S[u[2]],new bt(0,0,0));n&&e.negate(),this.addCap(l,r,e,S,u)}}}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}})(),addCap(e,t,i,n,s){const r=this.getCoordIndices(),o=this.getNormals(),a=this.getVertices();for(let l=0,u=s.length;l<u;l+=3){const u=s[l],h=s[l+1],d=s[l+2],c=n[u],p=n[h],g=n[d],f=t[u],m=t[h],_=t[d];r.push(u,h,d),e.push(f.x,f.y,0,1),e.push(m.x,m.y,0,1),e.push(_.x,_.y,0,1),o.push(i.x,i.y,i.z,i.x,i.y,i.z,i.x,i.y,i.z),a.push(c.x,c.y,c.z,1,p.x,p.y,p.z,1,g.x,g.y,g.z,1)}}}),Object.defineProperties(ep,{typeName:{value:"Extrusion",enumerable:!0},componentName:{value:"Geometry3D",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_crossSection",new Yn.MFVec2f),new X(d.inputOnly,"set_orientation",new Yn.MFRotation),new X(d.inputOnly,"set_scale",new Yn.MFVec2f),new X(d.inputOnly,"set_spine",new Yn.MFVec3f),new X(d.initializeOnly,"beginCap",new Yn.SFBool(!0)),new X(d.initializeOnly,"endCap",new Yn.SFBool(!0)),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"convex",new Yn.SFBool(!0)),new X(d.initializeOnly,"creaseAngle",new Yn.SFFloat),new X(d.initializeOnly,"crossSection",new Yn.MFVec2f(new ft(1,1),new ft(1,-1),new ft(-1,-1),new ft(-1,1),new ft(1,1))),new X(d.initializeOnly,"orientation",new Yn.MFRotation(new ai)),new X(d.initializeOnly,"scale",new Yn.MFVec2f(new ft(1,1))),new X(d.initializeOnly,"spine",new Yn.MFVec3f(new bt(0,0,0),new bt(0,1,0)))]),enumerable:!0}});const tp=ep;i.add("Extrusion","x_ite/Components/Geometry3D/Extrusion",tp);const ip=tp;function np(e){Ol.call(this,e),this.addType(d.X3DComposedGeometryNode),this.fogCoordNode=null,this.colorNode=null,this.texCoordNode=null,this.normalNode=null,this.coordNode=null}Object.assign(Object.setPrototypeOf(np.prototype,Ol.prototype),{initialize(){Ol.prototype.initialize.call(this),this._attrib.addInterest("set_attrib__",this),this._fogCoord.addInterest("set_fogCoord__",this),this._color.addInterest("set_color__",this),this._texCoord.addInterest("set_texCoord__",this),this._normal.addInterest("set_normal__",this),this._coord.addInterest("set_coord__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_texCoord__(),this.set_normal__(),this.set_coord__()},getFogCoord(){return this.fogCoordNode},getColor(){return this.colorNode},getTexCoord(){return this.texCoordNode},getNormal(){return this.normalNode},getCoord(){return this.coordNode},set_attrib__(){const e=this.getAttrib();for(const t of e)t.removeInterest("requestRebuild",this),t._attribute_changed.removeInterest("updateVertexArrays",this);e.length=0;for(const t of this._attrib){const i=ql(d.X3DVertexAttributeNode,t);i&&e.push(i)}for(const t of e)t.addInterest("requestRebuild",this),t._attribute_changed.addInterest("updateVertexArrays",this);this.updateVertexArrays()},set_fogCoord__(){this.fogCoordNode?.removeInterest("requestRebuild",this),this.fogCoordNode=ql(d.FogCoordinate,this._fogCoord),this.fogCoordNode?.addInterest("requestRebuild",this)},set_color__(){this.colorNode?.removeInterest("requestRebuild",this),this.colorNode=ql(d.X3DColorNode,this._color),this.colorNode?.addInterest("requestRebuild",this),this.setTransparent(this.colorNode?.isTransparent()??!1)},set_texCoord__(){this.texCoordNode?.removeInterest("requestRebuild",this),this.texCoordNode=ql(d.X3DTextureCoordinateNode,this._texCoord),this.texCoordNode?.addInterest("requestRebuild",this),this.setTextureCoordinate(this.texCoordNode)},set_normal__(){this.normalNode?.removeInterest("requestRebuild",this),this.normalNode=ql(d.X3DNormalNode,this._normal),this.normalNode?.addInterest("requestRebuild",this)},set_coord__(){this.coordNode?.removeInterest("requestRebuild",this),this.coordNode=ql(d.X3DCoordinateNode,this._coord),this.coordNode?.addInterest("requestRebuild",this)},getPolygonIndex:e=>e,getTriangleIndex:e=>e,build(e,t,i,n){if(!this.coordNode||this.coordNode.isEmpty())return;t-=t%e,n-=n%i;const s=this._colorPerVertex.getValue(),r=this._normalPerVertex.getValue(),o=this.getCoordIndices(),a=this.getAttrib(),l=a.length,u=this.getAttribs(),h=this.getFogCoord(),d=this.getColor(),c=this.getTexCoord(),p=this.getNormal(),g=this.getCoord(),f=this.getFogDepths(),m=this.getColors(),_=this.getMultiTexCoords(),x=this.getNormals(),y=this.getVertices();c?.init(_);for(let e=0;e<n;++e){const t=Math.floor(e/i),n=this.getPolygonIndex(this.getTriangleIndex(e));o.push(n);for(let e=0;e<l;++e)a[e].addValue(n,u[e]);h?.addDepth(n,f),d&&(s?d.addColor(n,m):d.addColor(t,m)),c?.addPoint(n,_),p&&(r?p.addVector(n,x):p.addVector(t,x)),g.addPoint(n,y)}this.getNormal()||this.buildNormals(e,t,n),this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())},buildNormals(e,t,i){const n=this.createNormals(e,t),s=this.getNormals();for(let e=0;e<i;++e){const t=n[this.getTriangleIndex(e)];s.push(t.x,t.y,t.z)}},createNormals(e,t){const i=this.createFaceNormals(e,t);if(!this._normalPerVertex.getValue())return i;const n=new Map;for(let e=0;e<t;++e){const t=this.getPolygonIndex(e);let i=n.get(t);i||n.set(t,i=[]),i.push(e)}return this.refineNormals(n,i,Math.PI)},createFaceNormals(e,t){const i=!this._ccw.getValue(),n=this.coordNode,s=[];for(let r=0;r<t;r+=e){const t=this.getPolygonNormal(r,e,n);i&&t.negate();for(let i=0;i<e;++i)s.push(t)}return s},getPolygonNormal:(()=>{let e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n,s){const r=new bt(0,0,0);s.get1Point(this.getPolygonIndex(i),t);for(let o=0;o<n;++o){const a=e;e=t,t=a,s.get1Point(this.getPolygonIndex(i+(o+1)%n),t),r.x+=(e.y-t.y)*(e.z+t.z),r.y+=(e.z-t.z)*(e.x+t.x),r.z+=(e.x-t.x)*(e.y+t.y)}return r.normalize()}})()}),Object.defineProperties(np,{typeName:{value:"X3DComposedGeometryNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const sp=np;i.add("X3DComposedGeometryNode","x_ite/Components/Rendering/X3DComposedGeometryNode",sp);const rp=sp;function op(e){rp.call(this,e),this.addType(d.IndexedFaceSet),this._creaseAngle.setUnit("angle")}Object.assign(Object.setPrototypeOf(op.prototype,rp.prototype),{initialize(){rp.prototype.initialize.call(this),this._set_colorIndex.addFieldInterest(this._colorIndex),this._set_texCoordIndex.addFieldInterest(this._texCoordIndex),this._set_normalIndex.addFieldInterest(this._normalIndex),this._set_coordIndex.addFieldInterest(this._coordIndex)},getTexCoordPerVertexIndex(e){return e<this._texCoordIndex.length?this._texCoordIndex[e]:this._coordIndex[e]},getColorPerVertexIndex(e){return e<this._colorIndex.length?this._colorIndex[e]:this._coordIndex[e]},getColorIndex(e){return e<this._colorIndex.length?this._colorIndex[e]:e},getNormalPerVertexIndex(e){return e<this._normalIndex.length?this._normalIndex[e]:this._coordIndex[e]},getNormalIndex(e){return e<this._normalIndex.length?this._normalIndex[e]:e},build(){const e=this.triangulate();if(0===e.length)return;const t=this._colorPerVertex.getValue(),i=this._normalPerVertex.getValue(),n=this._coordIndex.getValue(),s=this.getCoordIndices(),r=this.getAttrib(),o=r.length,a=this.getAttribs(),l=this.getFogCoord(),u=this.getColor(),h=this.getTexCoord(),d=this.getNormal(),c=this.getCoord(),p=this.getFogDepths(),g=this.getColors(),f=this.getMultiTexCoords(),m=this.getNormals(),_=this.getVertices();h?.init(f);for(const x of e){const{triangles:e,face:y}=x;for(const x of e){const e=n[x];s.push(e);for(let t=0;t<o;++t)r[t].addValue(e,a[t]);l?.addDepth(e,p),u&&(t?u.addColor(this.getColorPerVertexIndex(x),g):u.addColor(this.getColorIndex(y),g)),h?.addPoint(this.getTexCoordPerVertexIndex(x),f),d&&(i?d.addVector(this.getNormalPerVertexIndex(x),m):d.addVector(this.getNormalIndex(y),m)),c.addPoint(e,_)}}this.getNormal()||this.buildNormals(e),this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())},triangulate(){const e=this._convex.getValue(),t=this._coordIndex.length,i=[];if(!this.getCoord())return i;if(t&&this._coordIndex[t-1]>-1&&this._coordIndex.push(-1),t){const t=this._coordIndex.getValue(),n=this._coordIndex.length;for(let s=0,r=0,o=[];s<n;++s){if(t[s]>-1)o.push(s);else{switch(o.length){case 0:case 1:case 2:o.length=0;break;case 3:i.push({vertices:o,triangles:o,face:r}),o=[];break;default:{const t=[],n={vertices:o,triangles:t,face:r};e?ga.triangulateConvexPolygon(o,t):this.triangulatePolygon(o,t),t.length<3?o.length=0:(i.push(n),o=[]);break}}++r}}}return i},triangulatePolygon:(()=>{const e=[];return function(t,i){const n=this._coordIndex.getValue(),s=this.getCoord(),r=t.length;for(let t=e.length;t<r;++t)e.push(new bt(0,0,0));for(let i=0;i<r;++i){const r=t[i],o=e[i];o.index=r,s.get1Point(n[r],o)}e.length=r,ga.triangulatePolygon(e,i)}})(),buildNormals(e){const t=this.createNormals(e),i=this.getNormals();for(const n of e)for(const e of n.triangles){const n=t[e];i.push(n.x,n.y,n.z)}},createNormals(e){const t=!this._ccw.getValue(),i=this._coordIndex.getValue(),n=this.getCoord(),s=new Map,r=[];for(const a of e){const e=a.vertices;switch(e.length){case 3:var o=n.getNormal(i[e[0]],i[e[1]],i[e[2]]);break;case 4:o=n.getQuadNormal(i[e[0]],i[e[1]],i[e[2]],i[e[3]]);break;default:o=this.getPolygonNormal(e,i,n)}for(const t of e){const e=i[t];let n=s.get(e);n||s.set(e,n=[]),n.push(t),r[t]=o}t&&o.negate()}return this._normalPerVertex.getValue()?this.refineNormals(s,r,this._creaseAngle.getValue()):r},getPolygonNormal:(()=>{let e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n,s){const r=new bt(0,0,0);s.get1Point(n[i[0]],t);for(let o=0,a=i.length;o<a;++o){const l=e;e=t,t=l,s.get1Point(n[i[(o+1)%a]],t),r.x+=(e.y-t.y)*(e.z+t.z),r.y+=(e.z-t.z)*(e.x+t.x),r.z+=(e.x-t.x)*(e.y+t.y)}return r.normalize()}})()}),Object.defineProperties(op,{typeName:{value:"IndexedFaceSet",enumerable:!0},componentName:{value:"Geometry3D",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_colorIndex",new Yn.MFInt32),new X(d.inputOnly,"set_texCoordIndex",new Yn.MFInt32),new X(d.inputOnly,"set_normalIndex",new Yn.MFInt32),new X(d.inputOnly,"set_coordIndex",new Yn.MFInt32),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"convex",new Yn.SFBool(!0)),new X(d.initializeOnly,"creaseAngle",new Yn.SFFloat),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorIndex",new Yn.MFInt32),new X(d.initializeOnly,"texCoordIndex",new Yn.MFInt32),new X(d.initializeOnly,"normalIndex",new Yn.MFInt32),new X(d.initializeOnly,"coordIndex",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const ap=op;i.add("IndexedFaceSet","x_ite/Components/Geometry3D/IndexedFaceSet",ap);const lp=ap;function up(e){Ol.call(this,e),this.addType(d.Sphere),this._radius.setUnit("length")}Object.assign(Object.setPrototypeOf(up.prototype,Ol.prototype),{set_live__(){Ol.prototype.set_live__.call(this),this.getLive().getValue()?this.getBrowser().getSphereOptions().addInterest("requestRebuild",this):this.getBrowser().getSphereOptions().removeInterest("requestRebuild",this)},build(){const e=this.getBrowser().getSphereOptions().getGeometry(),t=Math.abs(this._radius.getValue());if(this.setMultiTexCoords(e.getMultiTexCoords()),this.setNormals(e.getNormals()),1===t)this.setVertices(e.getVertices()),this.getMin().assign(e.getMin()),this.getMax().assign(e.getMax());else{const i=e.getVertices().getValue(),n=this.getVertices();for(let e=0,s=i.length;e<s;e+=4)n.push(t*i[e],t*i[e+1],t*i[e+2],1);this.getMin().set(-t,-t,-t),this.getMax().set(t,t,t)}this.setSolid(this._solid.getValue())}}),Object.defineProperties(up,{typeName:{value:"Sphere",enumerable:!0},componentName:{value:"Geometry3D",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"radius",new Yn.SFFloat(1)),new X(d.initializeOnly,"solid",new Yn.SFBool(!0))]),enumerable:!0}});const hp=up;i.add("Sphere","x_ite/Components/Geometry3D/Sphere",hp);const dp={name:"Geometry3D",concreteNodes:[Gc,Yc,Jc,Qc,ip,lp,hp],abstractNodes:[]};i.add("Geometry3D","x_ite/Components/Geometry3D",dp);const cp=dp,pp=Symbol(),gp=Symbol(),fp=Symbol(),mp=Symbol(),_p=Symbol();function xp(e){Hs.call(this,e),ju.call(this,e),this.addType(d.StaticGroup),this.groupNode=new $u(this.getExecutionContext()),this.bbox=new Ua,this.shadowBBox=new Ua}Object.assign(Object.setPrototypeOf(xp.prototype,Hs.prototype),ju.prototype,{initialize(){Hs.prototype.initialize.call(this),ju.prototype.initialize.call(this),this._bboxSize.addFieldInterest(this.groupNode._bboxSize),this._bboxCenter.addFieldInterest(this.groupNode._bboxCenter),this._children.addFieldInterest(this.groupNode._children),this.groupNode._bboxSize=this._bboxSize,this.groupNode._bboxCenter=this._bboxCenter,this.groupNode._children=this._children,this.groupNode.setPrivate(!0),this.groupNode.setup(),this.groupNode._isCameraObject.addFieldInterest(this._isCameraObject),this.groupNode._isPickableObject.addFieldInterest(this._isPickableObject),this.groupNode._children.addInterest("set_children__",this),this.setCameraObject(this.groupNode.isCameraObject()),this.setPickableObject(this.groupNode.isPickableObject()),this.set_children__()},getBBox(e,t){return e.assign(t?this.shadowBBox:this.bbox)},set_children__(){this.groupNode.getBBox(this.bbox),this.groupNode.getBBox(this.shadowBBox,!0),this[pp]=null,this[gp]=null,this[fp]=null,this[mp]=null,this[_p]=null},traverse(e,t){switch(e){case Ia.CAMERA:return;case Ia.POINTER:return void this.traverseObjects(pp,"Pointing",e,t);case Ia.COLLISION:return void this.traverseObjects(gp,"Collision",e,t);case Ia.SHADOW:return void this.traverseObjects(fp,"Shadow",e,t);case Ia.DISPLAY:return this.traverseObjects(mp,"Opaque",e,t),void this.traverseObjects(_p,"Transparent",e,t)}},traverseObjects:(()=>{const e=new va;return e.intersectsSphere=function(){return!0},function(t,i,n,s){if(!this[t]){const r=s.getViewVolumes(),o=s.getViewport(),a=s.getProjectionMatrix(),l=s.getModelViewMatrix(),u=s[`getNum${i}Shapes`]();r.push(e.set(a,o,o)),l.push(),l.identity(),this.groupNode.traverse(n,s),l.pop(),r.pop();const h=s[`getNum${i}Shapes`]();this[t]=s[`get${i}Shapes`]().splice(u,h-u),s[`setNum${i}Shapes`](u)}const r=s.getModelViewMatrix();for(const{modelViewMatrix:e,shapeNode:i}of this[t])r.push(),r.multLeft(e),i.traverse(n,s),r.pop()}})(),dispose(){ju.prototype.dispose.call(this),Hs.prototype.dispose.call(this)}}),Object.defineProperties(xp,{typeName:{value:"StaticGroup",enumerable:!0},componentName:{value:"Grouping",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.initializeOnly,"children",new Yn.MFNode)]),enumerable:!0}});const yp=xp;i.add("StaticGroup","x_ite/Components/Grouping/StaticGroup",yp);const wp=yp;function bp(e){qu.call(this,e),this.addType(d.Switch),2==e.getSpecificationVersion()&&this.addAlias("choice",this._children),this.childNode=null,this.visibleNode=null,this.boundedObject=null}Object.assign(Object.setPrototypeOf(bp.prototype,qu.prototype),{initialize(){qu.prototype.initialize.call(this),this._whichChoice.addInterest("set_child__",this),this._children.addInterest("set_child__",this),this.set_child__()},getSubBBox(e,t){if(this._bboxSize.getValue().equals(this.getDefaultBBoxSize())){const i=ql(d.X3DBoundedObject,this.visibleNode);return i?.getBBox(e,t)??e.set()}return e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},clear(){},add(){},remove(){},set_child__(){this.childNode&&(this.childNode._isCameraObject.removeInterest("set_cameraObject__",this),this.childNode._isPickableObject.removeInterest("set_transformSensors__",this)),ql(d.X3DBoundedObject,this.childNode)&&(this.childNode._display.removeInterest("set_display__",this),this.childNode._bboxDisplay.removeInterest("set_bboxDisplay__",this));const e=this._whichChoice.getValue();e>=0&&e<this._children.length?(this.childNode=ql(d.X3DChildNode,this._children[e]),this.childNode&&(this.childNode._isCameraObject.addInterest("set_cameraObject__",this),this.childNode._isPickableObject.addInterest("set_transformSensors__",this),ql(d.X3DBoundedObject,this.childNode)&&(this.childNode._display.addInterest("set_display__",this),this.childNode._bboxDisplay.addInterest("set_bboxDisplay__",this)),delete this.traverse)):(this.childNode=null,this.traverse=Function.prototype),this.set_display__(),this.set_bboxDisplay__()},set_cameraObject__(){this.setCameraObject(!!this.visibleNode?.isCameraObject())},set_transformSensors__(){this.setPickableObject(!(!this.getTransformSensors().size&&!this.visibleNode?.isPickableObject()))},set_display__(){ql(d.X3DBoundedObject,this.childNode)?this.visibleNode=this.childNode._display.getValue()?this.childNode:null:this.visibleNode=this.childNode,this.set_cameraObject__(),this.set_transformSensors__()},set_bboxDisplay__(){ql(d.X3DBoundedObject,this.childNode)?this.boundedObject=this.childNode._bboxDisplay.getValue()?this.childNode:null:this.boundedObject=null},traverse(e,t){switch(e){case Ia.POINTER:case Ia.CAMERA:case Ia.SHADOW:return void this.visibleNode?.traverse(e,t);case Ia.PICKING:{if(this.getTransformSensors().size){const e=t.getModelViewMatrix().get();for(const t of this.getTransformSensors())t.collect(e)}const i=this.visibleNode;if(i){const n=this.getBrowser().getPickingHierarchy();n.push(this),i.traverse(e,t),n.pop()}return}case Ia.COLLISION:return void this.visibleNode?.traverse(e,t);case Ia.DISPLAY:return this.visibleNode?.traverse(e,t),void this.boundedObject?.displayBBox(e,t)}}}),Object.defineProperties(bp,{typeName:{value:"Switch",enumerable:!0},componentName:{value:"Grouping",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"whichChoice",new Yn.SFInt32(-1)),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Sp=bp;i.add("Switch","x_ite/Components/Grouping/Switch",Sp);const Tp=Sp;function vp(e){qu.call(this,e),this.addType(d.X3DTransformMatrix3DNode),this.matrix=new ci}Object.assign(Object.setPrototypeOf(vp.prototype,qu.prototype),{setMatrix(e){e.equals(ci.Identity)?(this.matrix.identity(),this.getBBox=this.getSubBBox,this.traverse=this.groupTraverse):(this.matrix.assign(e),delete this.getBBox,delete this.traverse)},getMatrix(){return this.matrix},setTransform(e,t,i,n,s){e.equals(bt.Zero)&&t.equals(ai.Identity)&&i.equals(bt.One)?(this.matrix.identity(),this.getBBox=this.getSubBBox,this.traverse=this.groupTraverse):(this.matrix.set(e,t,i,n,s),delete this.getBBox,delete this.traverse)},getBBox(e,t){return this.getSubBBox(e,t).multRight(this.matrix)},traverse(e,t){const i=t.getModelViewMatrix();i.push(),i.multLeft(this.matrix),qu.prototype.traverse.call(this,e,t),i.pop()},groupTraverse:qu.prototype.traverse}),Object.defineProperties(vp,{typeName:{value:"X3DTransformMatrix3DNode",enumerable:!0},componentName:{value:"Grouping",enumerable:!0}});const Op=vp;i.add("X3DTransformMatrix3DNode","x_ite/Components/Grouping/X3DTransformMatrix3DNode",Op);const Ep=Op;function Np(e){Ep.call(this,e),this.addType(d.X3DTransformNode),this._translation.setUnit("length"),this._center.setUnit("length")}Object.assign(Object.setPrototypeOf(Np.prototype,Ep.prototype),{initialize(){Ep.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed(){this.setTransform(this._translation.getValue(),this._rotation.getValue(),this._scale.getValue(),this._scaleOrientation.getValue(),this._center.getValue())}}),Object.defineProperties(Np,{typeName:{value:"X3DTransformNode",enumerable:!0},componentName:{value:"Grouping",enumerable:!0}});const Cp=Np;i.add("X3DTransformNode","x_ite/Components/Grouping/X3DTransformNode",Cp);const Fp=Cp;function Ip(e){Fp.call(this,e),this.addType(d.Transform)}Object.setPrototypeOf(Ip.prototype,Fp.prototype),Object.defineProperties(Ip,{typeName:{value:"Transform",enumerable:!0},componentName:{value:"Grouping",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"translation",new Yn.SFVec3f),new X(d.inputOutput,"rotation",new Yn.SFRotation),new X(d.inputOutput,"scale",new Yn.SFVec3f(1,1,1)),new X(d.inputOutput,"scaleOrientation",new Yn.SFRotation),new X(d.inputOutput,"center",new Yn.SFVec3f),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Mp=Ip;i.add("Transform","x_ite/Components/Grouping/Transform",Mp);const Dp={name:"Grouping",concreteNodes:[$u,wp,Tp,Mp],abstractNodes:[ju,qu,Ep,Fp]};i.add("Grouping","x_ite/Components/Grouping",Dp);const Pp=Dp;function Rp(e){bu.call(this,e),this.addType(d.ColorInterpolator),this.hsv=[]}Object.assign(Object.setPrototypeOf(Rp.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this)},set_keyValue__(){const e=this._keyValue;e.length<this._key.length&&this._keyValue.resize(this._key.length,e.length?e[this._keyValue.length-1]:new Yn.SFColor),this.hsv.length=0;for(const t of e)this.hsv.push(t.getHSV())},interpolate:(()=>{const e=[];return function(t,i,n){Ce.lerp(this.hsv[t],this.hsv[i],n,e),this._value_changed.setHSV(e[0],e[1],e[2])}})()}),Object.defineProperties(Rp,{typeName:{value:"ColorInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFColor),new X(d.outputOnly,"value_changed",new Yn.SFColor)]),enumerable:!0}});const Ap=Rp;i.add("ColorInterpolator","x_ite/Components/Interpolation/ColorInterpolator",Ap);const Vp=Ap;function Lp(e){bu.call(this,e),this.addType(d.CoordinateInterpolator)}Object.assign(Object.setPrototypeOf(Lp.prototype,bu.prototype),{set_keyValue__(){},interpolate(e,t,i){const n=this._keyValue.getValue();let s=this._key.length?Math.floor(this._keyValue.length/this._key.length):0;this._value_changed.length=s;const r=this._value_changed.getValue();t=(e*=s)+(this._key.length>1?s:0),e*=3,t*=3,s*=3;for(let o=0;o<s;o+=3){const s=o+1,a=o+2;r[o]=g.lerp(n[e+o],n[t+o],i),r[s]=g.lerp(n[e+s],n[t+s],i),r[a]=g.lerp(n[e+a],n[t+a],i)}this._value_changed.addEvent()}}),Object.defineProperties(Lp,{typeName:{value:"CoordinateInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFVec3f),new X(d.outputOnly,"value_changed",new Yn.MFVec3f)]),enumerable:!0}});const Bp=Lp;i.add("CoordinateInterpolator","x_ite/Components/Interpolation/CoordinateInterpolator",Bp);const Up=Bp;function Xp(e){bu.call(this,e),this.addType(d.CoordinateInterpolator2D)}Object.assign(Object.setPrototypeOf(Xp.prototype,bu.prototype),{set_keyValue__(){},interpolate(e,t,i){const n=this._keyValue.getValue();let s=this._key.length?Math.floor(this._keyValue.length/this._key.length):0;this._value_changed.length=s;const r=this._value_changed.getValue();t=(e*=s)+(this._key.length>1?s:0),e*=2,t*=2,s*=2;for(let o=0;o<s;o+=2){const s=o+1;r[o]=g.lerp(n[e+o],n[t+o],i),r[s]=g.lerp(n[e+s],n[t+s],i)}this._value_changed.addEvent()}}),Object.defineProperties(Xp,{typeName:{value:"CoordinateInterpolator2D",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFVec2f),new X(d.outputOnly,"value_changed",new Yn.MFVec2f)]),enumerable:!0}});const kp=Xp;i.add("CoordinateInterpolator2D","x_ite/Components/Interpolation/CoordinateInterpolator2D",kp);const jp=kp;function zp(e){bu.call(this,e),this.addType(d.NormalInterpolator)}Object.assign(Object.setPrototypeOf(zp.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this)},set_keyValue__(){},interpolate:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n,s){const r=this._keyValue.getValue();let o=this._key.length>1?Math.floor(this._keyValue.length/this._key.length):0;this._value_changed.length=o;const a=this._value_changed.getValue();n=(i*=o)+o,i*=3,n*=3,o*=3;for(let l=0;l<o;l+=3)try{const o=l+1,u=l+2;e.set(r[i+l],r[i+o],r[i+u]),t.set(r[n+l],r[n+o],r[n+u]);const h=g.simpleSlerp(e,t,s);a[l]=h[0],a[o]=h[1],a[u]=h[2]}catch(e){}this._value_changed.addEvent()}})()}),Object.defineProperties(zp,{typeName:{value:"NormalInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFVec3f),new X(d.outputOnly,"value_changed",new Yn.MFVec3f)]),enumerable:!0}});const Gp=zp;i.add("NormalInterpolator","x_ite/Components/Interpolation/NormalInterpolator",Gp);const Hp=Gp;function qp(e){bu.call(this,e),this.addType(d.PositionInterpolator2D)}Object.assign(Object.setPrototypeOf(qp.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:new Yn.SFVec2f)},interpolate:(()=>{const e=new ft(0,0);return function(t,i,n){this._value_changed=e.assign(this._keyValue[t].getValue()).lerp(this._keyValue[i].getValue(),n)}})()}),Object.defineProperties(qp,{typeName:{value:"PositionInterpolator2D",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFVec2f),new X(d.outputOnly,"value_changed",new Yn.SFVec2f)]),enumerable:!0}});const Yp=qp;i.add("PositionInterpolator2D","x_ite/Components/Interpolation/PositionInterpolator2D",Yp);const Wp=Yp;function $p(){this.T0=[],this.T1=[]}Object.assign($p.prototype,{generate:(()=>{const e=[],t=[],i=[];return function(n,s,r,o,a){const l=this.T0,u=this.T1;if(l.length=0,u.length=0,e.length=0,t.length=0,i.length=0,s.length>1){if(0===o.length){n?e.push(this.divide(this.subtract(r[1],r[r.length-2]),2)):e.push(this.create());for(let t=1,i=r.length-1;t<i;++t)e.push(this.divide(this.subtract(r[t+1],r[t-1]),2));e.push(this.copy(e[0]))}else{for(let t=0,i=o.length;t<i;++t)e.push(this.copy(o[t]));if(a){let t=0;for(let e=0,i=r.length-1;e<i;++e)t+=this.magnitude(this.subtract(r[e],r[e+1]));for(let i=0,n=e.length-1;i<n;++i){const n=this.magnitude(e[i]);n&&(e[i]=this.multiply(e[i],t/n))}}}if(n){const e=s.length-1,n=s.length-2,r=s[1]-s[0]+s[e]-s[n];i.push(2*(s[1]-s[0])/r),t.push(2*(s[e]-s[n])/r)}else i.push(1),t.push(1);for(let e=1,n=s.length-1;e<n;++e){const n=s[e+1]-s[e-1];i.push(2*(s[e+1]-s[e])/n),t.push(2*(s[e]-s[e-1])/n)}i.push(i[0]),t.push(t[0]);for(let n=0,s=e.length;n<s;++n)l.push(this.multiply(e[n],t[n])),u.push(this.multiply(e[n],i[n]))}else l.push(this.create()),u.push(this.create())}})(),interpolate:(()=>{const e=new jt(0,0,0,0),t=new ci(2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0);return function(i,n,s,r){return e.set(s**3,s**2,s,1),this.dot(t.multVecMatrix(e),r[i],r[n],this.T0[i],this.T1[n])}})()});const Jp=$p;i.add("CatmullRomSplineInterpolator","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator",Jp);const Kp=Jp;const Zp=function(e){function t(){this.T0=[],this.T1=[]}return Object.assign(Object.setPrototypeOf(t.prototype,Kp.prototype),{create:()=>e.Zero.copy(),copy:e=>e.copy(),subtract:(e,t)=>e.copy().subtract(t),multiply:(e,t)=>e.copy().multiply(t),divide:(e,t)=>e.copy().divide(t),magnitude:e=>e.magnitude(),dot:(()=>{const t=new e(0,0,0,0),i=new e(0,0,0,0),n=new e(0,0,0,0),s=new e(0,0,0,0);return function(e,r,o,a,l){return t.assign(r).multiply(e[0]),i.assign(o).multiply(e[1]),n.assign(a).multiply(e[2]),s.assign(l).multiply(e[3]),t.add(i).add(n).add(s)}})()}),t};i.add("CatmullRomSplineInterpolatorTemplate","x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate",Zp);const Qp=Zp,eg=Qp(bt);i.add("CatmullRomSplineInterpolator3","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3",eg);const tg=eg;function ig(e){bu.call(this,e),this.addType(d.SplinePositionInterpolator),this.spline=new tg}Object.assign(Object.setPrototypeOf(ig.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this),this._keyVelocity.addInterest("set_keyVelocity__",this),this._normalizeVelocity.addInterest("set_normalizeVelocity__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:new Yn.SFVec3f),this.set_keyVelocity__()},set_keyVelocity__(){this._keyVelocity.length&&this._keyVelocity.length<this._key.length&&this._keyVelocity.resize(this._key.length,new Yn.SFVec3f),this.set_normalizeVelocity__()},set_normalizeVelocity__(){this.spline.generate(this._closed.getValue(),this._key,this._keyValue,this._keyVelocity,this._normalizeVelocity.getValue())},interpolate(e,t,i){this._value_changed=this.spline.interpolate(e,t,i,this._keyValue)}}),Object.defineProperties(ig,{typeName:{value:"SplinePositionInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"closed",new Yn.SFBool),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFVec3f),new X(d.inputOutput,"keyVelocity",new Yn.MFVec3f),new X(d.inputOutput,"normalizeVelocity",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFVec3f)]),enumerable:!0}});const ng=ig;i.add("SplinePositionInterpolator","x_ite/Components/Interpolation/SplinePositionInterpolator",ng);const sg=ng,rg=Qp(ft);i.add("CatmullRomSplineInterpolator2","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2",rg);const og=rg;function ag(e){bu.call(this,e),this.addType(d.SplinePositionInterpolator2D),this.spline=new og}Object.assign(Object.setPrototypeOf(ag.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this),this._keyVelocity.addInterest("set_keyVelocity__",this),this._normalizeVelocity.addInterest("set_normalizeVelocity__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:new Yn.SFVec2f),this.set_keyVelocity__()},set_keyVelocity__(){this._keyVelocity.length&&this._keyVelocity.length<this._key.length&&this._keyVelocity.resize(this._key.length,new Yn.SFVec2f),this.set_normalizeVelocity__()},set_normalizeVelocity__(){this.spline.generate(this._closed.getValue(),this._key,this._keyValue,this._keyVelocity,this._normalizeVelocity.getValue())},interpolate(e,t,i){this._value_changed=this.spline.interpolate(e,t,i,this._keyValue)}}),Object.defineProperties(ag,{typeName:{value:"SplinePositionInterpolator2D",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"closed",new Yn.SFBool),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFVec2f),new X(d.inputOutput,"keyVelocity",new Yn.MFVec2f),new X(d.inputOutput,"normalizeVelocity",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFVec2f)]),enumerable:!0}});const lg=ag;i.add("SplinePositionInterpolator2D","x_ite/Components/Interpolation/SplinePositionInterpolator2D",lg);const ug=lg;function hg(){Kp.call(this)}Object.assign(Object.setPrototypeOf(hg.prototype,Kp.prototype),{create:()=>0,copy:e=>e,subtract:(e,t)=>e-t,multiply:(e,t)=>e*t,divide:(e,t)=>e/t,magnitude:e=>Math.abs(e),dot:(e,t,i,n,s)=>t*e[0]+i*e[1]+n*e[2]+s*e[3]});const dg=hg;i.add("CatmullRomSplineInterpolator1","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1",dg);const cg=dg;function pg(e){bu.call(this,e),this.addType(d.SplineScalarInterpolator),this.spline=new cg}Object.assign(Object.setPrototypeOf(pg.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this),this._keyVelocity.addInterest("set_keyVelocity__",this),this._normalizeVelocity.addInterest("set_normalizeVelocity__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:new Yn.SFFloat),this.set_keyVelocity__()},set_keyVelocity__(){this._keyVelocity.length&&this._keyVelocity.length<this._key.length&&this._keyVelocity.resize(this._key.length,new Yn.SFFloat),this.set_normalizeVelocity__()},set_normalizeVelocity__(){this.spline.generate(this._closed.getValue(),this._key,this._keyValue,this._keyVelocity,this._normalizeVelocity.getValue())},interpolate(e,t,i){this._value_changed=this.spline.interpolate(e,t,i,this._keyValue)}}),Object.defineProperties(pg,{typeName:{value:"SplineScalarInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"closed",new Yn.SFBool),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFFloat),new X(d.inputOutput,"keyVelocity",new Yn.MFFloat),new X(d.inputOutput,"normalizeVelocity",new Yn.SFBool),new X(d.outputOnly,"value_changed",new Yn.SFFloat)]),enumerable:!0}});const gg=pg;i.add("SplineScalarInterpolator","x_ite/Components/Interpolation/SplineScalarInterpolator",gg);const fg=gg;function mg(){this.s=[]}Object.assign(mg.prototype,{generate(e,t,i){const n=this.s;if(n.length=0,t.length>1){e?n.push(ai.spline(i[t.length-2].getValue(),i[0].getValue(),i[1].getValue())):n.push(i[0].getValue());for(let e=1,s=t.length-1;e<s;++e)n.push(ai.spline(i[e-1].getValue(),i[e].getValue(),i[e+1].getValue()));e?n.push(ai.spline(i[t.length-2].getValue(),i[t.length-1].getValue(),i[1].getValue())):n.push(i[t.length-1].getValue())}else t.length>0&&n.push(i[0].getValue().copy())},interpolate:(()=>{const e=new ai;return function(t,i,n,s){return e.assign(s[t].getValue()).squad(this.s[t],this.s[i],s[i].getValue(),n)}})()});const _g=mg;i.add("SquatInterpolator","x_ite/Browser/Interpolation/SquatInterpolator",_g);const xg=_g;function yg(e){bu.call(this,e),this.addType(d.SquadOrientationInterpolator),this._keyValue.setUnit("angle"),this._value_changed.setUnit("angle"),this.squad=new xg}Object.assign(Object.setPrototypeOf(yg.prototype,bu.prototype),{initialize(){bu.prototype.initialize.call(this),this._keyValue.addInterest("set_keyValue__",this)},set_keyValue__(){const e=this._key,t=this._keyValue;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:new Yn.SFRotation),this.squad.generate(this._closed.getValue(),this._key,this._keyValue)},interpolate(e,t,i){try{this._value_changed=this.squad.interpolate(e,t,i,this._keyValue)}catch(e){console.error(e)}}}),Object.defineProperties(yg,{typeName:{value:"SquadOrientationInterpolator",enumerable:!0},componentName:{value:"Interpolation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_fraction",new Yn.SFFloat),new X(d.inputOutput,"closed",new Yn.SFBool),new X(d.inputOutput,"key",new Yn.MFFloat),new X(d.inputOutput,"keyValue",new Yn.MFRotation),new X(d.outputOnly,"value_changed",new Yn.SFRotation)]),enumerable:!0}});const wg=yg;i.add("SquadOrientationInterpolator","x_ite/Components/Interpolation/SquadOrientationInterpolator",wg);const bg={name:"Interpolation",concreteNodes:[Vp,Up,jp,vu,Hp,Iu,Nu,Wp,Pu,sg,ug,fg,wg],abstractNodes:[bu]};i.add("Interpolation","x_ite/Components/Interpolation",bg);const Sg=bg;function Tg(e){qu.call(this,e),this.addType(d.X3DViewportNode)}Object.setPrototypeOf(Tg.prototype,qu.prototype),Object.defineProperties(Tg,{typeName:{value:"X3DViewportNode",enumerable:!0},componentName:{value:"Layering",enumerable:!0}});const vg=Tg;i.add("X3DViewportNode","x_ite/Components/Layering/X3DViewportNode",vg);const Og=vg,Eg=al(va);function Ng(e){Og.call(this,e),this.addType(d.Viewport),this.rectangle=new jt(0,0,0,0)}Object.assign(Object.setPrototypeOf(Ng.prototype,Og.prototype),{getRectangle(){const e=this.getBrowser().getViewport(),t=Math.floor(e[2]*this.getLeft()),i=Math.floor(e[2]*this.getRight()),n=Math.floor(e[3]*this.getBottom()),s=Math.floor(e[3]*this.getTop());return this.rectangle.set(t,n,Math.max(0,i-t),Math.max(0,s-n)),this.rectangle},getLeft(){return this._clipBoundary.length>0?this._clipBoundary[0]:0},getRight(){return this._clipBoundary.length>1?this._clipBoundary[1]:1},getBottom(){return this._clipBoundary.length>2?this._clipBoundary[2]:0},getTop(){return this._clipBoundary.length>3?this._clipBoundary[3]:1},traverse(e,t){if(this.push(t),e===Ia.POINTER)this.getBrowser().isPointerInRectangle(this.rectangle)&&Og.prototype.traverse.call(this,e,t);else Og.prototype.traverse.call(this,e,t);this.pop(t)},push(e){const t=e.getViewVolumes(),i=this.getRectangle(),n=t.length?t.at(-1).getViewport():i,s=Eg.pop();s.set(e.getProjectionMatrix().get(),n,i),t.push(s)},pop(e){Eg.push(e.getViewVolumes().pop())}}),Object.defineProperties(Ng,{typeName:{value:"Viewport",enumerable:!0},componentName:{value:"Layering",enumerable:!0},containerField:{value:"viewport",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"clipBoundary",new Yn.MFFloat(0,1,0,1)),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Cg=Ng;i.add("Viewport","x_ite/Components/Layering/Viewport",Cg);const Fg=Cg,Ig={name:"Layering",concreteNodes:[Zu,th,Fg],abstractNodes:[uu,Og]};i.add("Layering","x_ite/Components/Layering",Ig);const Mg=Ig;function Dg(e){Hs.call(this,e),this.addType(d.X3DLightNode)}Object.assign(Object.setPrototypeOf(Dg.prototype,Hs.prototype),{initialize(){Hs.prototype.initialize.call(this),this._on.addInterest("set_on__",this),this._intensity.addInterest("set_on__",this),this.set_on__()},set_on__(){this._on.getValue()&&this.getIntensity()>0?(delete this.push,delete this.pop):(this.push=Function.prototype,this.pop=Function.prototype)},getGlobal(){return this._global.getValue()},getColor(){return this._color.getValue()},getIntensity(){return Math.max(this._intensity.getValue(),0)},getAmbientIntensity(){return g.clamp(this._ambientIntensity.getValue(),0,1)},getDirection(){return this._direction.getValue()},getShadows(){return this._shadows.getValue()},getShadowColor(){return this._shadowColor.getValue()},getShadowIntensity(){return this.getShadows()?g.clamp(this._shadowIntensity.getValue(),0,1):0},getShadowBias(){return g.clamp(this._shadowBias.getValue(),0,1)},getShadowMapSize(){return Math.min(this._shadowMapSize.getValue(),this.getBrowser().getMaxTextureSize())},getBiasMatrix:(()=>{const e=new ci(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1);return function(){return e}})(),push(e,t){if(e.isIndependent()){const i=this.getLights().pop();this._global.getValue()?(i.set(this,e.getLayer().getGroup(),e.getModelViewMatrix().get()),e.getGlobalObjects().push(i),e.getLights().push(i),e.pushGlobalShadows(!!this.getShadowIntensity())):(i.set(this,t,e.getModelViewMatrix().get()),e.getLocalObjects().push(i),e.getLights().push(i),e.pushLocalShadows(!!this.getShadowIntensity()),++e.getLocalObjectsCount()[1])}else{const t=e.getLightContainer();t.modelViewMatrix.pushMatrix(e.getModelViewMatrix().get()),this._global.getValue()?(e.getGlobalObjects().push(t),e.getLights().push(t),e.pushGlobalShadows(!!this.getShadowIntensity())):(e.getLocalObjects().push(t),e.getLights().push(t),e.pushLocalShadows(!!this.getShadowIntensity()),++e.getLocalObjectsCount()[1])}},pop(e){if(this._global.getValue())return;const t=e.getLocalObjects().pop();e.isIndependent()&&this.getBrowser().getLocalObjects().push(t),e.popLocalShadows(),--e.getLocalObjectsCount()[1]}}),Object.defineProperties(Dg,{typeName:{value:"X3DLightNode",enumerable:!0},componentName:{value:"Lighting",enumerable:!0}});const Pg=Dg;i.add("X3DLightNode","x_ite/Components/Lighting/X3DLightNode",Pg);const Rg=Pg,Ag=al(Vg);function Vg(){this.direction=new bt(0,0,0),this.shadowBuffer=null,this.bbox=new Ua,this.viewVolume=new va,this.viewport=new jt(0,0,0,0),this.projectionMatrix=new ci,this.modelViewMatrix=new Ho(ci),this.modelMatrix=new ci,this.invLightSpaceMatrix=new ci,this.invLightSpaceProjectionMatrix=new ci,this.shadowMatrix=new ci,this.shadowMatrixArray=new Float32Array(16),this.rotation=new ai,this.textureUnit=void 0}function Lg(e){Rg.call(this,e),this.addType(d.DirectionalLight),2==e.getSpecificationVersion()&&(this._global=!0)}Object.assign(Vg.prototype,{set(e,t,i){const n=e.getShadowMapSize();this.browser=e.getBrowser(),this.lightNode=e,this.groupNode=t,this.global=e.getGlobal(),this.modelViewMatrix.pushMatrix(i),e.getShadowIntensity()>0&&n>0&&(this.shadowBuffer=this.browser.popShadowBuffer(n),this.shadowBuffer||console.warn("Couldn't create shadow buffer."))},renderShadowMap(e){if(!this.shadowBuffer)return;const t=this.lightNode,i=e.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),s=this.invLightSpaceMatrix.assign(this.global?n:ci.Identity);s.rotate(this.rotation.setFromToVec(bt.zAxis,this.direction.assign(t.getDirection()).negate())),s.inverse();const r=this.groupNode.getSubBBox(this.bbox,!0).multRight(s),o=t.getShadowMapSize(),a=this.viewport.set(0,0,o,o),l=Va.orthoBox(r,this.projectionMatrix);this.shadowBuffer.bind(),e.getViewVolumes().push(this.viewVolume.set(l,a,a)),e.getProjectionMatrix().pushMatrix(l),e.getModelViewMatrix().pushMatrix(s),e.render(Ia.SHADOW,qu.prototype.traverse,this.groupNode),e.getModelViewMatrix().pop(),e.getProjectionMatrix().pop(),e.getViewVolumes().pop(),this.shadowBuffer.unbind(),this.global||s.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(s).multRight(l).multRight(t.getBiasMatrix())},setGlobalVariables(e){this.modelViewMatrix.get().multDirMatrix(this.direction.assign(this.lightNode.getDirection())).normalize(),this.shadowBuffer&&(this.shadowMatrix.assign(e.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix))},setShaderUniforms(e,t){const i=t.numLights++;if(this.shadowBuffer){const n=this.global?this.textureUnit=this.textureUnit??this.browser.popTexture2DUnit():this.browser.getTexture2DUnit();void 0!==n?(e.activeTexture(e.TEXTURE0+n),e.HAS_FEATURE_DEPTH_TEXTURE?e.bindTexture(e.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):e.bindTexture(e.TEXTURE_2D,this.shadowBuffer.getColorTexture()),e.uniform1i(t.x3d_ShadowMap[i],n)):console.warn("Not enough combined texture units for shadow map available.")}if(t.hasLight(i,this))return;const n=this.lightNode,s=n.getColor(),r=this.direction;if(e.uniform1i(t.x3d_LightType[i],1),e.uniform3f(t.x3d_LightColor[i],s.r,s.g,s.b),e.uniform1f(t.x3d_LightIntensity[i],n.getIntensity()),e.uniform1f(t.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),e.uniform3f(t.x3d_LightDirection[i],r.x,r.y,r.z),this.shadowBuffer){const s=n.getShadowColor();e.uniform3f(t.x3d_ShadowColor[i],s.r,s.g,s.b),e.uniform1f(t.x3d_ShadowIntensity[i],n.getShadowIntensity()),e.uniform1f(t.x3d_ShadowBias[i],n.getShadowBias()),e.uniformMatrix4fv(t.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),e.uniform1i(t.x3d_ShadowMapSize[i],n.getShadowMapSize())}else e.uniform1f(t.x3d_ShadowIntensity[i],0)},dispose(){this.browser.pushShadowBuffer(this.shadowBuffer),this.browser.pushTexture2DUnit(this.textureUnit),this.modelViewMatrix.clear(),this.shadowBuffer=null,this.textureUnit=void 0,Ag.push(this)}}),Object.assign(Object.setPrototypeOf(Lg.prototype,Rg.prototype),{getLights:()=>Ag}),Object.defineProperties(Lg,{typeName:{value:"DirectionalLight",enumerable:!0},componentName:{value:"Lighting",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"global",new Yn.SFBool),new X(d.inputOutput,"on",new Yn.SFBool(!0)),new X(d.inputOutput,"color",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"intensity",new Yn.SFFloat(1)),new X(d.inputOutput,"ambientIntensity",new Yn.SFFloat),new X(d.inputOutput,"direction",new Yn.SFVec3f(0,0,-1)),new X(d.inputOutput,"shadows",new Yn.SFBool),new X(d.inputOutput,"shadowColor",new Yn.SFColor),new X(d.inputOutput,"shadowIntensity",new Yn.SFFloat(1)),new X(d.inputOutput,"shadowBias",new Yn.SFFloat(.005)),new X(d.initializeOnly,"shadowMapSize",new Yn.SFInt32(1024))]),enumerable:!0}});const Bg=Lg;i.add("DirectionalLight","x_ite/Components/Lighting/DirectionalLight",Bg);const Ug=Bg,Xg=al(kg);function kg(){this.modelViewMatrix=new Ho(ci)}function jg(e){Rg.call(this,e),this.addType(d.EnvironmentLight)}Object.assign(kg.prototype,{set(e,t,i){},getModelViewMatrix(){return this.modelViewMatrix},renderShadowMap(e){},setGlobalVariables(e){},setShaderUniforms(e,t){},dispose(){Xg.push(this)}}),Object.assign(Object.setPrototypeOf(jg.prototype,Rg.prototype),{getLights:()=>Xg}),Object.defineProperties(jg,{typeName:{value:"EnvironmentLight",enumerable:!0},componentName:{value:"Lighting",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"global",new Yn.SFBool),new X(d.inputOutput,"on",new Yn.SFBool(!0)),new X(d.inputOutput,"rotation",new Yn.SFRotation),new X(d.inputOutput,"color",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"intensity",new Yn.SFFloat(1)),new X(d.inputOutput,"ambientIntensity",new Yn.SFFloat),new X(d.inputOutput,"diffuseCoefficients",new Yn.MFFloat),new X(d.inputOutput,"diffuse",new Yn.SFNode),new X(d.inputOutput,"diffuseTexture",new Yn.SFNode),new X(d.inputOutput,"specularTexture",new Yn.SFNode),new X(d.inputOutput,"shadows",new Yn.SFBool),new X(d.inputOutput,"shadowColor",new Yn.SFColor),new X(d.inputOutput,"shadowIntensity",new Yn.SFFloat(1)),new X(d.inputOutput,"shadowBias",new Yn.SFFloat(.005)),new X(d.initializeOnly,"shadowMapSize",new Yn.SFInt32(1024))]),enumerable:!0}});const zg=jg;i.add("EnvironmentLight","x_ite/Components/Lighting/EnvironmentLight",zg);const Gg=zg,Hg=[(new ci).setRotation(new ai(new bt(1,0,0),bt.zAxis)),(new ci).setRotation(new ai(new bt(-1,0,0),bt.zAxis)),(new ci).setRotation(new ai(new bt(0,0,-1),bt.zAxis)),(new ci).setRotation(new ai(new bt(0,0,1),bt.zAxis)),(new ci).setRotation(new ai(new bt(0,1,0),bt.zAxis)),(new ci).setRotation(new ai(new bt(0,-1,0),bt.zAxis))],qg=[new jt(0,.5,.25,.5),new jt(.5,.5,.25,.5),new jt(.75,.5,.25,.5),new jt(.25,.5,.25,.5),new jt(0,0,.5,.5),new jt(.5,0,.5,.5)],Yg=al(Wg);function Wg(){this.location=new bt(0,0,0),this.matrixArray=new Float32Array(9),this.shadowBuffer=null,this.viewVolume=new va,this.viewport=new jt(0,0,0,0),this.projectionMatrix=new ci,this.modelViewMatrix=new Ho(ci),this.modelMatrix=new ci,this.invLightSpaceMatrix=new ci,this.invLightSpaceProjectionMatrix=new ci,this.shadowMatrix=new ci,this.shadowMatrixArray=new Float32Array(16),this.rotation=new ai,this.rotationMatrix=new ci,this.textureUnit=void 0}function $g(e){Rg.call(this,e),this.addType(d.PointLight),this._location.setUnit("length"),this._radius.setUnit("length")}Object.assign(Wg.prototype,{set(e,t,i){const n=e.getShadowMapSize();this.browser=e.getBrowser(),this.lightNode=e,this.groupNode=t,this.global=e.getGlobal(),this.matrixArray.set(i.submatrix.inverse()),this.modelViewMatrix.pushMatrix(i),e.getShadowIntensity()>0&&n>0&&(this.shadowBuffer=this.browser.popShadowBuffer(n),this.shadowBuffer||console.warn("Couldn't create shadow buffer."))},renderShadowMap(e){if(!this.shadowBuffer)return;const t=this.lightNode,i=e.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),s=this.invLightSpaceMatrix.assign(this.global?n:ci.Identity);s.translate(t.getLocation()),s.inverse();const r=t.getShadowMapSize();this.shadowBuffer.bind();for(let t=0;t<6;++t){const i=qg[t],n=this.viewport.set(i[0]*r,i[1]*r,i[2]*r,i[3]*r),o=Va.perspective2(g.radians(90),.125,1e4,n[2],n[3],this.projectionMatrix);e.getViewVolumes().push(this.viewVolume.set(o,n,n)),e.getProjectionMatrix().pushMatrix(this.projectionMatrix),e.getModelViewMatrix().pushMatrix(Hg[t]),e.getModelViewMatrix().multLeft(s),e.render(Ia.SHADOW,qu.prototype.traverse,this.groupNode),e.getModelViewMatrix().pop(),e.getProjectionMatrix().pop(),e.getViewVolumes().pop()}this.shadowBuffer.unbind(),this.global||s.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(s)},setGlobalVariables(e){this.modelViewMatrix.get().multVecMatrix(this.location.assign(this.lightNode._location.getValue())),this.shadowBuffer&&(this.shadowMatrix.assign(e.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix))},setShaderUniforms(e,t){const i=t.numLights++;if(this.shadowBuffer){const n=this.global?this.textureUnit=this.textureUnit??this.browser.popTexture2DUnit():this.browser.getTexture2DUnit();void 0!==n?(e.activeTexture(e.TEXTURE0+n),e.HAS_FEATURE_DEPTH_TEXTURE?e.bindTexture(e.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):e.bindTexture(e.TEXTURE_2D,this.shadowBuffer.getColorTexture()),e.uniform1i(t.x3d_ShadowMap[i],n)):console.warn("Not enough combined texture units for shadow map available.")}if(t.hasLight(i,this))return;const n=this.lightNode,s=n.getColor(),r=n.getAttenuation(),o=this.location;if(e.uniform1i(t.x3d_LightType[i],2),e.uniform3f(t.x3d_LightColor[i],s.r,s.g,s.b),e.uniform1f(t.x3d_LightIntensity[i],n.getIntensity()),e.uniform1f(t.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),e.uniform3f(t.x3d_LightAttenuation[i],Math.max(0,r.x),Math.max(0,r.y),Math.max(0,r.z)),e.uniform3f(t.x3d_LightLocation[i],o.x,o.y,o.z),e.uniform1f(t.x3d_LightRadius[i],n.getRadius()),e.uniformMatrix3fv(t.x3d_LightMatrix[i],!1,this.matrixArray),this.shadowBuffer){const s=n.getShadowColor();e.uniform3f(t.x3d_ShadowColor[i],s.r,s.g,s.b),e.uniform1f(t.x3d_ShadowIntensity[i],n.getShadowIntensity()),e.uniform1f(t.x3d_ShadowBias[i],n.getShadowBias()),e.uniformMatrix4fv(t.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),e.uniform1i(t.x3d_ShadowMapSize[i],n.getShadowMapSize())}else e.uniform1f(t.x3d_ShadowIntensity[i],0)},dispose(){this.browser.pushShadowBuffer(this.shadowBuffer),this.browser.pushTexture2DUnit(this.textureUnit),this.modelViewMatrix.clear(),this.shadowBuffer=null,this.textureUnit=void 0,Yg.push(this)}}),Object.assign(Object.setPrototypeOf($g.prototype,Rg.prototype),{getAttenuation(){return this._attenuation.getValue()},getLocation(){return this._location.getValue()},getRadius(){return Math.max(0,this._radius.getValue())},getLights:()=>Yg}),Object.defineProperties($g,{typeName:{value:"PointLight",enumerable:!0},componentName:{value:"Lighting",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"global",new Yn.SFBool(!0)),new X(d.inputOutput,"on",new Yn.SFBool(!0)),new X(d.inputOutput,"color",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"intensity",new Yn.SFFloat(1)),new X(d.inputOutput,"ambientIntensity",new Yn.SFFloat),new X(d.inputOutput,"attenuation",new Yn.SFVec3f(1,0,0)),new X(d.inputOutput,"location",new Yn.SFVec3f),new X(d.inputOutput,"radius",new Yn.SFFloat(100)),new X(d.inputOutput,"shadows",new Yn.SFBool),new X(d.inputOutput,"shadowColor",new Yn.SFColor),new X(d.inputOutput,"shadowIntensity",new Yn.SFFloat(1)),new X(d.inputOutput,"shadowBias",new Yn.SFFloat(.005)),new X(d.initializeOnly,"shadowMapSize",new Yn.SFInt32(1024))]),enumerable:!0}});const Jg=$g;i.add("PointLight","x_ite/Components/Lighting/PointLight",Jg);const Kg=Jg,Zg=al(Qg);function Qg(){this.location=new bt(0,0,0),this.direction=new bt(0,0,0),this.matrixArray=new Float32Array(9),this.renderShadow=!0,this.shadowBuffer=null,this.bbox=new Ua,this.viewVolume=new va,this.viewport=new jt(0,0,0,0),this.projectionMatrix=new ci,this.modelViewMatrix=new Ho(ci),this.modelMatrix=new ci,this.invLightSpaceMatrix=new ci,this.invLightSpaceProjectionMatrix=new ci,this.shadowMatrix=new ci,this.shadowMatrixArray=new Float32Array(16),this.rotation=new ai,this.lightBBoxMin=new bt(0,0,0),this.lightBBoxMax=new bt(0,0,0),this.textureUnit=void 0}function ef(e){Rg.call(this,e),this.addType(d.SpotLight),e.getSpecificationVersion()<=3.2&&(this._beamWidth=1.5708,this._cutOffAngle=.785398),this._location.setUnit("length"),this._radius.setUnit("length"),this._beamWidth.setUnit("angle"),this._cutOffAngle.setUnit("angle")}Object.assign(Qg.prototype,{set(e,t,i){const n=e.getShadowMapSize();this.browser=e.getBrowser(),this.lightNode=e,this.groupNode=t,this.global=e.getGlobal(),this.matrixArray.set(i.submatrix.inverse()),this.modelViewMatrix.pushMatrix(i),e.getShadowIntensity()>0&&n>0&&(this.shadowBuffer=this.browser.popShadowBuffer(n),this.shadowBuffer||console.warn("Couldn't create shadow buffer."))},renderShadowMap(e){if(!this.shadowBuffer)return;const t=this.lightNode,i=e.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),s=this.invLightSpaceMatrix.assign(this.global?n:ci.Identity);s.translate(t.getLocation()),s.rotate(this.rotation.setFromToVec(bt.zAxis,this.direction.assign(t.getDirection()).negate())),s.inverse();this.groupNode.getSubBBox(this.bbox,!0).multRight(s).getExtents(this.lightBBoxMin,this.lightBBoxMax);const r=t.getShadowMapSize(),o=Math.min(t.getRadius(),-this.lightBBoxMin.z),a=this.viewport.set(0,0,r,r),l=Va.perspective(2*t.getCutOffAngle(),.125,Math.max(1e4,o),r,r,this.projectionMatrix);this.renderShadow=o>0,this.shadowBuffer.bind(),e.getViewVolumes().push(this.viewVolume.set(l,a,a)),e.getProjectionMatrix().pushMatrix(l),e.getModelViewMatrix().pushMatrix(s),e.render(Ia.SHADOW,qu.prototype.traverse,this.groupNode),e.getModelViewMatrix().pop(),e.getProjectionMatrix().pop(),e.getViewVolumes().pop(),this.shadowBuffer.unbind(),this.global||s.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(s).multRight(l).multRight(t.getBiasMatrix())},setGlobalVariables(e){const t=this.lightNode,i=this.modelViewMatrix.get();i.multVecMatrix(this.location.assign(t._location.getValue())),i.multDirMatrix(this.direction.assign(t._direction.getValue())).normalize(),this.shadowBuffer&&(this.shadowMatrix.assign(e.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix))},setShaderUniforms(e,t){const i=t.numLights++;if(this.shadowBuffer){const n=this.global?this.textureUnit=this.textureUnit??this.browser.popTexture2DUnit():this.browser.getTexture2DUnit();void 0!==n?(e.activeTexture(e.TEXTURE0+n),e.HAS_FEATURE_DEPTH_TEXTURE?e.bindTexture(e.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):e.bindTexture(e.TEXTURE_2D,this.shadowBuffer.getColorTexture()),e.uniform1i(t.x3d_ShadowMap[i],n)):console.warn("Not enough combined texture units for shadow map available.")}if(t.hasLight(i,this))return;const n=this.lightNode,s=n.getColor(),r=n.getAttenuation(),o=this.location,a=this.direction;if(e.uniform1i(t.x3d_LightType[i],3),e.uniform3f(t.x3d_LightColor[i],s.r,s.g,s.b),e.uniform1f(t.x3d_LightIntensity[i],n.getIntensity()),e.uniform1f(t.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),e.uniform3f(t.x3d_LightAttenuation[i],Math.max(0,r.x),Math.max(0,r.y),Math.max(0,r.z)),e.uniform3f(t.x3d_LightLocation[i],o.x,o.y,o.z),e.uniform3f(t.x3d_LightDirection[i],a.x,a.y,a.z),e.uniform1f(t.x3d_LightRadius[i],n.getRadius()),e.uniform1f(t.x3d_LightBeamWidth[i],n.getBeamWidth()),e.uniform1f(t.x3d_LightCutOffAngle[i],n.getCutOffAngle()),e.uniformMatrix3fv(t.x3d_LightMatrix[i],!1,this.matrixArray),this.renderShadow&&this.shadowBuffer){const s=n.getShadowColor();e.uniform3f(t.x3d_ShadowColor[i],s.r,s.g,s.b),e.uniform1f(t.x3d_ShadowIntensity[i],n.getShadowIntensity()),e.uniform1f(t.x3d_ShadowBias[i],n.getShadowBias()),e.uniformMatrix4fv(t.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),e.uniform1i(t.x3d_ShadowMapSize[i],n.getShadowMapSize())}else e.uniform1f(t.x3d_ShadowIntensity[i],0)},dispose(){this.browser.pushShadowBuffer(this.shadowBuffer),this.browser.pushTexture2DUnit(this.textureUnit),this.modelViewMatrix.clear(),this.shadowBuffer=null,this.textureUnit=void 0,Zg.push(this)}}),Object.assign(Object.setPrototypeOf(ef.prototype,Rg.prototype),{getAttenuation(){return this._attenuation.getValue()},getLocation(){return this._location.getValue()},getRadius(){return Math.max(0,this._radius.getValue())},getBeamWidth(){const e=this._beamWidth.getValue(),t=this.getCutOffAngle();return e>t?t:g.clamp(e,0,Math.PI/2)},getCutOffAngle(){return g.clamp(this._cutOffAngle.getValue(),0,Math.PI/2)},getLights:()=>Zg}),Object.defineProperties(ef,{typeName:{value:"SpotLight",enumerable:!0},componentName:{value:"Lighting",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"global",new Yn.SFBool(!0)),new X(d.inputOutput,"on",new Yn.SFBool(!0)),new X(d.inputOutput,"color",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"intensity",new Yn.SFFloat(1)),new X(d.inputOutput,"ambientIntensity",new Yn.SFFloat),new X(d.inputOutput,"attenuation",new Yn.SFVec3f(1,0,0)),new X(d.inputOutput,"location",new Yn.SFVec3f),new X(d.inputOutput,"direction",new Yn.SFVec3f(0,0,-1)),new X(d.inputOutput,"radius",new Yn.SFFloat(100)),new X(d.inputOutput,"beamWidth",new Yn.SFFloat(.785398)),new X(d.inputOutput,"cutOffAngle",new Yn.SFFloat(1.5708)),new X(d.inputOutput,"shadows",new Yn.SFBool),new X(d.inputOutput,"shadowColor",new Yn.SFColor),new X(d.inputOutput,"shadowIntensity",new Yn.SFFloat(1)),new X(d.inputOutput,"shadowBias",new Yn.SFFloat(.005)),new X(d.initializeOnly,"shadowMapSize",new Yn.SFInt32(1024))]),enumerable:!0}});const tf=ef;i.add("SpotLight","x_ite/Components/Lighting/SpotLight",tf);const nf={name:"Lighting",concreteNodes:[Ug,Gg,Kg,tf],abstractNodes:[Rg]};i.add("Lighting","x_ite/Components/Lighting",nf);const sf=nf;function rf(e){qu.call(this,e),this.addType(d.Billboard),this.matrix=new ci}Object.assign(Object.setPrototypeOf(rf.prototype,qu.prototype),{getBBox(e,t){return qu.prototype.getBBox.call(this,e,t).multRight(this.matrix)},getMatrix(){return this.matrix},rotate:(()=>{const e=new ci,t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0),s=new bt(0,0,0),r=new ai;return function(o){e.assign(o).inverse();const a=e.origin.normalize();if(this._axisOfRotation.getValue().equals(bt.Zero)){e.multDirMatrix(t.assign(bt.yAxis)).normalize();const n=t.cross(a);i.assign(a).cross(n);const s=a;n.normalize(),i.normalize(),this.matrix.set(n.x,n.y,n.z,0,i.x,i.y,i.z,0,s.x,s.y,s.z,0,0,0,0,1)}else n.assign(this._axisOfRotation.getValue()).cross(a),s.assign(this._axisOfRotation.getValue()).cross(bt.zAxis),this.matrix.setRotation(r.setFromToVec(s,n));return this.matrix}})(),traverse(e,t){const i=t.getModelViewMatrix();switch(i.push(),e){case Ia.CAMERA:case Ia.PICKING:case Ia.SHADOW:i.multLeft(this.matrix);break;default:i.multLeft(this.rotate(i.get()))}qu.prototype.traverse.call(this,e,t),i.pop()}}),Object.defineProperties(rf,{typeName:{value:"Billboard",enumerable:!0},componentName:{value:"Navigation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"axisOfRotation",new Yn.SFVec3f(0,1,0)),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const of=rf;i.add("Billboard","x_ite/Components/Navigation/Billboard",of);const af=of;function lf(e){qu.call(this,e),cu.call(this,e),this.addType(d.Collision),2==e.getSpecificationVersion()&&this.addAlias("collide",this._enabled)}Object.assign(Object.setPrototypeOf(lf.prototype,qu.prototype),cu.prototype,{initialize(){qu.prototype.initialize.call(this),this.getLive().addInterest("set_live__",this),this._enabled.addInterest("set_live__",this),this._proxy.addInterest("set_proxy__",this),this.set_live__(),this.set_proxy__()},set_live__(){this.getLive().getValue()&&this._enabled.getValue()?this.getBrowser().addCollision(this):this.getBrowser().removeCollision(this)},set_active(e){this._isActive.getValue()!==e&&(this._isActive=e,e&&(this._collideTime=this.getBrowser().getCurrentTime()))},set_proxy__(){this.proxyNode=ql(d.X3DChildNode,this._proxy)},traverse(e,t){if(e!==Ia.COLLISION)qu.prototype.traverse.call(this,e,t);else if(this._enabled.getValue()){const i=t.getCollisions();i.push(this),this.proxyNode?this.proxyNode.traverse(e,t):qu.prototype.traverse.call(this,e,t),i.pop()}},dispose(){qu.prototype.dispose.call(this)}}),Object.defineProperties(lf,{typeName:{value:"Collision",enumerable:!0},componentName:{value:"Navigation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"collideTime",new Yn.SFTime),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.initializeOnly,"proxy",new Yn.SFNode),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const uf=lf;i.add("Collision","x_ite/Components/Navigation/Collision",uf);const hf=uf;function df(e){qu.call(this,e),this.addType(d.LOD),2==e.getSpecificationVersion()&&this.addAlias("level",this._children),this._center.setUnit("length"),this._range.setUnit("length"),this.frameRate=60,this.keepCurrentLevel=!1,this.childNode=null,this.visibleNode=null,this.boundedObject=null}Object.assign(Object.setPrototypeOf(df.prototype,qu.prototype),{initialize(){qu.prototype.initialize.call(this),this._children.addInterest("set_child__",this)},getSubBBox(e,t){if(this._bboxSize.getValue().equals(this.getDefaultBBoxSize())){const i=ql(d.X3DBoundedObject,this.visibleNode);return i?.getBBox(e,t)??e.set()}return e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},clear(){},add(){},remove(){},set_child__(){this.set_level__(Math.min(this._level_changed.getValue(),this._children.length-1))},set_level__(e){this.childNode&&(this.childNode._isCameraObject.removeInterest("set_cameraObject__",this),this.childNode._isPickableObject.removeInterest("set_transformSensors__",this)),ql(d.X3DBoundedObject,this.childNode)&&(this.childNode._display.removeInterest("set_display__",this),this.childNode._bboxDisplay.removeInterest("set_bboxDisplay__",this)),e>=0&&e<this._children.length?(this.childNode=ql(d.X3DChildNode,this._children[e]),this.childNode&&(this.childNode._isCameraObject.addInterest("set_cameraObject__",this),this.childNode._isPickableObject.addInterest("set_transformSensors__",this),ql(d.X3DBoundedObject,this.childNode)&&(this.childNode._display.addInterest("set_display__",this),this.childNode._bboxDisplay.addInterest("set_bboxDisplay__",this)))):this.childNode=null,this.set_display__(),this.set_bboxDisplay__()},set_cameraObject__(){this.setCameraObject(!!this.visibleNode?.isCameraObject())},set_transformSensors__(){this.setPickableObject(!(!this.getTransformSensors().size&&!this.visibleNode?.isPickableObject()))},set_display__(){ql(d.X3DBoundedObject,this.childNode)?this.visibleNode=this.childNode._display.getValue()?this.childNode:null:this.visibleNode=this.childNode,this.set_cameraObject__(),this.set_transformSensors__()},set_bboxDisplay__(){ql(d.X3DBoundedObject,this.childNode)?this.boundedObject=this.childNode._bboxDisplay.getValue()?this.childNode:null:this.boundedObject=null},getLevel:function(e,t){if(0===this._range.length){this.frameRate=(179*this.frameRate+e.currentFrameRate)/180;const t=this._children.length;switch(t){case 0:return-1;case 1:return 0;case 2:return+(this.frameRate>55);default:{const e=1-g.clamp((this.frameRate-20)/35,0,1);return Math.min(Math.floor(e*t),t-1)}}}const i=t.translate(this._center.getValue()).origin.magnitude();return g.upperBound(this._range,0,this._range.length,i)},traverse:(()=>{const e=new ci;return function(t,i){switch(t){case Ia.POINTER:case Ia.CAMERA:case Ia.SHADOW:return void this.visibleNode?.traverse(t,i);case Ia.PICKING:{if(this.getTransformSensors().size){const e=i.getModelViewMatrix().get();for(const t of this.getTransformSensors())t.collect(e)}const e=this.visibleNode;if(e){const n=this.getBrowser().getPickingHierarchy();n.push(this),e.traverse(t,i),n.pop()}return}case Ia.COLLISION:return void this.visibleNode?.traverse(t,i);case Ia.DISPLAY:if(!this.keepCurrentLevel){let t=this.getLevel(this.getBrowser(),e.assign(i.getModelViewMatrix().get())),n=this._level_changed.getValue();this._forceTransitions.getValue()&&(t>n?t=n+1:t<n&&(t=n-1)),t!==n&&(this._level_changed=t,this.set_level__(Math.min(t,this._children.length-1)))}return this.visibleNode?.traverse(t,i),void this.boundedObject?.displayBBox(t,i)}}})()}),Object.defineProperties(df,{typeName:{value:"LOD",enumerable:!0},componentName:{value:"Navigation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"forceTransitions",new Yn.SFBool),new X(d.initializeOnly,"center",new Yn.SFVec3f),new X(d.initializeOnly,"range",new Yn.MFFloat),new X(d.outputOnly,"level_changed",new Yn.SFInt32(-1)),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const cf=df;i.add("LOD","x_ite/Components/Navigation/LOD",cf);const pf=cf;function gf(e){Vu.call(this,e),this.addType(d.OrthoViewpoint),this.addChildObjects(d.inputOutput,"fieldOfViewOffset",new Yn.MFFloat(0,0,0,0)),this._position.setUnit("length"),this._centerOfRotation.setUnit("length"),this._fieldOfView.setUnit("length"),this.projectionMatrix=new ci,this.fieldOfViewOffsetInterpolator0=new Pu(this.getBrowser().getPrivateScene()),this.fieldOfViewOffsetInterpolator1=new Pu(this.getBrowser().getPrivateScene()),this.fieldOfViewOffsetInterpolator2=new Pu(this.getBrowser().getPrivateScene()),this.fieldOfViewOffsetInterpolator3=new Pu(this.getBrowser().getPrivateScene())}Object.assign(Object.setPrototypeOf(gf.prototype,Vu.prototype),{initialize(){Vu.prototype.initialize.call(this),this.fieldOfViewOffsetInterpolator0._key=new Yn.MFFloat(0,1),this.fieldOfViewOffsetInterpolator1._key=new Yn.MFFloat(0,1),this.fieldOfViewOffsetInterpolator2._key=new Yn.MFFloat(0,1),this.fieldOfViewOffsetInterpolator3._key=new Yn.MFFloat(0,1),this.fieldOfViewOffsetInterpolator0.setup(),this.fieldOfViewOffsetInterpolator1.setup(),this.fieldOfViewOffsetInterpolator2.setup(),this.fieldOfViewOffsetInterpolator3.setup(),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.fieldOfViewOffsetInterpolator0._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.fieldOfViewOffsetInterpolator1._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.fieldOfViewOffsetInterpolator2._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.fieldOfViewOffsetInterpolator3._set_fraction),this.fieldOfViewOffsetInterpolator0._value_changed.addInterest("set_fieldOfViewOffset__",this),this.fieldOfViewOffsetInterpolator1._value_changed.addInterest("set_fieldOfViewOffset__",this),this.fieldOfViewOffsetInterpolator2._value_changed.addInterest("set_fieldOfViewOffset__",this),this.fieldOfViewOffsetInterpolator3._value_changed.addInterest("set_fieldOfViewOffset__",this)},set_fieldOfViewOffset__(){this._fieldOfViewOffset[0]=this.fieldOfViewOffsetInterpolator0._value_changed.getValue(),this._fieldOfViewOffset[1]=this.fieldOfViewOffsetInterpolator1._value_changed.getValue(),this._fieldOfViewOffset[2]=this.fieldOfViewOffsetInterpolator2._value_changed.getValue(),this._fieldOfViewOffset[3]=this.fieldOfViewOffsetInterpolator3._value_changed.getValue()},resetUserOffsets(){Vu.prototype.resetUserOffsets.call(this),this._fieldOfViewOffset[0]=0,this._fieldOfViewOffset[1]=0,this._fieldOfViewOffset[2]=0,this._fieldOfViewOffset[3]=0},getRelativeTransformation(e){const t=Vu.prototype.getRelativeTransformation.call(this,e);return e.constructor===this.constructor&&(t.userMinimumX=e.getUserMinimumX(),t.userMinimumY=e.getUserMinimumY(),t.userMaximumX=e.getUserMaximumX(),t.userMaximumY=e.getUserMaximumY()),t},setInterpolators(e,t){if(e.constructor===this.constructor){const e=t.userMinimumX-this.getMinimumX(),i=t.userMinimumY-this.getMinimumY(),n=t.userMaximumX-this.getMaximumX(),s=t.userMaximumY-this.getMaximumY();this.fieldOfViewOffsetInterpolator0._keyValue=new Yn.MFFloat(e,this._fieldOfViewOffset[0]),this.fieldOfViewOffsetInterpolator1._keyValue=new Yn.MFFloat(i,this._fieldOfViewOffset[1]),this.fieldOfViewOffsetInterpolator2._keyValue=new Yn.MFFloat(n,this._fieldOfViewOffset[2]),this.fieldOfViewOffsetInterpolator3._keyValue=new Yn.MFFloat(s,this._fieldOfViewOffset[3]),this.fieldOfViewScaleInterpolator._keyValue=new Yn.MFFloat(1,this._fieldOfViewScale.getValue()),this._fieldOfViewOffset[0]=t.offset0,this._fieldOfViewOffset[1]=t.offset1,this._fieldOfViewOffset[2]=t.offset2,this._fieldOfViewOffset[3]=t.offset3,this._fieldOfViewScale=1}else this.fieldOfViewOffsetInterpolator0._keyValue=new Yn.MFFloat(this._fieldOfViewOffset[0],this._fieldOfViewOffset[0]),this.fieldOfViewOffsetInterpolator1._keyValue=new Yn.MFFloat(this._fieldOfViewOffset[1],this._fieldOfViewOffset[1]),this.fieldOfViewOffsetInterpolator2._keyValue=new Yn.MFFloat(this._fieldOfViewOffset[2],this._fieldOfViewOffset[2]),this.fieldOfViewOffsetInterpolator3._keyValue=new Yn.MFFloat(this._fieldOfViewOffset[3],this._fieldOfViewOffset[3]),this.fieldOfViewScaleInterpolator._keyValue=new Yn.MFFloat(1,this._fieldOfViewOffset.getValue()),this._fieldOfViewOffset=this._fieldOfViewOffset.getValue(),this._fieldOfViewScale=1},getLogarithmicDepthBuffer:()=>!1,getMinimumX(){return this._fieldOfView.length>0?this._fieldOfView[0]:-1},getUserMinimumX(){return(this.getMinimumX()+this._fieldOfViewOffset[0])*this._fieldOfViewScale.getValue()},getMinimumY(){return this._fieldOfView.length>1?this._fieldOfView[1]:-1},getUserMinimumY(){return(this.getMinimumY()+this._fieldOfViewOffset[1])*this._fieldOfViewScale.getValue()},getMaximumX(){return this._fieldOfView.length>2?this._fieldOfView[2]:1},getUserMaximumX(){return(this.getMaximumX()+this._fieldOfViewOffset[2])*this._fieldOfViewScale.getValue()},getMaximumY(){return this._fieldOfView.length>3?this._fieldOfView[3]:1},getUserMaximumY(){return(this.getMaximumY()+this._fieldOfViewOffset[3])*this._fieldOfViewScale.getValue()},getSizeX(){return this.getMaximumX()-this.getMinimumX()},getUserSizeX(){return this.getUserMaximumX()-this.getUserMinimumX()},getSizeY(){return this.getMaximumY()-this.getMinimumY()},getUserSizeY(){return this.getUserMaximumY()-this.getUserMinimumY()},getMaxFarValue:()=>1e4,getScreenScale(e,t,i){const n=t[2],s=t[3],r=this.getUserSizeX(),o=this.getUserSizeY();if(n/s>r/o){const e=o/s;return i.set(e,e,e)}{const e=r/n;return i.set(e,e,e)}},getViewportSize:(()=>{const e=new ft(0,0);return function(t,i){const n=t[2],s=t[3],r=this.getUserSizeX(),o=this.getUserSizeY(),a=n/s;return a>r/o?e.set(o*a,o):e.set(r,r/a)}})(),getLookAtDistance:e=>e.size.magnitude()/2+10,getProjectionMatrixWithLimits(e,t,i){const n=i[2]/i[3],s=this.getUserSizeX(),r=this.getUserSizeY();if(n>s/r){const i=(this.getUserMinimumX()+this.getUserMaximumX())/2,s=r*n/2;return Va.ortho(i-s,i+s,this.getUserMinimumY(),this.getUserMaximumY(),e,t,this.projectionMatrix)}{const i=(this.getUserMinimumY()+this.getUserMaximumY())/2,r=s/n/2;return Va.ortho(this.getUserMinimumX(),this.getUserMaximumX(),i-r,i+r,e,t,this.projectionMatrix)}},viewAll(e){Vu.prototype.viewAll.call(this,e);const t=e.size,i=t.x/this.getSizeX(),n=t.y/this.getSizeY(),s=1.1*Math.max(i,n);this._fieldOfViewOffset[0]=this.getMinimumX()*s-this.getMinimumX(),this._fieldOfViewOffset[1]=this.getMinimumY()*s-this.getMinimumY(),this._fieldOfViewOffset[2]=this.getMaximumX()*s-this.getMaximumX(),this._fieldOfViewOffset[3]=this.getMaximumY()*s-this.getMaximumY()}}),Object.defineProperties(gf,{typeName:{value:"OrthoViewpoint",enumerable:!0},componentName:{value:"Navigation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_bind",new Yn.SFBool),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"position",new Yn.SFVec3f(0,0,10)),new X(d.inputOutput,"orientation",new Yn.SFRotation),new X(d.inputOutput,"centerOfRotation",new Yn.SFVec3f),new X(d.inputOutput,"fieldOfView",new Yn.MFFloat(-1,-1,1,1)),new X(d.inputOutput,"nearDistance",new Yn.SFFloat(-1)),new X(d.inputOutput,"farDistance",new Yn.SFFloat(-1)),new X(d.inputOutput,"viewAll",new Yn.SFBool),new X(d.inputOutput,"jump",new Yn.SFBool(!0)),new X(d.inputOutput,"retainUserOffsets",new Yn.SFBool),new X(d.outputOnly,"isBound",new Yn.SFBool),new X(d.outputOnly,"bindTime",new Yn.SFTime),new X(d.inputOutput,"navigationInfo",new Yn.SFNode)]),enumerable:!0}});const ff=gf;i.add("OrthoViewpoint","x_ite/Components/Navigation/OrthoViewpoint",ff);const mf=ff;function _f(e){Hs.call(this,e),this.addType(d.ViewpointGroup),this._size.setUnit("length"),this._center.setUnit("length"),this.setCameraObject(!0),this.proximitySensor=new gd(e),this.cameraObjects=[],this.viewpointGroups=[]}Object.assign(Object.setPrototypeOf(_f.prototype,Hs.prototype),{initialize(){Hs.prototype.initialize.call(this),this.proximitySensor.setup(),this._size.addFieldInterest(this.proximitySensor._size),this._center.addFieldInterest(this.proximitySensor._center),this.proximitySensor._size=this._size,this.proximitySensor._center=this._center,this._size.addInterest("set_size__",this),this._children.addInterest("set_children__",this),this.set_size__(),this.set_children__()},set_size__(){this.proximitySensor._enabled=!this._size.getValue().equals(bt.Zero)},set_children__(){this.cameraObjects.length=0,this.viewpointGroups.length=0;for(const e of this._children){const t=ql(d.X3DChildNode,e);if(!t)continue;const i=t.getType();for(let e=i.length-1;e>=0;--e)switch(i[e]){case d.X3DViewpointNode:this.cameraObjects.push(t);break;case d.ViewpointGroup:this.cameraObjects.push(t),this.viewpointGroups.push(t)}}},traverse(e,t){const i=this.proximitySensor;switch(e){case Ia.CAMERA:if(i.traverse(e,t),i._isActive.getValue()||!i._enabled.getValue()){t.getViewpointGroups().push(this);for(const i of this.cameraObjects)i.traverse(e,t);t.getViewpointGroups().pop()}return;case Ia.DISPLAY:if(i.traverse(e,t),i._isActive.getValue()||!i._enabled.getValue())for(const i of this.viewpointGroups)i.traverse(e,t);return}}}),Object.defineProperties(_f,{typeName:{value:"ViewpointGroup",enumerable:!0},componentName:{value:"Navigation",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"displayed",new Yn.SFBool(!0)),new X(d.inputOutput,"retainUserOffsets",new Yn.SFBool),new X(d.inputOutput,"size",new Yn.SFVec3f),new X(d.inputOutput,"center",new Yn.SFVec3f),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const xf=_f;i.add("ViewpointGroup","x_ite/Components/Navigation/ViewpointGroup",xf);const yf={name:"Navigation",concreteNodes:[af,hf,pf,rl,mf,Uu,xf],abstractNodes:[Vu]};i.add("Navigation","x_ite/Components/Navigation",yf);const wf=yf;function bf(e,t,i,n){this.node=null,this.modelViewMatrix=new ci,this.projectionMatrix=new ci,this.viewport=new jt(0,0,0,0),this.set(e,t,i,n)}Object.assign(bf.prototype,{set(e,t,i,n){this.node=e,this.modelViewMatrix.assign(t),this.projectionMatrix.assign(i),this.viewport.assign(n)},set_over__(e,t){this.node.set_over__(e,t,this.modelViewMatrix,this.projectionMatrix,this.viewport)},set_active__(e,t){this.node.set_active__(e,t,this.modelViewMatrix,this.projectionMatrix,this.viewport)},set_motion__(e){this.node.set_motion__(e,this.modelViewMatrix,this.projectionMatrix,this.viewport)}});const Sf=bf;i.add("PointingDeviceSensorContainer","x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer",Sf);const Tf=Sf;function vf(e){cu.call(this,e),this.addType(d.X3DPointingDeviceSensorNode)}Object.assign(Object.setPrototypeOf(vf.prototype,cu.prototype),{initialize(){cu.prototype.initialize.call(this),this.getLive().addInterest("set_live__",this),this._enabled.addInterest("set_live__",this),this.set_live__()},set_live__(){this.getLive().getValue()&&this._enabled.getValue()?(this.getBrowser().addPointingDeviceSensor(this),delete this.push):(this.getBrowser().removePointingDeviceSensor(this),this._isActive.getValue()&&(this._isActive=!1),this._isOver.getValue()&&(this._isOver=!1),this.push=Function.prototype)},set_over__(e,t){e!==this._isOver.getValue()&&(this._isOver=e,e&&(this.getBrowser().getNotification()._string=this._description))},set_active__(e,t){e!==this._isActive.getValue()&&(this._isActive=e)},set_motion__(e){},push(e,t){t.push(new Tf(this,e.getModelViewMatrix().get(),e.getProjectionMatrix().get(),e.getViewVolume().getViewport()))}}),Object.defineProperties(vf,{typeName:{value:"X3DPointingDeviceSensorNode",enumerable:!0},componentName:{value:"PointingDeviceSensor",enumerable:!0}});const Of=vf;i.add("X3DPointingDeviceSensorNode","x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode",Of);const Ef=Of;function Nf(e){Ef.call(this,e),this.addType(d.X3DTouchSensorNode)}Object.assign(Object.setPrototypeOf(Nf.prototype,Ef.prototype),{set_active__(e,t){Ef.prototype.set_active__.call(this,e,t),this._enabled.getValue()&&this._isOver.getValue()&&!e&&(this._touchTime=this.getBrowser().getCurrentTime())},set_over__:(()=>{const e=new ci,t=new ft(0,0);return function(i,n,s,r,o){Ef.prototype.set_over__.call(this,i,n,s,r,o),this._isOver.getValue()&&(t.set(n.texCoord.x,n.texCoord.y).divide(n.texCoord.w),e.assign(s).inverse(),this._hitTexCoord_changed=t,this._hitNormal_changed=s.multMatrixDir(n.normal.copy()).normalize(),this._hitPoint_changed=e.multVecMatrix(n.point.copy()))}})()}),Object.defineProperties(Nf,{typeName:{value:"X3DTouchSensorNode",enumerable:!0},componentName:{value:"PointingDeviceSensor",enumerable:!0}});const Cf=Nf;i.add("X3DTouchSensorNode","x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode",Cf);const Ff=Cf;function If(e){Ff.call(this,e),this.addType(d.TouchSensor),this._hitPoint_changed.setUnit("length")}Object.setPrototypeOf(If.prototype,Ff.prototype),Object.defineProperties(If,{typeName:{value:"TouchSensor",enumerable:!0},componentName:{value:"PointingDeviceSensor",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.outputOnly,"hitTexCoord_changed",new Yn.SFVec2f),new X(d.outputOnly,"hitNormal_changed",new Yn.SFVec3f),new X(d.outputOnly,"hitPoint_changed",new Yn.SFVec3f),new X(d.outputOnly,"isOver",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"touchTime",new Yn.SFTime)]),enumerable:!0}});const Mf=If;i.add("TouchSensor","x_ite/Components/PointingDeviceSensor/TouchSensor",Mf);const Df=Mf;function Pf(e){qu.call(this,e),Sr.call(this,e),this.addType(d.Anchor),this.touchSensorNode=new Df(e),this.anchorSensors=[]}Object.assign(Object.setPrototypeOf(Pf.prototype,qu.prototype),Sr.prototype,{initialize(){qu.prototype.initialize.call(this),Sr.prototype.initialize.call(this),this._description.addFieldInterest(this.touchSensorNode._description),this._load.addFieldInterest(this.touchSensorNode._enabled),this.touchSensorNode._description=this._description,this.touchSensorNode._enabled=this._load,this.touchSensorNode.setup(),this.touchSensorNode.set_active__=(e,t)=>{Df.prototype.set_active__.call(this.touchSensorNode,e,t),this.touchSensorNode._isOver.getValue()&&!e&&this.requestImmediateLoad().catch(Function.prototype)}},set_load__(){},set_url__(){},requestImmediateLoad(e=!0){return this.setCache(e),this.setLoadState(d.IN_PROGRESS_STATE,!1),new Promise(((e,t)=>{new uh(this).createX3DFromURL(this._url,this._parameter,(i=>{i?(this.getBrowser().replaceWorld(i),this.setLoadState(d.COMPLETE_STATE,!1),e()):(this.setLoadState(d.FAILED_STATE,!1),t())}),(t=>{this.getBrowser().changeViewpoint(t),this.setLoadState(d.COMPLETE_STATE,!1),e()}),((t,i)=>{i?window.open(t,i):location=t,this.setLoadState(d.COMPLETE_STATE,!1),e()}))}))},requestUnload(){},traverse(e,t){if(e===Ia.POINTER){const i=this.anchorSensors;i.length=0,this.touchSensorNode.push(t,i),i.length?(t.getSensors().push(i),qu.prototype.traverse.call(this,e,t),t.getSensors().pop()):qu.prototype.traverse.call(this,e,t)}else qu.prototype.traverse.call(this,e,t)},dispose(){Sr.prototype.dispose.call(this),qu.prototype.dispose.call(this)}}),Object.defineProperties(Pf,{typeName:{value:"Anchor",enumerable:!0},componentName:{value:"Networking",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"parameter",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600)),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOnly,"addChildren",new Yn.MFNode),new X(d.inputOnly,"removeChildren",new Yn.MFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Rf=Pf;i.add("Anchor","x_ite/Components/Networking/Anchor",Rf);const Af=Rf;function Vf(e){Hs.call(this,e),Sr.call(this,e),ju.call(this,e),this.addType(d.Inline),e.getSpecificationVersion()<4&&(this._global=!0),this.scene=this.getBrowser().getDefaultScene(),this.groupNode=new $u(e),this.localObjects=[],this.localShadows=!1}Object.assign(Object.setPrototypeOf(Vf.prototype,Hs.prototype),Sr.prototype,ju.prototype,{initialize(){Hs.prototype.initialize.call(this),Sr.prototype.initialize.call(this),ju.prototype.initialize.call(this),this.groupNode.setPrivate(!0),this.groupNode.setup(),this.groupNode._isCameraObject.addFieldInterest(this._isCameraObject),this.groupNode._isPickableObject.addFieldInterest(this._isPickableObject),this.requestImmediateLoad().catch(Function.prototype)},getBBox(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?this.groupNode.getBBox(e,t):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},set_live__(){Sr.prototype.set_live__.call(this),this.scene.setLive(this.getLive().getValue())},unloadData(){this.abortLoading(),this.setInternalScene(this.getBrowser().getDefaultScene())},loadData(){this.abortLoading(),this.fileLoader=new uh(this).createX3DFromURL(this._url,null,this.setInternalSceneAsync.bind(this))},abortLoading(){this.scene._loadCount.removeInterest("checkLoadCount",this),this.fileLoader&&this.fileLoader.abort()},setInternalSceneAsync(e){e?(e._loadCount.addInterest("checkLoadCount",this),this.setInternalScene(e),this.checkLoadCount(e._loadCount)):(this.setInternalScene(this.getBrowser().getDefaultScene()),this.setLoadState(d.FAILED_STATE))},checkLoadCount(e){e.getValue()||(e.removeInterest("checkLoadCount",this),this.setLoadState(d.COMPLETE_STATE))},setInternalScene(e){this.scene.setLive(!1),this.scene.rootNodes.removeFieldInterest(this.groupNode._children),this.scene=e,this.scene.setExecutionContext(this.getExecutionContext()),this.scene.rootNodes.addFieldInterest(this.groupNode._children),this.groupNode._children=this.scene.rootNodes,this.set_live__(),this.getBrowser().addBrowserEvent()},getInternalScene(){return this.scene},traverse(e,t){switch(e){case Ia.PICKING:{const i=this.getBrowser().getPickingHierarchy();return i.push(this),this.groupNode.traverse(e,t),void i.pop()}case Ia.DISPLAY:if(this._global.getValue())this.groupNode.traverse(e,t);else{const i=t.getGlobalObjects(),n=t.getGlobalShadows(),s=i.length,r=n.length,o=this.localObjects,a=o.length,l=o.reduce(((e,t)=>e+!!t.lightNode),0),u=o.reduce(((e,t)=>e+!!t.textureProjectorNode),0);if(a&&(t.getLocalObjects().push(...o),t.pushLocalShadows(this.localShadows),t.getLocalObjectsCount()[1]+=l,t.getLocalObjectsCount()[2]+=u),this.groupNode.traverse(e,t),a){if(t.isIndependent()){const e=this.getBrowser();for(let i=0;i<a;++i)e.getLocalObjects().push(t.getLocalObjects().pop())}else for(let e=0;e<a;++e)t.getLocalObjects().pop();t.popLocalShadows(),t.getLocalObjectsCount()[1]-=l,t.getLocalObjectsCount()[2]-=u}const h=i.length-s;for(let e=0;e<h;++e){const t=i[s+e];t.groupNode=this.groupNode,t.global=!1,o[e]=t}o.length=h,this.localShadows=n.at(-1),i.length=s,n.length=r}return;default:return void this.groupNode.traverse(e,t)}},dispose(){ju.prototype.dispose.call(this),Sr.prototype.dispose.call(this),Hs.prototype.dispose.call(this)}}),Object.defineProperties(Vf,{typeName:{value:"Inline",enumerable:!0},componentName:{value:"Networking",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"global",new Yn.SFBool),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600)),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f)]),enumerable:!0}});const Lf=Vf;i.add("Inline","x_ite/Components/Networking/Inline",Lf);const Bf=Lf;function Uf(e){cu.call(this,e),this.addType(d.X3DNetworkSensorNode)}Object.setPrototypeOf(Uf.prototype,cu.prototype),Object.defineProperties(Uf,{typeName:{value:"X3DNetworkSensorNode",enumerable:!0},componentName:{value:"Networking",enumerable:!0}});const Xf=Uf;i.add("X3DNetworkSensorNode","x_ite/Components/Networking/X3DNetworkSensorNode",Xf);const kf=Xf;function jf(e){kf.call(this,e),this.addType(d.LoadSensor),e.getSpecificationVersion()<=3.3&&this.addAlias("watchList",this._children),this.urlObjects=[],this.aborted=!1,this.timeOutId=void 0}Object.assign(Object.setPrototypeOf(jf.prototype,kf.prototype),{initialize(){kf.prototype.initialize.call(this),this._enabled.addInterest("set_enabled__",this),this._timeOut.addInterest("set_timeOut__",this),this._children.addInterest("set_children__",this),this.set_children__()},set_enabled__(){this._enabled.getValue()?this.reset():(this.abort(),this.remove())},set_timeOut__(){this._isActive.getValue()&&(this.clearTimeout(),this.aborted=!1,this._timeOut.getValue()>0&&(this.timeOutId=setTimeout(this.abort.bind(this),1e3*this._timeOut.getValue())))},set_children__(){this.reset()},set_loadState__(e){switch(e.checkLoadState()){case d.NOT_STARTED_STATE:break;case d.IN_PROGRESS_STATE:case d.COMPLETE_STATE:case d.FAILED_STATE:this.count()}},count(){const e=this.urlObjects;if(e.length){let t=0,i=0;for(const n of e)t+=n.checkLoadState()==d.COMPLETE_STATE,i+=n.checkLoadState()==d.FAILED_STATE;const n=t===e.length,s=t/e.length;this.aborted||i||n?(this.clearTimeout(),this._isActive=!1,this._isLoaded=n,this._progress=s,n&&(this._loadTime=this.getBrowser().getCurrentTime())):this._isActive.getValue()?this._progress=s:(this._isActive=!0,this._progress=s,this.set_timeOut__())}else this._isActive=!1,this._isLoaded=!1,this._progress=0},abort(){this.clearTimeout(),this.aborted=!0,this._enabled.getValue()&&this.count()},reset(){if(this.remove(),!this._enabled.getValue())return;const e=this.urlObjects;for(const t of this._children){const i=ql(d.X3DUrlObject,t);i&&(e.push(i),i._loadState.addInterest("set_loadState__",this,i))}this.count()},remove(){this.clearTimeout();const e=this.urlObjects;for(const t of e)t._loadState.removeInterest("set_loadState__",this);e.length=0},clearTimeout(){clearTimeout(this.timeOutId),this.timeOutId=void 0}}),Object.defineProperties(jf,{typeName:{value:"LoadSensor",enumerable:!0},componentName:{value:"Networking",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"timeOut",new Yn.SFTime),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"isLoaded",new Yn.SFBool),new X(d.outputOnly,"progress",new Yn.SFFloat),new X(d.outputOnly,"loadTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const zf=jf;i.add("LoadSensor","x_ite/Components/Networking/LoadSensor",zf);const Gf=zf,Hf={name:"Networking",concreteNodes:[Af,Bf,Gf],abstractNodes:[kf,Sr]};i.add("Networking","x_ite/Components/Networking",Hf);const qf=Hf;function Yf(e){Ef.call(this,e),this.addType(d.X3DDragSensorNode),this._trackPoint_changed.setUnit("length")}Object.setPrototypeOf(Yf.prototype,Ef.prototype),Object.defineProperties(Yf,{typeName:{value:"X3DDragSensorNode",enumerable:!0},componentName:{value:"PointingDeviceSensor",enumerable:!0}});const Wf=Yf;i.add("X3DDragSensorNode","x_ite/Components/PointingDeviceSensor/X3DDragSensorNode",Wf);const $f=Wf;function Jf(e,t){this.axis=e.copy(),this.radius=t}Object.assign(Jf.prototype,{intersectsLine(e,t,i){const n=new ai(this.axis.direction,new bt(0,1,0)),s=ci.Rotation(n),r=1/this.radius,o=new ci;o.scale(new bt(r,r,r)),o.multLeft(s);const a=e.point.copy().subtract(this.axis.point),l=new ja(a,e.direction).multLineMatrix(o),u=this.unitCylinderIntersectsLine(l,t,i);if(u){const e=o.inverse();e.multVecMatrix(t),t.add(this.axis.point),e.multVecMatrix(i),i.add(this.axis.point)}return u},unitCylinderIntersectsLine(e,t,i){let n,s;const r=e.point,o=e.direction,a=o[0]*o[0]+o[2]*o[2],l=2*(r[0]*o[0]+r[2]*o[2]),u=r[0]*r[0]+r[2]*r[2]-1,h=l*l-4*a*u;if(h<0)return!1;const d=Math.sqrt(h);return l>0?(n=-2*u/(d+l),s=-(d+l)/(2*a)):(n=2*u/(d-l),s=(d-l)/(2*a)),t.assign(o).multiply(n).add(r),i.assign(o).multiply(s).add(r),!0},toString(){return`${this.axis}, ${this.radius}`}});const Kf=Jf;i.add("Cylinder3","standard/Math/Geometry/Cylinder3",Kf);const Zf=Kf;function Qf(e){$f.call(this,e),this.addType(d.CylinderSensor),this._diskAngle.setUnit("angle"),this._minAngle.setUnit("angle"),this._maxAngle.setUnit("angle"),this._offset.setUnit("angle")}Object.assign(Object.setPrototypeOf(Qf.prototype,$f.prototype),{initialize(){$f.prototype.initialize.call(this),this.modelViewMatrix=new ci,this.invModelViewMatrix=new ci,this.cylinder=new Zf(new ja(new bt(0,0,0),new bt(0,0,0)),0),this.disk=!1,this.yPlane=null,this.zPlane=null,this.sxPlane=null,this.szNormal=null,this.behind=!1,this.fromVector=new bt(0,0,0),this.startOffset=new ai},isBehind(e,t){const i=new bt(0,0,0),n=new bt(0,0,0);return this.cylinder.intersectsLine(e,i,n),t.distance(i)>t.distance(n)},getTrackPoint(e,t){const i=new bt(0,0,0);this.zPlane.intersectsLine(e,i);const n=i.copy().add(this.cylinder.axis.getPerpendicularVectorToPoint(i,new bt(0,0,0))),s=this.sxPlane.getDistanceToPoint(i)/this.cylinder.radius,r=Math.floor((s+1)/2),o=g.interval(s,-1,1),a=(0===r?Math.asin(o):o*Math.PI/2)+r*Math.PI;new ai(this.cylinder.axis.direction,a).multVecRot(t.assign(this.szNormal).multiply(this.cylinder.radius)),t.add(n)},getAngle(e){return e.getAxis(new bt(0,0,0)).dot(this.cylinder.axis.direction)>0?e.angle:-e.angle},set_active__(e,t,i,n,s){if($f.prototype.set_active__.call(this,e,t,i,n,s),this._isActive.getValue()){this.modelViewMatrix.assign(i),this.invModelViewMatrix.assign(i).inverse();const e=t.hitRay.copy().multLineMatrix(this.invModelViewMatrix),n=this.invModelViewMatrix.multVecMatrix(t.point.copy()),s=this._axisRotation.getValue().multVecRot(new bt(0,1,0)),r=this.invModelViewMatrix.multDirMatrix(new bt(0,0,1)).normalize(),o=new ja(new bt(0,0,0),s),a=o.getPerpendicularVectorToPoint(n,new bt(0,0,0)).magnitude();this.cylinder=new Zf(o,a),this.disk=Math.abs(r.dot(s))>Math.cos(this._diskAngle.getValue()),this.behind=this.isBehind(e,n),this.yPlane=new ha(n,s),this.zPlane=new ha(n,r);const l=this.invModelViewMatrix.origin,u=s.copy().cross(l).normalize();this.sxPlane=new ha(new bt(0,0,0),u),this.szNormal=u.copy().cross(s).normalize();const h=new bt(0,0,0);this.disk?this.yPlane.intersectsLine(e,h):this.getTrackPoint(e,h),this.fromVector=this.cylinder.axis.getPerpendicularVectorToPoint(h,new bt(0,0,0)).negate(),this.startOffset=new ai(s,this._offset.getValue()),this._trackPoint_changed=h,this._rotation_changed=this.startOffset,this.angle=this._offset.getValue(),this.startVector=this._rotation_changed.getValue().multVecRot(this._axisRotation.getValue().multVecRot(new bt(0,0,1)))}else this._autoOffset.getValue()&&(this._offset=this.getAngle(this._rotation_changed.getValue()))},set_motion__(e){const t=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),i=new bt(0,0,0);this.disk?this.yPlane.intersectsLine(t,i):this.getTrackPoint(t,i),this._trackPoint_changed=i;const n=this.cylinder.axis.getPerpendicularVectorToPoint(i,new bt(0,0,0)).negate(),s=new ai(this.fromVector,n);if(this.disk){this.modelViewMatrix.multVecMatrix(i.copy()).z>0&&s.multRight(new ai(this.yPlane.normal,Math.PI))}else this.behind&&s.inverse();if(s.multLeft(this.startOffset),this._minAngle.getValue()>this._maxAngle.getValue())this._rotation_changed=s;else{const e=s.multVecRot(this._axisRotation.getValue().multVecRot(new bt(0,0,1))),t=new ai(this.startVector,e),i=this._axisRotation.getValue().multVecRot(new bt(0,1,0)).dot(t.getAxis(new bt(0,0,0)))>0?1:-1,n=this._minAngle.getValue(),r=this._maxAngle.getValue();this.angle+=i*t.angle,this.startVector.assign(e),this.angle<n?s.setAxisAngle(this.cylinder.axis.direction,n):this.angle>r?s.setAxisAngle(this.cylinder.axis.direction,r):s.setAxisAngle(this.cylinder.axis.direction,this.angle),this._rotation_changed.getValue().equals(s)||(this._rotation_changed=s)}}}),Object.defineProperties(Qf,{typeName:{value:"CylinderSensor",enumerable:!0},componentName:{value:"PointingDeviceSensor",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"axisRotation",new Yn.SFRotation),new X(d.inputOutput,"diskAngle",new Yn.SFFloat(.261792)),new X(d.inputOutput,"minAngle",new Yn.SFFloat),new X(d.inputOutput,"maxAngle",new Yn.SFFloat(-1)),new X(d.inputOutput,"offset",new Yn.SFFloat),new X(d.inputOutput,"autoOffset",new Yn.SFBool(!0)),new X(d.outputOnly,"trackPoint_changed",new Yn.SFVec3f),new X(d.outputOnly,"rotation_changed",new Yn.SFRotation),new X(d.outputOnly,"isOver",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const em=Qf;i.add("CylinderSensor","x_ite/Components/PointingDeviceSensor/CylinderSensor",em);const tm=em;function im(e,t){this.point=e.copy(),this.direction=t.copy()}Object.assign(im.prototype,{copy(){const e=Object.create(im.prototype);return e.point=this.point.copy(),e.direction=this.direction.copy(),e},assign(e){return this.point.assign(e.point),this.direction.assign(e.direction),this},set(e,t){return this.point.assign(e),this.direction.assign(t),this},setPoints(e,t){return this.point.assign(e),this.direction.assign(t).subtract(e).normalize(),this},multMatrixLine(e){return e.multMatrixVec(this.point),e.multMatrixDir(this.direction).normalize(),this},multLineMatrix(e){return e.multVecMatrix(this.point),e.multDirMatrix(this.direction).normalize(),this},getClosestPointToPoint(e,t){const i=t.assign(e).subtract(this.point).dot(this.direction);return t.assign(this.direction).multiply(i).add(this.point)},getPerpendicularVectorToPoint:(()=>{const e=new ft(0,0);return function(t,i){return i.assign(this.point).subtract(t),i.subtract(e.assign(this.direction).multiply(i.dot(this.direction)))}})(),intersectsLine:(()=>{const e=new ft(0,0);return function(t,i){const{point:n,direction:s}=this,{point:r,direction:o}=t,a=s.dot(o);if(Math.abs(a)>=1)return!1;e.assign(r).subtract(n);const l=(e.dot(s)-a*e.dot(o))/(1-a*a);return i.assign(s).multiply(l).add(n),!0}})(),toString(){return`${this.point}, ${this.direction}`}}),Object.assign(im,{Points(e,t){const i=Object.create(im.prototype);return i.point=e.copy(),i.direction=t.copy().subtract(e).normalize(),i}});const nm=im;i.add("Line2","standard/Math/Geometry/Line2",nm);const sm=new nm(ft.Zero,ft.Zero),rm=new ft(0,0,0),om=new ja(bt.Zero,bt.Zero);function am(e){$f.call(this,e),this.addType(d.PlaneSensor),this._offset.setUnit("length"),this._minPosition.setUnit("length"),this._maxPosition.setUnit("length"),this._translation_changed.setUnit("length")}Object.assign(Object.setPrototypeOf(am.prototype,$f.prototype),{initialize(){$f.prototype.initialize.call(this),this.modelViewMatrix=new ci,this.invModelViewMatrix=new ci,this.projectionMatrix=new ci,this.viewport=new jt,this.planeSensor=!0,this.plane=null,this.line=null,this.startOffset=new bt(0,0,0),this.startPoint=new bt(0,0,0)},getLineTrackPoint(e,t,i){return va.projectLine(t,this.modelViewMatrix,this.projectionMatrix,this.viewport,sm),sm.getClosestPointToPoint(e.pointer,rm),va.unProjectRay(rm.x,rm.y,this.modelViewMatrix,this.projectionMatrix,this.viewport,om),t.getClosestPointToLine(om,i)},set_active__(e,t,i,n,s){if($f.prototype.set_active__.call(this,e,t,i,n,s),this._isActive.getValue()){this.modelViewMatrix.assign(i),this.projectionMatrix.assign(n),this.viewport.assign(s),this.invModelViewMatrix.assign(i).inverse();const e=t.hitRay.copy().multLineMatrix(this.invModelViewMatrix),r=this.invModelViewMatrix.multVecMatrix(t.point.copy()),o=this._axisRotation.getValue();if(this._minPosition.x===this._maxPosition.x){this.planeSensor=!1;const e=o.multVecRot(new bt(0,Math.abs(this._maxPosition.y-this._minPosition.y),0));this.line=new ja(r,e.normalize())}else if(this._minPosition.y===this._maxPosition.y){this.planeSensor=!1;const e=o.multVecRot(new bt(Math.abs(this._maxPosition.x-this._minPosition.x),0,0));this.line=new ja(r,e.normalize())}else this.planeSensor=!0,this.plane=new ha(r,o.multVecRot(new bt(0,0,1)));if(this.planeSensor)this.plane.intersectsLine(e,this.startPoint)&&this.trackStart(this.startPoint);else if(this.getLineTrackPoint(t,this.line,this.startPoint)){const e=new bt(0,0,0);try{this.getLineTrackPoint(t,new ja(this.line.direction,this.line.direction),e)}catch{e.assign(this.startPoint)}this.trackStart(e)}}else this._autoOffset.getValue()&&(this._offset=this._translation_changed)},trackStart(e){this.startOffset.assign(this._offset.getValue()),this._trackPoint_changed=e,this._translation_changed=this._offset.getValue()},set_motion__(e){try{if(this.planeSensor){const t=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),i=new bt(0,0,0);if(!this.plane.intersectsLine(t,i))throw new Error("Plane and line are parallel.");this.track(i,i.copy())}else{const t=new bt(0,0,0),i=new bt(0,0,0);if(!this.getLineTrackPoint(e,this.line,t))throw new Error("Lines are parallel.");try{this.getLineTrackPoint(e,new ja(bt.Zero,this.line.direction),i)}catch{i.assign(t)}this.track(t,i)}}catch{this._trackPoint_changed.addEvent(),this._translation_changed.addEvent()}},track(e,t){const i=this._axisRotation.getValue(),n=i.copy().inverse().multVecRot(e.add(this.startOffset).subtract(this.startPoint));this._minPosition.x>this._maxPosition.x||(n.x=g.clamp(n.x,this._minPosition.x,this._maxPosition.x)),this._minPosition.y>this._maxPosition.y||(n.y=g.clamp(n.y,this._minPosition.y,this._maxPosition.y)),i.multVecRot(n),this._trackPoint_changed.getValue().equals(t)||(this._trackPoint_changed=t),this._translation_changed.getValue().equals(n)||(this._translation_changed=n)}}),Object.defineProperties(am,{typeName:{value:"PlaneSensor",enumerable:!0},componentName:{value:"PointingDeviceSensor",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"axisRotation",new Yn.SFRotation),new X(d.inputOutput,"autoOffset",new Yn.SFBool(!0)),new X(d.inputOutput,"offset",new Yn.SFVec3f),new X(d.inputOutput,"minPosition",new Yn.SFVec2f),new X(d.inputOutput,"maxPosition",new Yn.SFVec2f(-1,-1)),new X(d.outputOnly,"trackPoint_changed",new Yn.SFVec3f),new X(d.outputOnly,"translation_changed",new Yn.SFVec3f),new X(d.outputOnly,"isOver",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const lm=am;i.add("PlaneSensor","x_ite/Components/PointingDeviceSensor/PlaneSensor",lm);const um=lm;function hm(e,t){this.radius=e,this.center=t.copy()}Object.assign(hm.prototype,{set(e,t){this.radius=e,this.center.assign(t)},intersectsLine(e,t,i){const{point:n,direction:s}=e,{center:r,radius:o}=this,a=2*(n.dot(s)-r.dot(s)),l=a*a-4*(n.x*n.x+n.y*n.y+n.z*n.z+(r.x*r.x+r.y*r.y+r.z*r.z)-2*n.dot(r)-o*o);if(l>=0){let e=(-a+Math.sqrt(l))/2,r=(-a-Math.sqrt(l))/2;if(e>r){const t=e;e=r,r=t}return t.assign(s).multiply(e).add(n),i.assign(s).multiply(r).add(n),!0}return!1},intersectsTriangle:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0),s=new bt(0,0,0),r=new bt(0,0,0),o=new bt(0,0,0);return function(a,l,u){const h=this.center,d=this.radius;a.subtract(h),l.subtract(h),u.subtract(h),e.assign(l).subtract(a),t.assign(u).subtract(a);const c=d*d,p=e.cross(t),g=a.dot(p);if(g*g>c*p.dot(p))return!1;const f=a.dot(a),m=a.dot(l),_=a.dot(u),x=l.dot(l),y=l.dot(u),w=u.dot(u);if(f>c&&m>f&&_>f||x>c&&m>x&&y>x||w>c&&_>w&&y>w)return!1;e.assign(l).subtract(a),i.assign(u).subtract(l),n.assign(a).subtract(u);const b=m-f,S=y-x,T=_-w,v=e.dot(e),O=i.dot(i),E=n.dot(n);s.assign(a).multiply(v).subtract(e.multiply(b)),r.assign(l).multiply(O).subtract(i.multiply(S)),o.assign(u).multiply(E).subtract(n.multiply(T));const N=u.multiply(v).subtract(s),C=a.multiply(O).subtract(r),F=l.multiply(E).subtract(o),I=s.dot(s)>c*v*v&&s.dot(N)>0,M=r.dot(r)>c*O*O&&r.dot(C)>0,D=o.dot(o)>c*E*E&&o.dot(F)>0;return!(I||M||D)}})(),toString(){return`${this.radius} ${this.center}`}});const dm=hm;i.add("Sphere3","standard/Math/Geometry/Sphere3",dm);const cm=dm;function pm(e){$f.call(this,e),this.addType(d.SphereSensor)}Object.assign(Object.setPrototypeOf(pm.prototype,$f.prototype),{initialize(){$f.prototype.initialize.call(this),this.modelViewMatrix=new ci,this.invModelViewMatrix=new ci,this.sphere=null,this.zPlane=null,this.behind=!1,this.fromVector=new bt(0,0,0),this.startPoint=new bt(0,0,0),this.startOffset=new ai},getTrackPoint(e,t,i){const n=new bt(0,0,0);return!!this.sphere.intersectsLine(e,t,n)&&((e.point.distance(n)<e.point.distance(t))-i&&t.assign(n),!0)},set_active__(e,t,i,n,s){if($f.prototype.set_active__.call(this,e,t,i,n,s),this._isActive.getValue()){this.modelViewMatrix.assign(i),this.invModelViewMatrix.assign(i).inverse();const e=this.invModelViewMatrix.multVecMatrix(t.point.copy()),n=new bt(0,0,0);this.zPlane=new ha(n,this.invModelViewMatrix.multDirMatrix(new bt(0,0,1)).normalize()),this.sphere=new cm(e.magnitude(),n),this.behind=this.zPlane.getDistanceToPoint(e)<0,this.fromVector.assign(e),this.startPoint.assign(e),this.startOffset.assign(this._offset.getValue()),this._trackPoint_changed=e,this._rotation_changed=this._offset.getValue()}else this._autoOffset.getValue()&&(this._offset=this._rotation_changed)},set_motion__(e){const t=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),i=new bt(0,0,0);if(this.getTrackPoint(t,i,this.behind)){const e=this.invModelViewMatrix.multDirMatrix(new bt(0,0,1)).normalize();this.zPlane=new ha(i,e)}else{const e=new bt(0,0,0);this.zPlane.intersectsLine(t,e),t.set(e,this.sphere.center.copy().subtract(e).normalize()),this.getTrackPoint(t,i,!1);const n=ga.normal(this.sphere.center,i,this.startPoint,new bt(0,0,0)),s=i.copy().subtract(this.sphere.center).normalize(),r=n.copy().cross(s).normalize(),o=i.copy().subtract(r.multiply(e.copy().subtract(i).magnitude()));t.set(o,this.sphere.center.copy().subtract(o).normalize()),this.getTrackPoint(t,i,!1)}this._trackPoint_changed=i;const n=i.copy().subtract(this.sphere.center),s=new ai(this.fromVector,n);this.behind&&s.inverse(),this._rotation_changed=this.startOffset.copy().multRight(s)}}),Object.defineProperties(pm,{typeName:{value:"SphereSensor",enumerable:!0},componentName:{value:"PointingDeviceSensor",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"autoOffset",new Yn.SFBool(!0)),new X(d.inputOutput,"offset",new Yn.SFRotation),new X(d.outputOnly,"trackPoint_changed",new Yn.SFVec3f),new X(d.outputOnly,"rotation_changed",new Yn.SFRotation),new X(d.outputOnly,"isOver",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const gm=pm;i.add("SphereSensor","x_ite/Components/PointingDeviceSensor/SphereSensor",gm);const fm={name:"PointingDeviceSensor",concreteNodes:[tm,um,gm,Df],abstractNodes:[$f,Ef,Ff]};i.add("PointingDeviceSensor","x_ite/Components/PointingDeviceSensor",fm);const mm=fm,_m=al(xm);function xm(){this.plane=new ha(bt.Zero,bt.Zero)}function ym(e){Hs.call(this,e),this.addType(d.ClipPlane),this.enabled=!1,this.plane=new jt(0,0,0,0)}Object.assign(xm.prototype,{isClipped(e){return this.plane.getDistanceToPoint(e)<0},set(e,t){const i=this.plane,n=e.plane;i.normal.assign(n),i.distanceFromOrigin=-n.w,i.multRight(t)},setShaderUniforms(e,t){const i=this.plane,n=i.normal;e.uniform4f(t.x3d_ClipPlane[t.numClipPlanes++],n.x,n.y,n.z,i.distanceFromOrigin)},dispose(){_m.push(this)}}),Object.assign(Object.setPrototypeOf(ym.prototype,Hs.prototype),{initialize(){Hs.prototype.initialize.call(this),this._enabled.addInterest("set_enabled__",this),this._plane.addInterest("set_enabled__",this),this.set_enabled__()},set_enabled__(){this.plane.assign(this._plane.getValue()),this.enabled=this._enabled.getValue()&&!this.plane.equals(jt.Zero)},push(e){if(this.enabled){const t=_m.pop();t.set(this,e.getModelViewMatrix().get()),e.getLocalObjects().push(t),++e.getLocalObjectsCount()[0]}},pop(e){this.enabled&&(this.getBrowser().getLocalObjects().push(e.getLocalObjects().pop()),--e.getLocalObjectsCount()[0])}}),Object.defineProperties(ym,{typeName:{value:"ClipPlane",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"plane",new Yn.SFVec4f(0,1,0,0))]),enumerable:!0}});const wm=ym;i.add("ClipPlane","x_ite/Components/Rendering/ClipPlane",wm);const bm=wm;function Sm(e){Zh.call(this,e),this.addType(d.X3DColorNode),this.addChildObjects(d.outputOnly,"transparent",new Yn.SFBool)}Object.assign(Object.setPrototypeOf(Sm.prototype,Zh.prototype),{setTransparent(e){e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()}}),Object.defineProperties(Sm,{typeName:{value:"X3DColorNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const Tm=Sm;i.add("X3DColorNode","x_ite/Components/Rendering/X3DColorNode",Tm);const vm=Tm;function Om(e){vm.call(this,e),this.addType(d.Color)}Object.assign(Object.setPrototypeOf(Om.prototype,vm.prototype),{initialize(){vm.prototype.initialize.call(this),this._color.addInterest("set_color__",this),this.set_color__()},set_color__(){this.color=this._color.getValue(),this.length=this._color.length},addColor(e,t){if(e>=0&&this.length){const i=this.color,n=e%this.length*3;return t.push(i[n],i[n+1],i[n+2],1)}t.push(1,1,1,1)},addColors(e,t=this.length){const i=this.length;if(i){const n=this.color;for(let s=0;s<t;++s){const t=s%i*3;e.push(n[t],n[t+1],n[t+2],1)}}else for(let i=0;i<t;++i)e.push(1,1,1,1);return e}}),Object.defineProperties(Om,{typeName:{value:"Color",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"color",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.MFColor)]),enumerable:!0}});const Em=Om;i.add("Color","x_ite/Components/Rendering/Color",Em);const Nm=Em;function Cm(e){vm.call(this,e),this.addType(d.ColorRGBA),this.setTransparent(!0)}Object.assign(Object.setPrototypeOf(Cm.prototype,vm.prototype),{initialize(){vm.prototype.initialize.call(this),this._color.addInterest("set_color__",this),this.set_color__()},set_color__(){this.color=this._color.getValue(),this.length=this._color.length},addColor(e,t){if(e>=0&&this.length){const i=this.color,n=e%this.length*4;return t.push(i[n],i[n+1],i[n+2],i[n+3])}t.push(1,1,1,1)},addColors(e,t=this.length){const i=this.length;if(i){const n=this.color;for(let s=0;s<t;++s){const t=s%i*4;e.push(n[t],n[t+1],n[t+2],n[t+3])}}else for(let i=0;i<t;++i)e.push(1,1,1,1);return e}}),Object.defineProperties(Cm,{typeName:{value:"ColorRGBA",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"color",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.MFColorRGBA)]),enumerable:!0}});const Fm=Cm;i.add("ColorRGBA","x_ite/Components/Rendering/ColorRGBA",Fm);const Im=Fm;function Mm(e){Zh.call(this,e),this.addType(d.X3DCoordinateNode)}Object.assign(Object.setPrototypeOf(Mm.prototype,Zh.prototype),{initialize(){Zh.prototype.initialize.call(this),this._point.addInterest("set_point__",this),this.set_point__()},set_point__(){this.point=this._point.getValue(),this.length=this._point.length},isEmpty(){return 0===this.length},getSize(){return this.length},set1Point(e,t){this._point[e]=t},get1Point(e,t){if(e<this.length){const i=this.point;return e*=3,t.set(i[e],i[e+1],i[e+2])}return t.set(0,0,0)},addPoint(e,t){if(e<this.length){const i=this.point;e*=3,t.push(i[e],i[e+1],i[e+2],1)}else t.push(0,0,0,1)},addPoints(e){const t=this.point,i=3*this.length;for(let n=0;n<i;n+=3)e.push(t[n],t[n+1],t[n+2],1);return e},getNormal:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0);return function(n,s,r){const o=this.length;return n<o&&s<o&&r<o?ga.normal(this.get1Point(n,e),this.get1Point(s,t),this.get1Point(r,i),new bt(0,0,0)):new bt(0,0,0)}})(),getQuadNormal:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0);return function(s,r,o,a){const l=this.length;return s<l&&r<l&&o<l&&a<l?ga.quadNormal(this.get1Point(s,e),this.get1Point(r,t),this.get1Point(o,i),this.get1Point(a,n),new bt(0,0,0)):new bt(0,0,0)}})()}),Object.defineProperties(Mm,{typeName:{value:"X3DCoordinateNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const Dm=Mm;i.add("X3DCoordinateNode","x_ite/Components/Rendering/X3DCoordinateNode",Dm);const Pm=Dm;function Rm(e){Pm.call(this,e),this.addType(d.Coordinate),this._point.setUnit("length")}Object.setPrototypeOf(Rm.prototype,Pm.prototype),Object.defineProperties(Rm,{typeName:{value:"Coordinate",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"coord",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"point",new Yn.MFVec3f)]),enumerable:!0}});const Am=Rm;i.add("Coordinate","x_ite/Components/Rendering/Coordinate",Am);const Vm=Am;function Lm(e){this.getExecutionContext()||Ol.call(this,e);const t=this.getBrowser().getContext();this.lineStipples=new Float32Array,this.lineStippleBuffer=t.createBuffer(),this.trianglesBuffer=t.createBuffer(),this.thickVertexArrayObject=new xl(t),this.setGeometryType(1),this.setPrimitiveMode(t.LINES),this.setSolid(!1)}Object.assign(Object.setPrototypeOf(Lm.prototype,Ol.prototype),{intersectsLine:()=>!1,intersectsBox:()=>!1,updateVertexArrays(){Ol.prototype.updateVertexArrays.call(this),this.thickVertexArrayObject.update()},buildTexCoords(){if(this.lineStipples.length/6==this.getVertices().length/8)return;const e=this.getBrowser().getContext(),t=this.getVertices().length/8;this.lineStipples=new Float32Array(6*t),e.bindBuffer(e.ARRAY_BUFFER,this.lineStippleBuffer),e.bufferData(e.ARRAY_BUFFER,this.lineStipples,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.trianglesBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(96*t),e.DYNAMIC_DRAW)},updateLengthSoFar:(()=>{const e=new ci,t=new jt(0,0,0,0),i=new jt(0,0,0,0),n=new ft(0,0),s=new ft(0,0);return function(r,o){const a=o.renderObject.getViewVolume().getViewport(),l=o.renderObject.getProjectionMatrix().get(),u=this.lineStipples,h=this.getVertices().getValue(),d=h.length;e.assign(o.modelViewMatrix).multRight(l);let c=0;for(let r=0,o=0;r<d;r+=8,o+=6)t.set(h[r],h[r+1],h[r+2],h[r+3]),i.set(h[r+4],h[r+5],h[r+6],h[r+7]),va.projectPointMatrix(t,e,a,n),va.projectPointMatrix(i,e,a,s),u[o]=s.x,u[o+1]=s.y,u[o+3]=n.x,u[o+4]=n.y,u[o+5]=c,c+=s.subtract(n).magnitude();r.bindBuffer(r.ARRAY_BUFFER,this.lineStippleBuffer),r.bufferData(r.ARRAY_BUFFER,u,r.DYNAMIC_DRAW)}})(),displaySimple(e,t,i){const n=t.shapeNode.getAppearance().getStyleProperties(1);if(n&&n.getTransformLines()){if(this.thickVertexArrayObject.enable(i)){const t=16*Float32Array.BYTES_PER_ELEMENT,n=0,s=1*Float32Array.BYTES_PER_ELEMENT,r=9*Float32Array.BYTES_PER_ELEMENT,o=12*Float32Array.BYTES_PER_ELEMENT;i.enableCoordIndexAttribute(e,this.trianglesBuffer,t,n),i.enableLineStippleAttribute(e,this.trianglesBuffer,t,s),this.hasNormals&&i.enableNormalAttribute(e,this.trianglesBuffer,t,r),i.enableVertexAttribute(e,this.trianglesBuffer,t,o),e.bindBuffer(e.ARRAY_BUFFER,null)}return e.frontFace(e.CCW),e.enable(e.CULL_FACE),void e.drawArrays(e.TRIANGLES,0,3*this.vertexCount)}this.vertexArrayObject.enable(i)&&(this.coordIndices.length&&i.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0),i.enableLineStippleAttribute(e,this.lineStippleBuffer,0,0),this.hasNormals&&i.enableNormalAttribute(e,this.normalBuffer,0,0),i.enableVertexAttribute(e,this.vertexBuffer,0,0)),e.drawArrays(this.primitiveMode,0,this.vertexCount),e.lineWidth(1)},display:(()=>{const e=new ci,t=new Float32Array(16),i=new Float32Array(16);return function(n,s){const r=this.getBrowser(),o=s.appearanceNode,a=o.getLineProperties(),l=o.getShader(this,s),u=o.getBlendMode(),h=this.getAttrib(),d=this.getAttribBuffers();if(a&&(a.getApplied()&&1!==a.getLinetype()&&this.updateLengthSoFar(n,s),a.getTransformLines())){const o=s.renderObject,h=o.getViewVolume().getViewport(),d=o.getProjectionMatrix().get(),c=r.getWireframe()?n.TRIANGLES:r.getPrimitiveMode(n.TRIANGLES),p=r.getLineTransformShader();if(t.set(e.assign(s.modelViewMatrix).multRight(d)),i.set(e.inverse()),p.enable(n),n.uniform4f(p.viewport,h.x,h.y,h.z,h.w),n.uniformMatrix4fv(p.modelViewProjectionMatrix,!1,t),n.uniformMatrix4fv(p.invModelViewProjectionMatrix,!1,i),n.uniform1f(p.scale,a.getLinewidthScaleFactor()/2),this.thickVertexArrayObject.enable(p)){const e=2*Float32Array.BYTES_PER_ELEMENT,t=0,i=1*Float32Array.BYTES_PER_ELEMENT,s=6*Float32Array.BYTES_PER_ELEMENT,r=0,o=3*Float32Array.BYTES_PER_ELEMENT,a=2*Float32Array.BYTES_PER_ELEMENT,l=0,u=1*Float32Array.BYTES_PER_ELEMENT,h=8*Float32Array.BYTES_PER_ELEMENT,d=0,c=4*Float32Array.BYTES_PER_ELEMENT,g=6*Float32Array.BYTES_PER_ELEMENT,f=0,m=3*Float32Array.BYTES_PER_ELEMENT,_=8*Float32Array.BYTES_PER_ELEMENT,x=0,y=4*Float32Array.BYTES_PER_ELEMENT;this.coordIndices.length&&(p.enableFloatAttrib(n,"x3d_CoordIndex0",this.coordIndexBuffer,1,e,t),p.enableFloatAttrib(n,"x3d_CoordIndex1",this.coordIndexBuffer,1,e,i)),p.enableFloatAttrib(n,"x3d_LineStipple0",this.lineStippleBuffer,3,s,r),p.enableFloatAttrib(n,"x3d_LineStipple1",this.lineStippleBuffer,3,s,o),this.hasFogCoords&&(p.enableFloatAttrib(n,"x3d_FogDepth0",this.fogDepthBuffer,1,a,l),p.enableFloatAttrib(n,"x3d_FogDepth1",this.fogDepthBuffer,1,a,u)),this.colorMaterial&&(p.enableFloatAttrib(n,"x3d_Color0",this.colorBuffer,4,h,d),p.enableFloatAttrib(n,"x3d_Color1",this.colorBuffer,4,h,c)),this.hasNormals&&(p.enableFloatAttrib(n,"x3d_Normal0",this.normalBuffer,3,g,f),p.enableFloatAttrib(n,"x3d_Normal1",this.normalBuffer,3,g,m)),p.enableFloatAttrib(n,"x3d_Vertex0",this.vertexBuffer,4,_,x),p.enableFloatAttrib(n,"x3d_Vertex1",this.vertexBuffer,4,_,y)}if(n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,r.getLineTransformFeedback()),n.bindBufferBase(n.TRANSFORM_FEEDBACK_BUFFER,0,this.trianglesBuffer),n.enable(n.RASTERIZER_DISCARD),n.beginTransformFeedback(n.POINTS),n.drawArraysInstanced(n.POINTS,0,this.vertexCount/2,2),n.endTransformFeedback(),n.disable(n.RASTERIZER_DISCARD),n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,null),u?.enable(n),l.enable(n),l.setUniforms(n,this,s),this.thickVertexArrayObject.enable(l)){const e=16*Float32Array.BYTES_PER_ELEMENT,t=0,i=1*Float32Array.BYTES_PER_ELEMENT,s=4*Float32Array.BYTES_PER_ELEMENT,r=5*Float32Array.BYTES_PER_ELEMENT,o=9*Float32Array.BYTES_PER_ELEMENT,a=12*Float32Array.BYTES_PER_ELEMENT;l.enableCoordIndexAttribute(n,this.trianglesBuffer,e,t),l.enableLineStippleAttribute(n,this.trianglesBuffer,e,i),this.hasFogCoords&&l.enableFogDepthAttribute(n,this.trianglesBuffer,e,s),this.colorMaterial&&l.enableColorAttribute(n,this.trianglesBuffer,e,r),this.hasNormals&&l.enableNormalAttribute(n,this.trianglesBuffer,e,o),l.enableVertexAttribute(n,this.trianglesBuffer,e,a),n.bindBuffer(n.ARRAY_BUFFER,null)}return n.frontFace(n.CCW),n.enable(n.CULL_FACE),n.drawArrays(c,0,3*this.vertexCount),void u?.disable(n)}const c=r.getPrimitiveMode(this.getPrimitiveMode());if(u?.enable(n),l.enable(n),l.setUniforms(n,this,s),this.vertexArrayObject.enable(l)){this.coordIndices.length&&l.enableCoordIndexAttribute(n,this.coordIndexBuffer,0,0);for(let e=0,t=h.length;e<t;++e)h[e].enable(n,l,d[e]);l.enableLineStippleAttribute(n,this.lineStippleBuffer,0,0),this.hasFogCoords&&l.enableFogDepthAttribute(n,this.fogDepthBuffer,0,0),this.colorMaterial&&l.enableColorAttribute(n,this.colorBuffer,0,0),this.hasNormals&&l.enableNormalAttribute(n,this.normalBuffer,0,0),l.enableVertexAttribute(n,this.vertexBuffer,0,0)}n.drawArrays(c,0,this.vertexCount),u?.disable(n),n.lineWidth(1)}})(),displayParticles(e,t,i){const n=this.getBrowser(),s=t.appearanceNode,r=s.getShader(this,t),o=s.getBlendMode(),a=this.getAttrib(),l=this.getAttribBuffers(),u=n.getPrimitiveMode(this.getPrimitiveMode());o?.enable(e),r.enable(e),r.setUniforms(e,this,t);const h=i.outputParticles;if(h.vertexArrayObject.update(this.updateParticles).enable(r)){const t=i.particleStride;r.enableParticleAttribute(e,h,t,i.particleOffset,1),r.enableParticleMatrixAttribute(e,h,t,i.matrixOffset,1);for(let t=0,i=a.length;t<i;++t)a[t].enable(e,r,l[t]);this.hasFogCoords&&r.enableFogDepthAttribute(e,this.fogDepthBuffer,0,0),this.colorMaterial&&r.enableColorAttribute(e,this.colorBuffer,0,0),this.hasNormals&&r.enableNormalAttribute(e,this.normalBuffer,0,0),r.enableVertexAttribute(e,this.vertexBuffer,0,0),this.updateParticles=!1}e.drawArraysInstanced(u,0,this.vertexCount,i.numParticles),o?.disable(e),e.lineWidth(1)}}),Object.defineProperties(Lm,{typeName:{value:"X3DLineGeometryNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const Bm=Lm;i.add("X3DLineGeometryNode","x_ite/Components/Rendering/X3DLineGeometryNode",Bm);const Um=Bm;function Xm(e){Um.call(this,e),this.addType(d.IndexedLineSet),this.fogCoordNode=null,this.colorNode=null,this.normalNode=null,this.coordNode=null}Object.assign(Object.setPrototypeOf(Xm.prototype,Um.prototype),{initialize(){Um.prototype.initialize.call(this),this._set_colorIndex.addFieldInterest(this._colorIndex),this._set_coordIndex.addFieldInterest(this._coordIndex),this._attrib.addInterest("set_attrib__",this),this._fogCoord.addInterest("set_fogCoord__",this),this._color.addInterest("set_color__",this),this._normal.addInterest("set_normal__",this),this._coord.addInterest("set_coord__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_normal__(),this.set_coord__()},set_attrib__(){const e=this.getAttrib();for(const t of e)t.removeInterest("requestRebuild",this),t._attribute_changed.removeInterest("updateVertexArrays",this);e.length=0;for(const t of this._attrib){const i=ql(d.X3DVertexAttributeNode,t);i&&e.push(i)}for(const t of e)t.addInterest("requestRebuild",this),t._attribute_changed.addInterest("updateVertexArrays",this);this.updateVertexArrays()},set_fogCoord__(){this.fogCoordNode?.removeInterest("requestRebuild",this),this.fogCoordNode=ql(d.FogCoordinate,this._fogCoord),this.fogCoordNode?.addInterest("requestRebuild",this)},set_color__(){this.colorNode?.removeInterest("requestRebuild",this),this.colorNode=ql(d.X3DColorNode,this._color),this.colorNode?.addInterest("requestRebuild",this),this.setTransparent(this.colorNode?.isTransparent()??!1)},set_normal__(){this.normalNode?.removeInterest("requestRebuild",this),this.normalNode=ql(d.X3DNormalNode,this._normal),this.normalNode?.addInterest("requestRebuild",this)},set_coord__(){this.coordNode?.removeInterest("requestRebuild",this),this.coordNode=ql(d.X3DCoordinateNode,this._coord),this.coordNode?.addInterest("requestRebuild",this)},getColorPerVertexIndex(e){return e<this._colorIndex.length?this._colorIndex[e]:this._coordIndex[e]},getColorIndex(e){return e<this._colorIndex.length?this._colorIndex[e]:e},getPolylineIndices(){const e=this._coordIndex,t=[];let i=[];if(e.length){for(let n=0,s=e.length;n<s;++n){e[n]>=0?i.push(n):(t.push(i),i=[])}e[e.length-1]>=0&&t.push(i)}return t},build(){if(!this.coordNode||this.coordNode.isEmpty())return;const e=this._coordIndex,t=this.getPolylineIndices(),i=this._colorPerVertex.getValue(),n=this.getCoordIndices(),s=this.getAttrib(),r=s.length,o=this.getAttribs(),a=this.fogCoordNode,l=this.colorNode,u=this.coordNode,h=this.normalNode,d=this.getFogDepths(),c=this.getColors(),p=this.getNormals(),g=this.getVertices();let f=0;for(const m of t){if(m.length>1)for(let t=0,_=m.length-1;t<_;++t)for(let _=t,x=t+2;_<x;++_){const t=m[_],x=e[t];n.push(x);for(let e=0;e<r;++e)s[e].addValue(x,o[e]);a?.addDepth(x,d),l&&(i?l.addColor(this.getColorPerVertexIndex(t),c):l.addColor(this.getColorIndex(f),c)),h?.addVector(x,p),u.addPoint(x,g)}++f}}}),Object.defineProperties(Xm,{typeName:{value:"IndexedLineSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_colorIndex",new Yn.MFInt32),new X(d.inputOnly,"set_coordIndex",new Yn.MFInt32),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorIndex",new Yn.MFInt32),new X(d.initializeOnly,"coordIndex",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const km=Xm;i.add("IndexedLineSet","x_ite/Components/Rendering/IndexedLineSet",km);const jm=km;function zm(e){rp.call(this,e),this.addType(d.IndexedTriangleFanSet),this.triangleIndex=[]}Object.assign(Object.setPrototypeOf(zm.prototype,rp.prototype),{initialize(){rp.prototype.initialize.call(this),this._set_index.addFieldInterest(this._index),this._index.addInterest("set_index__",this),this.set_index__()},set_index__(){const e=this._index,t=this.triangleIndex;t.length=0;for(let i=0,n=e.length;i<n;++i){const s=e[i];if(!(s<0)&&++i<n){let r=e[i];if(r<0)continue;for(++i;i<n;++i){const n=e[i];if(n<0)break;t.push(s,r,n),r=n}}}},getPolygonIndex(e){return this.triangleIndex[e]},build(){rp.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),Object.defineProperties(zm,{typeName:{value:"IndexedTriangleFanSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_index",new Yn.MFInt32),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"index",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const Gm=zm;i.add("IndexedTriangleFanSet","x_ite/Components/Rendering/IndexedTriangleFanSet",Gm);const Hm=Gm;function qm(e){rp.call(this,e),this.addType(d.IndexedTriangleSet)}Object.assign(Object.setPrototypeOf(qm.prototype,rp.prototype),{getPolygonIndex(e){return this._index[e]},initialize(){rp.prototype.initialize.call(this),this._set_index.addFieldInterest(this._index)},build(){rp.prototype.build.call(this,3,this._index.length,3,this._index.length)}}),Object.defineProperties(qm,{typeName:{value:"IndexedTriangleSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_index",new Yn.MFInt32),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"index",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const Ym=qm;i.add("IndexedTriangleSet","x_ite/Components/Rendering/IndexedTriangleSet",Ym);const Wm=Ym;function $m(e){rp.call(this,e),this.addType(d.IndexedTriangleStripSet),this.triangleIndex=[]}Object.assign(Object.setPrototypeOf($m.prototype,rp.prototype),{initialize(){rp.prototype.initialize.call(this),this._set_index.addFieldInterest(this._index),this._index.addInterest("set_index__",this),this.set_index__()},set_index__(){const e=this._index,t=this.triangleIndex;t.length=0;for(let i=0,n=e.length;i<n;++i){let s=e[i];if(!(s<0)&&++i<n){let r=e[i];if(r<0)continue;++i;for(let o=0;i<n;++i,++o){const n=e[i];if(n<0)break;t.push(s,r,n),1&o?r=n:s=n}}}},getPolygonIndex(e){return this.triangleIndex[e]},build(){rp.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),Object.defineProperties($m,{typeName:{value:"IndexedTriangleStripSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"set_index",new Yn.MFInt32),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"index",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const Jm=$m;i.add("IndexedTriangleStripSet","x_ite/Components/Rendering/IndexedTriangleStripSet",Jm);const Km=Jm;function Zm(e){Um.call(this,e),this.addType(d.LineSet),this.fogCoordNode=null,this.colorNode=null,this.normalNode=null,this.coordNode=null}Object.assign(Object.setPrototypeOf(Zm.prototype,Um.prototype),{initialize(){Um.prototype.initialize.call(this),this._attrib.addInterest("set_attrib__",this),this._fogCoord.addInterest("set_fogCoord__",this),this._color.addInterest("set_color__",this),this._normal.addInterest("set_normal__",this),this._coord.addInterest("set_coord__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_normal__(),this.set_coord__()},set_attrib__(){const e=this.getAttrib();for(const t of e)t.removeInterest("requestRebuild",this),t._attribute_changed.removeInterest("updateVertexArrays",this);e.length=0;for(const t of this._attrib){const i=ql(d.X3DVertexAttributeNode,t);i&&e.push(i)}for(const t of e)t.addInterest("requestRebuild",this),t._attribute_changed.addInterest("updateVertexArrays",this);this.updateVertexArrays()},set_fogCoord__(){this.fogCoordNode?.removeInterest("requestRebuild",this),this.fogCoordNode=ql(d.FogCoordinate,this._fogCoord),this.fogCoordNode?.addInterest("requestRebuild",this)},set_color__(){this.colorNode?.removeInterest("requestRebuild",this),this.colorNode=ql(d.X3DColorNode,this._color),this.colorNode?.addInterest("requestRebuild",this),this.setTransparent(this.colorNode?.isTransparent()??!1)},set_normal__(){this.normalNode?.removeInterest("requestRebuild",this),this.normalNode=ql(d.X3DNormalNode,this._normal),this.normalNode?.addInterest("requestRebuild",this)},set_coord__(){this.coordNode?.removeInterest("requestRebuild",this),this.coordNode=ql(d.X3DCoordinateNode,this._coord),this.coordNode?.addInterest("requestRebuild",this)},build(){if(!this.coordNode||this.coordNode.isEmpty())return;const e=this._vertexCount,t=this.getCoordIndices(),i=this.getAttrib(),n=i.length,s=this.getAttribs(),r=this.fogCoordNode,o=this.colorNode,a=this.normalNode,l=this.coordNode,u=this.getFogDepths(),h=this.getColors(),d=this.getNormals(),c=this.getVertices(),p=l.getSize();let g=0;for(let f of e){if(g+f>p)break;if(f>1){f=2*f-2;for(let e=0;e<f;++e,g+=1&e){t.push(g);for(let e=0;e<n;++e)i[e].addValue(g,s[e]);r?.addDepth(g,u),o?.addColor(g,h),a?.addVector(g,d),l.addPoint(g,c)}++g}else g+=f}}}),Object.defineProperties(Zm,{typeName:{value:"LineSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"vertexCount",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const Qm=Zm;i.add("LineSet","x_ite/Components/Rendering/LineSet",Qm);const e_=Qm;function t_(e){Zh.call(this,e),this.addType(d.X3DNormalNode)}Object.setPrototypeOf(t_.prototype,Zh.prototype),Object.defineProperties(t_,{typeName:{value:"X3DNormalNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const i_=t_;i.add("X3DNormalNode","x_ite/Components/Rendering/X3DNormalNode",i_);const n_=i_;function s_(e){n_.call(this,e),this.addType(d.Normal)}Object.assign(Object.setPrototypeOf(s_.prototype,n_.prototype),{initialize(){n_.prototype.initialize.call(this),this._vector.addInterest("set_vector__",this),this.set_vector__()},set_vector__(){this.vector=this._vector.getValue(),this.length=this._vector.length},addVector(e,t){if(!(e>=0&&this.length))return t.push(0,0,0);{const i=this.vector,n=e%this.length*3;t.push(i[n],i[n+1],i[n+2])}},addNormals(e,t=this.length){const i=this.length;if(i){const n=this.vector;for(let s=0;s<t;++s){const t=s%i*3;e.push(n[t],n[t+1],n[t+2])}}else for(let i=0;i<t;++i)e.push(0,0,0);return e}}),Object.defineProperties(s_,{typeName:{value:"Normal",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"normal",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"vector",new Yn.MFVec3f)]),enumerable:!0}});const r_=s_;i.add("Normal","x_ite/Components/Rendering/Normal",r_);const o_=r_;function a_(e){Ol.call(this,e);const t=this.getBrowser();this.setGeometryType(0),this.setPrimitiveMode(t.getContext().POINTS),this.setSolid(!1),this.setTransparent(!0)}Object.assign(Object.setPrototypeOf(a_.prototype,Ol.prototype),{intersectsLine:()=>!1,intersectsBox:()=>!1,buildTexCoords(){},display(e,t){const i=t.appearanceNode,n=i.getShader(this,t),s=i.getBlendMode(),r=this.getAttrib(),o=this.getAttribBuffers();if(s?.enable(e),n.enable(e),n.setUniforms(e,this,t),this.vertexArrayObject.enable(n)){this.coordIndices.length&&n.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0);for(let t=0,i=r.length;t<i;++t)r[t].enable(e,n,o[t]);this.hasFogCoords&&n.enableFogDepthAttribute(e,this.fogDepthBuffer,0,0),this.colorMaterial&&n.enableColorAttribute(e,this.colorBuffer,0,0),this.hasNormals&&n.enableNormalAttribute(e,this.normalBuffer,0,0),n.enableVertexAttribute(e,this.vertexBuffer,0,0)}e.drawArrays(this.primitiveMode,0,this.vertexCount),s?.disable(e)},displayParticles(e,t,i){const n=t.appearanceNode,s=n.getShader(this,t),r=n.getBlendMode(),o=this.getAttrib(),a=this.getAttribBuffers();r?.enable(e),s.enable(e),s.setUniforms(e,this,t);const l=i.outputParticles;if(l.vertexArrayObject.update(this.updateParticles).enable(s)){const t=i.particleStride;s.enableParticleAttribute(e,l,t,i.particleOffset,1),s.enableParticleMatrixAttribute(e,l,t,i.matrixOffset,1);for(let t=0,i=o.length;t<i;++t)o[t].enable(e,s,a[t]);this.hasFogCoords&&s.enableFogDepthAttribute(e,this.fogDepthBuffer,0,0),this.colorMaterial&&s.enableColorAttribute(e,this.colorBuffer,0,0),this.hasNormals&&s.enableNormalAttribute(e,this.normalBuffer,0,0),s.enableVertexAttribute(e,this.vertexBuffer,0,0),this.updateParticles=!1}e.drawArraysInstanced(this.primitiveMode,0,this.vertexCount,i.numParticles),r?.disable(e)}}),Object.defineProperties(a_,{typeName:{value:"X3DPointGeometryNode",enumerable:!0},componentName:{value:"Rendering",enumerable:!0}});const l_=a_;i.add("X3DPointGeometryNode","x_ite/Components/Rendering/X3DPointGeometryNode",l_);const u_=l_;function h_(e){u_.call(this,e),this.addType(d.PointSet),this.fogCoordNode=null,this.colorNode=null,this.normalNode=null,this.coordNode=null}Object.assign(Object.setPrototypeOf(h_.prototype,u_.prototype),{initialize(){u_.prototype.initialize.call(this),this._attrib.addInterest("set_attrib__",this),this._fogCoord.addInterest("set_fogCoord__",this),this._color.addInterest("set_color__",this),this._normal.addInterest("set_normal__",this),this._coord.addInterest("set_coord__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_normal__(),this.set_coord__()},getCoord(){return this.coordNode},set_attrib__(){const e=this.getAttrib();for(const t of e)t.removeInterest("requestRebuild",this),t._attribute_changed.removeInterest("updateVertexArrays",this);e.length=0;for(const t of this._attrib){const i=ql(d.X3DVertexAttributeNode,t);i&&e.push(i)}for(const t of e)t.addInterest("requestRebuild",this),t._attribute_changed.addInterest("updateVertexArrays",this);this.updateVertexArrays()},set_fogCoord__(){this.fogCoordNode?.removeInterest("requestRebuild",this),this.fogCoordNode=ql(d.FogCoordinate,this._fogCoord),this.fogCoordNode?.addInterest("requestRebuild",this)},set_color__(){this.colorNode?.removeInterest("requestRebuild",this),this.colorNode=ql(d.X3DColorNode,this._color),this.colorNode?.addInterest("requestRebuild",this)},set_normal__(){this.normalNode?.removeInterest("requestRebuild",this),this.normalNode=ql(d.X3DNormalNode,this._normal),this.normalNode?.addInterest("requestRebuild",this)},set_coord__(){this.coordNode?.removeInterest("requestRebuild",this),this.coordNode=ql(d.X3DCoordinateNode,this._coord),this.coordNode?.addInterest("requestRebuild",this)},build(){if(!this.coordNode||this.coordNode.isEmpty())return;const e=this.getCoordIndices(),t=this.getAttrib(),i=t.length,n=this.getAttribs(),s=this.fogCoordNode,r=this.getFogDepths(),o=this.colorNode,a=this.getColors(),l=this.coordNode,u=this.getNormals(),h=this.normalNode,d=this.getVertices(),c=l._point.length;for(let t=0;t<c;++t)e.push(t);for(let e=0;e<i;++e)for(let i=0;i<c;++i)t[e].addValue(i,n[e]);s?.addDepths(r,c),o?.addColors(a,c),h?.addNormals(u,c),l.addPoints(d)}}),Object.defineProperties(h_,{typeName:{value:"PointSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const d_=h_;i.add("PointSet","x_ite/Components/Rendering/PointSet",d_);const c_=d_;function p_(e){rp.call(this,e),this.addType(d.TriangleFanSet),this.triangleIndex=[]}Object.assign(Object.setPrototypeOf(p_.prototype,rp.prototype),{initialize(){rp.prototype.initialize.call(this),this._fanCount.addInterest("set_fanCount__",this),this.set_fanCount__()},set_fanCount__(){const e=this._fanCount,t=this.triangleIndex;t.length=0;let i=0;for(const n of e){for(let e=1,s=n-1;e<s;++e)t.push(i,i+e,i+e+1);i+=n}},getPolygonIndex(e){return this.triangleIndex[e]},build(){rp.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),Object.defineProperties(p_,{typeName:{value:"TriangleFanSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.inputOutput,"fanCount",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const g_=p_;i.add("TriangleFanSet","x_ite/Components/Rendering/TriangleFanSet",g_);const f_=g_;function m_(e){rp.call(this,e),this.addType(d.TriangleSet)}Object.assign(Object.setPrototypeOf(m_.prototype,rp.prototype),{build(){this.getCoord()&&rp.prototype.build.call(this,3,this.getCoord().getSize(),3,this.getCoord().getSize())},createNormals(e,t){return this.createFaceNormals(e,t)}}),Object.defineProperties(m_,{typeName:{value:"TriangleSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const __=m_;i.add("TriangleSet","x_ite/Components/Rendering/TriangleSet",__);const x_=__;function y_(e){rp.call(this,e),this.addType(d.TriangleStripSet),this.triangleIndex=[]}Object.assign(Object.setPrototypeOf(y_.prototype,rp.prototype),{initialize(){rp.prototype.initialize.call(this),this._stripCount.addInterest("set_stripCount__",this),this.set_stripCount__()},set_stripCount__(){const e=this._stripCount,t=this.triangleIndex;t.length=0;let i=0;for(const n of e){for(let e=0,s=n-2;e<s;++e){const n=1&e;t.push(i+(n?e+1:e),i+(n?e:e+1),i+(e+2))}i+=n}},getPolygonIndex(e){return this.triangleIndex[e]},build(){rp.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),Object.defineProperties(y_,{typeName:{value:"TriangleStripSet",enumerable:!0},componentName:{value:"Rendering",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"solid",new Yn.SFBool(!0)),new X(d.initializeOnly,"ccw",new Yn.SFBool(!0)),new X(d.initializeOnly,"colorPerVertex",new Yn.SFBool(!0)),new X(d.initializeOnly,"normalPerVertex",new Yn.SFBool(!0)),new X(d.inputOutput,"stripCount",new Yn.MFInt32),new X(d.inputOutput,"attrib",new Yn.MFNode),new X(d.inputOutput,"fogCoord",new Yn.SFNode),new X(d.inputOutput,"color",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.SFNode),new X(d.inputOutput,"normal",new Yn.SFNode),new X(d.inputOutput,"coord",new Yn.SFNode)]),enumerable:!0}});const w_=y_;i.add("TriangleStripSet","x_ite/Components/Rendering/TriangleStripSet",w_);const b_={name:"Rendering",concreteNodes:[bm,Nm,Im,Vm,jm,Hm,Wm,Km,e_,o_,c_,f_,x_,w_],abstractNodes:[vm,rp,Pm,Zh,Ol,Um,n_]};i.add("Rendering","x_ite/Components/Rendering",b_);const S_=b_;function T_(e){kl.call(this,e),this.addType(d.X3DShaderNode),this.valid=!1,this.selected=0}Object.assign(Object.setPrototypeOf(T_.prototype,kl.prototype),{setValid(e){this._isValid=this.valid=e},isValid(){return this.valid},select(){++this.selected,this._isSelected.getValue()||(this._isSelected=!0)},deselect(){--this.selected,0===this.selected&&this._isSelected.getValue()&&(this._isSelected=!1)}}),Object.defineProperties(T_,{typeName:{value:"X3DShaderNode",enumerable:!0},componentName:{value:"Shaders",enumerable:!0}});const v_=T_;i.add("X3DShaderNode","x_ite/Components/Shaders/X3DShaderNode",v_);const O_=v_;var E_=n(464);const N_=Symbol.for("X_ITE.X3DField.uniformLocation");function C_(e){this.addType(d.X3DProgrammableShaderObject),this.uniformNames=[],this.x3d_ClipPlane=[],this.x3d_LightType=[],this.x3d_LightOn=[],this.x3d_LightColor=[],this.x3d_LightIntensity=[],this.x3d_LightAmbientIntensity=[],this.x3d_LightAttenuation=[],this.x3d_LightLocation=[],this.x3d_LightDirection=[],this.x3d_LightBeamWidth=[],this.x3d_LightCutOffAngle=[],this.x3d_LightRadius=[],this.x3d_LightMatrix=[],this.x3d_ShadowIntensity=[],this.x3d_ShadowColor=[],this.x3d_ShadowBias=[],this.x3d_ShadowMatrix=[],this.x3d_ShadowMapSize=[],this.x3d_ShadowMap=[],this.x3d_Texture=[],this.x3d_MultiTextureMode=[],this.x3d_MultiTextureAlphaMode=[],this.x3d_MultiTextureSource=[],this.x3d_MultiTextureFunction=[],this.x3d_TextureCoordinateGeneratorMode=[],this.x3d_TextureCoordinateGeneratorParameter=[],this.x3d_ProjectiveTexture=[],this.x3d_ProjectiveTextureMatrix=[],this.x3d_ProjectiveTextureLocation=[],this.x3d_TexCoord=[],this.x3d_TextureMatrix=[],this.numClipPlanes=0,this.fogNode=null,this.numLights=0,this.numGlobalLights=0,this.lightNodes=[],this.numProjectiveTextures=0,this.numGlobalProjectiveTextures=0,this.projectiveTextureNodes=[],this.textures=new Set}Object.assign(C_.prototype,{initialize(){this.getBrowser().getRenderingProperties()._LogarithmicDepthBuffer.addInterest("set_logarithmicDepthBuffer__",this),this.set_logarithmicDepthBuffer__()},set_logarithmicDepthBuffer__(){this.logarithmicDepthBuffer=this.getBrowser().getRenderingProperty("LogarithmicDepthBuffer")},canUserDefinedFields:()=>!0,getUniformNames(){return this.uniformNames},setUniformNames(e){this.uniformNames=e},getDefaultUniformsAndAttributes(){const e=this.getProgram(),t=this.getBrowser(),i=t.getContext(),n=t.getMaxClipPlanes(),s=t.getMaxLights(),r=t.getMaxTextures(),o=t.getMaxTextureTransforms(),a=t.getMaxTexCoords();i.useProgram(e);for(const t of this.uniformNames)this[t]=i.getUniformLocation(e,t);this.x3d_Id=i.getUniformLocation(e,"x3d_Id"),this.x3d_LogarithmicFarFactor1_2=i.getUniformLocation(e,"x3d_LogarithmicFarFactor1_2");for(let t=0;t<n;++t)this.x3d_ClipPlane[t]=i.getUniformLocation(e,"x3d_ClipPlane["+t+"]");this.x3d_FogColor=this.getUniformLocation(i,e,"x3d_Fog.color","x3d_FogColor"),this.x3d_FogVisibilityRange=this.getUniformLocation(i,e,"x3d_Fog.visibilityRange","x3d_FogVisibilityRange"),this.x3d_FogMatrix=this.getUniformLocation(i,e,"x3d_Fog.matrix","x3d_FogMatrix"),this.x3d_AlphaCutoff=i.getUniformLocation(e,"x3d_AlphaCutoff"),this.x3d_PointPropertiesPointSizeScaleFactor=i.getUniformLocation(e,"x3d_PointProperties.pointSizeScaleFactor"),this.x3d_PointPropertiesPointSizeMinValue=i.getUniformLocation(e,"x3d_PointProperties.pointSizeMinValue"),this.x3d_PointPropertiesPointSizeMaxValue=i.getUniformLocation(e,"x3d_PointProperties.pointSizeMaxValue"),this.x3d_PointPropertiesAttenuation=i.getUniformLocation(e,"x3d_PointProperties.attenuation"),this.x3d_LinePropertiesLinetype=i.getUniformLocation(e,"x3d_LineProperties.linetype"),this.x3d_LineStippleScale=i.getUniformLocation(e,"x3d_LineProperties.lineStippleScale"),this.x3d_LinePropertiesTexture=i.getUniformLocation(e,"x3d_LineProperties.texture"),this.x3d_FillPropertiesFilled=i.getUniformLocation(e,"x3d_FillProperties.filled"),this.x3d_FillPropertiesHatched=i.getUniformLocation(e,"x3d_FillProperties.hatched"),this.x3d_FillPropertiesHatchColor=i.getUniformLocation(e,"x3d_FillProperties.hatchColor"),this.x3d_FillPropertiesTexture=i.getUniformLocation(e,"x3d_FillProperties.texture"),this.x3d_FillPropertiesScale=i.getUniformLocation(e,"x3d_FillProperties.scale");for(let t=0;t<s;++t)this.x3d_LightType[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].type","x3d_LightType["+t+"]"),this.x3d_LightColor[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].color","x3d_LightColor["+t+"]"),this.x3d_LightAmbientIntensity[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].ambientIntensity","x3d_LightAmbientIntensity["+t+"]"),this.x3d_LightIntensity[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].intensity","x3d_LightIntensity["+t+"]"),this.x3d_LightAttenuation[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].attenuation","x3d_LightAttenuation["+t+"]"),this.x3d_LightLocation[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].location","x3d_LightLocation["+t+"]"),this.x3d_LightDirection[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].direction","x3d_LightDirection["+t+"]"),this.x3d_LightBeamWidth[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].beamWidth","x3d_LightBeamWidth["+t+"]"),this.x3d_LightCutOffAngle[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].cutOffAngle","x3d_LightCutOffAngle["+t+"]"),this.x3d_LightRadius[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].radius","x3d_LightRadius["+t+"]"),this.x3d_LightMatrix[t]=this.getUniformLocation(i,e,"x3d_LightSource["+t+"].matrix","x3d_LightMatrix["+t+"]"),this.x3d_ShadowIntensity[t]=i.getUniformLocation(e,"x3d_LightSource["+t+"].shadowIntensity"),this.x3d_ShadowColor[t]=i.getUniformLocation(e,"x3d_LightSource["+t+"].shadowColor"),this.x3d_ShadowBias[t]=i.getUniformLocation(e,"x3d_LightSource["+t+"].shadowBias"),this.x3d_ShadowMatrix[t]=i.getUniformLocation(e,"x3d_LightSource["+t+"].shadowMatrix"),this.x3d_ShadowMapSize[t]=i.getUniformLocation(e,"x3d_LightSource["+t+"].shadowMapSize"),this.x3d_ShadowMap[t]=i.getUniformLocation(e,"x3d_ShadowMap["+t+"]");this.x3d_AmbientIntensity=this.getUniformLocation(i,e,"x3d_Material.ambientIntensity","x3d_FrontMaterial.ambientIntensity"),this.x3d_DiffuseColor=this.getUniformLocation(i,e,"x3d_Material.diffuseColor","x3d_FrontMaterial.diffuseColor"),this.x3d_SpecularColor=this.getUniformLocation(i,e,"x3d_Material.specularColor","x3d_FrontMaterial.specularColor"),this.x3d_EmissiveColor=this.getUniformLocation(i,e,"x3d_Material.emissiveColor","x3d_FrontMaterial.emissiveColor"),this.x3d_Shininess=this.getUniformLocation(i,e,"x3d_Material.shininess","x3d_FrontMaterial.shininess"),this.x3d_BaseColor=i.getUniformLocation(e,"x3d_Material.baseColor"),this.x3d_Metallic=i.getUniformLocation(e,"x3d_Material.metallic"),this.x3d_Roughness=i.getUniformLocation(e,"x3d_Material.roughness"),this.x3d_OcclusionStrength=i.getUniformLocation(e,"x3d_Material.occlusionStrength"),this.x3d_NormalScale=i.getUniformLocation(e,"x3d_Material.normalScale"),this.x3d_Transparency=this.getUniformLocation(i,e,"x3d_Material.transparency","x3d_FrontMaterial.transparency");const l=["x3d_AmbientTexture","x3d_DiffuseTexture","x3d_SpecularTexture","x3d_EmissiveTexture","x3d_ShininessTexture","x3d_BaseTexture","x3d_MetallicRoughnessTexture","x3d_OcclusionTexture","x3d_NormalTexture"];for(const t of l)this[t]={textureTransformMapping:i.getUniformLocation(e,t+".textureTransformMapping"),textureCoordinateMapping:i.getUniformLocation(e,t+".textureCoordinateMapping"),texture2D:i.getUniformLocation(e,t+".texture2D"),texture3D:i.getUniformLocation(e,t+".texture3D"),textureCube:i.getUniformLocation(e,t+".textureCube")};this.x3d_MultiTextureColor=i.getUniformLocation(e,"x3d_MultiTextureColor"),this.x3d_TexCoord.length=0;for(let t=0;t<r;++t)this.x3d_TextureCoordinateGeneratorMode[t]=i.getUniformLocation(e,"x3d_TextureCoordinateGenerator["+t+"].mode"),this.x3d_TextureCoordinateGeneratorParameter[t]=i.getUniformLocation(e,"x3d_TextureCoordinateGenerator["+t+"].parameter"),this.x3d_Texture[t]={texture2D:i.getUniformLocation(e,"x3d_Texture2D["+t+"]"),texture3D:i.getUniformLocation(e,"x3d_Texture3D["+t+"]"),textureCube:this.getUniformLocation(i,e,"x3d_TextureCube["+t+"]","x3d_CubeMapTexture["+t+"]")},this.x3d_MultiTextureMode[t]=i.getUniformLocation(e,"x3d_MultiTexture["+t+"].mode"),this.x3d_MultiTextureAlphaMode[t]=i.getUniformLocation(e,"x3d_MultiTexture["+t+"].alphaMode"),this.x3d_MultiTextureSource[t]=i.getUniformLocation(e,"x3d_MultiTexture["+t+"].source"),this.x3d_MultiTextureFunction[t]=i.getUniformLocation(e,"x3d_MultiTexture["+t+"].function"),this.x3d_ProjectiveTexture[t]=i.getUniformLocation(e,"x3d_ProjectiveTexture["+t+"]"),this.x3d_ProjectiveTextureMatrix[t]=i.getUniformLocation(e,"x3d_ProjectiveTextureMatrix["+t+"]"),this.x3d_ProjectiveTextureLocation[t]=i.getUniformLocation(e,"x3d_ProjectiveTextureLocation["+t+"]");for(let t=0;t<o;++t){const n=i.getUniformLocation(e,"x3d_TextureMatrix["+t+"]");null!==n&&(this.x3d_TextureMatrix[t]=n)}for(let t=0;t<a;++t){const n=this.getAttribLocation(i,e,"x3d_TexCoord"+t,t?"":"x3d_TexCoord");-1!==n&&this.x3d_TexCoord.push([t,n])}this.x3d_TexCoordRamp=i.getUniformLocation(e,"x3d_TexCoordRamp"),this.x3d_JointsTexture=i.getUniformLocation(e,"x3d_JointsTexture"),this.x3d_DisplacementsTexture=i.getUniformLocation(e,"x3d_DisplacementsTexture"),this.x3d_JointMatricesTexture=i.getUniformLocation(e,"x3d_JointMatricesTexture"),this.x3d_Viewport=i.getUniformLocation(e,"x3d_Viewport"),this.x3d_ProjectionMatrix=i.getUniformLocation(e,"x3d_ProjectionMatrix"),this.x3d_ModelViewMatrix=i.getUniformLocation(e,"x3d_ModelViewMatrix"),this.x3d_NormalMatrix=i.getUniformLocation(e,"x3d_NormalMatrix"),this.x3d_CameraSpaceMatrix=i.getUniformLocation(e,"x3d_CameraSpaceMatrix");const u=["CoordIndex","LineStipple","FogDepth","Color","Normal","Vertex","Particle","ParticleMatrix"];for(const t of u){const n=i.getAttribLocation(e,`x3d_${t}`);this[`x3d_${t}`]=n,n<0?(this[`enable${t}Attribute`]=Function.prototype,this[`${E_.toLowerCaseFirst(t)}AttributeDivisor`]=Function.prototype):(delete this[`enable${t}Attribute`],delete this[`${E_.toLowerCaseFirst(t)}AttributeDivisor`])}0===this.x3d_TexCoord.length?(this.enableTexCoordAttribute=Function.prototype,this.texCoordAttributeDivisor=Function.prototype):(delete this.enableTexCoordAttribute,delete this.texCoordAttributeDivisor),i.uniform1i(this.x3d_LinePropertiesTexture,t.getDefaultTexture2DUnit()),i.uniform1i(this.x3d_FillPropertiesTexture,t.getDefaultTexture2DUnit());for(const e of l)i.uniform1i(this[e].texture2D,t.getDefaultTexture2DUnit()),i.uniform1i(this[e].texture3D,t.getDefaultTexture3DUnit()),i.uniform1i(this[e].textureCube,t.getDefaultTextureCubeUnit());for(const e of this.x3d_Texture)i.uniform1i(e.texture2D,t.getDefaultTexture2DUnit()),i.getVersion()>=2&&i.uniform1i(e.texture3D,t.getDefaultTexture3DUnit()),i.uniform1i(e.textureCube,t.getDefaultTextureCubeUnit());for(const e of this.x3d_ShadowMap)i.uniform1i(e,t.getDefaultTexture2DUnit());for(const e of this.x3d_ProjectiveTexture)i.uniform1i(e,t.getDefaultTexture2DUnit());i.uniform1i(this.x3d_TexCoordRamp,t.getDefaultTexture2DUnit()),i.uniform1i(this.x3d_JointsTexture,t.getDefaultTexture2DUnit()),i.uniform1i(this.x3d_DisplacementsTexture,t.getDefaultTexture2DUnit()),i.uniform1i(this.x3d_JointMatricesTexture,t.getDefaultTexture2DUnit())},getUniformLocation(e,t,i,n){let s=e.getUniformLocation(t,i);return s||(n?(s=e.getUniformLocation(t,n),s&&console.warn(this.getTypeName(),this.getName(),"Using uniform location name '"+n+"' is depreciated, use '"+i+"'. See https://create3000.github.io/x_ite/custom-shaders."),s):0)},getAttribLocation(e,t,i,n){let s=e.getAttribLocation(t,i);return s>=0?s:n?(s=e.getAttribLocation(t,n),s>=0&&console.warn(this.getTypeName(),this.getName(),"Using attribute location name '"+n+"' is depreciated, use '"+i+"'. See https://create3000.github.io/x_ite/custom-shaders."),s):-1},addShaderFields(){const e=this.getProgram(),t=this.getBrowser().getContext();t.useProgram(e),this.textures.clear();for(const i of this.getUserDefinedFields()){if(i.getAccessType()===d.outputOnly)continue;const n=t.getUniformLocation(e,i.getName());if(n){switch(i.getType()){case d.SFImage:n.array=new Int32Array(3+i.array.length);break;case d.SFMatrix3d:case d.SFMatrix3f:case d.SFRotation:n.array=new Float32Array(9);break;case d.SFMatrix4d:case d.SFMatrix4f:n.array=new Float32Array(16);break;case d.SFNode:break;case d.MFBool:case d.MFInt32:n.array=new Int32Array(this.getLocationLength(t,e,i));break;case d.MFFloat:case d.MFDouble:case d.MFTime:n.array=new Float32Array(this.getLocationLength(t,e,i));break;case d.MFImage:n.array=new Int32Array(this.getImagesLength(i));break;case d.MFMatrix3d:case d.MFMatrix3f:case d.MFRotation:n.array=new Float32Array(9*this.getLocationLength(t,e,i));break;case d.MFMatrix4d:case d.MFMatrix4f:n.array=new Float32Array(16*this.getLocationLength(t,e,i));break;case d.MFNode:{const s=n.locations=[];for(let n=0;;++n){const r=t.getUniformLocation(e,i.getName()+"["+n+"]");if(!r)break;s.push(r)}break}case d.MFVec2d:case d.MFVec2f:n.array=new Float32Array(2*this.getLocationLength(t,e,i));break;case d.MFVec3d:case d.MFVec3f:case d.MFColor:n.array=new Float32Array(3*this.getLocationLength(t,e,i));break;case d.MFVec4d:case d.MFVec4f:case d.MFColorRGBA:n.array=new Float32Array(4*this.getLocationLength(t,e,i))}n.array?i[N_]=n.array.length?n:null:i[N_]=n,i.addInterest("set_field__",this),this.set_field__(i)}}},removeShaderFields(){for(const e of this.getUserDefinedFields())e.removeInterest("set_field__",this)},set_field__:(()=>{const e=new Float32Array(9);return function(t){const i=this.getProgram(),n=this.getBrowser().getContext(),s=t[N_];if(n.useProgram(i),s)switch(t.getType()){case d.SFBool:case d.SFInt32:return void n.uniform1i(s,t.getValue());case d.SFColor:{const e=t.getValue();return void n.uniform3f(s,e.r,e.g,e.b)}case d.SFColorRGBA:{const e=t.getValue();return void n.uniform4f(s,e.r,e.g,e.b,e.a)}case d.SFDouble:case d.SFFloat:case d.SFTime:return void n.uniform1f(s,t.getValue());case d.SFImage:{let e=s.array;const i=t.array,r=3+i.length;r!==e.length&&(e=s.array=new Int32Array(r)),e[0]=t.width,e[1]=t.height,e[2]=t.comp;for(let t=3,n=0,s=i.length;n<s;++n,++t)e[t]=i[n];return void n.uniform1iv(s,e)}case d.SFMatrix3d:case d.SFMatrix3f:return s.array.set(t.getValue()),void n.uniformMatrix3fv(s,!1,s.array);case d.SFMatrix4d:case d.SFMatrix4f:return s.array.set(t.getValue()),void n.uniformMatrix4fv(s,!1,s.array);case d.SFNode:{const e=ql(d.X3DTextureNode,t);return void(e?(s.name=t.getName(),s.texture=e,this.textures.add(s)):this.textures.delete(s))}case d.SFRotation:return t.getValue().getMatrix(s.array),void n.uniformMatrix3fv(s,!1,s.array);case d.SFString:return;case d.SFVec2d:case d.SFVec2f:{const e=t.getValue();return void n.uniform2f(s,e.x,e.y)}case d.SFVec3d:case d.SFVec3f:{const e=t.getValue();return void n.uniform3f(s,e.x,e.y,e.z)}case d.SFVec4d:case d.SFVec4f:{const e=t.getValue();return void n.uniform4f(s,e.x,e.y,e.z,e.w)}case d.MFBool:case d.MFInt32:{const e=s.array;for(var r=0,o=t.length;r<o;++r)e[r]=t[r];for(let t=e.length;r<t;++r)e[r]=0;return void n.uniform1iv(s,e)}case d.MFColor:{const e=s.array;r=0;var a=0;for(o=t.length;r<o;++r){const i=t[r];e[a++]=i.r,e[a++]=i.g,e[a++]=i.b}for(let t=e.length;a<t;++a)e[a]=0;return void n.uniform3fv(s,e)}case d.MFColorRGBA:{const e=s.array;for(r=0,a=0,o=t.length;r<o;++r){const i=t[r];e[a++]=i.r,e[a++]=i.g,e[a++]=i.b,e[a++]=i.a}for(let t=e.length;a<t;++a)e[a]=0;return void n.uniform4fv(s,e)}case d.MFDouble:case d.MFFloat:case d.MFTime:{const e=s.array;for(r=0,o=t.length;r<o;++r)e[r]=t[r];for(let t=e.length;r<t;++r)e[r]=0;return void n.uniform1fv(s,e)}case d.MFImage:{const e=s.array;for(let i=0,n=0,s=t.length;i<s;++i){const s=t[i],r=s.array;e[n++]=s.width,e[n++]=s.height,e[n++]=s.comp;for(let t=0,i=r.length;t<i;++t)e[n++]=r[t]}return void n.uniform1iv(s,e)}case d.MFMatrix3d:case d.MFMatrix3f:{const e=s.array;for(r=0,a=0,o=t.length;r<o;++r){const i=t[r];for(let t=0;t<9;++t)e[a++]=i[t]}for(let t=e.length;a<t;++a)e[a]=0;return void n.uniformMatrix3fv(s,!1,e)}case d.MFMatrix4d:case d.MFMatrix4f:{const e=s.array;for(r=0,a=0,o=t.length;r<o;++r){const i=t[r];for(let t=0;t<16;++t)e[a++]=i[t]}for(let t=e.length;a<t;++a)e[a]=0;return void n.uniformMatrix4fv(s,!1,e)}case d.MFNode:{const e=s.locations;for(let i=0,n=t.length;i<n;++i){const n=ql(d.X3DTextureNode,t[i]);n?(e[i].name=t.getName(),e[i].texture=n,this.textures.add(e[i])):this.textures.delete(e[i])}return}case d.MFRotation:{const i=s.array;for(r=0,a=0,o=t.length;r<o;++r)t[r].getValue().getMatrix(e),i[a++]=e[0],i[a++]=e[1],i[a++]=e[2],i[a++]=e[3],i[a++]=e[4],i[a++]=e[5],i[a++]=e[6],i[a++]=e[7],i[a++]=e[8];for(let e=i.length;a<e;++a)i[a]=0;return void n.uniformMatrix3fv(s,!1,i)}case d.MFString:return;case d.MFVec2d:case d.MFVec2f:{const e=s.array;for(r=0,a=0,o=t.length;r<o;++r){const i=t[r];e[a++]=i.x,e[a++]=i.y}for(let t=e.length;a<t;++a)e[a]=0;return void n.uniform2fv(s,e)}case d.MFVec3d:case d.MFVec3f:{const e=s.array;for(r=0,a=0,o=t.length;r<o;++r){const i=t[r];e[a++]=i.x,e[a++]=i.y,e[a++]=i.z}for(let t=e.length;a<t;++a)e[a]=0;return void n.uniform3fv(s,e)}case d.MFVec4d:case d.MFVec4f:{const e=s.array;for(r=0,a=0,o=t.length;r<o;++r){const i=t[r];e[a++]=i.x,e[a++]=i.y,e[a++]=i.z,e[a++]=i.w}for(let t=e.length;a<t;++a)e[a]=0;return void n.uniform4fv(s,e)}}}})(),getImagesLength(e){const t=e.getValue();let i=3*t.length;for(const e of t)i+=e.array.length;return i},getLocationLength(e,t,i){const n=i.getName();for(let i=0;;++i){if(!e.getUniformLocation(t,n+"["+i+"]"))return i}},hasFog(e){return this.fogNode===e||(this.fogNode=e,!1)},hasLight(e,t){return this.lightNodes[e]===t||(this.lightNodes[e]=t,!1)},hasTextureProjector(e,t){return this.projectiveTextureNodes[e]===t||(this.projectiveTextureNodes[e]=t,!1)},setClipPlanes(e,t){this.numClipPlanes=0;for(const i of t)i.setShaderUniforms(e,this)},setUniforms:(()=>{const e=new Float32Array(9);return function(t,i,n,s=!0){const{renderObject:r,fogNode:o,appearanceNode:a,humanoidNode:l,modelViewMatrix:u}=n,h=a.getStyleProperties(i.geometryType),d=s?a.getMaterial():a.getBackMaterial(),c=n.textureNode||a.getTexture();if(this.renderCount!==r.getRenderCount()){this.renderCount=r.getRenderCount(),t.uniform4iv(this.x3d_Viewport,r.getViewportArray()),t.uniformMatrix4fv(this.x3d_ProjectionMatrix,!1,r.getProjectionMatrixArray()),t.uniformMatrix4fv(this.x3d_CameraSpaceMatrix,!1,r.getCameraSpaceMatrixArray()),this.fogNode=null,this.numLights=0,this.numProjectiveTextures=0,this.lightNodes.length=0,this.projectiveTextureNodes.length=0;const e=r.getGlobalObjects();for(const i of e)i.setShaderUniforms(t,this,r);this.numGlobalLights=this.numLights,this.numGlobalProjectiveTextures=this.numProjectiveTextures;const i=r.getViewpoint();if(this.logarithmicDepthBuffer||i.getLogarithmicDepthBuffer()){const e=r.getNavigationInfo();t.uniform1f(this.x3d_LogarithmicFarFactor1_2,1/Math.log2(e.getFarValue(i)+1))}}t.uniformMatrix4fv(this.x3d_ModelViewMatrix,!1,u),i.hasNormals&&(e[0]=u[0],e[3]=u[1],e[6]=u[2],e[1]=u[4],e[4]=u[5],e[7]=u[6],e[2]=u[8],e[5]=u[9],e[8]=u[10],Pt.prototype.inverse.call(e),t.uniformMatrix3fv(this.x3d_NormalMatrix,!1,e)),o?.setShaderUniforms(t,this),this.numClipPlanes=0,this.numLights=this.numGlobalLights,this.numProjectiveTextures=this.numGlobalProjectiveTextures;for(const e of n.localObjects)e.setShaderUniforms(t,this,r);t.uniform1f(this.x3d_AlphaCutoff,a.getAlphaCutoff()),h?.setShaderUniforms(t,this),d.setShaderUniforms(t,this,r,a.getTextureTransformMapping(),i.getTextureCoordinateMapping(),s),c?.setShaderUniforms(t,this,r),a.getTextureTransform().setShaderUniforms(t,this),i.getTextureCoordinate().setShaderUniforms(t,this),l?.setShaderUniforms(t,this)}})(),enable(e){e.useProgram(this.getProgram());for(const t of this.textures){const i=t.texture,n=this.getBrowser().getTextureUnit(i.getTextureType());if(void 0===n)return void console.warn("Not enough combined texture units for uniform variable '"+t.name+"' available.");e.activeTexture(e.TEXTURE0+n),e.bindTexture(i.getTarget(),i.getTexture()),e.uniform1i(t,n)}},enableFloatAttrib(e,t,i,n,s,r){const o=e.getAttribLocation(this.getProgram(),t);-1!==o&&(e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(o),e.vertexAttribPointer(o,n,e.FLOAT,!1,s,r))},enableMatrix3Attrib(e,t,i,n,s){const r=e.getAttribLocation(this.getProgram(),t);if(-1!==r){n=n||36,e.bindBuffer(e.ARRAY_BUFFER,i);for(let t=0;t<3;++t){const i=r+t;e.enableVertexAttribArray(i),e.vertexAttribPointer(i,3,e.FLOAT,!1,n,s+12*t)}}},enableMatrix4Attrib(e,t,i,n,s){const r=e.getAttribLocation(this.getProgram(),t);if(-1!==r){n=n||64,e.bindBuffer(e.ARRAY_BUFFER,i);for(let t=0;t<4;++t){const i=r+t;e.enableVertexAttribArray(i),e.vertexAttribPointer(i,4,e.FLOAT,!1,n,s+16*t)}}},enableCoordIndexAttribute(e,t,i,n){const s=this.x3d_CoordIndex;e.bindBuffer(e.ARRAY_BUFFER,t),e.enableVertexAttribArray(s),e.vertexAttribPointer(s,1,e.FLOAT,!1,i,n)},enableLineStippleAttribute(e,t,i,n){const s=this.x3d_LineStipple;e.bindBuffer(e.ARRAY_BUFFER,t),e.enableVertexAttribArray(s),e.vertexAttribPointer(s,3,e.FLOAT,!1,i,n)},enableFogDepthAttribute(e,t,i,n){const s=this.x3d_FogDepth;e.bindBuffer(e.ARRAY_BUFFER,t),e.enableVertexAttribArray(s),e.vertexAttribPointer(s,1,e.FLOAT,!1,i,n)},enableColorAttribute(e,t,i,n){const s=this.x3d_Color;e.bindBuffer(e.ARRAY_BUFFER,t),e.enableVertexAttribArray(s),e.vertexAttribPointer(s,4,e.FLOAT,!1,i,n)},colorAttributeDivisor(e,t){e.vertexAttribDivisor(this.x3d_Color,t)},enableTexCoordAttribute(e,t,i,n){for(const[s,r]of this.x3d_TexCoord)e.bindBuffer(e.ARRAY_BUFFER,t[s]),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,4,e.FLOAT,!1,i,n)},texCoordAttributeDivisor(e,t){for(const[i,n]of this.x3d_TexCoord)e.vertexAttribDivisor(n,t)},enableNormalAttribute(e,t,i,n){const s=this.x3d_Normal;e.bindBuffer(e.ARRAY_BUFFER,t),e.enableVertexAttribArray(s),e.vertexAttribPointer(s,3,e.FLOAT,!1,i,n)},normalAttributeDivisor(e,t){e.vertexAttribDivisor(this.x3d_Normal,t)},enableVertexAttribute(e,t,i,n){const s=this.x3d_Vertex;e.bindBuffer(e.ARRAY_BUFFER,t),e.enableVertexAttribArray(s),e.vertexAttribPointer(s,4,e.FLOAT,!1,i,n)},vertexAttributeDivisor(e,t){e.vertexAttribDivisor(this.x3d_Vertex,t)},enableParticleAttribute(e,t,i,n,s){const r=this.x3d_Particle;e.bindBuffer(e.ARRAY_BUFFER,t),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,4,e.FLOAT,!1,i,n),e.vertexAttribDivisor(r,s)},enableParticleMatrixAttribute(e,t,i,n,s){const r=this.x3d_ParticleMatrix;i=i||64,e.bindBuffer(e.ARRAY_BUFFER,t);for(let t=0;t<4;++t){const o=r+t;e.enableVertexAttribArray(o),e.vertexAttribPointer(o,4,e.FLOAT,!1,i,n+16*t),e.vertexAttribDivisor(o,s)}},getProgramInfo(){function e(e,t){return e<t?-1:e>t?1:0}const t=this.getProgram(),i=this.getBrowser().getContext(),n={attributes:[],uniforms:[],attributeCount:0,uniformCount:0},s=i.getProgramParameter(t,i.ACTIVE_UNIFORMS),r=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES),o={35664:"vec2",35665:"vec3",35666:"vec4",35667:"ivec2",35668:"ivec3",35669:"ivec4",35670:"bool",35671:"bvec2",35672:"bvec3",35673:"bvec4",35674:"mat2",35675:"mat3",35676:"mat4",35678:"sampler2D",35680:"samplerCube",5120:"byte",5121:"ubyte",5122:"short",5123:"ushort",5124:"int",5125:"uint",5126:"float"};for(let e=0;e<s;++e){const s=i.getActiveUniform(t,e);s.typeName=o[s.type],n.uniforms.push(Object.assign({},s)),n.uniformCount+=s.size}for(let e=0;e<r;++e){const s=i.getActiveAttrib(t,e);s.typeName=o[s.type],n.attributes.push(Object.assign({},s)),n.attributeCount+=s.size}return n.uniforms.sort(((t,i)=>e(t.name,i.name))),n.attributes.sort(((t,i)=>e(t.name,i.name))),n},printProgramInfo(){const e=this.getProgramInfo();console.log(this.getName()),console.table(e.attributes),console.log(this.getName(),"attributeCount",e.attributeCount),console.log(this.getName()),console.table(e.uniforms),console.log(this.getName(),"uniformCount",e.uniformCount)},dispose(){}}),Object.defineProperties(C_,{typeName:{value:"X3DProgrammableShaderObject",enumerable:!0},componentName:{value:"Shaders",enumerable:!0}});const F_=C_;i.add("X3DProgrammableShaderObject","x_ite/Components/Shaders/X3DProgrammableShaderObject",F_);const I_=F_;function M_(e){O_.call(this,e),I_.call(this,e),this.addType(d.ComposedShader),this.loadSensor=new Gf(e),this.transformFeedbackVaryings=[]}Object.assign(Object.setPrototypeOf(M_.prototype,O_.prototype),I_.prototype,{wireframe:!1,initialize(){O_.prototype.initialize.call(this),I_.prototype.initialize.call(this),this._activate.addInterest("set_activate__",this),this._parts.addFieldInterest(this.loadSensor._children),this.loadSensor._isLoaded.addInterest("connectLoaded",this),this.loadSensor._children=this._parts,this.loadSensor.setPrivate(!0),this.loadSensor.setup(),this.loadSensor._isLoaded.getValue()?this.set_loaded__():this.connectLoaded()},connectLoaded(){this.loadSensor._isLoaded.removeInterest("connectLoaded",this),this.loadSensor._isLoaded.addInterest("set_loaded__",this)},addUserDefinedField(e,t,i){const n=this.isInitialized()&&this.isValid();n&&this.removeShaderFields(),O_.prototype.addUserDefinedField.call(this,e,t,i),n&&this.addShaderFields()},removeUserDefinedField(e){const t=this.isInitialized()&&this.isValid();t&&this.removeShaderFields(),O_.prototype.removeUserDefinedField.call(this,e),t&&this.addShaderFields()},setTransformFeedbackVaryings(e){this.transformFeedbackVaryings=e},getProgram(){return this.program},set_activate__(){this._activate.getValue()&&this.set_loaded__()},set_loaded__(){if(this.loadSensor._isLoaded.getValue()&&"GLSL"===this._language.getValue()){const e=this.getBrowser().getContext(),t=e.createProgram();this.isValid()&&this.removeShaderFields(),e.deleteProgram(this.program),this.program=t;for(const i of this._parts){const n=ql(d.ShaderPart,i);n?.getShader()&&e.attachShader(t,n.getShader())}this.transformFeedbackVaryings.length&&e.transformFeedbackVaryings(t,this.transformFeedbackVaryings,e.INTERLEAVED_ATTRIBS),e.linkProgram(t),e.getProgramParameter(t,e.LINK_STATUS)?(this.setValid(!0),this.getDefaultUniformsAndAttributes(),this.addShaderFields()):(this.setValid(!1),this._parts.length&&console.warn("Couldn't initialize "+this.getTypeName()+" '"+this.getName()+"': "+e.getProgramInfoLog(t)))}else this.setValid(!1)},dispose(){I_.prototype.dispose.call(this),O_.prototype.dispose.call(this)}}),Object.defineProperties(M_,{typeName:{value:"ComposedShader",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"shaders",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"activate",new Yn.SFBool),new X(d.outputOnly,"isSelected",new Yn.SFBool),new X(d.outputOnly,"isValid",new Yn.SFBool),new X(d.initializeOnly,"language",new Yn.SFString),new X(d.inputOutput,"parts",new Yn.MFNode)]),enumerable:!0}});const D_=M_;i.add("ComposedShader","x_ite/Components/Shaders/ComposedShader",D_);const P_=D_;function R_(e){Zh.call(this,e),this.addType(d.X3DVertexAttributeNode),this.addChildObjects(d.outputOnly,"attribute_changed",new Yn.SFTime)}Object.assign(Object.setPrototypeOf(R_.prototype,Zh.prototype),{initialize(){Zh.prototype.initialize.call(this),this._name.addInterest("set_attribute__",this)},set_attribute__(){this._attribute_changed=this.getBrowser().getCurrentTime()}}),Object.defineProperties(R_,{typeName:{value:"X3DVertexAttributeNode",enumerable:!0},componentName:{value:"Shaders",enumerable:!0}});const A_=R_;i.add("X3DVertexAttributeNode","x_ite/Components/Shaders/X3DVertexAttributeNode",A_);const V_=A_;function L_(e){V_.call(this,e),this.addType(d.FloatVertexAttribute)}Object.assign(Object.setPrototypeOf(L_.prototype,V_.prototype),{initialize(){V_.prototype.initialize.call(this),this._numComponents.addInterest("set_numComponents__",this),this._numComponents.addInterest("set_attribute__",this),this._value.addInterest("set_value__",this),this.set_numComponents__(),this.set_value__()},set_numComponents__(){this.numComponents=g.clamp(this._numComponents.getValue(),1,4)},set_value__(){this.value=this._value.getValue(),this.length=this._value.length},addValue(e,t){const i=this.value;let n=e*this.numComponents,s=n+this.numComponents;if(s<=this.length)for(;n<s;++n)t.push(i[n]);else if(this.numComponents<=this.length)for(s=i.length,n=s-this.numComponents;n<s;++n)t.push(i[n]);else for(;n<s;++n)t.push(0)},enable(e,t,i){t.enableFloatAttrib(e,this._name.getValue(),i,this.numComponents,0,0)}}),Object.defineProperties(L_,{typeName:{value:"FloatVertexAttribute",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"attrib",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"name",new Yn.SFString),new X(d.initializeOnly,"numComponents",new Yn.SFInt32(4)),new X(d.inputOutput,"value",new Yn.MFFloat)]),enumerable:!0}});const B_=L_;i.add("FloatVertexAttribute","x_ite/Components/Shaders/FloatVertexAttribute",B_);const U_=B_;function X_(e){V_.call(this,e),this.addType(d.Matrix3VertexAttribute)}Object.assign(Object.setPrototypeOf(X_.prototype,V_.prototype),{initialize(){V_.prototype.initialize.call(this),this._value.addInterest("set_value__",this),this.set_value__()},set_value__(){this.value=this._value.getValue(),this.length=this._value.length},addValue(e,t){if(e<this.length){const i=this.value;for(let n=9*e,s=n+9;n<s;++n)t.push(i[n])}else if(this.length){const i=this.value;for(let n=9*(e=this.length-1),s=n+9;n<s;++n)t.push(i[n])}else{const e=Pt.Identity;for(let i=0;i<9;++i)t.push(e[i])}},enable(e,t,i){t.enableMatrix3Attrib(e,this._name.getValue(),i,0,0)}}),Object.defineProperties(X_,{typeName:{value:"Matrix3VertexAttribute",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"attrib",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"name",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFMatrix3f)]),enumerable:!0}});const k_=X_;i.add("Matrix3VertexAttribute","x_ite/Components/Shaders/Matrix3VertexAttribute",k_);const j_=k_;function z_(e){V_.call(this,e),this.addType(d.Matrix4VertexAttribute)}Object.assign(Object.setPrototypeOf(z_.prototype,V_.prototype),{initialize(){V_.prototype.initialize.call(this),this._value.addInterest("set_value__",this),this.set_value__()},set_value__(){this.value=this._value.getValue(),this.length=this._value.length},addValue(e,t){if(e<this.length){const i=this.value;for(let n=16*e,s=n+16;n<s;++n)t.push(i[n])}else if(this.length){const i=this.value;for(let n=16*(e=this.length-1),s=n+16;n<s;++n)t.push(i[n])}else{const e=Matrix4.Identity;for(let i=0;i<16;++i)t.push(e[i])}},enable(e,t,i){t.enableMatrix4Attrib(e,this._name.getValue(),i,0,0)}}),Object.defineProperties(z_,{typeName:{value:"Matrix4VertexAttribute",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"attrib",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.initializeOnly,"name",new Yn.SFString),new X(d.inputOutput,"value",new Yn.MFMatrix4f)]),enumerable:!0}});const G_=z_;i.add("Matrix4VertexAttribute","x_ite/Components/Shaders/Matrix4VertexAttribute",G_);const H_=G_;function q_(e){O_.call(this,e),Sr.call(this,e),I_.call(this,e),this.addType(d.PackagedShader)}Object.assign(Object.setPrototypeOf(q_.prototype,O_.prototype),Sr.prototype,I_.prototype,{getSourceText(){return this._url},requestImmediateLoad(e=!0){},initialize(){O_.prototype.initialize.call(this),Sr.prototype.initialize.call(this),I_.prototype.initialize.call(this)},dispose(){I_.prototype.dispose.call(this),Sr.prototype.dispose.call(this),O_.prototype.dispose.call(this)}}),Object.defineProperties(q_,{typeName:{value:"PackagedShader",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"shaders",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOnly,"activate",new Yn.SFBool),new X(d.outputOnly,"isSelected",new Yn.SFBool),new X(d.outputOnly,"isValid",new Yn.SFBool),new X(d.initializeOnly,"language",new Yn.SFString),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600))]),enumerable:!0}});const Y_=q_;i.add("PackagedShader","x_ite/Components/Shaders/PackagedShader",Y_);const W_=Y_;function $_(e){O_.call(this,e),this.addType(d.ProgramShader)}Object.setPrototypeOf($_.prototype,O_.prototype),Object.defineProperties($_,{typeName:{value:"ProgramShader",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"shaders",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOnly,"activate",new Yn.SFBool),new X(d.outputOnly,"isSelected",new Yn.SFBool),new X(d.outputOnly,"isValid",new Yn.SFBool),new X(d.initializeOnly,"language",new Yn.SFString),new X(d.inputOutput,"programs",new Yn.MFNode)]),enumerable:!0}});const J_=$_;i.add("ProgramShader","x_ite/Components/Shaders/ProgramShader",J_);const K_=J_,Z_="#if defined(X3D_FOG)\nstruct x3d_FogParameters{mediump int type;mediump vec3 color;mediump float visibilityRange;mediump mat3 matrix;};\n#endif\n#if defined(X3D_LIGHTING)\nstruct x3d_LightSourceParameters{mediump int type;mediump vec3 color;mediump float intensity;mediump float ambientIntensity;mediump vec3 attenuation;mediump vec3 location;mediump vec3 direction;mediump float radius;mediump float beamWidth;mediump float cutOffAngle;mediump mat3 matrix;\n#if defined(X3D_SHADOWS)\nmediump vec3 shadowColor;mediump float shadowIntensity;mediump float shadowBias;mediump mat4 shadowMatrix;mediump int shadowMapSize;\n#endif\n};\n#endif\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nstruct x3d_PointPropertiesParameters{mediump float pointSizeScaleFactor;mediump float pointSizeMinValue;mediump float pointSizeMaxValue;mediump vec3 attenuation;};\n#endif\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nstruct x3d_LinePropertiesParameters{mediump int linetype;mediump float lineStippleScale;\n#if defined(X3D_STYLE_PROPERTIES_TEXTURE)\nsampler2D texture;\n#endif\n};\n#endif\n#if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)\nstruct x3d_FillPropertiesParameters{bool filled;bool hatched;mediump vec3 hatchColor;\n#if defined(X3D_STYLE_PROPERTIES_TEXTURE)\nsampler2D texture;\n#endif\nmediump float scale;};\n#endif\n#if defined(X3D_UNLIT_MATERIAL)\nstruct x3d_UnlitMaterialParameters{mediump vec3 emissiveColor;mediump float normalScale;mediump float transparency;};\n#endif\n#if defined(X3D_MATERIAL)\nstruct x3d_MaterialParameters{mediump float ambientIntensity;mediump vec3 diffuseColor;mediump vec3 specularColor;mediump vec3 emissiveColor;mediump float shininess;mediump float occlusionStrength;mediump float normalScale;mediump float transparency;};\n#endif\n#if defined(X3D_PHYSICAL_MATERIAL)\nstruct x3d_PhysicalMaterialParameters{mediump vec3 baseColor;mediump vec3 emissiveColor;mediump float metallic;mediump float roughness;mediump float occlusionStrength;mediump float normalScale;mediump float transparency;};\n#endif\n#if defined(X3D_AMBIENT_TEXTURE)\nstruct x3d_AmbientTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_AMBIENT_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_AMBIENT_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_AMBIENT_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_DIFFUSE_TEXTURE)\nstruct x3d_DiffuseTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_DIFFUSE_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_DIFFUSE_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_DIFFUSE_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_SPECULAR_TEXTURE)\nstruct x3d_SpecularTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_SPECULAR_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_SPECULAR_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_SPECULAR_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_EMISSIVE_TEXTURE)\nstruct x3d_EmissiveTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_EMISSIVE_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_EMISSIVE_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_EMISSIVE_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_SHININESS_TEXTURE)\nstruct x3d_ShininessTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_SHININESS_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_SHININESS_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_SHININESS_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_BASE_TEXTURE)\nstruct x3d_BaseTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_BASE_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_BASE_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_BASE_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)\nstruct x3d_MetallicRoughnessTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_OCCLUSION_TEXTURE)\nstruct x3d_OcclusionTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_OCCLUSION_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_OCCLUSION_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_OCCLUSION_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_NORMAL_TEXTURE)\nstruct x3d_NormalTextureParameters{mediump int textureTransformMapping;mediump int textureCoordinateMapping;\n#if defined(X3D_NORMAL_TEXTURE_2D)\nmediump sampler2D texture2D;\n#endif\n#if defined(X3D_NORMAL_TEXTURE_3D)&&__VERSION__!=100\nmediump sampler3D texture3D;\n#endif\n#if defined(X3D_NORMAL_TEXTURE_CUBE)\nmediump samplerCube textureCube;\n#endif\n};\n#endif\n#if defined(X3D_MULTI_TEXTURING)\nstruct x3d_MultiTextureParameters{mediump int mode;mediump int alphaMode;mediump int source;mediump int function;};\n#endif\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nstruct x3d_TextureCoordinateGeneratorParameters{mediump int mode;mediump float parameter[6];};\n#endif\n";i.add("Types.glsl","assets/shaders/Types.glsl",Z_);const Q_=Z_;let ex=0;const tx={REPLACE:ex++,MODULATE:ex++,MODULATE2X:ex++,MODULATE4X:ex++,ADD:ex++,ADDSIGNED:ex++,ADDSIGNED2X:ex++,ADDSMOOTH:ex++,SUBTRACT:ex++,BLENDDIFFUSEALPHA:ex++,BLENDTEXTUREALPHA:ex++,BLENDFACTORALPHA:ex++,BLENDCURRENTALPHA:ex++,MODULATEALPHA_ADDCOLOR:ex++,MODULATEINVALPHA_ADDCOLOR:ex++,MODULATEINVCOLOR_ADDALPHA:ex++,DOTPRODUCT3:ex++,SELECTARG1:ex++,SELECTARG2:ex++,OFF:ex++};i.add("ModeType","x_ite/Browser/Texturing/ModeType",tx);const ix=tx;let nx=0;const sx={DEFAULT:nx++,DIFFUSE:nx++,SPECULAR:nx++,FACTOR:nx++};i.add("SourceType","x_ite/Browser/Texturing/SourceType",sx);const rx=sx;let ox=0;const ax={DEFAULT:ox++,COMPLEMENT:ox++,ALPHAREPLICATE:ox++};i.add("FunctionType","x_ite/Browser/Texturing/FunctionType",ax);const lx=ax;let ux=0;const hx={NONE:ux++,SPHERE:ux++,CAMERASPACENORMAL:ux++,CAMERASPACEPOSITION:ux++,CAMERASPACEREFLECTIONVECTOR:ux++,SPHERE_LOCAL:ux++,COORD:ux++,COORD_EYE:ux++,NOISE:ux++,NOISE_EYE:ux++,SPHERE_REFLECT:ux++,SPHERE_REFLECT_LOCAL:ux++};i.add("TextureCoordinateGeneratorModeType","x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType",hx);const dx=hx;const cx={getSource(e,t,i,n){const s="\\s+|/\\*[\\s\\S]*?\\*/|//.*?\\n",r="#line\\s+.*?\\n|#if\\s+.*?\\n|#elif\\s+.*?\\n|#ifdef\\s+.*?\\n|#ifndef\\s+.*?\\n|#else.*?\\n|#endif.*?\\n|#define\\s+(?:[^\\n\\\\]|\\\\[^\\r\\n]|\\\\\\r?\\n)*\\n|#undef\\s+.*?\\n|#pragma\\s+.*?\\n",o=new RegExp("^((?:"+s+"|"+r+")*(?:#version\\s+.*?\\n)?(?:"+s+"|"+r+"|#extension\\s+.*?\\n)*)([\\s\\S]*)$"),a=i.match(o);if(!a)return i;let l="";l+="#define X_ITE\n",e.HAS_FEATURE_DEPTH_TEXTURE&&(l+="#define X3D_DEPTH_TEXTURE\n");for(const e of n)l+="#define "+e+"\n";let u="";u+="#define x3d_None 0\n",u+="#define x3d_Points 0\n",u+="#define x3d_Lines 1\n",u+="#define x3d_Geometry2D 2\n",u+="#define x3d_Geometry3D 3\n",u+="#define x3d_MaxClipPlanes "+t.getMaxClipPlanes()+"\n",u+="#define x3d_LinearFog 1\n",u+="#define x3d_ExponentialFog 2\n",u+="#define x3d_Exponential2Fog 3\n",u+="#define x3d_MaxLights "+t.getMaxLights()+"\n",u+="#define x3d_DirectionalLight 1\n",u+="#define x3d_PointLight 2\n",u+="#define x3d_SpotLight 3\n",u+="#define x3d_MaxTextures "+t.getMaxTextures()+"\n",u+="#define x3d_TextureType2D 2\n",u+="#define x3d_TextureType3D 3\n",u+="#define x3d_TextureTypeCube 4\n",u+="#define x3d_Replace "+ix.REPLACE+"\n",u+="#define x3d_Modulate "+ix.MODULATE+"\n",u+="#define x3d_Modulate2X "+ix.MODULATE2X+"\n",u+="#define x3d_Modulate4X "+ix.MODULATE4X+"\n",u+="#define x3d_Add "+ix.ADD+"\n",u+="#define x3d_AddSigned "+ix.ADDSIGNED+"\n",u+="#define x3d_AddSigned2X "+ix.ADDSIGNED2X+"\n",u+="#define x3d_AddSmooth "+ix.ADDSMOOTH+"\n",u+="#define x3d_Subtract "+ix.SUBTRACT+"\n",u+="#define x3d_BlendDiffuseAlpha "+ix.BLENDDIFFUSEALPHA+"\n",u+="#define x3d_BlendTextureAlpha "+ix.BLENDTEXTUREALPHA+"\n",u+="#define x3d_BlendFactorAlpha "+ix.BLENDFACTORALPHA+"\n",u+="#define x3d_BlendCurrentAlpha "+ix.BLENDCURRENTALPHA+"\n",u+="#define x3d_ModulateAlphaAddColor "+ix.MODULATEALPHA_ADDCOLOR+"\n",u+="#define x3d_ModulateInvAlphaAddColor "+ix.MODULATEINVALPHA_ADDCOLOR+"\n",u+="#define x3d_ModulateInvColorAddAlpha "+ix.MODULATEINVCOLOR_ADDALPHA+"\n",u+="#define x3d_DotProduct3 "+ix.DOTPRODUCT3+"\n",u+="#define x3d_SelectArg1 "+ix.SELECTARG1+"\n",u+="#define x3d_SelectArg2 "+ix.SELECTARG2+"\n",u+="#define x3d_Off "+ix.OFF+"\n",u+="#define x3d_Diffuse "+rx.DIFFUSE+"\n",u+="#define x3d_Specular "+rx.SPECULAR+"\n",u+="#define x3d_Factor "+rx.FACTOR+"\n",u+="#define x3d_Complement "+lx.COMPLEMENT+"\n",u+="#define x3d_AlphaReplicate "+lx.ALPHAREPLICATE+"\n",u+="#define x3d_Sphere "+dx.SPHERE+"\n",u+="#define x3d_CameraSpaceNormal "+dx.CAMERASPACENORMAL+"\n",u+="#define x3d_CameraSpacePosition "+dx.CAMERASPACEPOSITION+"\n",u+="#define x3d_CameraSpaceReflectionVector "+dx.CAMERASPACEREFLECTIONVECTOR+"\n",u+="#define x3d_SphereLocal "+dx.SPHERE_LOCAL+"\n",u+="#define x3d_Coord "+dx.COORD+"\n",u+="#define x3d_CoordEye "+dx.COORD_EYE+"\n",u+="#define x3d_Noise "+dx.NOISE+"\n",u+="#define x3d_NoiseEye "+dx.NOISE_EYE+"\n",u+="#define x3d_SphereReflect "+dx.SPHERE_REFLECT+"\n",u+="#define x3d_SphereReflectLocal "+dx.SPHERE_REFLECT_LOCAL+"\n",u+="#define x3d_GeometryPoints 0\n",u+="#define x3d_GeometryLines 1\n",u+="#define x3d_NoneClipPlane vec4 (88.0, 51.0, 68.0, 33.0)\n",u+="#define x3d_NoneFog 0\n",u+="#define x3d_NoneLight 0\n",u+="#define x3d_NoneTexture 0\n";const h=i.match(/\s*precision\s+(lowp|mediump|highp)\s+float\s*;/),d=i.match(/\s*precision\s+(lowp|mediump|highp)\s+int\s*;/),c=h?h[1]:"mediump",p=d?d[1]:"mediump",g=Q_.replace(/mediump\s+(float|vec2|vec3|mat3|mat4)/g,c+" $1").replace(/mediump\s+(int)/g,p+" $1"),f=(a[1].match(/\n/g)||[]).length+1;return a[1]+l+u+g+"#line "+(f+1)+" -1\n"+a[2]}};i.add("ShaderSource","x_ite/Browser/Shaders/ShaderSource",cx);const px=cx,gx="#if defined(X3D_CLIP_PLANES)\nuniform vec4 x3d_ClipPlane[X3D_NUM_CLIP_PLANES];void clip(){for(int i=0;i<X3D_NUM_CLIP_PLANES;++i){if(dot(vertex,x3d_ClipPlane[i].xyz)-x3d_ClipPlane[i].w<0.0)discard;}}\n#endif\n";i.add("ClipPlanes1.glsl","assets/shaders/webgl1/include/ClipPlanes1.glsl",gx);const fx=gx,mx="vec4 SRGBtoLINEAR(const in vec4 srgbIn){\n#if defined(MANUAL_SRGB)\n#if defined(SRGB_FAST_APPROXIMATION)\nvec3 linOut=pow(srgbIn.xyz,vec3(2.2));\n#else \nvec3 bLess=step(vec3(0.04045),srgbIn.xyz);vec3 linOut=mix(srgbIn.xyz/vec3(12.92),pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)),bLess);\n#endif \nreturn vec4(linOut,srgbIn.w);\n#else \nreturn srgbIn;\n#endif \n}\n#if defined(MANUAL_SRGB)\nvec4 Gamma(const in vec4 color){return vec4(pow(color.rgb,vec3(1.0/2.2)),color.a);}\n#else\n#define Gamma(color)(color)\n#endif\n";i.add("Colors1.glsl","assets/shaders/webgl1/include/Colors1.glsl",mx);const _x=mx,xx="#if defined(X3D_FOG)\nuniform x3d_FogParameters x3d_Fog;float getFogInterpolant(){\n#if defined(X3D_FOG_COORDS)\nreturn clamp(1.0-fogDepth,0.0,1.0);\n#else\nfloat visibilityRange=x3d_Fog.visibilityRange;float dV=length(x3d_Fog.matrix*vertex);\n#if defined(X3D_FOG_LINEAR)\nreturn max(0.0,visibilityRange-dV)/visibilityRange;\n#elif defined(X3D_FOG_EXPONENTIAL)\nreturn exp(-dV/max(0.001,visibilityRange-dV));\n#endif\n#endif\n}vec3 getFogColor(const in vec3 color){return mix(x3d_Fog.color,color,getFogInterpolant());}\n#endif\n";i.add("Fog1.glsl","assets/shaders/webgl1/include/Fog1.glsl",xx);const yx=xx,wx='#if defined(X3D_NORMAL_TEXTURE)\n#extension GL_OES_standard_derivatives:enable\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\n#extension GL_EXT_frag_depth:enable\n#endif\n#if defined(X3D_ALPHA_MODE_MASK)\nuniform float x3d_AlphaCutoff;\n#endif\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nvarying float fogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\nvarying vec4 color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nvarying vec4 texCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nvarying vec4 texCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nvarying vec4 texCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nvarying vec4 texCoord3;\n#endif\n#endif\n#else\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nvec4 texCoord0=vec4(0.0,0.0,0.0,1.0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nvec4 texCoord1=vec4(0.0,0.0,0.0,1.0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nvec4 texCoord2=vec4(0.0,0.0,0.0,1.0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nvec4 texCoord3=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if defined(X3D_NORMALS)\nvarying vec3 normal;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nvarying vec3 localNormal;\n#endif\n#else\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nconst vec3 localNormal=vec3(0.0,0.0,1.0);\n#endif\n#endif\nvarying vec3 vertex;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nvarying vec3 localVertex;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nuniform float x3d_LogarithmicFarFactor1_2;varying float depth;\n#endif\n#pragma X3D include "Texture.glsl"\n#pragma X3D include "ClipPlanes.glsl"\n#pragma X3D include "Point.glsl"\n#pragma X3D include "Hatch.glsl"\n#pragma X3D include "Fog.glsl"\nvec4 getMaterialColor();void fragment_main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nsetPointTexCoords();\n#endif\nvec4 finalColor=getMaterialColor();\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nfinalColor=getPointColor(finalColor);\n#endif\n#if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)\nfinalColor=getHatchColor(finalColor);\n#endif\n#if defined(X3D_FOG)\nfinalColor.rgb=getFogColor(finalColor.rgb);\n#endif\n#if defined(X3D_ALPHA_MODE_OPAQUE)\nfinalColor.a=1.0;\n#endif\n#if defined(X3D_ALPHA_MODE_MASK)\nif(finalColor.a<x3d_AlphaCutoff)discard;finalColor.a=1.0;\n#endif\ngl_FragColor=finalColor;\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\ngl_FragDepthEXT=log2(depth)*x3d_LogarithmicFarFactor1_2;\n#endif\n}\n';i.add("Fragment1.glsl","assets/shaders/webgl1/include/Fragment1.glsl",wx);const bx=wx,Sx="#if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)\nuniform x3d_FillPropertiesParameters x3d_FillProperties;vec4 getHatchColor(vec4 color){vec4 finalColor=x3d_FillProperties.filled?color:vec4(0.0);\n#if defined(X3D_STYLE_PROPERTIES_TEXTURE)\nvec4 hatch=texture2D(x3d_FillProperties.texture,gl_FragCoord.xy/(32.0*x3d_FillProperties.scale));hatch.rgb*=x3d_FillProperties.hatchColor;finalColor=mix(finalColor,hatch,hatch.a);\n#endif\nreturn finalColor;}\n#endif\n";i.add("Hatch1.glsl","assets/shaders/webgl1/include/Hatch1.glsl",Sx);const Tx=Sx,vx='uniform x3d_MaterialParameters x3d_Material;\n#if defined(X3D_LIGHTING)\n#pragma X3D include "SpotFactor.glsl"\n#pragma X3D include "Shadow.glsl"\nuniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];vec3 getMaterialColor(const in vec3 vertex,const in vec3 N,const in vec3 ambientColor,const in vec3 diffuseColor,const in vec3 specularColor,const in float shininess){vec3 V=normalize(-vertex);vec3 finalColor=vec3(0.0);for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 H=normalize(L+V);float lightAngle=max(dot(N,L),0.0);vec3 diffuseTerm=diffuseColor*lightAngle;float specularFactor=shininess>0.0?pow(max(dot(N,H),0.0),shininess*128.0):1.0;vec3 specularTerm=specularColor*specularFactor;float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 ambientTerm=light.ambientIntensity*ambientColor;vec3 diffuseSpecularTerm=light.intensity*(diffuseTerm+specularTerm);\n#if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)\nif(lightAngle>0.0&&light.shadowIntensity>0.0)diffuseSpecularTerm=mix(diffuseSpecularTerm,light.shadowColor,getShadowIntensity(i,light));\n#endif\nfinalColor+=attenuationSpotFactor*light.color*(ambientTerm+diffuseSpecularTerm);}}return finalColor;}\n#endif\n';i.add("Material1.glsl","assets/shaders/webgl1/include/Material1.glsl",vx);const Ox=vx,Ex="#if defined(X3D_NORMAL_TEXTURE)\nmat3 getTBNMatrix(const in vec2 texCoord){vec3 pos_dx=dFdx(vertex);vec3 pos_dy=dFdy(vertex);vec3 tex_dx=dFdx(vec3(texCoord,0.0));vec3 tex_dy=dFdy(vec3(texCoord,0.0));vec3 t=(tex_dy.t*pos_dx-tex_dx.t*pos_dy)/(tex_dx.s*tex_dy.t-tex_dy.s*tex_dx.t);vec3 N=normalize(normal);vec3 T=normalize(t-N*dot(N,t));vec3 B=normalize(cross(N,T));mat3 tbn=mat3(T,B,N);return tbn;}\n#endif\n#if defined(X3D_NORMAL_TEXTURE)\nuniform x3d_NormalTextureParameters x3d_NormalTexture;\n#endif\nvec3 getNormalVector(const in float normalScale){float facing=gl_FrontFacing?1.0:-1.0;\n#if defined(X3D_NORMAL_TEXTURE)&&!defined(X3D_NORMAL_TEXTURE_3D)\nvec3 texCoord=getTexCoord(x3d_NormalTexture.textureTransformMapping,x3d_NormalTexture.textureCoordinateMapping);vec3 scale=vec3(vec2(normalScale),1.0);mat3 tbn=getTBNMatrix(texCoord.st);\n#if defined(X3D_NORMAL_TEXTURE_2D)\nvec3 n=texture2D(x3d_NormalTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_NORMAL_TEXTURE_CUBE)\nvec3 n=textureCube(x3d_NormalTexture.textureCube,texCoord).rgb;\n#endif\nreturn normalize(tbn*((n*2.0-1.0)*scale))*facing;\n#else\nreturn normalize(normal)*facing;\n#endif\n}\n";i.add("Normal1.glsl","assets/shaders/webgl1/include/Normal1.glsl",Ex);const Nx=Ex,Cx="float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}float rand(vec2 co,float l){return rand(vec2(rand(co),l));}float rand(vec2 co,float l,float t){return rand(vec2(rand(co,l),t));}float perlin(vec2 p,float dim,float time){const float M_PI=3.14159265358979323846;vec2 pos=floor(p*dim);vec2 posx=pos+vec2(1.0,0.0);vec2 posy=pos+vec2(0.0,1.0);vec2 posxy=pos+vec2(1.0);float c=rand(pos,dim,time);float cx=rand(posx,dim,time);float cy=rand(posy,dim,time);float cxy=rand(posxy,dim,time);vec2 d=fract(p*dim);d=-0.5*cos(d*M_PI)+0.5;float ccx=mix(c,cx,d.x);float cycxy=mix(cy,cxy,d.x);float center=mix(ccx,cycxy,d.y);return center*2.0-1.0;}vec3 perlin(vec3 p){return vec3(perlin(p.xy,1.0,0.0),perlin(p.yz,1.0,0.0),perlin(p.zx,1.0,0.0));}\n";i.add("Perlin1.glsl","assets/shaders/webgl1/include/Perlin1.glsl",Cx);const Fx=Cx,Ix="#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nvoid setPointTexCoords(){vec4 texCoord=vec4(gl_PointCoord.x,1.0-gl_PointCoord.y,0.0,1.0);\n#if X3D_NUM_TEXTURE_COORDINATES>0\ntexCoord0=texCoord;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\ntexCoord1=texCoord;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\ntexCoord2=texCoord;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\ntexCoord3=texCoord;\n#endif\n}\n#define getPointColor(color)(color)\n#else\n#define setPointTexCoords()\nvarying float pointSize;vec4 getPointColor(in vec4 color){if(pointSize>1.0)color.a*=clamp(pointSize*(0.5-distance(vec2(0.5),gl_PointCoord)),0.0,1.0);else color.a*=pointSize;return color;}\n#endif\n#endif\n";i.add("Point1.glsl","assets/shaders/webgl1/include/Point1.glsl",Ix);const Mx=Ix,Dx="#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nuniform x3d_PointPropertiesParameters x3d_PointProperties;varying float pointSize;float getPointSize(const in vec3 vertex){float pointSizeMinValue=x3d_PointProperties.pointSizeMinValue;float pointSizeMaxValue=x3d_PointProperties.pointSizeMaxValue;vec3 attenuation=x3d_PointProperties.attenuation;float dL=length(vertex);float pointSize=0.0;pointSize=x3d_PointProperties.pointSizeScaleFactor;pointSize/=dot(attenuation,vec3(1.0,dL,dL*dL));pointSize=clamp(pointSize,pointSizeMinValue,pointSizeMaxValue);\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURE)\nreturn pointSize;\n#else\nreturn pointSize+1.0-step(pointSize,1.0);\n#endif\n}\n#endif\n";i.add("PointSize1.glsl","assets/shaders/webgl1/include/PointSize1.glsl",Dx);const Px=Dx,Rx="#if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)\nuniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){\n#if X3D_NUM_LIGHTS>0\nif(index==0)return texture2D(x3d_ShadowMap[0],shadowCoord).r;\n#endif\n#if X3D_NUM_LIGHTS>1\nif(index==1)return texture2D(x3d_ShadowMap[1],shadowCoord).r;\n#endif\n#if X3D_NUM_LIGHTS>2\nif(index==2)return texture2D(x3d_ShadowMap[2],shadowCoord).r;\n#endif\n#if X3D_NUM_LIGHTS>3\nif(index==3)return texture2D(x3d_ShadowMap[3],shadowCoord).r;\n#endif\n#if X3D_NUM_LIGHTS>4\nif(index==4)return texture2D(x3d_ShadowMap[4],shadowCoord).r;\n#endif\n#if X3D_NUM_LIGHTS>5\nif(index==5)return texture2D(x3d_ShadowMap[5],shadowCoord).r;\n#endif\n#if X3D_NUM_LIGHTS>6\nif(index==6)return texture2D(x3d_ShadowMap[6],shadowCoord).r;\n#endif\n#if X3D_NUM_LIGHTS>7\nif(index==7)return texture2D(x3d_ShadowMap[7],shadowCoord).r;\n#endif\nreturn 0.0;}float texture2DCompare(const in int index,const in vec2 texCoord,const in float compare){float shadowDepth=getShadowDepth(index,texCoord);return(1.0-step(1.0,shadowDepth))*step(shadowDepth,compare);}float texture2DShadowLerp(const in int index,const in vec2 texelSize,const in float shadowMapSize,const in vec2 texCoord,const in float compare){const vec2 offset=vec2(0.0,1.0);vec2 centroidTexCoord=floor(texCoord*shadowMapSize+0.5)/shadowMapSize;float lb=texture2DCompare(index,centroidTexCoord+texelSize*offset.xx,compare);float lt=texture2DCompare(index,centroidTexCoord+texelSize*offset.xy,compare);float rb=texture2DCompare(index,centroidTexCoord+texelSize*offset.yx,compare);float rt=texture2DCompare(index,centroidTexCoord+texelSize*offset.yy,compare);vec2 f=fract(texCoord*shadowMapSize+0.5);float a=mix(lb,lt,f.y);float b=mix(rb,rt,f.y);float c=mix(a,b,f.x);return c;}vec2 cubeToUVCompact(in vec3 v,const float texelSizeY){vec3 absV=abs(v);float scaleToCube=1.0/max(absV.x,max(absV.y,absV.z));absV*=scaleToCube;v*=scaleToCube*(1.0-2.0*texelSizeY);vec2 planar=v.xy;float almostATexel=1.5*texelSizeY;float almostOne=1.0-almostATexel;if(absV.z>=almostOne){if(v.z>0.0)planar.x=4.0-v.x;}else if(absV.x>=almostOne){float signX=sign(v.x);planar.x=v.z*signX+2.0*signX;}else if(absV.y>=almostOne){float signY=sign(v.y);planar.x=(v.x+0.5+signY)*2.0;planar.y=v.z*signY-2.0;}return vec2(0.125,0.25)*planar+vec2(0.375,0.75);}mat4 getPointLightRotations(const in vec3 vector){mat4 rotations[6];rotations[0]=mat4(0,0,1,0,0,1,0,0,-1,0,0,0,0,0,0,1);rotations[1]=mat4(0,0,-1,0,0,1,0,0,1,0,0,0,0,0,0,1);rotations[2]=mat4(-1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1);rotations[3]=mat4(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);rotations[4]=mat4(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);rotations[5]=mat4(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);vec3 a=abs(vector.xyz);if(a.x>a.y){if(a.x>a.z)return vector.x>0.0?rotations[1]:rotations[0];else return vector.z>0.0?rotations[2]:rotations[3];}else{if(a.y>a.z)return vector.y>0.0?rotations[5]:rotations[4];else return vector.z>0.0?rotations[2]:rotations[3];}return rotations[3];}float getShadowIntensity(const in int index,const in x3d_LightSourceParameters light){if(light.type==x3d_PointLight){const mat4 biasMatrix=mat4(0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.5,0.5,1.0);const mat4 projectionMatrix=mat4(1.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,-1.000025000312504,-1.0,0,0.0,-0.25000312503906297,0.0);vec2 texelSize=vec2(1.0)/(float(light.shadowMapSize)*vec2(4.0,2.0));vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);vec3 lightToPosition=shadowCoord.xyz;shadowCoord=biasMatrix*(projectionMatrix*(getPointLightRotations(lightToPosition)*shadowCoord));shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;\n#if defined(X3D_PCF_FILTERING)||defined(X3D_PCF_SOFT_FILTERING)\nvec2 offset=vec2(-1,1)*(texelSize.y*42.0);float value=(texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxx,texelSize.y),shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;\n#else \nfloat value=texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z);return light.shadowIntensity*value;\n#endif\n}else{\n#if defined(X3D_PCF_FILTERING)\nvec2 texelSize=vec2(1.0)/vec2(light.shadowMapSize);vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;vec2 d0=-texelSize;vec2 d1=texelSize;float value=(texture2DCompare(index,shadowCoord.xy+d0,shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(0.0,d0.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d1.x,d0.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d0.x,0.0),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy,shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d1.x,0.0),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d0.x,d1.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(0.0,d1.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+d1,shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;\n#elif defined(X3D_PCF_SOFT_FILTERING)\nvec2 texelSize=vec2(1.0)/vec2(light.shadowMapSize);vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;vec2 d0=-texelSize;vec2 d1=texelSize;float value=(texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+d0,shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(0.0,d0.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d1.x,d0.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d0.x,0.0),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy,shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d1.x,0.0),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d0.x,d1.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(0.0,d1.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+d1,shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;\n#else \nvec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;float value=texture2DCompare(index,shadowCoord.xy,shadowCoord.z);return light.shadowIntensity*value;\n#endif\n}return 0.0;}\n#endif\n";i.add("Shadow1.glsl","assets/shaders/webgl1/include/Shadow1.glsl",Rx);const Ax=Rx,Vx="float getSpotFactor(const in float cutOffAngle,const in float beamWidth,const in vec3 L,const in vec3 d){float spotAngle=acos(clamp(dot(-L,d),-1.0,1.0));if(spotAngle>=cutOffAngle)return 0.0;else if(spotAngle<=beamWidth)return 1.0;return(spotAngle-cutOffAngle)/(beamWidth-cutOffAngle);}\n";i.add("SpotFactor1.glsl","assets/shaders/webgl1/include/SpotFactor1.glsl",Vx);const Lx=Vx,Bx='#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#pragma X3D include "Perlin.glsl"\nuniform mat4 x3d_TextureMatrix[X3D_NUM_TEXTURE_TRANSFORMS];mat4 getTextureMatrix(const in int i){\n#if X3D_NUM_TEXTURE_TRANSFORMS>1\nmat4 textureMatrix=mat4(0.0);\n#if X3D_NUM_TEXTURE_TRANSFORMS>0\nif(i==0)textureMatrix=x3d_TextureMatrix[0];\n#endif\n#if X3D_NUM_TEXTURE_TRANSFORMS>1\nelse if(i==1)textureMatrix=x3d_TextureMatrix[1];\n#endif\n#if X3D_NUM_TEXTURE_TRANSFORMS>2\nelse if(i==2)textureMatrix=x3d_TextureMatrix[2];\n#endif\n#if X3D_NUM_TEXTURE_TRANSFORMS>3\nelse if(i==3)textureMatrix=x3d_TextureMatrix[3];\n#endif\nreturn textureMatrix;\n#else\nreturn x3d_TextureMatrix[0];\n#endif\n}vec4 getTexCoord(const in int i){\n#if X3D_NUM_TEXTURE_COORDINATES>1\nvec4 texCoord=vec4(0.0);\n#if X3D_NUM_TEXTURE_COORDINATES>0\nif(i==0)texCoord=texCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nelse if(i==1)texCoord=texCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nelse if(i==2)texCoord=texCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nelse if(i==3)texCoord=texCoord3;\n#endif\nreturn texCoord;\n#else\nreturn texCoord0;\n#endif\n}vec4 getTexCoord(const in x3d_TextureCoordinateGeneratorParameters textureCoordinateGenerator,const in int textureTransformMapping,const in int textureCoordinateMapping){int mode=textureCoordinateGenerator.mode;if(mode==x3d_None){return getTextureMatrix(textureTransformMapping)*getTexCoord(textureCoordinateMapping);}else if(mode==x3d_Sphere){vec2 N=normalize(gl_FrontFacing?normal:-normal).xy;return vec4(N*0.5+0.5,0.0,1.0);}else if(mode==x3d_CameraSpaceNormal){vec3 N=normalize(gl_FrontFacing?normal:-normal);return vec4(N,1.0);}else if(mode==x3d_CameraSpacePosition){return vec4(vertex,1.0);}else if(mode==x3d_CameraSpaceReflectionVector){vec3 N=normalize(gl_FrontFacing?normal:-normal);return vec4(reflect(normalize(vertex),-N),1.0);}else if(mode==x3d_SphereLocal){vec2 N=normalize(gl_FrontFacing?localNormal:-localNormal).xy;return vec4(N*0.5+0.5,0.0,1.0);}else if(mode==x3d_Coord){return vec4(localVertex,1.0);}else if(mode==x3d_CoordEye){return vec4(vertex,1.0);}else if(mode==x3d_Noise){vec3 scale=vec3(textureCoordinateGenerator.parameter[0],textureCoordinateGenerator.parameter[1],textureCoordinateGenerator.parameter[2]);vec3 translation=vec3(textureCoordinateGenerator.parameter[3],textureCoordinateGenerator.parameter[4],textureCoordinateGenerator.parameter[5]);return vec4(perlin(localVertex*scale+translation),1.0);}else if(mode==x3d_NoiseEye){vec3 scale=vec3(textureCoordinateGenerator.parameter[0],textureCoordinateGenerator.parameter[1],textureCoordinateGenerator.parameter[2]);vec3 translation=vec3(textureCoordinateGenerator.parameter[3],textureCoordinateGenerator.parameter[4],textureCoordinateGenerator.parameter[5]);return vec4(perlin(vertex*scale+translation),1.0);}else if(mode==x3d_SphereReflect){vec3 N=normalize(gl_FrontFacing?normal:-normal);float eta=textureCoordinateGenerator.parameter[0];return vec4(refract(normalize(vertex),-N,eta),1.0);}else if(mode==x3d_SphereReflectLocal){vec3 N=normalize(gl_FrontFacing?localNormal:-localNormal);float eta=textureCoordinateGenerator.parameter[0];vec3 eye=vec3(textureCoordinateGenerator.parameter[1],textureCoordinateGenerator.parameter[2],textureCoordinateGenerator.parameter[3]);return vec4(refract(normalize(localVertex-eye),-N,eta),1.0);}return getTextureMatrix(textureTransformMapping)*getTexCoord(textureCoordinateMapping);}uniform x3d_TextureCoordinateGeneratorParameters x3d_TextureCoordinateGenerator[X3D_NUM_TEXTURE_COORDINATES];vec3 getTexCoord(const in int textureTransformMapping,const in int textureCoordinateMapping){vec4 texCoord;\n#if X3D_NUM_TEXTURE_COORDINATES>0\nif(textureCoordinateMapping==0)texCoord=getTexCoord(x3d_TextureCoordinateGenerator[0],textureTransformMapping,textureCoordinateMapping);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nelse if(textureCoordinateMapping==1)texCoord=getTexCoord(x3d_TextureCoordinateGenerator[1],textureTransformMapping,textureCoordinateMapping);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nelse if(textureCoordinateMapping==2)texCoord=getTexCoord(x3d_TextureCoordinateGenerator[2],textureTransformMapping,textureCoordinateMapping);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nelse if(textureCoordinateMapping==3)texCoord=getTexCoord(x3d_TextureCoordinateGenerator[3],textureTransformMapping,textureCoordinateMapping);\n#endif\ntexCoord.stp/=texCoord.q;\n#if defined(X3D_GEOMETRY_2D)\nif(gl_FrontFacing==false)texCoord.s=1.0-texCoord.s;\n#endif\nreturn texCoord.stp;}\n#endif \n#if defined(X3D_TEXTURE)\nuniform sampler2D x3d_Texture2D[X3D_NUM_TEXTURES];uniform samplerCube x3d_TextureCube[X3D_NUM_TEXTURES];\n#if defined(X3D_MULTI_TEXTURING)\nvec4 getTexture(const in int i,const in vec3 texCoord){vec4 textureColor=vec4(0.0);\n#if X3D_NUM_TEXTURES>0\nif(i==0){\n#if defined(X3D_TEXTURE0_2D)\ntextureColor=texture2D(x3d_Texture2D[0],texCoord.st);\n#elif defined(X3D_TEXTURE0_CUBE)\ntextureColor=textureCube(x3d_TextureCube[0],texCoord.stp);\n#endif\n}\n#endif\n#if X3D_NUM_TEXTURES>1\nelse if(i==1){\n#if defined(X3D_TEXTURE0_2D)\ntextureColor=texture2D(x3d_Texture2D[1],texCoord.st);\n#elif defined(X3D_TEXTURE0_CUBE)\ntextureColor=textureCube(x3d_TextureCube[1],texCoord.stp);\n#endif\n}\n#endif\nreturn textureColor;}\n#endif\n#if defined(X3D_MULTI_TEXTURING)\nuniform vec4 x3d_MultiTextureColor;uniform x3d_MultiTextureParameters x3d_MultiTexture[X3D_NUM_TEXTURES];\n#endif\nint minI(const in int a,const in int b){return a<b?a:b;}vec4 getTextureColor(const in vec4 diffuseColor,const in vec4 specularColor){\n#if defined(X3D_MULTI_TEXTURING)\nvec4 currentColor=diffuseColor;for(int i=0;i<X3D_NUM_TEXTURES;++i){vec3 texCoord=getTexCoord(minI(i,X3D_NUM_TEXTURE_TRANSFORMS-1),minI(i,X3D_NUM_TEXTURE_COORDINATES-1));vec4 textureColor=getTexture(i,texCoord);x3d_MultiTextureParameters multiTexture=x3d_MultiTexture[i];vec4 arg1=textureColor;vec4 arg2=currentColor;int source=multiTexture.source;if(source==x3d_Diffuse){arg1=diffuseColor;}else if(source==x3d_Specular){arg1=specularColor;}else if(source==x3d_Factor){arg1=x3d_MultiTextureColor;}int function=multiTexture.function;if(function==x3d_Complement){arg1=1.0-arg1;}else if(function==x3d_AlphaReplicate){arg1.a=arg2.a;}int mode=multiTexture.mode;int alphaMode=multiTexture.alphaMode;if(mode==x3d_Replace){currentColor.rgb=arg1.rgb;}else if(mode==x3d_Modulate){currentColor.rgb=arg1.rgb*arg2.rgb;}else if(mode==x3d_Modulate2X){currentColor.rgb=(arg1.rgb*arg2.rgb)*2.0;}else if(mode==x3d_Modulate4X){currentColor.rgb=(arg1.rgb*arg2.rgb)*4.0;}else if(mode==x3d_Add){currentColor.rgb=arg1.rgb+arg2.rgb;}else if(mode==x3d_AddSigned){currentColor.rgb=arg1.rgb+arg2.rgb-0.5;}else if(mode==x3d_AddSigned2X){currentColor.rgb=(arg1.rgb+arg2.rgb-0.5)*2.0;}else if(mode==x3d_AddSmooth){currentColor.rgb=arg1.rgb+(1.0-arg1.rgb)*arg2.rgb;}else if(mode==x3d_Subtract){currentColor.rgb=arg1.rgb-arg2.rgb;}else if(mode==x3d_BlendDiffuseAlpha){currentColor.rgb=arg1.rgb*diffuseColor.a+arg2.rgb*(1.0-diffuseColor.a);}else if(mode==x3d_BlendTextureAlpha){currentColor.rgb=arg1.rgb*arg1.a+arg2.rgb*(1.0-arg1.a);}else if(mode==x3d_BlendFactorAlpha){currentColor.rgb=arg1.rgb*x3d_MultiTextureColor.a+arg2.rgb*(1.0-x3d_MultiTextureColor.a);}else if(mode==x3d_BlendCurrentAlpha){currentColor.rgb=arg1.rgb*arg2.a+arg2.rgb*(1.0-arg2.a);}else if(mode==x3d_ModulateAlphaAddColor){currentColor.rgb=arg1.rgb+arg1.a*arg2.rgb;}else if(mode==x3d_ModulateInvAlphaAddColor){currentColor.rgb=(1.0-arg1.a)*arg2.rgb+arg1.rgb;}else if(mode==x3d_ModulateInvColorAddAlpha){currentColor.rgb=(1.0-arg1.rgb)*arg2.rgb+arg1.a;}else if(mode==x3d_DotProduct3){currentColor.rgb=vec3(dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0));}else if(mode==x3d_SelectArg1){currentColor.rgb=arg1.rgb;}else if(mode==x3d_SelectArg2){currentColor.rgb=arg2.rgb;}else if(mode==x3d_Off);if(alphaMode==x3d_Replace){currentColor.a=arg1.a;}else if(alphaMode==x3d_Modulate){currentColor.a=arg1.a*arg2.a;}else if(alphaMode==x3d_Modulate2X){currentColor.a=(arg1.a*arg2.a)*2.0;}else if(alphaMode==x3d_Modulate4X){currentColor.a=(arg1.a*arg2.a)*4.0;}else if(alphaMode==x3d_Add){currentColor.a=arg1.a+arg2.a;}else if(alphaMode==x3d_AddSigned){currentColor.a=arg1.a+arg2.a-0.5;}else if(alphaMode==x3d_AddSigned2X){currentColor.a=(arg1.a+arg2.a-0.5)*2.0;}else if(alphaMode==x3d_AddSmooth){currentColor.a=arg1.a+(1.0-arg1.a)*arg2.a;}else if(alphaMode==x3d_Subtract){currentColor.a=arg1.a-arg2.a;}else if(alphaMode==x3d_BlendDiffuseAlpha){currentColor.a=arg1.a*diffuseColor.a+arg2.a*(1.0-diffuseColor.a);}else if(alphaMode==x3d_BlendTextureAlpha){currentColor.a=arg1.a*arg1.a+arg2.a*(1.0-arg1.a);}else if(alphaMode==x3d_BlendFactorAlpha){currentColor.a=arg1.a*x3d_MultiTextureColor.a+arg2.a*(1.0-x3d_MultiTextureColor.a);}else if(alphaMode==x3d_BlendCurrentAlpha){currentColor.a=arg1.a*arg2.a+arg2.a*(1.0-arg2.a);}else if(alphaMode==x3d_ModulateAlphaAddColor){currentColor.a=arg1.a+arg1.a*arg2.a;}else if(alphaMode==x3d_ModulateInvAlphaAddColor){currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;}else if(alphaMode==x3d_ModulateInvColorAddAlpha){currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;}else if(alphaMode==x3d_DotProduct3){currentColor.a=dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0);}else if(alphaMode==x3d_SelectArg1){currentColor.a=arg1.a;}else if(alphaMode==x3d_SelectArg2){currentColor.a=arg2.a;}else if(alphaMode==x3d_Off);}return currentColor;\n#else\nvec3 texCoord=getTexCoord(0,0);\n#if defined(X3D_TEXTURE0_2D)\nvec4 textureColor=texture2D(x3d_Texture2D[0],texCoord.st);\n#elif defined(X3D_TEXTURE0_CUBE)\nvec4 textureColor=textureCube(x3d_TextureCube[0],texCoord.stp);\n#else\nvec4 textureColor=vec4(0.0);\n#endif\nreturn diffuseColor*textureColor;\n#endif\n}\n#endif\n#if defined(X3D_PROJECTIVE_TEXTURE_MAPPING)\nuniform sampler2D x3d_ProjectiveTexture[X3D_NUM_TEXTURE_PROJECTORS];uniform mat4 x3d_ProjectiveTextureMatrix[X3D_NUM_TEXTURE_PROJECTORS];uniform vec3 x3d_ProjectiveTextureLocation[X3D_NUM_TEXTURE_PROJECTORS];vec4 getProjectiveTexture(const in int i,const in vec2 texCoord){vec4 color=vec4(0.0);\n#if X3D_NUM_TEXTURE_PROJECTORS>0\nif(i==0)color=texture2D(x3d_ProjectiveTexture[0],texCoord);\n#endif\n#if X3D_NUM_TEXTURE_PROJECTORS>1\nelse if(i==1)color=texture2D(x3d_ProjectiveTexture[1],texCoord);\n#endif\nreturn color;}vec4 getProjectiveTextureColor(in vec4 currentColor){vec3 N=gl_FrontFacing?normal:-normal;for(int i=0;i<X3D_NUM_TEXTURE_PROJECTORS;++i){vec4 texCoord=x3d_ProjectiveTextureMatrix[i]*vec4(vertex,1.0);texCoord.stp/=texCoord.q;if(texCoord.s<0.0||texCoord.s>1.0)continue;if(texCoord.t<0.0||texCoord.t>1.0)continue;if(texCoord.p<0.0||texCoord.p>1.0)continue;vec3 p=x3d_ProjectiveTextureLocation[i]-vertex;if(dot(N,p)<0.0)continue;currentColor*=getProjectiveTexture(i,texCoord.st);}return currentColor;}\n#endif \n';i.add("Texture1.glsl","assets/shaders/webgl1/include/Texture1.glsl",Bx);const Ux=Bx,Xx='uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nattribute float x3d_FogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\nattribute vec4 x3d_Color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nattribute vec4 x3d_TexCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nattribute vec4 x3d_TexCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nattribute vec4 x3d_TexCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nattribute vec4 x3d_TexCoord3;\n#endif\n#endif\n#endif\nattribute vec4 x3d_Vertex;\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nvarying float fogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\nvarying vec4 color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nvarying vec4 texCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nvarying vec4 texCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nvarying vec4 texCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nvarying vec4 texCoord3;\n#endif\n#endif\n#endif\n#if defined(X3D_NORMALS)\nuniform mat3 x3d_NormalMatrix;attribute vec3 x3d_Normal;varying vec3 normal;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nvarying vec3 localNormal;\n#endif\n#endif\nvarying vec3 vertex;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nvarying vec3 localVertex;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nvarying float depth;\n#endif\n#pragma X3D include "PointSize.glsl"\nvoid vertex_main(){vec4 position=x3d_ModelViewMatrix*x3d_Vertex;vertex=position.xyz;\n#if defined(X3D_GEOMETRY_0D)\n#if defined(X3D_STYLE_PROPERTIES)\ngl_PointSize=pointSize=getPointSize(vertex);\n#else\ngl_PointSize=1.0;\n#endif\n#endif\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nfogDepth=x3d_FogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\ncolor=x3d_Color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\ntexCoord0=x3d_TexCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\ntexCoord1=x3d_TexCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\ntexCoord2=x3d_TexCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\ntexCoord3=x3d_TexCoord3;\n#endif\n#endif\n#endif\n#if defined(X3D_NORMALS)\nnormal=x3d_NormalMatrix*x3d_Normal;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nlocalNormal=x3d_Normal;\n#endif\n#endif\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nlocalVertex=x3d_Vertex.xyz;\n#endif\ngl_Position=x3d_ProjectionMatrix*position;\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\ndepth=1.0+gl_Position.w;\n#endif\n}\n';i.add("Vertex1.glsl","assets/shaders/webgl1/include/Vertex1.glsl",Xx);const kx=Xx,jx="#if defined(X3D_CLIP_PLANES)\nuniform vec4 x3d_ClipPlane[X3D_NUM_CLIP_PLANES];void clip(){for(int i=0;i<X3D_NUM_CLIP_PLANES;++i){if(dot(vertex,x3d_ClipPlane[i].xyz)-x3d_ClipPlane[i].w<0.0)discard;}}\n#endif\n";i.add("ClipPlanes2.glsl","assets/shaders/webgl2/include/ClipPlanes2.glsl",jx);const zx=jx,Gx="vec4 SRGBtoLINEAR(const in vec4 srgbIn){\n#if defined(MANUAL_SRGB)\n#if defined(SRGB_FAST_APPROXIMATION)\nvec3 linOut=pow(srgbIn.xyz,vec3(2.2));\n#else \nvec3 bLess=step(vec3(0.04045),srgbIn.xyz);vec3 linOut=mix(srgbIn.xyz/vec3(12.92),pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)),bLess);\n#endif \nreturn vec4(linOut,srgbIn.w);\n#else \nreturn srgbIn;\n#endif \n}\n#if defined(MANUAL_SRGB)\nvec4 Gamma(const in vec4 color){return vec4(pow(color.rgb,vec3(1.0/2.2)),color.a);}\n#else\n#define Gamma(color)(color)\n#endif\n";i.add("Colors2.glsl","assets/shaders/webgl2/include/Colors2.glsl",Gx);const Hx=Gx,qx="#if defined(X3D_FOG)\nuniform x3d_FogParameters x3d_Fog;float getFogInterpolant(){\n#if defined(X3D_FOG_COORDS)\nreturn clamp(1.0-fogDepth,0.0,1.0);\n#else\nfloat visibilityRange=x3d_Fog.visibilityRange;float dV=length(x3d_Fog.matrix*vertex);\n#if defined(X3D_FOG_LINEAR)\nreturn max(0.0,visibilityRange-dV)/visibilityRange;\n#elif defined(X3D_FOG_EXPONENTIAL)\nreturn exp(-dV/max(0.001,visibilityRange-dV));\n#endif\n#endif\n}vec3 getFogColor(const in vec3 color){return mix(x3d_Fog.color,color,getFogInterpolant());}\n#endif\n";i.add("Fog2.glsl","assets/shaders/webgl2/include/Fog2.glsl",qx);const Yx=qx,Wx='#if defined(X3D_ALPHA_MODE_MASK)\nuniform float x3d_AlphaCutoff;\n#endif\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nin float fogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\nin vec4 color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nin vec4 texCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nin vec4 texCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nin vec4 texCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nin vec4 texCoord3;\n#endif\n#endif\n#else\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nvec4 texCoord0=vec4(0.0,0.0,0.0,1.0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nvec4 texCoord1=vec4(0.0,0.0,0.0,1.0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nvec4 texCoord2=vec4(0.0,0.0,0.0,1.0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nvec4 texCoord3=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if defined(X3D_NORMALS)\nin vec3 normal;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nin vec3 localNormal;\n#endif\n#else\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nconst vec3 localNormal=vec3(0.0,0.0,1.0);\n#endif\n#endif\nin vec3 vertex;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nin vec3 localVertex;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nuniform float x3d_LogarithmicFarFactor1_2;in float depth;\n#endif\n#if defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)\nlayout(location=0)out vec4 x3d_FragData0;layout(location=1)out vec4 x3d_FragData1;\n#else\nout vec4 x3d_FragColor;\n#endif\n#pragma X3D include "Texture.glsl"\n#pragma X3D include "ClipPlanes.glsl"\n#pragma X3D include "Point.glsl"\n#pragma X3D include "Stipple.glsl"\n#pragma X3D include "Hatch.glsl"\n#pragma X3D include "Fog.glsl"\nvec4 getMaterialColor();\n#if defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)\nfloat weight(const in float z,const in float a){return clamp(pow(min(1.0,a*10.0)+0.01,3.0)*1e8*pow(1.0-z*0.9,3.0),1e-2,3e3);}\n#endif\nvoid fragment_main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nstipple();\n#endif\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nsetPointTexCoords();\n#elif defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nsetTexCoords();\n#endif\nvec4 finalColor=getMaterialColor();\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nfinalColor=getPointColor(finalColor);\n#endif\n#if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)\nfinalColor=getHatchColor(finalColor);\n#endif\n#if defined(X3D_FOG)\nfinalColor.rgb=getFogColor(finalColor.rgb);\n#endif\n#if defined(X3D_ALPHA_MODE_OPAQUE)\nfinalColor.a=1.0;\n#endif\n#if defined(X3D_ALPHA_MODE_MASK)\nif(finalColor.a<x3d_AlphaCutoff)discard;finalColor.a=1.0;\n#endif\n#if defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)\nfloat a=finalColor.a;float w=weight(gl_FragCoord.z,a);finalColor.rgb*=a;finalColor*=w;x3d_FragData0=vec4(finalColor.rgb,a);x3d_FragData1=vec4(finalColor.a);\n#else\nx3d_FragColor=finalColor;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\ngl_FragDepth=log2(depth)*x3d_LogarithmicFarFactor1_2;\n#endif\n}\n';i.add("Fragment2.glsl","assets/shaders/webgl2/include/Fragment2.glsl",Wx);const $x=Wx,Jx="#if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)\nuniform x3d_FillPropertiesParameters x3d_FillProperties;vec4 getHatchColor(vec4 color){vec4 finalColor=x3d_FillProperties.filled?color:vec4(0.0);\n#if defined(X3D_STYLE_PROPERTIES_TEXTURE)\nvec4 hatch=texture(x3d_FillProperties.texture,gl_FragCoord.xy/(32.0*x3d_FillProperties.scale));hatch.rgb*=x3d_FillProperties.hatchColor;finalColor=mix(finalColor,hatch,hatch.a);\n#endif\nreturn finalColor;}\n#endif\n";i.add("Hatch2.glsl","assets/shaders/webgl2/include/Hatch2.glsl",Jx);const Kx=Jx,Zx="struct Line2{vec2 point;vec2 direction;};Line2 line2(const in vec2 point1,const in vec2 point2){return Line2(point1,normalize(point2-point1));}vec2 closest_point(const in Line2 line,const in vec2 point){vec2 r=point-line.point;float d=dot(r,line.direction);return line.direction*d+line.point;}\n";i.add("Line22.glsl","assets/shaders/webgl2/include/Line22.glsl",Zx);const Qx=Zx,ey='uniform x3d_MaterialParameters x3d_Material;\n#if defined(X3D_LIGHTING)\n#pragma X3D include "SpotFactor.glsl"\n#pragma X3D include "Shadow.glsl"\nuniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];vec3 getMaterialColor(const in vec3 vertex,const in vec3 N,const in vec3 ambientColor,const in vec3 diffuseColor,const in vec3 specularColor,const in float shininess){vec3 V=normalize(-vertex);vec3 finalColor=vec3(0.0);for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 H=normalize(L+V);float lightAngle=max(dot(N,L),0.0);vec3 diffuseTerm=diffuseColor*lightAngle;float specularFactor=shininess>0.0?pow(max(dot(N,H),0.0),shininess*128.0):1.0;vec3 specularTerm=specularColor*specularFactor;float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 ambientTerm=light.ambientIntensity*ambientColor;vec3 diffuseSpecularTerm=light.intensity*(diffuseTerm+specularTerm);\n#if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)\nif(lightAngle>0.0&&light.shadowIntensity>0.0)diffuseSpecularTerm=mix(diffuseSpecularTerm,light.shadowColor,getShadowIntensity(i,light));\n#endif\nfinalColor+=attenuationSpotFactor*light.color*(ambientTerm+diffuseSpecularTerm);}}return finalColor;}\n#endif\n';i.add("Material2.glsl","assets/shaders/webgl2/include/Material2.glsl",ey);const ty=ey,iy="#if defined(X3D_NORMAL_TEXTURE)\nmat3 getTBNMatrix(const in vec2 texCoord){vec3 pos_dx=dFdx(vertex);vec3 pos_dy=dFdy(vertex);vec3 tex_dx=dFdx(vec3(texCoord,0.0));vec3 tex_dy=dFdy(vec3(texCoord,0.0));vec3 t=(tex_dy.t*pos_dx-tex_dx.t*pos_dy)/(tex_dx.s*tex_dy.t-tex_dy.s*tex_dx.t);vec3 N=normalize(normal);vec3 T=normalize(t-N*dot(N,t));vec3 B=normalize(cross(N,T));mat3 tbn=mat3(T,B,N);return tbn;}\n#endif\n#if defined(X3D_NORMAL_TEXTURE)\nuniform x3d_NormalTextureParameters x3d_NormalTexture;\n#endif\nvec3 getNormalVector(const in float normalScale){float facing=gl_FrontFacing?1.0:-1.0;\n#if defined(X3D_NORMAL_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_NormalTexture.textureTransformMapping,x3d_NormalTexture.textureCoordinateMapping);vec3 scale=vec3(vec2(normalScale),1.0);mat3 tbn=getTBNMatrix(texCoord.st);\n#if defined(X3D_NORMAL_TEXTURE_2D)\nvec3 n=texture(x3d_NormalTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_NORMAL_TEXTURE_3D)\nvec3 n=texture(x3d_NormalTexture.texture3D,texCoord).rgb;\n#elif defined(X3D_NORMAL_TEXTURE_CUBE)\nvec3 n=texture(x3d_NormalTexture.textureCube,texCoord).rgb;\n#endif\nreturn normalize(tbn*((n*2.0-1.0)*scale))*facing;\n#else\nreturn normalize(normal)*facing;\n#endif\n}\n";i.add("Normal2.glsl","assets/shaders/webgl2/include/Normal2.glsl",iy);const ny=iy,sy="#if defined(X3D_PARTICLE_SYSTEM)\n#if defined(X3D_TEX_COORD_RAMP)\nuniform sampler2D x3d_TexCoordRamp;in vec4 x3d_Particle;vec4 getParticleTexCoord(const in vec4 texCoord){const int map[6]=int[6](0,1,2,0,2,3);int index0=int(x3d_Particle[3]);return texelFetch(x3d_TexCoordRamp,index0+map[gl_VertexID % 6],0);}\n#else\n#define getParticleTexCoord(texCoord)(texCoord)\n#endif\nin mat4 x3d_ParticleMatrix;vec4 getParticleVertex(const in vec4 vertex){return x3d_ParticleMatrix*vertex;}\n#else\n#define getParticleVertex(vertex)(vertex)\n#define getParticleTexCoord(texCoord)(texCoord)\n#endif\n";i.add("Particle2.glsl","assets/shaders/webgl2/include/Particle2.glsl",sy);const ry=sy,oy="float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}float rand(vec2 co,float l){return rand(vec2(rand(co),l));}float rand(vec2 co,float l,float t){return rand(vec2(rand(co,l),t));}float perlin(vec2 p,float dim,float time){const float M_PI=3.14159265358979323846;vec2 pos=floor(p*dim);vec2 posx=pos+vec2(1.0,0.0);vec2 posy=pos+vec2(0.0,1.0);vec2 posxy=pos+vec2(1.0);float c=rand(pos,dim,time);float cx=rand(posx,dim,time);float cy=rand(posy,dim,time);float cxy=rand(posxy,dim,time);vec2 d=fract(p*dim);d=-0.5*cos(d*M_PI)+0.5;float ccx=mix(c,cx,d.x);float cycxy=mix(cy,cxy,d.x);float center=mix(ccx,cycxy,d.y);return center*2.0-1.0;}vec3 perlin(vec3 p){return vec3(perlin(p.xy,1.0,0.0),perlin(p.yz,1.0,0.0),perlin(p.zx,1.0,0.0));}\n";i.add("Perlin2.glsl","assets/shaders/webgl2/include/Perlin2.glsl",oy);const ay=oy,ly="#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nvoid setPointTexCoords(){vec4 texCoord=vec4(gl_PointCoord.x,1.0-gl_PointCoord.y,0.0,1.0);\n#if X3D_NUM_TEXTURE_COORDINATES>0\ntexCoords[0]=texCoord;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\ntexCoords[1]=texCoord;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\ntexCoords[2]=texCoord;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\ntexCoords[3]=texCoord;\n#endif\n}\n#define getPointColor(color)(color)\n#else\n#define setPointTexCoords()\nin float pointSize;vec4 getPointColor(in vec4 color){if(pointSize>1.0)color.a*=clamp(pointSize*(0.5-distance(vec2(0.5),gl_PointCoord)),0.0,1.0);else color.a*=pointSize;return color;}\n#endif\n#endif\n";i.add("Point2.glsl","assets/shaders/webgl2/include/Point2.glsl",ly);const uy=ly,hy="#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nuniform x3d_PointPropertiesParameters x3d_PointProperties;out float pointSize;float getPointSize(const in vec3 vertex){float pointSizeMinValue=x3d_PointProperties.pointSizeMinValue;float pointSizeMaxValue=x3d_PointProperties.pointSizeMaxValue;vec3 attenuation=x3d_PointProperties.attenuation;float dL=length(vertex);float pointSize=0.0;pointSize=x3d_PointProperties.pointSizeScaleFactor;pointSize/=dot(attenuation,vec3(1.0,dL,dL*dL));pointSize=clamp(pointSize,pointSizeMinValue,pointSizeMaxValue);\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURE)\nreturn pointSize;\n#else\nreturn pointSize+1.0-step(pointSize,1.0);\n#endif\n}\n#endif\n";i.add("PointSize2.glsl","assets/shaders/webgl2/include/PointSize2.glsl",hy);const dy=hy,cy="#if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)\nuniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){switch(index){\n#if X3D_NUM_LIGHTS>0\ncase 0:{return texture(x3d_ShadowMap[0],shadowCoord).r;}\n#endif\n#if X3D_NUM_LIGHTS>1\ncase 1:{return texture(x3d_ShadowMap[1],shadowCoord).r;}\n#endif\n#if X3D_NUM_LIGHTS>2\ncase 2:{return texture(x3d_ShadowMap[2],shadowCoord).r;}\n#endif\n#if X3D_NUM_LIGHTS>3\ncase 3:{return texture(x3d_ShadowMap[3],shadowCoord).r;}\n#endif\n#if X3D_NUM_LIGHTS>4\ncase 4:{return texture(x3d_ShadowMap[4],shadowCoord).r;}\n#endif\n#if X3D_NUM_LIGHTS>5\ncase 5:{return texture(x3d_ShadowMap[5],shadowCoord).r;}\n#endif\n#if X3D_NUM_LIGHTS>6\ncase 6:{return texture(x3d_ShadowMap[6],shadowCoord).r;}\n#endif\n#if X3D_NUM_LIGHTS>7\ncase 7:{return texture(x3d_ShadowMap[7],shadowCoord).r;}\n#endif\ndefault:{return 0.0;}}}float texture2DCompare(const in int index,const in vec2 texCoord,const in float compare){float shadowDepth=getShadowDepth(index,texCoord);return(1.0-step(1.0,shadowDepth))*step(shadowDepth,compare);}float texture2DShadowLerp(const in int index,const in vec2 texelSize,const in float shadowMapSize,const in vec2 texCoord,const in float compare){const vec2 offset=vec2(0.0,1.0);vec2 centroidTexCoord=floor(texCoord*shadowMapSize+0.5)/shadowMapSize;float lb=texture2DCompare(index,centroidTexCoord+texelSize*offset.xx,compare);float lt=texture2DCompare(index,centroidTexCoord+texelSize*offset.xy,compare);float rb=texture2DCompare(index,centroidTexCoord+texelSize*offset.yx,compare);float rt=texture2DCompare(index,centroidTexCoord+texelSize*offset.yy,compare);vec2 f=fract(texCoord*shadowMapSize+0.5);float a=mix(lb,lt,f.y);float b=mix(rb,rt,f.y);float c=mix(a,b,f.x);return c;}vec2 cubeToUVCompact(in vec3 v,const float texelSizeY){vec3 absV=abs(v);float scaleToCube=1.0/max(absV.x,max(absV.y,absV.z));absV*=scaleToCube;v*=scaleToCube*(1.0-2.0*texelSizeY);vec2 planar=v.xy;float almostATexel=1.5*texelSizeY;float almostOne=1.0-almostATexel;if(absV.z>=almostOne){if(v.z>0.0)planar.x=4.0-v.x;}else if(absV.x>=almostOne){float signX=sign(v.x);planar.x=v.z*signX+2.0*signX;}else if(absV.y>=almostOne){float signY=sign(v.y);planar.x=(v.x+0.5+signY)*2.0;planar.y=v.z*signY-2.0;}return vec2(0.125,0.25)*planar+vec2(0.375,0.75);}mat4 getPointLightRotations(const in vec3 vector){mat4 rotations[6];rotations[0]=mat4(0,0,1,0,0,1,0,0,-1,0,0,0,0,0,0,1);rotations[1]=mat4(0,0,-1,0,0,1,0,0,1,0,0,0,0,0,0,1);rotations[2]=mat4(-1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1);rotations[3]=mat4(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);rotations[4]=mat4(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);rotations[5]=mat4(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);vec3 a=abs(vector.xyz);if(a.x>a.y){if(a.x>a.z)return vector.x>0.0?rotations[1]:rotations[0];else return vector.z>0.0?rotations[2]:rotations[3];}else{if(a.y>a.z)return vector.y>0.0?rotations[5]:rotations[4];else return vector.z>0.0?rotations[2]:rotations[3];}return rotations[3];}float getShadowIntensity(const in int index,const in x3d_LightSourceParameters light){if(light.type==x3d_PointLight){const mat4 biasMatrix=mat4(0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.5,0.5,1.0);const mat4 projectionMatrix=mat4(1.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,-1.000025000312504,-1.0,0,0.0,-0.25000312503906297,0.0);vec2 texelSize=vec2(1.0)/(float(light.shadowMapSize)*vec2(4.0,2.0));vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);vec3 lightToPosition=shadowCoord.xyz;shadowCoord=biasMatrix*(projectionMatrix*(getPointLightRotations(lightToPosition)*shadowCoord));shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;\n#if defined(X3D_PCF_FILTERING)||defined(X3D_PCF_SOFT_FILTERING)\nvec2 offset=vec2(-1,1)*(texelSize.y*42.0);float value=(texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxx,texelSize.y),shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;\n#else \nfloat value=texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z);return light.shadowIntensity*value;\n#endif\n}else{\n#if defined(X3D_PCF_FILTERING)\nvec2 texelSize=vec2(1.0)/vec2(light.shadowMapSize);vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;vec2 d0=-texelSize;vec2 d1=texelSize;float value=(texture2DCompare(index,shadowCoord.xy+d0,shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(0.0,d0.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d1.x,d0.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d0.x,0.0),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy,shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d1.x,0.0),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d0.x,d1.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(0.0,d1.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+d1,shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;\n#elif defined(X3D_PCF_SOFT_FILTERING)\nvec2 texelSize=vec2(1.0)/vec2(light.shadowMapSize);vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;vec2 d0=-texelSize;vec2 d1=texelSize;float value=(texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+d0,shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(0.0,d0.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d1.x,d0.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d0.x,0.0),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy,shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d1.x,0.0),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d0.x,d1.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(0.0,d1.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+d1,shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;\n#else \nvec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;float value=texture2DCompare(index,shadowCoord.xy,shadowCoord.z);return light.shadowIntensity*value;\n#endif\n}return 0.0;}\n#endif\n";i.add("Shadow2.glsl","assets/shaders/webgl2/include/Shadow2.glsl",cy);const py=cy,gy="#if defined(X3D_SKINNING)\nin float x3d_CoordIndex;uniform sampler2D x3d_JointsTexture;uniform sampler2D x3d_DisplacementsTexture;uniform sampler2D x3d_JointMatricesTexture;mat4 getJointMatrix(const in int joint){vec4 a=texelFetch(x3d_JointMatricesTexture,joint*8,0);vec4 b=texelFetch(x3d_JointMatricesTexture,joint*8+1,0);vec4 c=texelFetch(x3d_JointMatricesTexture,joint*8+2,0);vec4 d=texelFetch(x3d_JointMatricesTexture,joint*8+3,0);return mat4(a,b,c,d);}mat3 getDisplacementJointMatrix(const in int joint){mat4 m=getJointMatrix(joint);return mat3(m[0].xyz,m[1].xyz,m[2].xyz);}\n#if defined(X3D_NORMALS)\nvec3 skinNormal=vec3(0.0);mat3 getJointNormalMatrix(const in int joint){vec4 a=texelFetch(x3d_JointMatricesTexture,joint*8+4,0);vec4 b=texelFetch(x3d_JointMatricesTexture,joint*8+5,0);vec4 c=texelFetch(x3d_JointMatricesTexture,joint*8+6,0);return mat3(a.xyz,vec3(a.w,b.xy),vec3(b.zw,c.x));}\n#endif\nvec4 getSkinVertex(const in vec4 vertex,const in vec3 normal){int coordIndex2=int(x3d_CoordIndex)*2;ivec4 joints=ivec4(texelFetch(x3d_JointsTexture,coordIndex2,0));vec4 weights=texelFetch(x3d_JointsTexture,coordIndex2+1,0);int width=textureSize(x3d_DisplacementsTexture,0).x;int offset=(width*width)/2;vec4 skin=vertex;for(int i=0;i<2;++i){vec4 displacement=texelFetch(x3d_DisplacementsTexture,coordIndex2+i,0);float weight=texelFetch(x3d_DisplacementsTexture,coordIndex2+offset,0)[i];skin.xyz+=(getDisplacementJointMatrix(int(displacement.w))*displacement.xyz)*weight;}for(int i=0;i<4;++i)skin+=(getJointMatrix(joints[i])*vertex-vertex)*weights[i];\n#if defined(X3D_NORMALS)\n{skinNormal=normal;for(int i=0;i<4;++i)skinNormal+=(getJointNormalMatrix(joints[i])*normal-normal)*weights[i];}\n#endif\nreturn skin;}\n#if defined(X3D_NORMALS)\nvec3 getSkinNormal(const in vec3 normal){return skinNormal;}\n#endif\n#else\n#define getSkinVertex(vertex,normal)(vertex)\n#define getSkinNormal(normal)(normal)\n#endif\n";i.add("Skin2.glsl","assets/shaders/webgl2/include/Skin2.glsl",gy);const fy=gy,my="float getSpotFactor(const in float cutOffAngle,const in float beamWidth,const in vec3 L,const in vec3 d){float spotAngle=acos(clamp(dot(-L,d),-1.0,1.0));if(spotAngle>=cutOffAngle)return 0.0;else if(spotAngle<=beamWidth)return 1.0;return(spotAngle-cutOffAngle)/(beamWidth-cutOffAngle);}\n";i.add("SpotFactor2.glsl","assets/shaders/webgl2/include/SpotFactor2.glsl",my);const _y=my,xy='#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\n#pragma X3D include "Line2.glsl"\nuniform x3d_LinePropertiesParameters x3d_LineProperties;flat in float lengthSoFar;flat in vec2 startPoint;in vec2 midPoint;void stipple(){vec2 point=closest_point(line2(startPoint,midPoint),gl_FragCoord.xy);float s=(lengthSoFar+length(point-startPoint))*x3d_LineProperties.lineStippleScale;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\ntexCoord0=vec4(s,0.0,0.0,1.0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\ntexCoord1=vec4(s,0.0,0.0,1.0);\n#endif\n#endif\n#if defined(X3D_STYLE_PROPERTIES_TEXTURE)\nif(x3d_LineProperties.linetype==16)return;int linetype=x3d_LineProperties.linetype;int height=textureSize(x3d_LineProperties.texture,0).y;float t=1.0-float(linetype*2+1)/float(height*2);float alpha=texture(x3d_LineProperties.texture,vec2(s,t)).a;if(alpha!=1.0)discard;\n#endif\n}\n#endif\n';i.add("Stipple2.glsl","assets/shaders/webgl2/include/Stipple2.glsl",xy);const yy=xy,wy='#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#pragma X3D include "Perlin.glsl"\nvec4 texCoords[X3D_NUM_TEXTURE_COORDINATES];void setTexCoords(){\n#if X3D_NUM_TEXTURE_COORDINATES>0\ntexCoords[0]=texCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\ntexCoords[1]=texCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\ntexCoords[2]=texCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\ntexCoords[3]=texCoord3;\n#endif\n}uniform mat4 x3d_TextureMatrix[X3D_NUM_TEXTURE_TRANSFORMS];vec4 getTexCoord(const in x3d_TextureCoordinateGeneratorParameters textureCoordinateGenerator,const in int textureTransformMapping,const in int textureCoordinateMapping){int mode=textureCoordinateGenerator.mode;switch(mode){case x3d_None:{return x3d_TextureMatrix[textureTransformMapping]*texCoords[textureCoordinateMapping];}case x3d_Sphere:{vec2 N=normalize(gl_FrontFacing?normal:-normal).xy;return vec4(N*0.5+0.5,0.0,1.0);}case x3d_CameraSpaceNormal:{vec3 N=normalize(gl_FrontFacing?normal:-normal);return vec4(N,1.0);}case x3d_CameraSpacePosition:{return vec4(vertex,1.0);}case x3d_CameraSpaceReflectionVector:{vec3 N=normalize(gl_FrontFacing?normal:-normal);return vec4(reflect(normalize(vertex),-N),1.0);}case x3d_SphereLocal:{vec2 N=normalize(gl_FrontFacing?localNormal:-localNormal).xy;return vec4(N*0.5+0.5,0.0,1.0);}case x3d_Coord:{return vec4(localVertex,1.0);}case x3d_CoordEye:{return vec4(vertex,1.0);}case x3d_Noise:{vec3 scale=vec3(textureCoordinateGenerator.parameter[0],textureCoordinateGenerator.parameter[1],textureCoordinateGenerator.parameter[2]);vec3 translation=vec3(textureCoordinateGenerator.parameter[3],textureCoordinateGenerator.parameter[4],textureCoordinateGenerator.parameter[5]);return vec4(perlin(localVertex*scale+translation),1.0);}case x3d_NoiseEye:{vec3 scale=vec3(textureCoordinateGenerator.parameter[0],textureCoordinateGenerator.parameter[1],textureCoordinateGenerator.parameter[2]);vec3 translation=vec3(textureCoordinateGenerator.parameter[3],textureCoordinateGenerator.parameter[4],textureCoordinateGenerator.parameter[5]);return vec4(perlin(vertex*scale+translation),1.0);}case x3d_SphereReflect:{vec3 N=normalize(gl_FrontFacing?normal:-normal);float eta=textureCoordinateGenerator.parameter[0];return vec4(refract(normalize(vertex),-N,eta),1.0);}case x3d_SphereReflectLocal:{vec3 N=normalize(gl_FrontFacing?localNormal:-localNormal);float eta=textureCoordinateGenerator.parameter[0];vec3 eye=vec3(textureCoordinateGenerator.parameter[1],textureCoordinateGenerator.parameter[2],textureCoordinateGenerator.parameter[3]);return vec4(refract(normalize(localVertex-eye),-N,eta),1.0);}default:{return x3d_TextureMatrix[textureTransformMapping]*texCoords[textureCoordinateMapping];}}}uniform x3d_TextureCoordinateGeneratorParameters x3d_TextureCoordinateGenerator[X3D_NUM_TEXTURE_COORDINATES];vec3 getTexCoord(const in int textureTransformMapping,const in int textureCoordinateMapping){vec4 texCoord=getTexCoord(x3d_TextureCoordinateGenerator[textureCoordinateMapping],textureTransformMapping,textureCoordinateMapping);texCoord.stp/=texCoord.q;\n#if defined(X3D_GEOMETRY_2D)\nif(gl_FrontFacing==false)texCoord.s=1.0-texCoord.s;\n#endif\nreturn texCoord.stp;}\n#endif \n#if defined(X3D_TEXTURE)\nuniform int x3d_TextureType[X3D_NUM_TEXTURES];uniform sampler2D x3d_Texture2D[X3D_NUM_TEXTURES];uniform sampler3D x3d_Texture3D[X3D_NUM_TEXTURES];uniform samplerCube x3d_TextureCube[X3D_NUM_TEXTURES];\n#if defined(X3D_MULTI_TEXTURING)\nvec4 getTexture(const in int i,const in vec3 texCoord){switch(i){\n#if X3D_NUM_TEXTURES>0\ncase 0:\n#if defined(X3D_TEXTURE0_2D)\nreturn texture(x3d_Texture2D[0],texCoord.st);\n#elif defined(X3D_TEXTURE0_3D)\nreturn texture(x3d_Texture3D[0],texCoord.stp);\n#elif defined(X3D_TEXTURE0_CUBE)\nreturn texture(x3d_TextureCube[0],texCoord.stp);\n#endif\n#endif\n#if X3D_NUM_TEXTURES>1\ncase 1:\n#if defined(X3D_TEXTURE0_2D)\nreturn texture(x3d_Texture2D[1],texCoord.st);\n#elif defined(X3D_TEXTURE0_3D)\nreturn texture(x3d_Texture3D[1],texCoord.stp);\n#elif defined(X3D_TEXTURE0_CUBE)\nreturn texture(x3d_TextureCube[1],texCoord.stp);\n#endif\n#endif\n}return vec4(0.0);}\n#endif\n#if defined(X3D_MULTI_TEXTURING)\nuniform vec4 x3d_MultiTextureColor;uniform x3d_MultiTextureParameters x3d_MultiTexture[X3D_NUM_TEXTURES];\n#endif\nvec4 getTextureColor(const in vec4 diffuseColor,const in vec4 specularColor){\n#if defined(X3D_MULTI_TEXTURING)\nvec4 currentColor=diffuseColor;for(int i=0;i<X3D_NUM_TEXTURES;++i){vec3 texCoord=getTexCoord(min(i,X3D_NUM_TEXTURE_TRANSFORMS-1),min(i,X3D_NUM_TEXTURE_COORDINATES-1));vec4 textureColor=getTexture(i,texCoord);x3d_MultiTextureParameters multiTexture=x3d_MultiTexture[i];vec4 arg1=textureColor;vec4 arg2=currentColor;int source=multiTexture.source;switch(source){case x3d_Diffuse:{arg1=diffuseColor;break;}case x3d_Specular:{arg1=specularColor;break;}case x3d_Factor:{arg1=x3d_MultiTextureColor;break;}}int function=multiTexture.function;switch(function){case x3d_Complement:{arg1=1.0-arg1;break;}case x3d_AlphaReplicate:{arg1.a=arg2.a;break;}}int mode=multiTexture.mode;int alphaMode=multiTexture.alphaMode;switch(mode){case x3d_Replace:{currentColor.rgb=arg1.rgb;break;}case x3d_Modulate:{currentColor.rgb=arg1.rgb*arg2.rgb;break;}case x3d_Modulate2X:{currentColor.rgb=(arg1.rgb*arg2.rgb)*2.0;break;}case x3d_Modulate4X:{currentColor.rgb=(arg1.rgb*arg2.rgb)*4.0;break;}case x3d_Add:{currentColor.rgb=arg1.rgb+arg2.rgb;break;}case x3d_AddSigned:{currentColor.rgb=arg1.rgb+arg2.rgb-0.5;break;}case x3d_AddSigned2X:{currentColor.rgb=(arg1.rgb+arg2.rgb-0.5)*2.0;break;}case x3d_AddSmooth:{currentColor.rgb=arg1.rgb+(1.0-arg1.rgb)*arg2.rgb;break;}case x3d_Subtract:{currentColor.rgb=arg1.rgb-arg2.rgb;break;}case x3d_BlendDiffuseAlpha:{currentColor.rgb=arg1.rgb*diffuseColor.a+arg2.rgb*(1.0-diffuseColor.a);break;}case x3d_BlendTextureAlpha:{currentColor.rgb=arg1.rgb*arg1.a+arg2.rgb*(1.0-arg1.a);break;}case x3d_BlendFactorAlpha:{currentColor.rgb=arg1.rgb*x3d_MultiTextureColor.a+arg2.rgb*(1.0-x3d_MultiTextureColor.a);break;}case x3d_BlendCurrentAlpha:{currentColor.rgb=arg1.rgb*arg2.a+arg2.rgb*(1.0-arg2.a);break;}case x3d_ModulateAlphaAddColor:{currentColor.rgb=arg1.rgb+arg1.a*arg2.rgb;break;}case x3d_ModulateInvAlphaAddColor:{currentColor.rgb=(1.0-arg1.a)*arg2.rgb+arg1.rgb;break;}case x3d_ModulateInvColorAddAlpha:{currentColor.rgb=(1.0-arg1.rgb)*arg2.rgb+arg1.a;break;}case x3d_DotProduct3:{currentColor.rgb=vec3(dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0));break;}case x3d_SelectArg1:{currentColor.rgb=arg1.rgb;break;}case x3d_SelectArg2:{currentColor.rgb=arg2.rgb;break;}case x3d_Off:{break;}}switch(alphaMode){case x3d_Replace:{currentColor.a=arg1.a;break;}case x3d_Modulate:{currentColor.a=arg1.a*arg2.a;break;}case x3d_Modulate2X:{currentColor.a=(arg1.a*arg2.a)*2.0;break;}case x3d_Modulate4X:{currentColor.a=(arg1.a*arg2.a)*4.0;break;}case x3d_Add:{currentColor.a=arg1.a+arg2.a;break;}case x3d_AddSigned:{currentColor.a=arg1.a+arg2.a-0.5;break;}case x3d_AddSigned2X:{currentColor.a=(arg1.a+arg2.a-0.5)*2.0;break;}case x3d_AddSmooth:{currentColor.a=arg1.a+(1.0-arg1.a)*arg2.a;break;}case x3d_Subtract:{currentColor.a=arg1.a-arg2.a;break;}case x3d_BlendDiffuseAlpha:{currentColor.a=arg1.a*diffuseColor.a+arg2.a*(1.0-diffuseColor.a);break;}case x3d_BlendTextureAlpha:{currentColor.a=arg1.a*arg1.a+arg2.a*(1.0-arg1.a);break;}case x3d_BlendFactorAlpha:{currentColor.a=arg1.a*x3d_MultiTextureColor.a+arg2.a*(1.0-x3d_MultiTextureColor.a);break;}case x3d_BlendCurrentAlpha:{currentColor.a=arg1.a*arg2.a+arg2.a*(1.0-arg2.a);break;}case x3d_ModulateAlphaAddColor:{currentColor.a=arg1.a+arg1.a*arg2.a;break;}case x3d_ModulateInvAlphaAddColor:{currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;break;}case x3d_ModulateInvColorAddAlpha:{currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;break;}case x3d_DotProduct3:{currentColor.a=dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0);break;}case x3d_SelectArg1:{currentColor.a=arg1.a;break;}case x3d_SelectArg2:{currentColor.a=arg2.a;break;}case x3d_Off:{break;}}}return currentColor;\n#else\nvec3 texCoord=getTexCoord(0,0);\n#if defined(X3D_TEXTURE0_2D)\nvec4 textureColor=texture(x3d_Texture2D[0],texCoord.st);\n#elif defined(X3D_TEXTURE0_3D)\nvec4 textureColor=texture(x3d_Texture3D[0],texCoord.stp);\n#elif defined(X3D_TEXTURE0_CUBE)\nvec4 textureColor=texture(x3d_TextureCube[0],texCoord.stp);\n#endif\nreturn diffuseColor*textureColor;\n#endif\n}\n#endif \n#if defined(X3D_PROJECTIVE_TEXTURE_MAPPING)\nuniform sampler2D x3d_ProjectiveTexture[X3D_NUM_TEXTURE_PROJECTORS];uniform mat4 x3d_ProjectiveTextureMatrix[X3D_NUM_TEXTURE_PROJECTORS];uniform vec3 x3d_ProjectiveTextureLocation[X3D_NUM_TEXTURE_PROJECTORS];vec4 getProjectiveTexture(const in int i,const in vec2 texCoord){switch(i){\n#if X3D_NUM_TEXTURE_PROJECTORS>0\ncase 0:return texture(x3d_ProjectiveTexture[0],texCoord);\n#endif\n#if X3D_NUM_TEXTURE_PROJECTORS>1\ncase 1:return texture(x3d_ProjectiveTexture[1],texCoord);\n#endif\n}return vec4(0.0);}vec4 getProjectiveTextureColor(in vec4 currentColor){vec3 N=gl_FrontFacing?normal:-normal;for(int i=0;i<X3D_NUM_TEXTURE_PROJECTORS;++i){vec4 texCoord=x3d_ProjectiveTextureMatrix[i]*vec4(vertex,1.0);texCoord.stp/=texCoord.q;if(texCoord.s<0.0||texCoord.s>1.0)continue;if(texCoord.t<0.0||texCoord.t>1.0)continue;if(texCoord.p<0.0||texCoord.p>1.0)continue;vec3 p=x3d_ProjectiveTextureLocation[i]-vertex;if(dot(N,p)<0.0)continue;currentColor*=getProjectiveTexture(i,texCoord.st);}return currentColor;}\n#endif \n';i.add("Texture2.glsl","assets/shaders/webgl2/include/Texture2.glsl",wy);const by=wy,Sy="#if defined(X3D_SKINNING)||defined(X3D_PARTICLE_SYSTEM)\nvec4 texelFetch(const in sampler2D _sampler,const in int index,const in int lod){int x=textureSize(_sampler,lod).x;ivec2 p=ivec2(index % x,index/x);vec4 t=texelFetch(_sampler,p,lod);return t;}\n#endif\n";i.add("Utils2.glsl","assets/shaders/webgl2/include/Utils2.glsl",Sy);const Ty=Sy,vy='uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nin vec3 x3d_LineStipple;\n#endif\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nin float x3d_FogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\nin vec4 x3d_Color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nin vec4 x3d_TexCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nin vec4 x3d_TexCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nin vec4 x3d_TexCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nin vec4 x3d_TexCoord3;\n#endif\n#endif\n#endif\nin vec4 x3d_Vertex;\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nout float fogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\nout vec4 color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\nout vec4 texCoord0;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\nout vec4 texCoord1;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\nout vec4 texCoord2;\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\nout vec4 texCoord3;\n#endif\n#endif\n#endif\n#if defined(X3D_NORMALS)\nuniform mat3 x3d_NormalMatrix;in vec3 x3d_Normal;out vec3 normal;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nout vec3 localNormal;\n#endif\n#endif\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nflat out float lengthSoFar;flat out vec2 startPoint;out vec2 midPoint;\n#endif\nout vec3 vertex;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nout vec3 localVertex;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nout float depth;\n#endif\n#pragma X3D include "Utils.glsl"\n#pragma X3D include "Skin.glsl"\n#pragma X3D include "Particle.glsl"\n#pragma X3D include "PointSize.glsl"\nvoid vertex_main(){\n#if defined(X3D_NORMALS)\nvec4 x3d_TransformedVertex=getParticleVertex(getSkinVertex(x3d_Vertex,x3d_Normal));vec3 x3d_TransformedNormal=getSkinNormal(x3d_Normal);\n#else\nvec4 x3d_TransformedVertex=getParticleVertex(getSkinVertex(x3d_Vertex,vec3(0.0)));\n#endif\nvec4 position=x3d_ModelViewMatrix*x3d_TransformedVertex;vertex=position.xyz;\n#if defined(X3D_GEOMETRY_0D)\n#if defined(X3D_STYLE_PROPERTIES)\ngl_PointSize=pointSize=getPointSize(vertex);\n#else\ngl_PointSize=1.0;\n#endif\n#endif\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nlengthSoFar=x3d_LineStipple.z;startPoint=x3d_LineStipple.xy;midPoint=x3d_LineStipple.xy;\n#endif\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nfogDepth=x3d_FogDepth;\n#endif\n#if defined(X3D_COLOR_MATERIAL)\ncolor=x3d_Color;\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\n#if X3D_NUM_TEXTURE_COORDINATES>0\ntexCoord0=getParticleTexCoord(x3d_TexCoord0);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>1\ntexCoord1=getParticleTexCoord(x3d_TexCoord1);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>2\ntexCoord2=getParticleTexCoord(x3d_TexCoord2);\n#endif\n#if X3D_NUM_TEXTURE_COORDINATES>3\ntexCoord3=getParticleTexCoord(x3d_TexCoord3);\n#endif\n#endif\n#endif\n#if defined(X3D_NORMALS)\nnormal=x3d_NormalMatrix*x3d_TransformedNormal;\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nlocalNormal=x3d_TransformedNormal;\n#endif\n#endif\n#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)\nlocalVertex=x3d_TransformedVertex.xyz;\n#endif\ngl_Position=x3d_ProjectionMatrix*position;\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\ndepth=1.0+gl_Position.w;\n#endif\n}\n';i.add("Vertex2.glsl","assets/shaders/webgl2/include/Vertex2.glsl",vy);const Oy=vy,Ey='precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;\n#pragma X3D include "include/Vertex.glsl"\nvoid main(){vertex_main();}\n';i.add("Default1.vs","assets/shaders/webgl1/Default1.vs",Ey);const Ny=Ey,Cy='precision highp float;precision highp int;precision highp sampler2D;varying vec3 vertex;\n#pragma X3D include "include/ClipPlanes.glsl"\n#pragma X3D include "include/Point.glsl"\nvoid main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nif(getPointColor(vec4(1.0)).a<0.5)discard;\n#endif\ngl_FragColor=vec4(gl_FragCoord.z);}\n';i.add("Depth1.fs","assets/shaders/webgl1/Depth1.fs",Cy);const Fy=Cy,Iy='precision highp float;precision highp int;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;attribute vec4 x3d_Vertex;varying vec3 vertex;\n#pragma X3D include "include/PointSize.glsl"\nvoid main(){vec4 position=x3d_ModelViewMatrix*x3d_Vertex;vertex=position.xyz;\n#if defined(X3D_GEOMETRY_0D)\n#if defined(X3D_STYLE_PROPERTIES)\ngl_PointSize=max(pointSize=getPointSize(vertex),2.0);\n#else\ngl_PointSize=2.0;\n#endif\n#endif\ngl_Position=x3d_ProjectionMatrix*position;}\n';i.add("Depth1.vs","assets/shaders/webgl1/Depth1.vs",Iy);const My=Iy,Dy='precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\nvarying vec4 frontColor;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nvarying vec4 backColor;\n#endif\nvec4 getMaterialColor(){\n#if defined(X3D_GEOMETRY_0D)||defined(X3D_GEOMETRY_1D)\nvec4 finalColor=frontColor;\n#else\nvec4 finalColor=gl_FrontFacing?frontColor:backColor;\n#endif\n#if defined(X3D_TEXTURE)\nfinalColor=getTextureColor(finalColor,vec4(1.0));\n#endif\n#if defined(X3D_PROJECTIVE_TEXTURE_MAPPING)\nfinalColor=getProjectiveTextureColor(finalColor);\n#endif\nreturn finalColor;}void main(){fragment_main();}\n';i.add("Gouraud1.fs","assets/shaders/webgl1/Gouraud1.fs",Dy);const Py=Dy,Ry='precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;\n#pragma X3D include "include/Vertex.glsl"\n#pragma X3D include "include/Material.glsl"\nvarying vec4 frontColor;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nvarying vec4 backColor;\n#endif\nvec4 getMaterialColor(const in vec3 N,const in vec3 vertex,const in x3d_MaterialParameters material){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 diffuseParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 diffuseParameter=vec4(x3d_Material.diffuseColor,alpha);\n#endif\nvec3 ambientColor=diffuseParameter.rgb*material.ambientIntensity;\n#if defined(X3D_LIGHTING)\nvec3 finalColor=getMaterialColor(vertex,N,ambientColor,diffuseParameter.rgb,material.specularColor,material.shininess);\n#else\nvec3 finalColor=vec3(0.0);\n#endif\nfinalColor+=material.emissiveColor;return vec4(finalColor,diffuseParameter.a);}void main(){vertex_main();normal=normalize(normal);frontColor=getMaterialColor(normal,vertex,x3d_Material);\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nbackColor=getMaterialColor(-normal,vertex,x3d_Material);\n#endif\n}\n';i.add("Gouraud1.vs","assets/shaders/webgl1/Gouraud1.vs",Ry);const Ay=Ry,Vy='#extension GL_EXT_shader_texture_lod:enable\nprecision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\n#pragma X3D include "include/Colors.glsl"\n#pragma X3D include "include/Normal.glsl"\n#pragma X3D include "include/SpotFactor.glsl"\n#pragma X3D include "include/Shadow.glsl"\n#if defined(X3D_LIGHTING)\nuniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];\n#endif\nuniform x3d_PhysicalMaterialParameters x3d_Material;\n#if defined(USE_IBL)\nuniform samplerCube diffuseEnvironmentTexture;uniform samplerCube specularEnvironmentTexture;uniform sampler2D brdfLUT;\n#endif\n#if defined(X3D_BASE_TEXTURE)\nuniform x3d_BaseTextureParameters x3d_BaseTexture;\n#endif\nvec4 getBaseColor(){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 baseParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 baseParameter=vec4(x3d_Material.baseColor,alpha);\n#endif\n#if defined(X3D_BASE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_BaseTexture.textureTransformMapping,x3d_BaseTexture.textureCoordinateMapping);\n#if defined(X3D_BASE_TEXTURE_2D)\nreturn baseParameter*SRGBtoLINEAR(texture2D(x3d_BaseTexture.texture2D,texCoord.st));\n#elif defined(X3D_BASE_TEXTURE_CUBE)\nreturn baseParameter*SRGBtoLINEAR(textureCube(x3d_BaseTexture.textureCube,texCoord));\n#endif\n#elif defined(X3D_TEXTURE)\nreturn getTextureColor(baseParameter,vec4(vec3(1.0),alpha));\n#else\nreturn baseParameter;\n#endif\n}\n#if defined(X3D_EMISSIVE_TEXTURE)\nuniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;\n#endif\nvec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;\n#if defined(X3D_EMISSIVE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);\n#if defined(X3D_EMISSIVE_TEXTURE_2D)\nreturn emissiveParameter*SRGBtoLINEAR(texture2D(x3d_EmissiveTexture.texture2D,texCoord.st)).rgb;\n#elif defined(X3D_EMISSIVE_TEXTURE_CUBE)\nreturn emissiveParameter*SRGBtoLINEAR(textureCube(x3d_EmissiveTexture.textureCube,texCoord)).rgb;\n#endif\n#else\nreturn emissiveParameter.rgb;\n#endif\n}\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)\nuniform x3d_MetallicRoughnessTextureParameters x3d_MetallicRoughnessTexture;\n#endif\nvec2 getMetallicRoughness(){float metallic=x3d_Material.metallic;float perceptualRoughness=x3d_Material.roughness;\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_MetallicRoughnessTexture.textureTransformMapping,x3d_MetallicRoughnessTexture.textureCoordinateMapping);\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_2D)\nvec4 mrSample=texture2D(x3d_MetallicRoughnessTexture.texture2D,texCoord.st);\n#elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_CUBE)\nvec4 mrSample=textureCube(x3d_MetallicRoughnessTexture.textureCube,texCoord);\n#endif\nmetallic*=mrSample.b;perceptualRoughness*=mrSample.g;return vec2(metallic,perceptualRoughness);\n#else\nreturn vec2(metallic,perceptualRoughness);\n#endif\n}\n#if defined(X3D_OCCLUSION_TEXTURE)\nuniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;\n#endif\nfloat getOcclusionFactor(){\n#if defined(X3D_OCCLUSION_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);\n#if defined(X3D_OCCLUSION_TEXTURE_2D)\nreturn texture2D(x3d_OcclusionTexture.texture2D,texCoord.st).r;\n#elif defined(X3D_OCCLUSION_TEXTURE_CUBE)\nreturn textureCube(x3d_OcclusionTexture.textureCube,texCoord).r;\n#endif\n#else\nreturn 1.0;\n#endif\n}struct PBRInfo{float NdotL;float NdotV;float NdotH;float LdotH;float VdotH;float perceptualRoughness;float metalness;vec3 reflectance0;vec3 reflectance90;float alphaRoughness;vec3 diffuseColor;vec3 specularColor;};const float M_PI=3.141592653589793;const float c_MinRoughness=0.04;\n#if defined(USE_IBL)\nvec3 getIBLContribution(const in PBRInfo pbrInputs,vec3 n,const in vec3 reflection){float mipCount=9.0;float lod=pbrInputs.perceptualRoughness*mipCount;vec3 brdf=SRGBtoLINEAR(texture2D(brdfLUT,vec2(pbrInputs.NdotV,1.0-pbrInputs.perceptualRoughness))).rgb;vec3 diffuseLight=SRGBtoLINEAR(textureCube(diffuseEnvironmentTexture,n)).rgb;\n#if defined(USE_TEX_LOD)\nvec3 specularLight=SRGBtoLINEAR(textureCubeLodEXT(specularEnvironmentTexture,reflection,lod)).rgb;\n#else\nvec3 specularLight=SRGBtoLINEAR(textureCube(specularEnvironmentTexture,reflection)).rgb;\n#endif\nvec3 diffuse=diffuseLight*pbrInputs.diffuseColor;vec3 specular=specularLight*(pbrInputs.specularColor*brdf.x+brdf.y);return diffuse+specular;}\n#endif\nvec3 diffuse(const in PBRInfo pbrInputs){return pbrInputs.diffuseColor/M_PI;}vec3 specularReflection(const in PBRInfo pbrInputs){return pbrInputs.reflectance0+(pbrInputs.reflectance90-pbrInputs.reflectance0)*pow(clamp(1.0-pbrInputs.VdotH,0.0,1.0),5.0);}float geometricOcclusion(const in PBRInfo pbrInputs){float NdotL=pbrInputs.NdotL;float NdotV=pbrInputs.NdotV;float r=pbrInputs.alphaRoughness;float attenuationL=2.0*NdotL/(NdotL+sqrt(r*r+(1.0-r*r)*(NdotL*NdotL)));float attenuationV=2.0*NdotV/(NdotV+sqrt(r*r+(1.0-r*r)*(NdotV*NdotV)));return attenuationL*attenuationV;}float microfacetDistribution(const in PBRInfo pbrInputs){float roughnessSq=pbrInputs.alphaRoughness*pbrInputs.alphaRoughness;float f=(pbrInputs.NdotH*roughnessSq-pbrInputs.NdotH)*pbrInputs.NdotH+1.0;return roughnessSq/(M_PI*f*f);}vec4 getMaterialColor(){vec2 metallicRoughness=getMetallicRoughness();float perceptualRoughness=clamp(metallicRoughness[1],c_MinRoughness,1.0);float metallic=clamp(metallicRoughness[0],0.0,1.0);float alphaRoughness=perceptualRoughness*perceptualRoughness;vec4 baseColor=getBaseColor();float alpha=baseColor.a;vec3 f0=vec3(0.04);vec3 diffuseColor=baseColor.rgb*(vec3(1.0)-f0);diffuseColor*=1.0-metallic;vec3 specularColor=mix(f0,baseColor.rgb,metallic);float reflectance=max(max(specularColor.r,specularColor.g),specularColor.b);float reflectance90=clamp(reflectance*25.0,0.0,1.0);vec3 specularEnvironmentR0=specularColor.rgb;vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0)*reflectance90;vec3 n=getNormalVector(x3d_Material.normalScale);vec3 v=normalize(-vertex);vec3 finalColor=vec3(0.0);\n#if defined(X3D_LIGHTING)\nfor(int i=0;i<X3D_NUM_LIGHTS;i++){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 l=normalize(L);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.001,1.0);float NdotV=abs(dot(n,v))+0.001;float NdotH=clamp(dot(n,h),0.0,1.0);float LdotH=clamp(dot(l,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);PBRInfo pbrInputs=PBRInfo(NdotL,NdotV,NdotH,LdotH,VdotH,perceptualRoughness,metallic,specularEnvironmentR0,specularEnvironmentR90,alphaRoughness,diffuseColor,specularColor);vec3 F=specularReflection(pbrInputs);float G=geometricOcclusion(pbrInputs);float D=microfacetDistribution(pbrInputs);float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 diffuseContrib=(1.0-F)*diffuse(pbrInputs);vec3 specContrib=F*G*D/(4.0*NdotL*NdotV);vec3 diffuseSpecContrib=light.intensity*(diffuseContrib+specContrib);\n#if defined(X3D_SHADOWS)\nif(NdotL>0.001&&light.shadowIntensity>0.0)diffuseSpecContrib=mix(diffuseSpecContrib,light.shadowColor,getShadowIntensity(i,light));\n#endif\nvec3 color=NdotL*attenuationSpotFactor*light.color*diffuseSpecContrib;finalColor+=color;}}\n#endif\n#if defined(USE_IBL)\nvec3 reflection=-normalize(reflect(v,n));finalColor+=getIBLContribution(pbrInputs,n,reflection);\n#endif\n#if defined(X3D_OCCLUSION_TEXTURE)\nfinalColor=mix(finalColor,finalColor*getOcclusionFactor(),x3d_Material.occlusionStrength);\n#endif\nfinalColor+=getEmissiveColor();return Gamma(vec4(finalColor,alpha));}void main(){fragment_main();}\n';i.add("PBR1.fs","assets/shaders/webgl1/PBR1.fs",Vy);const Ly=Vy,By='precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\n#pragma X3D include "include/Material.glsl"\n#pragma X3D include "include/Normal.glsl"\n#if defined(X3D_AMBIENT_TEXTURE)\nuniform x3d_AmbientTextureParameters x3d_AmbientTexture;\n#endif\nvec3 getAmbientColor(const in vec3 diffuseColor){vec3 ambientParameter=x3d_Material.ambientIntensity*diffuseColor;\n#if defined(X3D_AMBIENT_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_AmbientTexture.textureTransformMapping,x3d_AmbientTexture.textureCoordinateMapping);\n#if defined(X3D_AMBIENT_TEXTURE_2D)\nreturn ambientParameter*texture2D(x3d_AmbientTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_AMBIENT_TEXTURE_CUBE)\nreturn ambientParameter*textureCube(x3d_AmbientTexture.textureCube,texCoord).rgb;\n#endif\n#else\nreturn ambientParameter;\n#endif\n}\n#if defined(X3D_DIFFUSE_TEXTURE)\nuniform x3d_DiffuseTextureParameters x3d_DiffuseTexture;\n#endif\nvec4 getDiffuseColor(){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 diffuseParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 diffuseParameter=vec4(x3d_Material.diffuseColor,alpha);\n#endif\n#if defined(X3D_DIFFUSE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_DiffuseTexture.textureTransformMapping,x3d_DiffuseTexture.textureCoordinateMapping);\n#if defined(X3D_DIFFUSE_TEXTURE_2D)\nreturn diffuseParameter*texture2D(x3d_DiffuseTexture.texture2D,texCoord.st);\n#elif defined(X3D_DIFFUSE_TEXTURE_CUBE)\nreturn diffuseParameter*textureCube(x3d_DiffuseTexture.textureCube,texCoord);\n#endif\n#elif defined(X3D_TEXTURE)\nreturn getTextureColor(diffuseParameter,vec4(x3d_Material.specularColor,alpha));\n#else\nreturn diffuseParameter;\n#endif\n}\n#if defined(X3D_SPECULAR_TEXTURE)\nuniform x3d_SpecularTextureParameters x3d_SpecularTexture;\n#endif\nvec3 getSpecularColor(){vec3 specularParameter=x3d_Material.specularColor;\n#if defined(X3D_SPECULAR_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_SpecularTexture.textureTransformMapping,x3d_SpecularTexture.textureCoordinateMapping);\n#if defined(X3D_SPECULAR_TEXTURE_2D)\nreturn specularParameter*texture2D(x3d_SpecularTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_SPECULAR_TEXTURE_CUBE)\nreturn specularParameter*textureCube(x3d_SpecularTexture.textureCube,texCoord).rgb;\n#endif\n#else\nreturn specularParameter;\n#endif\n}\n#if defined(X3D_EMISSIVE_TEXTURE)\nuniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;\n#endif\nvec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;\n#if defined(X3D_EMISSIVE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);\n#if defined(X3D_EMISSIVE_TEXTURE_2D)\nreturn emissiveParameter*texture2D(x3d_EmissiveTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_EMISSIVE_TEXTURE_CUBE)\nreturn emissiveParameter*textureCube(x3d_EmissiveTexture.textureCube,texCoord).rgb;\n#endif\n#else\nreturn emissiveParameter;\n#endif\n}\n#if defined(X3D_SHININESS_TEXTURE)\nuniform x3d_ShininessTextureParameters x3d_ShininessTexture;\n#endif\nfloat getShininessFactor(){float shininess=x3d_Material.shininess;\n#if defined(X3D_SHININESS_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_ShininessTexture.textureTransformMapping,x3d_ShininessTexture.textureCoordinateMapping);\n#if defined(X3D_SHININESS_TEXTURE_2D)\nreturn shininess*texture2D(x3d_ShininessTexture.texture2D,texCoord.st).a;\n#elif defined(X3D_SHININESS_TEXTURE_CUBE)\nreturn shininess*textureCube(x3d_ShininessTexture.textureCube,texCoord).a;\n#endif\n#else\nreturn shininess;\n#endif\n}\n#if defined(X3D_OCCLUSION_TEXTURE)\nuniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;\n#endif\nfloat getOcclusionFactor(){\n#if defined(X3D_OCCLUSION_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);\n#if defined(X3D_OCCLUSION_TEXTURE_2D)\nreturn texture2D(x3d_OcclusionTexture.texture2D,texCoord.st).r;\n#elif defined(X3D_OCCLUSION_TEXTURE_CUBE)\nreturn textureCube(x3d_OcclusionTexture.textureCube,texCoord).r;\n#endif\n#else\nreturn 1.0;\n#endif\n}vec4 getMaterialColor(){vec4 diffuseColorAlpha=getDiffuseColor();float alpha=diffuseColorAlpha.a;vec3 diffuseColor=diffuseColorAlpha.rgb;vec3 ambientColor=getAmbientColor(diffuseColor);vec3 specularColor=getSpecularColor();float shininess=getShininessFactor();float normalScale=x3d_Material.normalScale;\n#if defined(X3D_PROJECTIVE_TEXTURE_MAPPING)\nvec4 P=getProjectiveTextureColor(vec4(1.0));diffuseColor*=P.rgb;alpha*=P.a;\n#endif\n#if defined(X3D_LIGHTING)\nvec3 finalColor=getMaterialColor(vertex,getNormalVector(normalScale),ambientColor,diffuseColor,specularColor,shininess);\n#else\nvec3 finalColor=vec3(0.0);\n#endif\n#if defined(X3D_OCCLUSION_TEXTURE)\nfinalColor=mix(finalColor,finalColor*getOcclusionFactor(),x3d_Material.occlusionStrength);\n#endif\nfinalColor+=getEmissiveColor();return vec4(finalColor,alpha);}void main(){fragment_main();}\n';i.add("Phong1.fs","assets/shaders/webgl1/Phong1.fs",By);const Uy=By,Xy='#extension GL_EXT_draw_buffers:enable\nprecision highp float;precision highp int;precision highp sampler2D;varying vec3 vertex;varying vec3 normal;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nvarying vec4 texCoord0;\n#else\nvec4 texCoord0=vec4(0.0,0.0,0.0,1.0);\n#endif\n#pragma X3D include "include/ClipPlanes.glsl"\n#pragma X3D include "include/Point.glsl"\nuniform float x3d_Id;void main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nif(getPointColor(vec4(1.0)).a<0.5)discard;texCoord0=vec4(gl_PointCoord.x,1.0-gl_PointCoord.y,0.0,1.0);\n#endif\ngl_FragData[0]=vec4(vertex,x3d_Id);gl_FragData[1]=vec4(normal,0.0);gl_FragData[2]=texCoord0;}\n';i.add("Pointing1.fs","assets/shaders/webgl1/Pointing1.fs",Xy);const ky=Xy,jy='precision highp float;precision highp int;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;attribute vec4 x3d_Vertex;attribute vec3 x3d_Normal;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nattribute vec4 x3d_TexCoord0;\n#endif\nvarying vec3 vertex;varying vec3 normal;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nvarying vec4 texCoord0;\n#endif\n#pragma X3D include "include/PointSize.glsl"\nvoid main(){\n#if defined(X3D_GEOMETRY_0D)\n#if defined(X3D_STYLE_PROPERTIES)\ngl_PointSize=max(pointSize=getPointSize(vertex),2.0);\n#else\ngl_PointSize=2.0;\n#endif\n#endif\nvec4 position=x3d_ModelViewMatrix*x3d_Vertex;vertex=position.xyz;normal=x3d_Normal;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\ntexCoord0=x3d_TexCoord0;\n#endif\ngl_Position=x3d_ProjectionMatrix*position;}\n';i.add("Pointing1.vs","assets/shaders/webgl1/Pointing1.vs",jy);const zy=jy,Gy='precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\nuniform x3d_UnlitMaterialParameters x3d_Material;\n#if defined(X3D_EMISSIVE_TEXTURE)\nuniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;\n#endif\nvec4 getEmissiveColor(){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 emissiveParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 emissiveParameter=vec4(x3d_Material.emissiveColor,alpha);\n#endif\n#if defined(X3D_EMISSIVE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);\n#if defined(X3D_EMISSIVE_TEXTURE_2D)\nreturn emissiveParameter*texture2D(x3d_EmissiveTexture.texture2D,texCoord.st);\n#elif defined(X3D_EMISSIVE_TEXTURE_CUBE)\nreturn emissiveParameter*textureCube(x3d_EmissiveTexture.textureCube,texCoord);\n#endif\n#elif defined(X3D_TEXTURE)\nreturn getTextureColor(emissiveParameter,vec4(vec3(1.0),alpha));\n#else\nreturn emissiveParameter;\n#endif\n}vec4 getMaterialColor(){return getEmissiveColor();}void main(){fragment_main();}\n';i.add("Unlit1.fs","assets/shaders/webgl1/Unlit1.fs",Gy);const Hy=Gy,qy="#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;uniform sampler2D x3d_AccumRevealageTexture;uniform sampler2D x3d_AlphaTexture;out vec4 x3d_FragColor;void main(){ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 accum=texelFetch(x3d_AccumRevealageTexture,fragCoord,0);if(accum.a>=1.0)discard;float alpha=texelFetch(x3d_AlphaTexture,fragCoord,0).r;float revealage=1.0-accum.a;x3d_FragColor=vec4(revealage*accum.rgb/clamp(alpha,0.001,50000.0),revealage);}\n";i.add("Compose2.fs","assets/shaders/webgl2/Compose2.fs",qy);const Yy=qy,Wy="#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;layout(location=0)in vec4 x3d_Vertex;void main(){gl_Position=x3d_Vertex;}\n";i.add("Compose2.vs","assets/shaders/webgl2/Compose2.vs",Wy);const $y=Wy,Jy='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;\n#pragma X3D include "include/Vertex.glsl"\nvoid main(){vertex_main();}\n';i.add("Default2.vs","assets/shaders/webgl2/Default2.vs",Jy);const Ky=Jy,Zy='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;in vec3 vertex;out vec4 x3d_FragColor;\n#pragma X3D include "include/ClipPlanes.glsl"\n#pragma X3D include "include/Point.glsl"\nvoid main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nif(getPointColor(vec4(1.0)).a<0.5)discard;\n#endif\nx3d_FragColor=vec4(gl_FragCoord.z);}\n';i.add("Depth2.fs","assets/shaders/webgl2/Depth2.fs",Zy);const Qy=Zy,ew='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;in vec4 x3d_Vertex;out vec3 vertex;\n#pragma X3D include "include/Utils.glsl"\n#pragma X3D include "include/Skin.glsl"\n#pragma X3D include "include/Particle.glsl"\n#pragma X3D include "include/PointSize.glsl"\nvoid main(){vec4 x3d_TransformedVertex=getParticleVertex(getSkinVertex(x3d_Vertex,vec3(0.0)));vec4 position=x3d_ModelViewMatrix*x3d_TransformedVertex;vertex=position.xyz;\n#if defined(X3D_GEOMETRY_0D)\n#if defined(X3D_STYLE_PROPERTIES)\ngl_PointSize=max(pointSize=getPointSize(vertex),2.0);\n#else\ngl_PointSize=2.0;\n#endif\n#endif\ngl_Position=x3d_ProjectionMatrix*position;}\n';i.add("Depth2.vs","assets/shaders/webgl2/Depth2.vs",ew);const tw=ew,iw='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\nin vec4 frontColor;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nin vec4 backColor;\n#endif\nvec4 getMaterialColor(){\n#if defined(X3D_GEOMETRY_0D)||defined(X3D_GEOMETRY_1D)\nvec4 finalColor=frontColor;\n#else\nvec4 finalColor=gl_FrontFacing?frontColor:backColor;\n#endif\n#if defined(X3D_TEXTURE)\nfinalColor=getTextureColor(finalColor,vec4(1.0));\n#endif\n#if defined(X3D_PROJECTIVE_TEXTURE_MAPPING)\nfinalColor=getProjectiveTextureColor(finalColor);\n#endif\nreturn finalColor;}void main(){fragment_main();}\n';i.add("Gouraud2.fs","assets/shaders/webgl2/Gouraud2.fs",iw);const nw=iw,sw='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;\n#pragma X3D include "include/Vertex.glsl"\n#pragma X3D include "include/Material.glsl"\nout vec4 frontColor;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nout vec4 backColor;\n#endif\nvec4 getMaterialColor(const in vec3 N,const in vec3 vertex,const in x3d_MaterialParameters material){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 diffuseParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 diffuseParameter=vec4(x3d_Material.diffuseColor,alpha);\n#endif\nvec3 ambientColor=diffuseParameter.rgb*material.ambientIntensity;\n#if defined(X3D_LIGHTING)\nvec3 finalColor=getMaterialColor(vertex,N,ambientColor,diffuseParameter.rgb,material.specularColor,material.shininess);\n#else\nvec3 finalColor=vec3(0.0);\n#endif\nfinalColor+=material.emissiveColor;return vec4(finalColor,diffuseParameter.a);}void main(){vertex_main();normal=normalize(normal);frontColor=getMaterialColor(normal,vertex,x3d_Material);\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nbackColor=getMaterialColor(-normal,vertex,x3d_Material);\n#endif\n}\n';i.add("Gouraud2.vs","assets/shaders/webgl2/Gouraud2.vs",sw);const rw=sw,ow="#version 300 es\nprecision highp float;void main(){}\n";i.add("LineTransform2.fs","assets/shaders/webgl2/LineTransform2.fs",ow);const aw=ow,lw="#version 300 es\nprecision highp float;uniform vec4 viewport;uniform mat4 modelViewProjectionMatrix;uniform mat4 invModelViewProjectionMatrix;uniform float scale;in float x3d_CoordIndex0;in vec3 x3d_LineStipple0;in float x3d_FogDepth0;in vec4 x3d_Color0;in vec3 x3d_Normal0;in vec4 x3d_Vertex0;in float x3d_CoordIndex1;in vec3 x3d_LineStipple1;in float x3d_FogDepth1;in vec4 x3d_Color1;in vec3 x3d_Normal1;in vec4 x3d_Vertex1;out float coordIndex0;out vec3 lineStipple0;out float fogDepth0;out vec4 color0;out vec3 normal0;out vec4 vertex0;out float coordIndex1;out vec3 lineStipple1;out float fogDepth1;out vec4 color1;out vec3 normal1;out vec4 vertex1;out float coordIndex2;out vec3 lineStipple2;out float fogDepth2;out vec4 color2;out vec3 normal2;out vec4 vertex2;vec3 projectPoint(const in vec4 point,const in mat4 modelViewProjectionMatrix,const in vec4 viewport){vec4 vin=modelViewProjectionMatrix*point;vin.xyz=vin.xyz/(2.0*vin.w)+0.5;return vec3(vin.xy*viewport.zw+viewport.xy,vin.z);}vec4 unProjectPoint(const in vec3 win,const in mat4 invModelViewProjection,const in vec4 viewport){vec4 vin=vec4((win.xy-viewport.xy)/viewport.zw*2.0-1.0,2.0*win.z-1.0,1.0);vin=invModelViewProjection*vin;return vec4(vin.xyz/vin.w,1.0);}void main(){vec3 projected0=projectPoint(x3d_Vertex0,modelViewProjectionMatrix,viewport);vec3 projected1=projectPoint(x3d_Vertex1,modelViewProjectionMatrix,viewport);vec2 direction=normalize(projected1.xy-projected0.xy);vec2 offset=vec2(-direction.y,direction.x)*scale;if(gl_InstanceID==0){vec2 pq0=projected0.xy+offset;vec2 pq1=projected0.xy-offset;vec2 pq2=projected1.xy-offset;vec4 p0=unProjectPoint(vec3(pq0.xy,projected0.z),invModelViewProjectionMatrix,viewport);vec4 p1=unProjectPoint(vec3(pq1.xy,projected0.z),invModelViewProjectionMatrix,viewport);vec4 p2=unProjectPoint(vec3(pq2.xy,projected1.z),invModelViewProjectionMatrix,viewport);coordIndex0=x3d_CoordIndex0;lineStipple0=x3d_LineStipple0;fogDepth0=x3d_FogDepth0;color0=x3d_Color0;normal0=x3d_Normal0;vertex0=p0;coordIndex1=x3d_CoordIndex0;lineStipple1=x3d_LineStipple0;fogDepth1=x3d_FogDepth0;color1=x3d_Color0;normal1=x3d_Normal0;vertex1=p1;coordIndex2=x3d_CoordIndex1;lineStipple2=x3d_LineStipple1;fogDepth2=x3d_FogDepth1;color2=x3d_Color1;normal2=x3d_Normal1;vertex2=p2;}else{vec2 pq0=projected0.xy+offset;vec2 pq2=projected1.xy-offset;vec2 pq3=projected1.xy+offset;vec4 p0=unProjectPoint(vec3(pq0.xy,projected0.z),invModelViewProjectionMatrix,viewport);vec4 p2=unProjectPoint(vec3(pq2.xy,projected1.z),invModelViewProjectionMatrix,viewport);vec4 p3=unProjectPoint(vec3(pq3.xy,projected1.z),invModelViewProjectionMatrix,viewport);coordIndex0=x3d_CoordIndex0;lineStipple0=x3d_LineStipple0;fogDepth0=x3d_FogDepth0;color0=x3d_Color0;normal0=x3d_Normal0;vertex0=p0;coordIndex1=x3d_CoordIndex1;lineStipple1=x3d_LineStipple1;fogDepth1=x3d_FogDepth1;color1=x3d_Color1;normal1=x3d_Normal1;vertex1=p2;coordIndex2=x3d_CoordIndex1;lineStipple2=x3d_LineStipple1;fogDepth2=x3d_FogDepth1;color2=x3d_Color1;normal2=x3d_Normal1;vertex2=p3;}}\n";i.add("LineTransform2.vs","assets/shaders/webgl2/LineTransform2.vs",lw);const uw=lw,hw='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\n#pragma X3D include "include/Colors.glsl"\n#pragma X3D include "include/Normal.glsl"\n#pragma X3D include "include/SpotFactor.glsl"\n#pragma X3D include "include/Shadow.glsl"\n#if defined(X3D_LIGHTING)\nuniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];\n#endif\nuniform x3d_PhysicalMaterialParameters x3d_Material;\n#if defined(USE_IBL)\nuniform samplerCube diffuseEnvironmentTexture;uniform samplerCube specularEnvironmentTexture;uniform sampler2D brdfLUT;\n#endif\n#if defined(X3D_BASE_TEXTURE)\nuniform x3d_BaseTextureParameters x3d_BaseTexture;\n#endif\nvec4 getBaseColor(){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 baseParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 baseParameter=vec4(x3d_Material.baseColor,alpha);\n#endif\n#if defined(X3D_BASE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_BaseTexture.textureTransformMapping,x3d_BaseTexture.textureCoordinateMapping);\n#if defined(X3D_BASE_TEXTURE_2D)\nreturn baseParameter*SRGBtoLINEAR(texture(x3d_BaseTexture.texture2D,texCoord.st));\n#elif defined(X3D_BASE_TEXTURE_3D)\nreturn baseParameter*SRGBtoLINEAR(texture(x3d_BaseTexture.texture3D,texCoord));\n#elif defined(X3D_BASE_TEXTURE_CUBE)\nreturn baseParameter*SRGBtoLINEAR(texture(x3d_BaseTexture.textureCube,texCoord));\n#endif\n#elif defined(X3D_TEXTURE)\nreturn getTextureColor(baseParameter,vec4(vec3(1.0),alpha));\n#else\nreturn baseParameter;\n#endif\n}\n#if defined(X3D_EMISSIVE_TEXTURE)\nuniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;\n#endif\nvec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;\n#if defined(X3D_EMISSIVE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);\n#if defined(X3D_EMISSIVE_TEXTURE_2D)\nreturn emissiveParameter*SRGBtoLINEAR(texture(x3d_EmissiveTexture.texture2D,texCoord.st)).rgb;\n#elif defined(X3D_EMISSIVE_TEXTURE_3D)\nreturn emissiveParameter*SRGBtoLINEAR(texture(x3d_EmissiveTexture.texture3D,texCoord)).rgb;\n#elif defined(X3D_EMISSIVE_TEXTURE_CUBE)\nreturn emissiveParameter*SRGBtoLINEAR(texture(x3d_EmissiveTexture.textureCube,texCoord)).rgb;\n#endif\n#else\nreturn emissiveParameter.rgb;\n#endif\n}\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)\nuniform x3d_MetallicRoughnessTextureParameters x3d_MetallicRoughnessTexture;\n#endif\nvec2 getMetallicRoughness(){float metallic=x3d_Material.metallic;float perceptualRoughness=x3d_Material.roughness;\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_MetallicRoughnessTexture.textureTransformMapping,x3d_MetallicRoughnessTexture.textureCoordinateMapping);\n#if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_2D)\nvec4 mrSample=texture(x3d_MetallicRoughnessTexture.texture2D,texCoord.st);\n#elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_3D)\nvec4 mrSample=texture(x3d_MetallicRoughnessTexture.texture3D,texCoord);\n#elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_CUBE)\nvec4 mrSample=texture(x3d_MetallicRoughnessTexture.textureCube,texCoord);\n#endif\nmetallic*=mrSample.b;perceptualRoughness*=mrSample.g;return vec2(metallic,perceptualRoughness);\n#else\nreturn vec2(metallic,perceptualRoughness);\n#endif\n}\n#if defined(X3D_OCCLUSION_TEXTURE)\nuniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;\n#endif\nfloat getOcclusionFactor(){\n#if defined(X3D_OCCLUSION_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);\n#if defined(X3D_OCCLUSION_TEXTURE_2D)\nreturn texture(x3d_OcclusionTexture.texture2D,texCoord.st).r;\n#elif defined(X3D_OCCLUSION_TEXTURE_3D)\nreturn texture(x3d_OcclusionTexture.texture3D,texCoord).r;\n#elif defined(X3D_OCCLUSION_TEXTURE_CUBE)\nreturn texture(x3d_OcclusionTexture.textureCube,texCoord).r;\n#endif\n#else\nreturn 1.0;\n#endif\n}struct PBRInfo{float NdotL;float NdotV;float NdotH;float LdotH;float VdotH;float perceptualRoughness;float metalness;vec3 reflectance0;vec3 reflectance90;float alphaRoughness;vec3 diffuseColor;vec3 specularColor;};const float M_PI=3.141592653589793;const float c_MinRoughness=0.04;\n#if defined(USE_IBL)\nvec3 getIBLContribution(const in PBRInfo pbrInputs,vec3 n,const in vec3 reflection){float mipCount=9.0;float lod=pbrInputs.perceptualRoughness*mipCount;vec3 brdf=SRGBtoLINEAR(texture(brdfLUT,vec2(pbrInputs.NdotV,1.0-pbrInputs.perceptualRoughness))).rgb;vec3 diffuseLight=SRGBtoLINEAR(textureCube(diffuseEnvironmentTexture,n)).rgb;\n#if defined(USE_TEX_LOD)\nvec3 specularLight=SRGBtoLINEAR(textureCubeLodEXT(specularEnvironmentTexture,reflection,lod)).rgb;\n#else\nvec3 specularLight=SRGBtoLINEAR(textureCube(specularEnvironmentTexture,reflection)).rgb;\n#endif\nvec3 diffuse=diffuseLight*pbrInputs.diffuseColor;vec3 specular=specularLight*(pbrInputs.specularColor*brdf.x+brdf.y);return diffuse+specular;}\n#endif\nvec3 diffuse(const in PBRInfo pbrInputs){return pbrInputs.diffuseColor/M_PI;}vec3 specularReflection(const in PBRInfo pbrInputs){return pbrInputs.reflectance0+(pbrInputs.reflectance90-pbrInputs.reflectance0)*pow(clamp(1.0-pbrInputs.VdotH,0.0,1.0),5.0);}float geometricOcclusion(const in PBRInfo pbrInputs){float NdotL=pbrInputs.NdotL;float NdotV=pbrInputs.NdotV;float r=pbrInputs.alphaRoughness;float attenuationL=2.0*NdotL/(NdotL+sqrt(r*r+(1.0-r*r)*(NdotL*NdotL)));float attenuationV=2.0*NdotV/(NdotV+sqrt(r*r+(1.0-r*r)*(NdotV*NdotV)));return attenuationL*attenuationV;}float microfacetDistribution(const in PBRInfo pbrInputs){float roughnessSq=pbrInputs.alphaRoughness*pbrInputs.alphaRoughness;float f=(pbrInputs.NdotH*roughnessSq-pbrInputs.NdotH)*pbrInputs.NdotH+1.0;return roughnessSq/(M_PI*f*f);}vec4 getMaterialColor(){vec2 metallicRoughness=getMetallicRoughness();float perceptualRoughness=clamp(metallicRoughness[1],c_MinRoughness,1.0);float metallic=clamp(metallicRoughness[0],0.0,1.0);float alphaRoughness=perceptualRoughness*perceptualRoughness;vec4 baseColor=getBaseColor();float alpha=baseColor.a;vec3 f0=vec3(0.04);vec3 diffuseColor=baseColor.rgb*(vec3(1.0)-f0);diffuseColor*=1.0-metallic;vec3 specularColor=mix(f0,baseColor.rgb,metallic);float reflectance=max(max(specularColor.r,specularColor.g),specularColor.b);float reflectance90=clamp(reflectance*25.0,0.0,1.0);vec3 specularEnvironmentR0=specularColor.rgb;vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0)*reflectance90;vec3 n=getNormalVector(x3d_Material.normalScale);vec3 v=normalize(-vertex);vec3 finalColor=vec3(0.0);\n#if defined(X3D_LIGHTING)\nfor(int i=0;i<X3D_NUM_LIGHTS;i++){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 l=normalize(L);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.001,1.0);float NdotV=abs(dot(n,v))+0.001;float NdotH=clamp(dot(n,h),0.0,1.0);float LdotH=clamp(dot(l,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);PBRInfo pbrInputs=PBRInfo(NdotL,NdotV,NdotH,LdotH,VdotH,perceptualRoughness,metallic,specularEnvironmentR0,specularEnvironmentR90,alphaRoughness,diffuseColor,specularColor);vec3 F=specularReflection(pbrInputs);float G=geometricOcclusion(pbrInputs);float D=microfacetDistribution(pbrInputs);float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 diffuseContrib=(1.0-F)*diffuse(pbrInputs);vec3 specContrib=F*G*D/(4.0*NdotL*NdotV);vec3 diffuseSpecContrib=light.intensity*(diffuseContrib+specContrib);\n#if defined(X3D_SHADOWS)\nif(NdotL>0.001&&light.shadowIntensity>0.0)diffuseSpecContrib=mix(diffuseSpecContrib,light.shadowColor,getShadowIntensity(i,light));\n#endif\nvec3 color=NdotL*attenuationSpotFactor*light.color*diffuseSpecContrib;finalColor+=color;}}\n#endif\n#if defined(USE_IBL)\nvec3 reflection=-normalize(reflect(v,n));finalColor+=getIBLContribution(pbrInputs,n,reflection);\n#endif\n#if defined(X3D_OCCLUSION_TEXTURE)\nfinalColor=mix(finalColor,finalColor*getOcclusionFactor(),x3d_Material.occlusionStrength);\n#endif\nfinalColor+=getEmissiveColor();return Gamma(vec4(finalColor,alpha));}void main(){fragment_main();}\n';i.add("PBR2.fs","assets/shaders/webgl2/PBR2.fs",hw);const dw=hw,cw='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\n#pragma X3D include "include/Material.glsl"\n#pragma X3D include "include/Normal.glsl"\n#if defined(X3D_AMBIENT_TEXTURE)\nuniform x3d_AmbientTextureParameters x3d_AmbientTexture;\n#endif\nvec3 getAmbientColor(const in vec3 diffuseColor){vec3 ambientParameter=x3d_Material.ambientIntensity*diffuseColor;\n#if defined(X3D_AMBIENT_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_AmbientTexture.textureTransformMapping,x3d_AmbientTexture.textureCoordinateMapping);\n#if defined(X3D_AMBIENT_TEXTURE_2D)\nreturn ambientParameter*texture(x3d_AmbientTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_AMBIENT_TEXTURE_3D)\nreturn ambientParameter*texture(x3d_AmbientTexture.texture3D,texCoord).rgb;\n#elif defined(X3D_AMBIENT_TEXTURE_CUBE)\nreturn ambientParameter*texture(x3d_AmbientTexture.textureCube,texCoord).rgb;\n#endif\n#else\nreturn ambientParameter;\n#endif\n}\n#if defined(X3D_DIFFUSE_TEXTURE)\nuniform x3d_DiffuseTextureParameters x3d_DiffuseTexture;\n#endif\nvec4 getDiffuseColor(){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 diffuseParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 diffuseParameter=vec4(x3d_Material.diffuseColor,alpha);\n#endif\n#if defined(X3D_DIFFUSE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_DiffuseTexture.textureTransformMapping,x3d_DiffuseTexture.textureCoordinateMapping);\n#if defined(X3D_DIFFUSE_TEXTURE_2D)\nreturn diffuseParameter*texture(x3d_DiffuseTexture.texture2D,texCoord.st);\n#elif defined(X3D_DIFFUSE_TEXTURE_3D)\nreturn diffuseParameter*texture(x3d_DiffuseTexture.texture3D,texCoord);\n#elif defined(X3D_DIFFUSE_TEXTURE_CUBE)\nreturn diffuseParameter*texture(x3d_DiffuseTexture.textureCube,texCoord);\n#endif\n#elif defined(X3D_TEXTURE)\nreturn getTextureColor(diffuseParameter,vec4(x3d_Material.specularColor,alpha));\n#else\nreturn diffuseParameter;\n#endif\n}\n#if defined(X3D_SPECULAR_TEXTURE)\nuniform x3d_SpecularTextureParameters x3d_SpecularTexture;\n#endif\nvec3 getSpecularColor(){vec3 specularParameter=x3d_Material.specularColor;\n#if defined(X3D_SPECULAR_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_SpecularTexture.textureTransformMapping,x3d_SpecularTexture.textureCoordinateMapping);\n#if defined(X3D_SPECULAR_TEXTURE_2D)\nreturn specularParameter*texture(x3d_SpecularTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_SPECULAR_TEXTURE_3D)\nreturn specularParameter*texture(x3d_SpecularTexture.texture3D,texCoord).rgb;\n#elif defined(X3D_SPECULAR_TEXTURE_CUBE)\nreturn specularParameter*texture(x3d_SpecularTexture.textureCube,texCoord).rgb;\n#endif\n#else\nreturn specularParameter;\n#endif\n}\n#if defined(X3D_EMISSIVE_TEXTURE)\nuniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;\n#endif\nvec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;\n#if defined(X3D_EMISSIVE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);\n#if defined(X3D_EMISSIVE_TEXTURE_2D)\nreturn emissiveParameter*texture(x3d_EmissiveTexture.texture2D,texCoord.st).rgb;\n#elif defined(X3D_EMISSIVE_TEXTURE_3D)\nreturn emissiveParameter*texture(x3d_EmissiveTexture.texture3D,texCoord).rgb;\n#elif defined(X3D_EMISSIVE_TEXTURE_CUBE)\nreturn emissiveParameter*texture(x3d_EmissiveTexture.textureCube,texCoord).rgb;\n#endif\n#else\nreturn emissiveParameter;\n#endif\n}\n#if defined(X3D_SHININESS_TEXTURE)\nuniform x3d_ShininessTextureParameters x3d_ShininessTexture;\n#endif\nfloat getShininessFactor(){float shininess=x3d_Material.shininess;\n#if defined(X3D_SHININESS_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_ShininessTexture.textureTransformMapping,x3d_ShininessTexture.textureCoordinateMapping);\n#if defined(X3D_SHININESS_TEXTURE_2D)\nreturn shininess*texture(x3d_ShininessTexture.texture2D,texCoord.st).a;\n#elif defined(X3D_SHININESS_TEXTURE_3D)\nreturn shininess*texture(x3d_ShininessTexture.texture3D,texCoord).a;\n#elif defined(X3D_SHININESS_TEXTURE_CUBE)\nreturn shininess*texture(x3d_ShininessTexture.textureCube,texCoord).a;\n#endif\n#else\nreturn shininess;\n#endif\n}\n#if defined(X3D_OCCLUSION_TEXTURE)\nuniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;\n#endif\nfloat getOcclusionFactor(){\n#if defined(X3D_OCCLUSION_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);\n#if defined(X3D_OCCLUSION_TEXTURE_2D)\nreturn texture(x3d_OcclusionTexture.texture2D,texCoord.st).r;\n#elif defined(X3D_OCCLUSION_TEXTURE_3D)\nreturn texture(x3d_OcclusionTexture.texture3D,texCoord).r;\n#elif defined(X3D_OCCLUSION_TEXTURE_CUBE)\nreturn texture(x3d_OcclusionTexture.textureCube,texCoord).r;\n#endif\n#else\nreturn 1.0;\n#endif\n}vec4 getMaterialColor(){vec4 diffuseColorAlpha=getDiffuseColor();float alpha=diffuseColorAlpha.a;vec3 diffuseColor=diffuseColorAlpha.rgb;vec3 ambientColor=getAmbientColor(diffuseColor);vec3 specularColor=getSpecularColor();float shininess=getShininessFactor();float normalScale=x3d_Material.normalScale;\n#if defined(X3D_PROJECTIVE_TEXTURE_MAPPING)\nvec4 P=getProjectiveTextureColor(vec4(1.0));diffuseColor*=P.rgb;alpha*=P.a;\n#endif\n#if defined(X3D_LIGHTING)\nvec3 finalColor=getMaterialColor(vertex,getNormalVector(normalScale),ambientColor,diffuseColor,specularColor,shininess);\n#else\nvec3 finalColor=vec3(0.0);\n#endif\n#if defined(X3D_OCCLUSION_TEXTURE)\nfinalColor=mix(finalColor,finalColor*getOcclusionFactor(),x3d_Material.occlusionStrength);\n#endif\nfinalColor+=getEmissiveColor();return vec4(finalColor,alpha);}void main(){fragment_main();}\n';i.add("Phong2.fs","assets/shaders/webgl2/Phong2.fs",cw);const pw=cw,gw='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;in vec3 vertex;in vec3 normal;in vec4 texCoord;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nin vec4 texCoord0;\n#else\nvec4 texCoord0=vec4(0.0,0.0,0.0,1.0);\n#endif\nlayout(location=0)out vec4 x3d_FragData0;layout(location=1)out vec4 x3d_FragData1;layout(location=2)out vec4 x3d_FragData2;\n#pragma X3D include "include/ClipPlanes.glsl"\n#pragma X3D include "include/Point.glsl"\n#pragma X3D include "Stipple.glsl"\nuniform float x3d_Id;void main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\n#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)\nif(getPointColor(vec4(1.0)).a<0.5)discard;texCoord0=vec4(gl_PointCoord.x,1.0-gl_PointCoord.y,0.0,1.0);\n#endif\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nstipple();\n#endif\nx3d_FragData0=vec4(vertex,x3d_Id);x3d_FragData1=vec4(normal,0.0);x3d_FragData2=texCoord0;}\n';i.add("Pointing2.fs","assets/shaders/webgl2/Pointing2.fs",gw);const fw=gw,mw='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;in vec4 x3d_Vertex;in vec3 x3d_Normal;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nin vec4 x3d_TexCoord0;\n#endif\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nin vec3 x3d_LineStipple;\n#endif\nout vec3 vertex;out vec3 normal;\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\nout vec4 texCoord0;\n#endif\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nflat out float lengthSoFar;flat out vec2 startPoint;out vec2 midPoint;\n#endif\n#pragma X3D include "include/Utils.glsl"\n#pragma X3D include "include/Skin.glsl"\n#pragma X3D include "include/Particle.glsl"\n#pragma X3D include "include/PointSize.glsl"\nvoid main(){\n#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)\nlengthSoFar=x3d_LineStipple.z;startPoint=x3d_LineStipple.xy;midPoint=x3d_LineStipple.xy;\n#endif\nvec4 x3d_TransformedVertex=getParticleVertex(getSkinVertex(x3d_Vertex,vec3(0.0)));vec4 position=x3d_ModelViewMatrix*x3d_TransformedVertex;vertex=position.xyz;normal=x3d_Normal;\n#if defined(X3D_GEOMETRY_0D)\n#if defined(X3D_STYLE_PROPERTIES)\ngl_PointSize=max(pointSize=getPointSize(vertex),2.0);\n#else\ngl_PointSize=2.0;\n#endif\n#endif\n#if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)\ntexCoord0=x3d_TexCoord0;\n#endif\ngl_Position=x3d_ProjectionMatrix*position;}\n';i.add("Pointing2.vs","assets/shaders/webgl2/Pointing2.vs",mw);const _w=mw,xw='#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;\n#pragma X3D include "include/Fragment.glsl"\nuniform x3d_UnlitMaterialParameters x3d_Material;\n#if defined(X3D_EMISSIVE_TEXTURE)\nuniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;\n#endif\nvec4 getEmissiveColor(){float alpha=1.0-x3d_Material.transparency;\n#if defined(X3D_COLOR_MATERIAL)\nvec4 emissiveParameter=vec4(color.rgb,color.a*alpha);\n#else\nvec4 emissiveParameter=vec4(x3d_Material.emissiveColor,alpha);\n#endif\n#if defined(X3D_EMISSIVE_TEXTURE)\nvec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);\n#if defined(X3D_EMISSIVE_TEXTURE_2D)\nreturn emissiveParameter*texture(x3d_EmissiveTexture.texture2D,texCoord.st);\n#elif defined(X3D_EMISSIVE_TEXTURE_3D)\nreturn emissiveParameter*texture(x3d_EmissiveTexture.texture3D,texCoord);\n#elif defined(X3D_EMISSIVE_TEXTURE_CUBE)\nreturn emissiveParameter*texture(x3d_EmissiveTexture.textureCube,texCoord);\n#endif\n#elif defined(X3D_TEXTURE)\nreturn getTextureColor(emissiveParameter,vec4(vec3(1.0),alpha));\n#else\nreturn emissiveParameter;\n#endif\n}vec4 getMaterialColor(){return getEmissiveColor();}void main(){fragment_main();}\n';i.add("Unlit2.fs","assets/shaders/webgl2/Unlit2.fs",xw);const yw={includes:{1:{ClipPlanes:fx,Colors:_x,Fog:yx,Fragment:bx,Hatch:Tx,Material:Ox,Normal:Nx,Perlin:Fx,Point:Mx,PointSize:Px,Shadow:Ax,SpotFactor:Lx,Texture:Ux,Vertex:kx},2:{ClipPlanes:zx,Colors:Hx,Fog:Yx,Fragment:$x,Hatch:Kx,Line2:Qx,Material:ty,Normal:ny,Particle:ry,Perlin:ay,Point:uy,PointSize:dy,Shadow:py,Skin:fy,SpotFactor:_y,Stipple:yy,Texture:by,Utils:Ty,Vertex:Oy}},vertex:{1:{Default:Ny,Depth:My,Gouraud:Ay,Pointing:zy},2:{Compose:$y,Default:Ky,Depth:tw,Gouraud:rw,LineTransform:uw,Pointing:_w}},fragment:{1:{Depth:Fy,Gouraud:Py,PBR:Ly,Phong:Uy,Pointing:ky,Unlit:Hy},2:{Compose:Yy,Depth:Qy,Gouraud:nw,LineTransform:aw,PBR:dw,Phong:pw,Pointing:fw,Unlit:xw}}};i.add("ShaderRegistry","x_ite/Browser/Shaders/ShaderRegistry",yw);const ww=yw,bw=/^\s*#pragma\s+X3D\s+include\s+".*?([^\/]+)\.glsl"\s*$/;function Sw(e){this.includes=ww.includes[e.getVersion()],this.sourceFileNumbers={};for(const[e,t]of Object.getOwnPropertyNames(this.includes).entries())this.sourceFileNumbers[t]=e+1}Object.assign(Sw.prototype,{getSourceFileName(e){return Object.getOwnPropertyNames(this.includes)[e-1]},process(e,t=0){const i=e.split("\n");e="";for(let n=0,s=i.length;n<s;++n){const s=i[n],r=s.match(bw);r?(e+="#line 1 "+this.sourceFileNumbers[r[1]]+"\n",e+=this.process(this.includes[r[1]],this.sourceFileNumbers[r[1]]),e+="\n",e+="#line "+(n+2)+" "+t+"\n"):(e+=s,e+="\n")}return e}});const Tw=Sw;i.add("ShaderCompiler","x_ite/Browser/Shaders/ShaderCompiler",Tw);const vw=Tw;var Ow=n(464);const Ew=["X3D_GEOMETRY_0D","X3D_GEOMETRY_1D","X3D_GEOMETRY_2D","X3D_GEOMETRY_3D","X3D_FOG","X3D_STYLE_PROPERTIES","X3D_UNLIT_MATERIAL","X3D_MATERIAL","X3D_LIGHTING","X3D_TEXTURE","X3D_MULTI_TEXTURING"];function Nw(e){bs.call(this,e),Sr.call(this,e),this.addType(d.ShaderPart),this.options=[]}Object.assign(Object.setPrototypeOf(Nw.prototype,bs.prototype),Sr.prototype,{initialize(){bs.prototype.initialize.call(this),Sr.prototype.initialize.call(this),this.isPrivate()||(this.options=Ew.slice()),this._type.addInterest("set_type__",this),this.requestImmediateLoad().catch(Function.prototype)},set_type__(){this.setLoadState(d.NOT_STARTED_STATE),this.requestImmediateLoad().catch(Function.prototype)},getSourceText(){return this._url},getOptions(){return this.options},setOptions(e){this.options=e},getShader(){return this.shader},getShaderType:(()=>{const e=new Map([["VERTEX","VERTEX_SHADER"],["TESS_CONTROL","TESS_CONTROL_SHADER"],["TESS_EVALUATION","TESS_EVALUATION_SHADER"],["GEOMETRY","GEOMETRY_SHADER"],["FRAGMENT","FRAGMENT_SHADER"],["COMPUTE","COMPUTE_SHADER"]]);return function(){return e.get(this._type.getValue())||"VERTEX_SHADER"}})(),unloadData(){this.valid=!1},loadData(){new uh(this).loadDocument(this._url,function(e,t){if(null===e)this.setLoadState(d.FAILED_STATE);else{const i=this.getBrowser(),n=i.getContext(),s=this.getShaderType(),r=["X3D_"+s].concat(this.options),o=new vw(n),a=px.getSource(n,i,o.process(Ow.decodeText(e)),r),l=n.createShader(n[s]);if(n.deleteShader(this.shader),this.shader=l,n.shaderSource(l,a),n.compileShader(l),!n.getShaderParameter(l,n.COMPILE_STATUS)){const e=this.getTypeName(),i=this.getName(),s=n.getShaderInfoLog(l),r=s.match(/(\d+):(\d+)/);if(r){const n=o.getSourceFileName(r[1])||t||this.getExecutionContext().getWorldURL();throw new Error("Error in "+e+" '"+i+"' in URL '"+n+"', line "+r[2]+", "+s)}{const n=t||this.getExecutionContext().getWorldURL();throw new Error("Error in "+e+" '"+i+"' in URL '"+n+"', "+s)}}this.setLoadState(d.COMPLETE_STATE)}}.bind(this))},dispose(){Sr.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Nw,{typeName:{value:"ShaderPart",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"parts",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.initializeOnly,"type",new Yn.SFString("VERTEX")),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600))]),enumerable:!0}});const Cw=Nw;i.add("ShaderPart","x_ite/Components/Shaders/ShaderPart",Cw);const Fw=Cw;function Iw(e){bs.call(this,e),Sr.call(this,e),I_.call(this,e),this.addType(d.ShaderProgram)}Object.assign(Object.setPrototypeOf(Iw.prototype,bs.prototype),Sr.prototype,I_.prototype,{getSourceText(){return this._url},requestImmediateLoad(e=!0){},initialize(){bs.prototype.initialize.call(this),Sr.prototype.initialize.call(this),I_.prototype.initialize.call(this)},dispose(){I_.prototype.dispose.call(this),Sr.prototype.dispose.call(this),bs.prototype.dispose.call(this)}}),Object.defineProperties(Iw,{typeName:{value:"ShaderProgram",enumerable:!0},componentName:{value:"Shaders",enumerable:!0},containerField:{value:"programs",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.initializeOnly,"type",new Yn.SFString("VERTEX")),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600))]),enumerable:!0}});const Mw=Iw;i.add("ShaderProgram","x_ite/Components/Shaders/ShaderProgram",Mw);const Dw={name:"Shaders",concreteNodes:[P_,U_,j_,H_,W_,K_,Fw,Mw],abstractNodes:[I_,O_,V_]};i.add("Shaders","x_ite/Components/Shaders",Dw);const Pw=Dw;function Rw(e){kl.call(this,e),this.addType(d.AcousticProperties)}Object.setPrototypeOf(Rw.prototype,kl.prototype),Object.defineProperties(Rw,{typeName:{value:"AcousticProperties",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"acousticProperties",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"absorption",new Yn.SFFloat),new X(d.inputOutput,"refraction",new Yn.SFFloat),new X(d.inputOutput,"diffuse",new Yn.SFFloat),new X(d.inputOutput,"specular",new Yn.SFFloat)]),enumerable:!0}});const Aw=Rw;i.add("AcousticProperties","x_ite/Components/Shape/AcousticProperties",Aw);const Vw=Aw;function Lw(e){bs.call(this,e),this.addType(d.X3DAppearanceNode),this.addChildObjects(d.outputOnly,"transparent",new Yn.SFBool)}Object.assign(Object.setPrototypeOf(Lw.prototype,bs.prototype),{setTransparent(e){e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()}}),Object.defineProperties(Lw,{typeName:{value:"X3DAppearanceNode",enumerable:!0},componentName:{value:"Shape",enumerable:!0}});const Bw=Lw;i.add("X3DAppearanceNode","x_ite/Components/Shape/X3DAppearanceNode",Bw);const Uw=Bw;var Xw=n(464);function kw(e){Uw.call(this,e),this.addType(d.Appearance),this.stylePropertiesNode=[],this.textureTransformMapping=new Map,this.textureBits=new Rl,this.shaderNodes=[]}Object.assign(Object.setPrototypeOf(kw.prototype,Uw.prototype),{initialize(){Uw.prototype.initialize.call(this);this.getBrowser().getRenderingProperties()._ContentScale.addInterest("set_contentScale__",this),this._alphaMode.addInterest("set_alphaMode__",this),this._alphaCutoff.addInterest("set_alphaCutoff__",this),this._pointProperties.addInterest("set_pointProperties__",this),this._lineProperties.addInterest("set_lineProperties__",this),this._fillProperties.addInterest("set_fillProperties__",this),this._material.addInterest("set_material__",this),this._backMaterial.addInterest("set_backMaterial__",this),this._texture.addInterest("set_texture__",this),this._textureTransform.addInterest("set_textureTransform__",this),this._shaders.addInterest("set_shaders__",this),this._blendMode.addInterest("set_blendMode__",this),this._alphaMode.addInterest("set_transparent__",this),this._fillProperties.addInterest("set_transparent__",this),this._material.addInterest("set_transparent__",this),this._texture.addInterest("set_transparent__",this),this._blendMode.addInterest("set_transparent__",this),this.set_alphaMode__(),this.set_pointProperties__(),this.set_lineProperties__(),this.set_fillProperties__(),this.set_material__(),this.set_backMaterial__(),this.set_texture__(),this.set_textureTransform__(),this.set_shaders__(),this.set_blendMode__(),this.set_transparent__()},getAlphaMode(){return this.alphaMode},getNormalizedAlphaMode(e){return this.alphaMode||(e?Cl.BLEND:Cl.OPAQUE)},getAlphaCutoff(){return this.alphaCutoff},getStyleProperties(e){return this.stylePropertiesNode[e]},getPointProperties(){return this.stylePropertiesNode[0]},getLineProperties(){return this.stylePropertiesNode[1]},getFillProperties(){return this.stylePropertiesNode[2]},getMaterial(){return this.materialNode},getBackMaterial(){return this.backMaterialNode},getTexture(){return this.textureNode},getTextureBits(){return this.textureBits},updateTextureBits(){this.textureBits.clear(),this.textureNode.updateTextureBits(this.textureBits)},getTextureTransform(){return this.textureTransformNode},getTextureTransformMapping(){return this.textureTransformMapping},getShader(e,t){return this.materialNode.getShader(e,t)},getBackShader(e,t){return this.backMaterialNode.getShader(e,t)},getBlendMode(){return this.blendModeNode},set_contentScale__(){this.set_pointProperties__(),this.set_applied__()},set_alphaMode__(){this.alphaMode=Xw.enum(Cl,this._alphaMode.getValue(),Cl.AUTO),this.set_alphaCutoff__()},set_alphaCutoff__(){this.alphaCutoff=this.alphaMode===Cl.MASK?this._alphaCutoff.getValue():0},set_pointProperties__(){if(this.stylePropertiesNode[0]=ql(d.PointProperties,this._pointProperties),!this.stylePropertiesNode[0]){const e=this.getBrowser();1!==e.getRenderingProperty("ContentScale")&&(this.stylePropertiesNode[0]=e.getDefaultPointProperties())}},set_lineProperties__(){this.linePropertiesNode&&this.linePropertiesNode._applied.removeInterest("set_applied__",this),this.linePropertiesNode=ql(d.LineProperties,this._lineProperties),this.linePropertiesNode&&this.linePropertiesNode._applied.addInterest("set_applied__",this),this.set_applied__()},set_applied__(){if(this.linePropertiesNode&&this.linePropertiesNode._applied.getValue())this.stylePropertiesNode[1]=this.linePropertiesNode;else{const e=this.getBrowser();1!==e.getRenderingProperty("ContentScale")?this.stylePropertiesNode[1]=e.getDefaultLineProperties():this.stylePropertiesNode[1]=null}},set_fillProperties__(){this.stylePropertiesNode[2]&&this.stylePropertiesNode[2]._transparent.removeInterest("set_transparent__",this),this.stylePropertiesNode[2]=ql(d.FillProperties,this._fillProperties),this.stylePropertiesNode[2]&&this.stylePropertiesNode[2]._transparent.addInterest("set_transparent__",this),this.stylePropertiesNode[3]=this.stylePropertiesNode[2]},set_material__(){this.materialNode&&this.materialNode._transparent.removeInterest("set_transparent__",this),this.materialNode=ql(d.X3DMaterialNode,this._material),this.materialNode||(this.materialNode=this.getBrowser().getDefaultMaterial()),this.materialNode&&this.materialNode._transparent.addInterest("set_transparent__",this),ql(d.TwoSidedMaterial,this.materialNode)&&this.set_backMaterial__()},set_backMaterial__(){this.backMaterialNode&&this.backMaterialNode._transparent.removeInterest("set_transparent__",this),this.backMaterialNode=ql(d.X3DOneSidedMaterialNode,this._backMaterial),this.backMaterialNode&&this.backMaterialNode._transparent.addInterest("set_transparent__",this),!this.backMaterialNode&&ql(d.TwoSidedMaterial,this.materialNode)&&(this.backMaterialNode=this.materialNode)},set_texture__(){this.textureNode&&(this.textureNode.removeInterest("updateTextureBits",this),this.textureNode._transparent.removeInterest("set_transparent__",this)),this.textureNode=ql(d.X3DTextureNode,this._texture),this.textureNode?(this.textureNode.addInterest("updateTextureBits",this),this.textureNode._transparent.addInterest("set_transparent__",this),this.updateTextureBits()):this.textureBits.clear()},set_textureTransform__(){this.textureTransformNode&&this.textureTransformNode.removeInterest("updateTextureTransformMapping",this),this.textureTransformNode=ql(d.X3DTextureTransformNode,this._textureTransform),this.textureTransformNode||(this.textureTransformNode=this.getBrowser().getDefaultTextureTransform()),this.textureTransformNode.addInterest("updateTextureTransformMapping",this),this.updateTextureTransformMapping()},updateTextureTransformMapping(){this.textureTransformMapping.clear(),this.textureTransformNode.getTextureTransformMapping(this.textureTransformMapping)},set_shaders__(){const e=this.shaderNodes;for(const t of e)t._isValid.removeInterest("set_shader__",this);e.length=0;for(const t of this._shaders){const i=ql(d.X3DShaderNode,t);i&&e.push(i)}for(const t of e)t._isValid.addInterest("set_shader__",this);this.set_shader__()},set_shader__:(()=>{function e(){return this.shaderNode}return function(){const t=this.shaderNodes;this.shaderNode&&this.shaderNode.deselect(),this.shaderNode=null;for(const e of t)if(e._isValid.getValue()){this.shaderNode=e;break}this.shaderNode?(this.shaderNode.select(),this.getShader=e,this.getBackShader=e):(delete this.getShader,delete this.getBackShader)}})(),set_blendMode__(){this.blendModeNode=ql(d.BlendMode,this._blendMode)},set_transparent__(){switch(this.alphaMode){case Cl.AUTO:this.setTransparent(!!(this.stylePropertiesNode[3]?.isTransparent()||this.materialNode?.isTransparent()||this.backMaterialNode?.isTransparent()||this.textureNode?.isTransparent()||this.blendModeNode));break;case Cl.OPAQUE:case Cl.MASK:this.setTransparent(!1);break;case Cl.BLEND:this.setTransparent(!0)}},traverse(e,t){this.textureNode&&this.textureNode.traverse(e,t)}}),Object.defineProperties(kw,{typeName:{value:"Appearance",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"appearance",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"acousticProperties",new Yn.SFNode),new X(d.inputOutput,"alphaMode",new Yn.SFString("AUTO")),new X(d.inputOutput,"alphaCutoff",new Yn.SFFloat(.5)),new X(d.inputOutput,"pointProperties",new Yn.SFNode),new X(d.inputOutput,"lineProperties",new Yn.SFNode),new X(d.inputOutput,"fillProperties",new Yn.SFNode),new X(d.inputOutput,"material",new Yn.SFNode),new X(d.inputOutput,"backMaterial",new Yn.SFNode),new X(d.inputOutput,"texture",new Yn.SFNode),new X(d.inputOutput,"textureTransform",new Yn.SFNode),new X(d.inputOutput,"shaders",new Yn.MFNode),new X(d.inputOutput,"blendMode",new Yn.SFNode)]),enumerable:!0}});const jw=kw;i.add("Appearance","x_ite/Components/Shape/Appearance",jw);const zw=jw;function Gw(e){kl.call(this,e),this.addType(d.FillProperties),this.addChildObjects(d.outputOnly,"transparent",new Yn.SFBool),this.hatchColor=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Gw.prototype,kl.prototype),{initialize(){kl.prototype.initialize.call(this),this._filled.addInterest("set_filled__",this),this._hatched.addInterest("set_hatched__",this),this._hatchColor.addInterest("set_hatchColor__",this),this._hatchStyle.addInterest("set_hatchStyle__",this),this.set_filled__(),this.set_hatched__(),this.set_hatchColor__(),this.set_hatchStyle__(),this.getBrowser().getHatchStyleTexture(this.hatchStyle)},getStyleKey(){return this.hatched?2:1},set_filled__(){this.filled=this._filled.getValue(),this.setTransparent(!this.filled)},set_hatched__(){this.hatched=this._hatched.getValue()},set_hatchColor__(){this.hatchColor[0]=this._hatchColor[0],this.hatchColor[1]=this._hatchColor[1],this.hatchColor[2]=this._hatchColor[2]},set_hatchStyle__(){let e=this._hatchStyle.getValue();(e<1||e>19)&&(e=1),this.hatchStyle=e},setTransparent(e){e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()},setShaderUniforms(e,t){const i=this.hatched;if(e.uniform1i(t.x3d_FillPropertiesFilled,this.filled),e.uniform1i(t.x3d_FillPropertiesHatched,i),i){const i=this.getBrowser(),n=i.getHatchStyleTexture(this.hatchStyle),s=i.getTexture2DUnit();e.uniform3fv(t.x3d_FillPropertiesHatchColor,this.hatchColor),e.uniform1f(t.x3d_FillPropertiesScale,i.getRenderingProperty("ContentScale")),e.activeTexture(e.TEXTURE0+s),e.bindTexture(e.TEXTURE_2D,n.getTexture()),e.uniform1i(t.x3d_FillPropertiesTexture,s)}}}),Object.defineProperties(Gw,{typeName:{value:"FillProperties",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"fillProperties",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"filled",new Yn.SFBool(!0)),new X(d.inputOutput,"hatched",new Yn.SFBool(!0)),new X(d.inputOutput,"hatchStyle",new Yn.SFInt32(1)),new X(d.inputOutput,"hatchColor",new Yn.SFColor(1,1,1))]),enumerable:!0}});const Hw=Gw;i.add("FillProperties","x_ite/Components/Shape/FillProperties",Hw);const qw=Hw;function Yw(e){kl.call(this,e),this.addType(d.LineProperties)}Object.assign(Object.setPrototypeOf(Yw.prototype,kl.prototype),{initialize(){kl.prototype.initialize.call(this);this.getBrowser().getRenderingProperties()._ContentScale.addInterest("set_linewidthScaleFactor__",this),this._applied.addInterest("set_applied__",this),this._linetype.addInterest("set_linetype__",this),this._linewidthScaleFactor.addInterest("set_linewidthScaleFactor__",this),this.set_applied__(),this.set_linetype__(),this.set_linewidthScaleFactor__(),this.getBrowser().getLinetypeTexture()},getStyleKey(){return this.applied?2:1},getApplied(){return this.applied},getLinetype(){return this.linetype},getLinewidthScaleFactor(){return this.linewidthScaleFactor},getTransformLines(){return this.transformLines},set_applied__(){this.applied=this._applied.getValue()},set_linetype__(){let e=this._linetype.getValue();(e<1||e>16)&&(e=1),this.linetype=e},set_linewidthScaleFactor__(){const e=this.getBrowser(),t=e.getContext(),i=e.getRenderingProperty("ContentScale");this.linewidthScaleFactor=Math.max(1,this._linewidthScaleFactor.getValue())*i,this.transformLines=t.HAS_FEATURE_TRANSFORMED_LINES&&this.linewidthScaleFactor>1},setShaderUniforms(e,t){const i=this.getBrowser();if(this.applied){const n=i.getTexture2DUnit();e.lineWidth(this.linewidthScaleFactor),e.uniform1i(t.x3d_LinePropertiesLinetype,this.linetype),e.uniform1f(t.x3d_LineStippleScale,i.getLineStippleScale()),e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,i.getLinetypeTexture().getTexture()),e.uniform1i(t.x3d_LinePropertiesTexture,n)}else e.lineWidth(i.getRenderingProperty("ContentScale")),e.uniform1i(t.x3d_LinePropertiesLinetype,16),e.uniform1f(t.x3d_LineStippleScale,1)}}),Object.defineProperties(Yw,{typeName:{value:"LineProperties",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"lineProperties",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"applied",new Yn.SFBool(!0)),new X(d.inputOutput,"linetype",new Yn.SFInt32(1)),new X(d.inputOutput,"linewidthScaleFactor",new Yn.SFFloat)]),enumerable:!0}});const Ww=Yw;i.add("LineProperties","x_ite/Components/Shape/LineProperties",Ww);const $w=Ww;function Jw(e){kl.call(this,e),this.addType(d.X3DMaterialNode),this.addChildObjects(d.outputOnly,"transparent",new Yn.SFBool),this.textureBits=new Rl,this.shaderNodes=this.getBrowser().getShaders()}Object.assign(Object.setPrototypeOf(Jw.prototype,kl.prototype),{setTransparent(e){e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()},getBaseTexture:()=>null,setTexture(e,t){const i=t?t.getTextureType()-1:0;this.textureBits.set(2*e+0,1&i),this.textureBits.set(2*e+1,2&i)},getTextureBits(){return this.textureBits},getShader(e,t){let i="";if(i+=this.textureBits.toString(4),i+=".",i+=e.geometryKey,t){const{renderObject:n,transparent:s,shadows:r,fogNode:o,shapeNode:a,appearanceNode:l,textureNode:u,humanoidNode:h,objectsCount:d}=t;i+=l.getNormalizedAlphaMode(s),i+=this.getMaterialKey(r),i+=n.getLogarithmicDepthBuffer()?1:0,i+=r?1:0,i+=o?.getFogType()??0,i+=a.getShapeKey(),i+=l.getStyleProperties(e.geometryType)?.getStyleKey()??0,i+=l.getTextureTransformMapping().size||1,i+=e.textureCoordinateMapping.size||1,i+=h?1:0,i+=".",i+=d[0],i+=".",i+=d[1],i+=".",i+=d[2],i+=".",i+=u?1:l.getTextureBits().toString(4)}else{const{textureNode:t,objectsCount:n}=e;i+=e.alphaMode,i+=this.getMaterialKey(!1),i+="00000110",i+=".",i+=n[0],i+=".",i+=n[1],i+=".",i+=n[2],i+=".",i+=t?1:0}return this.shaderNodes.get(i)??this.createShader(i,e,t)},getShaderOptions(e,t){const i=this.getBrowser(),n=[];if(n.push(`X3D_GEOMETRY_${e.geometryType}D`),e.hasFogCoords&&n.push("X3D_FOG_COORDS"),e.colorMaterial&&n.push("X3D_COLOR_MATERIAL"),e.hasNormals&&n.push("X3D_NORMALS"),t){const{renderObject:s,fogNode:r,shapeNode:o,appearanceNode:a,humanoidNode:l,objectsCount:u}=t;switch(s.getLogarithmicDepthBuffer()&&n.push("X3D_LOGARITHMIC_DEPTH_BUFFER"),a.getNormalizedAlphaMode(t.transparent)){case Cl.OPAQUE:n.push("X3D_ALPHA_MODE_OPAQUE");break;case Cl.MASK:n.push("X3D_ALPHA_MODE_MASK");break;case Cl.BLEND:n.push("X3D_ALPHA_MODE_BLEND"),i.getBrowserOption("OrderIndependentTransparency")&&n.push("X3D_ORDER_INDEPENDENT_TRANSPARENCY")}switch(t.shadows&&n.push("X3D_SHADOWS","X3D_PCF_FILTERING"),r?.getFogType()){case 1:n.push("X3D_FOG","X3D_FOG_LINEAR");break;case 2:n.push("X3D_FOG","X3D_FOG_EXPONENTIAL")}if(l&&n.push("X3D_SKINNING"),u[0]&&(n.push("X3D_CLIP_PLANES"),n.push(`X3D_NUM_CLIP_PLANES ${Math.min(u[0],i.getMaxClipPlanes())}`)),u[1]&&(n.push("X3D_LIGHTING"),n.push(`X3D_NUM_LIGHTS ${Math.min(u[1],i.getMaxLights())}`)),u[2]&&(n.push("X3D_PROJECTIVE_TEXTURE_MAPPING"),n.push(`X3D_NUM_TEXTURE_PROJECTORS ${Math.min(u[2],i.getMaxTextures())}`)),a.getStyleProperties(e.geometryType)&&(n.push("X3D_STYLE_PROPERTIES"),a.getStyleProperties(e.geometryType).getStyleKey()>1&&n.push("X3D_STYLE_PROPERTIES_TEXTURE")),+this.textureBits&&n.push("X3D_MATERIAL_TEXTURES"),t.textureNode)n.push("X3D_TEXTURE","X3D_NUM_TEXTURES 1","X3D_NUM_TEXTURE_TRANSFORMS 1","X3D_NUM_TEXTURE_COORDINATES 1","X3D_TEXTURE0_2D");else{if(+a.getTextureBits()&&!this.getBaseTexture()){const e=a.getTexture();n.push("X3D_TEXTURE"),n.push(`X3D_NUM_TEXTURES ${e.getCount()}`),e.getType().includes(d.MultiTexture)&&n.push("X3D_MULTI_TEXTURING"),e.getShaderOptions(n)}n.push(`X3D_NUM_TEXTURE_TRANSFORMS ${a.getTextureTransformMapping().size||1}`),n.push(`X3D_NUM_TEXTURE_COORDINATES ${e.textureCoordinateMapping.size||1}`)}switch(o.getShapeKey()){case 1:n.push("X3D_PARTICLE_SYSTEM");break;case 2:n.push("X3D_PARTICLE_SYSTEM","X3D_TEX_COORD_RAMP")}}else{const{alphaMode:t,textureNode:s,objectsCount:r}=e;switch(t){case Cl.OPAQUE:n.push("X3D_ALPHA_MODE_OPAQUE");break;case Cl.MASK:n.push("X3D_ALPHA_MODE_MASK");break;case Cl.BLEND:n.push("X3D_ALPHA_MODE_BLEND"),i.getBrowserOption("OrderIndependentTransparency")&&n.push("X3D_ORDER_INDEPENDENT_TRANSPARENCY")}r[0]&&(n.push("X3D_CLIP_PLANES"),n.push(`X3D_NUM_CLIP_PLANES ${Math.min(r[0],i.getMaxClipPlanes())}`)),r[1]&&(n.push("X3D_LIGHTING"),n.push(`X3D_NUM_LIGHTS ${Math.min(r[1],i.getMaxLights())}`)),r[2]&&(n.push("X3D_PROJECTIVE_TEXTURE_MAPPING"),n.push(`X3D_NUM_TEXTURE_PROJECTORS ${Math.min(r[2],i.getMaxTextures())}`)),s&&n.push("X3D_TEXTURE","X3D_NUM_TEXTURES 1","X3D_NUM_TEXTURE_TRANSFORMS 1","X3D_NUM_TEXTURE_COORDINATES 1","X3D_TEXTURE0_2D")}return n}}),Object.defineProperties(Jw,{typeName:{value:"X3DMaterialNode",enumerable:!0},componentName:{value:"Shape",enumerable:!0}});const Kw=Jw;i.add("X3DMaterialNode","x_ite/Components/Shape/X3DMaterialNode",Kw);const Zw=Kw;function Qw(e){Zw.call(this,e),this.addType(d.X3DOneSidedMaterialNode),this.emissiveColor=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Qw.prototype,Zw.prototype),{initialize(){Zw.prototype.initialize.call(this),this._emissiveColor.addInterest("set_emissiveColor__",this),this._emissiveTexture.addInterest("set_emissiveTexture__",this),this._normalTexture.addInterest("set_normalTexture__",this),this._transparency.addInterest("set_transparency__",this),this._transparency.addInterest("set_transparent__",this),this.set_emissiveColor__(),this.set_emissiveTexture__(),this.set_normalTexture__(),this.set_transparency__()},set_emissiveColor__(){const e=this.emissiveColor,t=this._emissiveColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_emissiveTexture__(){this.emissiveTextureNode=ql(d.X3DSingleTextureNode,this._emissiveTexture),this.setTexture(this.getTextureIndices().EMISSIVE_TEXTURE,this.emissiveTextureNode)},set_normalTexture__(){this.normalTextureNode=ql(d.X3DSingleTextureNode,this._normalTexture),this.setTexture(this.getTextureIndices().NORMAL_TEXTURE,this.normalTextureNode)},set_transparency__(){this.transparency=g.clamp(this._transparency.getValue(),0,1)},set_transparent__(){this.setTransparent(!!this.transparency)},getBaseTexture(){return this.getEmissiveTexture()},getEmissiveTexture(){return this.emissiveTextureNode},getNormalTexture(){return this.normalTextureNode},getTransparency(){return this.transparency},getTextureIndices:(()=>{let e=0;const t={EMISSIVE_TEXTURE:e++,NORMAL_TEXTURE:e++};return function(){return t}})(),getShaderOptions(e,t){const i=Zw.prototype.getShaderOptions.call(this,e,t);return+this.getTextureBits()&&(this.getEmissiveTexture()&&i.push("X3D_EMISSIVE_TEXTURE",`X3D_EMISSIVE_TEXTURE_${this.getEmissiveTexture().getTextureTypeString()}`),this.getNormalTexture()&&i.push("X3D_NORMAL_TEXTURE",`X3D_NORMAL_TEXTURE_${this.getNormalTexture().getTextureTypeString()}`)),i},setShaderUniforms(e,t,i,n,s){if(e.uniform3fv(t.x3d_EmissiveColor,this.emissiveColor),e.uniform1f(t.x3d_Transparency,this.transparency),+this.getTextureBits()){if(this.emissiveTextureNode){const r=this._emissiveTextureMapping.getValue(),o=t.x3d_EmissiveTexture;this.emissiveTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}if(this.normalTextureNode){const r=this._normalTextureMapping.getValue(),o=t.x3d_NormalTexture;e.uniform1f(t.x3d_NormalScale,Math.max(this._normalScale.getValue(),0)),this.normalTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}}}}),Object.defineProperties(Qw,{typeName:{value:"X3DOneSidedMaterialNode",enumerable:!0},componentName:{value:"Shape",enumerable:!0}});const eb=Qw;i.add("X3DOneSidedMaterialNode","x_ite/Components/Shape/X3DOneSidedMaterialNode",eb);const tb=eb;function ib(e){tb.call(this,e),this.addType(d.Material),e.getSpecificationVersion()<=3.3&&(this.getMaterialKey=nb),this.diffuseColor=new Float32Array(3),this.specularColor=new Float32Array(3)}function nb(e){return e||+this.getTextureBits()||this.getBrowser().getBrowserOptions().getShading()===bl.PHONG?"2":"1"}Object.assign(Object.setPrototypeOf(ib.prototype,tb.prototype),{initialize(){tb.prototype.initialize.call(this),this._ambientIntensity.addInterest("set_ambientIntensity__",this),this._ambientTexture.addInterest("set_ambientTexture__",this),this._diffuseColor.addInterest("set_diffuseColor__",this),this._diffuseTexture.addInterest("set_diffuseTexture__",this),this._specularColor.addInterest("set_specularColor__",this),this._specularTexture.addInterest("set_specularTexture__",this),this._shininess.addInterest("set_shininess__",this),this._shininessTexture.addInterest("set_shininessTexture__",this),this._occlusionStrength.addInterest("set_occlusionStrength__",this),this._occlusionTexture.addInterest("set_occlusionTexture__",this),this.set_ambientIntensity__(),this.set_ambientTexture__(),this.set_diffuseColor__(),this.set_diffuseTexture__(),this.set_specularColor__(),this.set_specularTexture__(),this.set_shininess__(),this.set_shininessTexture__(),this.set_occlusionStrength__(),this.set_occlusionTexture__(),this.set_transparent__()},set_ambientIntensity__(){this.ambientIntensity=g.clamp(this._ambientIntensity.getValue(),0,1)},set_ambientTexture__(){this.ambientTextureNode=ql(d.X3DSingleTextureNode,this._ambientTexture),this.setTexture(this.getTextureIndices().AMBIENT_TEXTURE,this.ambientTextureNode)},set_diffuseColor__(){const e=this.diffuseColor,t=this._diffuseColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_diffuseTexture__(){this.diffuseTextureNode&&this.diffuseTextureNode._transparent.removeInterest("set_transparent__",this),this.diffuseTextureNode=ql(d.X3DSingleTextureNode,this._diffuseTexture),this.diffuseTextureNode&&this.diffuseTextureNode._transparent.addInterest("set_transparent__",this),this.setTexture(this.getTextureIndices().DIFFUSE_TEXTURE,this.diffuseTextureNode)},set_specularColor__(){const e=this.specularColor,t=this._specularColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_specularTexture__(){this.specularTextureNode=ql(d.X3DSingleTextureNode,this._specularTexture),this.setTexture(this.getTextureIndices().SPECULAR_TEXTURE,this.specularTextureNode)},set_shininess__(){this.shininess=g.clamp(this._shininess.getValue(),0,1)},set_shininessTexture__(){this.shininessTextureNode=ql(d.X3DSingleTextureNode,this._shininessTexture),this.setTexture(this.getTextureIndices().SHININESS_TEXTURE,this.shininessTextureNode)},set_occlusionStrength__(){this.occlusionStrength=g.clamp(this._occlusionStrength.getValue(),0,1)},set_occlusionTexture__(){this.occlusionTextureNode=ql(d.X3DSingleTextureNode,this._occlusionTexture),this.setTexture(this.getTextureIndices().OCCLUSION_TEXTURE,this.occlusionTextureNode)},set_transparent__(){this.setTransparent(!(!this.getTransparency()&&!this.diffuseTextureNode?.isTransparent()))},getBaseTexture(){return this.diffuseTexture},getTextureIndices:(()=>{let e=0;const t={EMISSIVE_TEXTURE:e++,NORMAL_TEXTURE:e++,AMBIENT_TEXTURE:e++,DIFFUSE_TEXTURE:e++,SPECULAR_TEXTURE:e++,SHININESS_TEXTURE:e++,OCCLUSION_TEXTURE:e++};return function(){return t}})(),getMaterialKey:()=>"2",createShader(e,t,i){const n=this.getBrowser(),s=this.getShaderOptions(t,i);if(t.hasNormals)switch(s.push("X3D_MATERIAL"),+this.getTextureBits()&&(this.ambientTextureNode&&s.push("X3D_AMBIENT_TEXTURE",`X3D_AMBIENT_TEXTURE_${this.ambientTextureNode.getTextureTypeString()}`),this.diffuseTextureNode&&s.push("X3D_DIFFUSE_TEXTURE",`X3D_DIFFUSE_TEXTURE_${this.diffuseTextureNode.getTextureTypeString()}`),this.specularTextureNode&&s.push("X3D_SPECULAR_TEXTURE",`X3D_SPECULAR_TEXTURE_${this.specularTextureNode.getTextureTypeString()}`),this.shininessTextureNode&&s.push("X3D_SHININESS_TEXTURE",`X3D_SHININESS_TEXTURE_${this.shininessTextureNode.getTextureTypeString()}`),this.occlusionTextureNode&&s.push("X3D_OCCLUSION_TEXTURE",`X3D_OCCLUSION_TEXTURE_${this.occlusionTextureNode.getTextureTypeString()}`)),this.getMaterialKey(i&&i.shadows)){case"1":var r=n.createShader("GouraudShader","Gouraud","Gouraud",s);break;case"2":r=n.createShader("PhongShader","Default","Phong",s)}else{s.push("X3D_UNLIT_MATERIAL");r=n.createShader("UnlitShader","Default","Unlit",s);n.getShaders().set(e.replace(/^(\d{1,2})\d*/,"$1").replace(/\d$/,"0"),r)}return n.getShaders().set(e,r),r},setShaderUniforms(e,t,i,n,s){if(tb.prototype.setShaderUniforms.call(this,e,t,i,n,s),e.uniform1f(t.x3d_AmbientIntensity,this.ambientIntensity),e.uniform3fv(t.x3d_DiffuseColor,this.diffuseColor),e.uniform3fv(t.x3d_SpecularColor,this.specularColor),e.uniform1f(t.x3d_Shininess,this.shininess),+this.getTextureBits()){if(this.ambientTextureNode){const r=this._ambientTextureMapping.getValue(),o=t.x3d_AmbientTexture;this.ambientTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}if(this.diffuseTextureNode){const r=this._diffuseTextureMapping.getValue(),o=t.x3d_DiffuseTexture;this.diffuseTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}if(this.specularTextureNode){const r=this._specularTextureMapping.getValue(),o=t.x3d_SpecularTexture;this.specularTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}if(this.shininessTextureNode){const r=this._shininessTextureMapping.getValue(),o=t.x3d_ShininessTexture;this.shininessTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}if(this.occlusionTextureNode){const r=this._occlusionTextureMapping.getValue(),o=t.x3d_OcclusionTexture;e.uniform1f(t.x3d_OcclusionStrength,this.occlusionStrength),this.occlusionTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}}}}),Object.defineProperties(ib,{typeName:{value:"Material",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"material",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"ambientIntensity",new Yn.SFFloat(.2)),new X(d.inputOutput,"ambientTextureMapping",new Yn.SFString),new X(d.inputOutput,"ambientTexture",new Yn.SFNode),new X(d.inputOutput,"diffuseColor",new Yn.SFColor(.8,.8,.8)),new X(d.inputOutput,"diffuseTextureMapping",new Yn.SFString),new X(d.inputOutput,"diffuseTexture",new Yn.SFNode),new X(d.inputOutput,"specularColor",new Yn.SFColor),new X(d.inputOutput,"specularTextureMapping",new Yn.SFString),new X(d.inputOutput,"specularTexture",new Yn.SFNode),new X(d.inputOutput,"emissiveColor",new Yn.SFColor),new X(d.inputOutput,"emissiveTextureMapping",new Yn.SFString),new X(d.inputOutput,"emissiveTexture",new Yn.SFNode),new X(d.inputOutput,"shininess",new Yn.SFFloat(.2)),new X(d.inputOutput,"shininessTextureMapping",new Yn.SFString),new X(d.inputOutput,"shininessTexture",new Yn.SFNode),new X(d.inputOutput,"occlusionStrength",new Yn.SFFloat(1)),new X(d.inputOutput,"occlusionTextureMapping",new Yn.SFString),new X(d.inputOutput,"occlusionTexture",new Yn.SFNode),new X(d.inputOutput,"normalScale",new Yn.SFFloat(1)),new X(d.inputOutput,"normalTextureMapping",new Yn.SFString),new X(d.inputOutput,"normalTexture",new Yn.SFNode),new X(d.inputOutput,"transparency",new Yn.SFFloat)]),enumerable:!0}});const sb=ib;i.add("Material","x_ite/Components/Shape/Material",sb);const rb=sb;function ob(e){tb.call(this,e),this.addType(d.PhysicalMaterial),this.baseColor=new Float32Array(3)}Object.assign(Object.setPrototypeOf(ob.prototype,tb.prototype),{initialize(){tb.prototype.initialize.call(this),this._baseColor.addInterest("set_baseColor__",this),this._baseTexture.addInterest("set_baseTexture__",this),this._metallic.addInterest("set_metallic__",this),this._roughness.addInterest("set_roughness__",this),this._metallicRoughnessTexture.addInterest("set_metallicRoughnessTexture__",this),this._occlusionStrength.addInterest("set_occlusionStrength__",this),this._occlusionTexture.addInterest("set_occlusionTexture__",this),this.set_baseColor__(),this.set_baseTexture__(),this.set_metallic__(),this.set_roughness__(),this.set_metallicRoughnessTexture__(),this.set_occlusionStrength__(),this.set_occlusionTexture__(),this.set_transparent__()},set_baseColor__(){const e=this.baseColor,t=this._baseColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_baseTexture__(){this.baseTextureNode&&this.baseTextureNode._transparent.removeInterest("set_transparent__",this),this.baseTextureNode=ql(d.X3DSingleTextureNode,this._baseTexture),this.setTexture(this.getTextureIndices().BASE_TEXTURE,this.baseTextureNode),this.baseTextureNode&&this.baseTextureNode._transparent.addInterest("set_transparent__",this)},set_metallic__(){this.metallic=g.clamp(this._metallic.getValue(),0,1)},set_roughness__(){this.roughness=g.clamp(this._roughness.getValue(),0,1)},set_metallicRoughnessTexture__(){this.metallicRoughnessTextureNode=ql(d.X3DSingleTextureNode,this._metallicRoughnessTexture),this.setTexture(this.getTextureIndices().METALLIC_ROUGHNESS_TEXTURE,this.metallicRoughnessTextureNode)},set_occlusionStrength__(){this.occlusionStrength=g.clamp(this._occlusionStrength.getValue(),0,1)},set_occlusionTexture__(){this.occlusionTextureNode=ql(d.X3DSingleTextureNode,this._occlusionTexture),this.setTexture(this.getTextureIndices().OCCLUSION_TEXTURE,this.occlusionTextureNode)},set_transparent__(){this.setTransparent(!(!this.getTransparency()&&!this.baseTextureNode?.isTransparent()))},getBaseTexture(){return this.baseTextureNode},getTextureIndices:(()=>{let e=0;const t={EMISSIVE_TEXTURE:e++,NORMAL_TEXTURE:e++,BASE_TEXTURE:e++,METALLIC_ROUGHNESS_TEXTURE:e++,OCCLUSION_TEXTURE:e++};return function(){return t}})(),getMaterialKey:()=>"3",createShader(e,t,i){const n=this.getBrowser(),s=this.getShaderOptions(t,i);if(t.hasNormals){s.push("X3D_PHYSICAL_MATERIAL","MANUAL_SRGB"),+this.getTextureBits()&&(this.baseTextureNode&&s.push("X3D_BASE_TEXTURE",`X3D_BASE_TEXTURE_${this.baseTextureNode.getTextureTypeString()}`),this.metallicRoughnessTextureNode&&s.push("X3D_METALLIC_ROUGHNESS_TEXTURE",`X3D_METALLIC_ROUGHNESS_TEXTURE_${this.metallicRoughnessTextureNode.getTextureTypeString()}`),this.occlusionTextureNode&&s.push("X3D_OCCLUSION_TEXTURE",`X3D_OCCLUSION_TEXTURE_${this.occlusionTextureNode.getTextureTypeString()}`));var r=n.createShader("PBRShader","Default","PBR",s)}else{s.push("X3D_UNLIT_MATERIAL");r=n.createShader("UnlitShader","Default","Unlit",s);n.getShaders().set(e.replace(/^(\d{1,2})\d*/,"$1").replace(/\d$/,"0"),r)}return n.getShaders().set(e,r),r},setShaderUniforms(e,t,i,n,s){if(tb.prototype.setShaderUniforms.call(this,e,t,i,n,s),e.uniform3fv(t.x3d_BaseColor,this.baseColor),e.uniform1f(t.x3d_Metallic,this.metallic),e.uniform1f(t.x3d_Roughness,this.roughness),+this.getTextureBits()){if(this.baseTextureNode){const r=this._baseTextureMapping.getValue(),o=t.x3d_BaseTexture;this.baseTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}if(this.metallicRoughnessTextureNode){const r=this._metallicRoughnessTextureMapping.getValue(),o=t.x3d_MetallicRoughnessTexture;this.metallicRoughnessTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}if(this.occlusionTextureNode){const r=this._occlusionTextureMapping.getValue(),o=t.x3d_OcclusionTexture;e.uniform1f(t.x3d_OcclusionStrength,this.occlusionStrength),this.occlusionTextureNode.setShaderUniforms(e,t,i,o),e.uniform1i(o.textureTransformMapping,n.get(r)??0),e.uniform1i(o.textureCoordinateMapping,s.get(r)??0)}}}}),Object.defineProperties(ob,{typeName:{value:"PhysicalMaterial",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"material",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"baseColor",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"baseTextureMapping",new Yn.SFString),new X(d.inputOutput,"baseTexture",new Yn.SFNode),new X(d.inputOutput,"emissiveColor",new Yn.SFColor),new X(d.inputOutput,"emissiveTextureMapping",new Yn.SFString),new X(d.inputOutput,"emissiveTexture",new Yn.SFNode),new X(d.inputOutput,"metallic",new Yn.SFFloat(1)),new X(d.inputOutput,"roughness",new Yn.SFFloat(1)),new X(d.inputOutput,"metallicRoughnessTextureMapping",new Yn.SFString),new X(d.inputOutput,"metallicRoughnessTexture",new Yn.SFNode),new X(d.inputOutput,"occlusionStrength",new Yn.SFFloat(1)),new X(d.inputOutput,"occlusionTextureMapping",new Yn.SFString),new X(d.inputOutput,"occlusionTexture",new Yn.SFNode),new X(d.inputOutput,"normalScale",new Yn.SFFloat(1)),new X(d.inputOutput,"normalTextureMapping",new Yn.SFString),new X(d.inputOutput,"normalTexture",new Yn.SFNode),new X(d.inputOutput,"transparency",new Yn.SFFloat)]),enumerable:!0}});const ab=ob;i.add("PhysicalMaterial","x_ite/Components/Shape/PhysicalMaterial",ab);const lb=ab;function ub(e){kl.call(this,e),this.addType(d.PointProperties),this.attenuation=new Float32Array(3)}Object.assign(Object.setPrototypeOf(ub.prototype,kl.prototype),{initialize(){kl.prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();this.pointSizeRange=t.getParameter(t.ALIASED_POINT_SIZE_RANGE),e.getRenderingProperties()._ContentScale.addInterest("set_contentScale__",this),this._pointSizeScaleFactor.addInterest("set_pointSizeScaleFactor__",this),this._pointSizeMinValue.addInterest("set_pointSizeMinValue__",this),this._pointSizeMaxValue.addInterest("set_pointSizeMaxValue__",this),this._attenuation.addInterest("set_attenuation__",this),this.set_pointSizeScaleFactor__(),this.set_pointSizeMinValue__(),this.set_pointSizeMaxValue__(),this.set_attenuation__()},getStyleKey:()=>1,set_contentScale__(){this.set_pointSizeScaleFactor__(),this.set_pointSizeMinValue__(),this.set_pointSizeMaxValue__()},set_pointSizeScaleFactor__(){const e=this.getBrowser().getRenderingProperty("ContentScale");this.pointSizeScaleFactor=Math.max(this._pointSizeScaleFactor.getValue(),0)*e},set_pointSizeMinValue__(){const e=this.getBrowser().getRenderingProperty("ContentScale");this.pointSizeMinValue=g.clamp(this._pointSizeMinValue.getValue(),0,this.pointSizeRange[1])*e},set_pointSizeMaxValue__(){const e=this.getBrowser().getRenderingProperty("ContentScale");this.pointSizeMaxValue=g.clamp(this._pointSizeMaxValue.getValue(),0,this.pointSizeRange[1])*e},set_attenuation__(){const e=this._attenuation.length;this.attenuation[0]=e>0?Math.max(0,this._attenuation[0]):1,this.attenuation[1]=e>1?Math.max(0,this._attenuation[1]):0,this.attenuation[2]=e>2?Math.max(0,this._attenuation[2]):0},setShaderUniforms(e,t){e.uniform1f(t.x3d_PointPropertiesPointSizeScaleFactor,this.pointSizeScaleFactor),e.uniform1f(t.x3d_PointPropertiesPointSizeMinValue,this.pointSizeMinValue),e.uniform1f(t.x3d_PointPropertiesPointSizeMaxValue,this.pointSizeMaxValue),e.uniform3fv(t.x3d_PointPropertiesAttenuation,this.attenuation)}}),Object.defineProperties(ub,{typeName:{value:"PointProperties",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"pointProperties",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"pointSizeScaleFactor",new Yn.SFFloat(1)),new X(d.inputOutput,"pointSizeMinValue",new Yn.SFFloat(1)),new X(d.inputOutput,"pointSizeMaxValue",new Yn.SFFloat(1)),new X(d.inputOutput,"attenuation",new Yn.MFFloat(1,0,0))]),enumerable:!0}});const hb=ub;i.add("PointProperties","x_ite/Components/Shape/PointProperties",hb);const db=hb;function cb(e){Hs.call(this,e),ju.call(this,e),this.addType(d.X3DShapeNode),this.bbox=new Ua,this.bboxSize=new bt(0,0,0),this.bboxCenter=new bt(0,0,0)}Object.assign(Object.setPrototypeOf(cb.prototype,Hs.prototype),ju.prototype,{initialize(){Hs.prototype.initialize.call(this),ju.prototype.initialize.call(this),this._bboxSize.addInterest("set_bbox__",this),this._bboxCenter.addInterest("set_bbox__",this),this._appearance.addInterest("set_appearance__",this),this._geometry.addInterest("set_geometry__",this),this._appearance.addInterest("set_transparent__",this),this._geometry.addInterest("set_transparent__",this),this.set_appearance__(),this.set_geometry__(),this.set_transparent__()},getBBox(e,t){return t?this._castShadow.getValue()?e.assign(this.bbox):e.set():e.assign(this.bbox)},getBBoxSize(){return this.bboxSize},getBBoxCenter(){return this.bboxCenter},setTransparent(e){this.transparent=e},isTransparent(){return this.transparent},getAppearance(){return this.appearanceNode},getGeometry(){return this.geometryNode},set_bbox__(){this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?this.getGeometry()?this.bbox.assign(this.getGeometry().getBBox()):this.bbox.set():this.bbox.set(this._bboxSize.getValue(),this._bboxCenter.getValue()),this.bboxSize.assign(this.bbox.size),this.bboxCenter.assign(this.bbox.center)},set_appearance__(){this.appearanceNode&&this.appearanceNode._transparent.removeInterest("set_transparent__",this),this.appearanceNode=ql(d.X3DAppearanceNode,this._appearance),this.appearanceNode?(this.appearanceNode._alphaMode.addInterest("set_transparent__",this),this.appearanceNode._transparent.addInterest("set_transparent__",this)):this.appearanceNode=this.getBrowser().getDefaultAppearance()},set_geometry__(){this.geometryNode&&(this.geometryNode._transparent.addInterest("set_transparent__",this),this.geometryNode._bbox_changed.addInterest("set_bbox__",this)),this.geometryNode=ql(d.X3DGeometryNode,this._geometry),this.geometryNode&&(this.geometryNode._transparent.addInterest("set_transparent__",this),this.geometryNode._bbox_changed.addInterest("set_bbox__",this)),this.set_bbox__()},set_transparent__(){this.appearanceNode.getAlphaMode()===Cl.AUTO?this.transparent=!(!this.appearanceNode.isTransparent()&&!this.geometryNode?.isTransparent()):this.transparent=this.appearanceNode.isTransparent()},dispose(){ju.prototype.dispose.call(this),Hs.prototype.dispose.call(this)}}),Object.defineProperties(cb,{typeName:{value:"X3DShapeNode",enumerable:!0},componentName:{value:"Shape",enumerable:!0}});const pb=cb;i.add("X3DShapeNode","x_ite/Components/Shape/X3DShapeNode",pb);const gb=pb;function fb(e){gb.call(this,e),this.addType(d.Shape)}Object.assign(Object.setPrototypeOf(fb.prototype,gb.prototype),{initialize(){gb.prototype.initialize.call(this),this._transformSensors_changed.addInterest("set_transformSensors__",this),this.set_transformSensors__()},getShapeKey:()=>0,getGeometryContext:gb.prototype.getGeometry,set_geometry__(){gb.prototype.set_geometry__.call(this),this.getGeometry()?delete this.traverse:this.traverse=Function.prototype},set_transformSensors__(){this.setPickableObject(this.getTransformSensors().size)},intersectsBox(e,t,i){return this.getGeometry().intersectsBox(e,t,i)},traverse(e,t){switch(e){case Ia.POINTER:t.addPointingShape(this);break;case Ia.PICKING:this.picking(t);break;case Ia.COLLISION:t.addCollisionShape(this);break;case Ia.SHADOW:this._castShadow.getValue()&&t.addShadowShape(this);break;case Ia.DISPLAY:t.addDisplayShape(this)&&this.getAppearance().traverse(e,t)}this.getGeometry().traverse(e,t)},picking(e){const t=e.getModelViewMatrix().get();if(this.getTransformSensors().size)for(const e of this.getTransformSensors())e.collect(t);const i=this.getBrowser(),n=i.getPickSensors(),s=i.getPickingHierarchy();s.push(this);for(const e of n.at(-1))e.collect(this.getGeometry(),t,s);s.pop()},displaySimple(e,t,i){this.getGeometry().displaySimple(e,t,i)},display(e,t){this.getGeometry().display(e,t)}}),Object.defineProperties(fb,{typeName:{value:"Shape",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"visible",new Yn.SFBool(!0)),new X(d.inputOutput,"castShadow",new Yn.SFBool(!0)),new X(d.inputOutput,"bboxDisplay",new Yn.SFBool),new X(d.initializeOnly,"bboxSize",new Yn.SFVec3f(-1,-1,-1)),new X(d.initializeOnly,"bboxCenter",new Yn.SFVec3f),new X(d.inputOutput,"appearance",new Yn.SFNode),new X(d.inputOutput,"geometry",new Yn.SFNode)]),enumerable:!0}});const mb=fb;i.add("Shape","x_ite/Components/Shape/Shape",mb);const _b=mb;function xb(e){console.warn("TwoSidedMaterial is depreciated, please use Appearance backMaterial field."),Zw.call(this,e),this.addType(d.TwoSidedMaterial),this.diffuseColor=new Float32Array(3),this.specularColor=new Float32Array(3),this.emissiveColor=new Float32Array(3),this.backDiffuseColor=new Float32Array(3),this.backSpecularColor=new Float32Array(3),this.backEmissiveColor=new Float32Array(3)}Object.assign(Object.setPrototypeOf(xb.prototype,Zw.prototype),{initialize(){Zw.prototype.initialize.call(this),this._ambientIntensity.addInterest("set_ambientIntensity__",this),this._diffuseColor.addInterest("set_diffuseColor__",this),this._specularColor.addInterest("set_specularColor__",this),this._emissiveColor.addInterest("set_emissiveColor__",this),this._shininess.addInterest("set_shininess__",this),this._transparency.addInterest("set_transparency__",this),this._backAmbientIntensity.addInterest("set_backAmbientIntensity__",this),this._backDiffuseColor.addInterest("set_backDiffuseColor__",this),this._backSpecularColor.addInterest("set_backSpecularColor__",this),this._backEmissiveColor.addInterest("set_backEmissiveColor__",this),this._backShininess.addInterest("set_backShininess__",this),this._backTransparency.addInterest("set_backTransparency__",this),this._separateBackColor.addInterest("set_transparent__",this),this._transparency.addInterest("set_transparent__",this),this._backTransparency.addInterest("set_transparent__",this),this.set_ambientIntensity__(),this.set_diffuseColor__(),this.set_specularColor__(),this.set_emissiveColor__(),this.set_shininess__(),this.set_transparency__(),this.set_backAmbientIntensity__(),this.set_backDiffuseColor__(),this.set_backSpecularColor__(),this.set_backEmissiveColor__(),this.set_backShininess__(),this.set_backTransparency__(),this.set_transparent__()},set_ambientIntensity__(){this.ambientIntensity=Math.max(this._ambientIntensity.getValue(),0)},set_diffuseColor__(){const e=this.diffuseColor,t=this._diffuseColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_specularColor__(){const e=this.specularColor,t=this._specularColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_emissiveColor__(){const e=this.emissiveColor,t=this._emissiveColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_shininess__(){this.shininess=g.clamp(this._shininess.getValue(),0,1)},set_transparency__(){this.transparency=g.clamp(this._transparency.getValue(),0,1)},set_backAmbientIntensity__(){this.backAmbientIntensity=Math.max(this._backAmbientIntensity.getValue(),0)},set_backDiffuseColor__(){const e=this.backDiffuseColor,t=this._backDiffuseColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_backSpecularColor__(){const e=this.backSpecularColor,t=this._backSpecularColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_backEmissiveColor__(){const e=this.backEmissiveColor,t=this._backEmissiveColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_backShininess__(){this.backShininess=g.clamp(this._backShininess.getValue(),0,1)},set_backTransparency__(){this.backTransparency=g.clamp(this._backTransparency.getValue(),0,1)},set_transparent__(){this.setTransparent(!!(this._transparency.getValue()||this._separateBackColor.getValue()&&this._backTransparency.getValue()))},getBaseTexture:rb.prototype.getBaseTexture,getMaterialKey:rb.prototype.getMaterialKey,createShader:rb.prototype.createShader,setShaderUniforms(e,t,i,n,s,r){!r&&this._separateBackColor.getValue()?(e.uniform1f(t.x3d_AmbientIntensity,this.backAmbientIntensity),e.uniform3fv(t.x3d_DiffuseColor,this.backDiffuseColor),e.uniform3fv(t.x3d_SpecularColor,this.backSpecularColor),e.uniform3fv(t.x3d_EmissiveColor,this.backEmissiveColor),e.uniform1f(t.x3d_Shininess,this.backShininess),e.uniform1f(t.x3d_Transparency,this.backTransparency)):(e.uniform1f(t.x3d_AmbientIntensity,this.ambientIntensity),e.uniform3fv(t.x3d_DiffuseColor,this.diffuseColor),e.uniform3fv(t.x3d_SpecularColor,this.specularColor),e.uniform3fv(t.x3d_EmissiveColor,this.emissiveColor),e.uniform1f(t.x3d_Shininess,this.shininess),e.uniform1f(t.x3d_Transparency,this.transparency))}}),Object.defineProperties(xb,{typeName:{value:"TwoSidedMaterial",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"material",enumerable:!0},specificationRange:{value:Object.freeze(["3.2","4.0"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"separateBackColor",new Yn.SFBool),new X(d.inputOutput,"ambientIntensity",new Yn.SFFloat(.2)),new X(d.inputOutput,"diffuseColor",new Yn.SFColor(.8,.8,.8)),new X(d.inputOutput,"specularColor",new Yn.SFColor),new X(d.inputOutput,"emissiveColor",new Yn.SFColor),new X(d.inputOutput,"shininess",new Yn.SFFloat(.2)),new X(d.inputOutput,"transparency",new Yn.SFFloat),new X(d.inputOutput,"backAmbientIntensity",new Yn.SFFloat(.2)),new X(d.inputOutput,"backDiffuseColor",new Yn.SFColor(.8,.8,.8)),new X(d.inputOutput,"backSpecularColor",new Yn.SFColor),new X(d.inputOutput,"backEmissiveColor",new Yn.SFColor),new X(d.inputOutput,"backShininess",new Yn.SFFloat(.2)),new X(d.inputOutput,"backTransparency",new Yn.SFFloat)]),enumerable:!0}});const yb=xb;i.add("TwoSidedMaterial","x_ite/Components/Shape/TwoSidedMaterial",yb);const wb=yb;function bb(e){tb.call(this,e),this.addType(d.UnlitMaterial)}Object.assign(Object.setPrototypeOf(bb.prototype,tb.prototype),{initialize(){tb.prototype.initialize.call(this),this.set_transparent__()},set_emissiveTexture__(){this.getEmissiveTexture()&&this.getEmissiveTexture()._transparent.removeInterest("set_transparent__",this),tb.prototype.set_emissiveTexture__.call(this),this.getEmissiveTexture()&&this.getEmissiveTexture()._transparent.addInterest("set_transparent__",this)},set_transparent__(){this.setTransparent(!(!this.getTransparency()&&!this.getEmissiveTexture()?.isTransparent()))},getMaterialKey:()=>"0",createShader(e,t,i){const n=this.getBrowser(),s=this.getShaderOptions(t,i);s.push("X3D_UNLIT_MATERIAL");const r=n.createShader("UnlitShader","Default","Unlit",s);return n.getShaders().set(e,r),r}}),Object.defineProperties(bb,{typeName:{value:"UnlitMaterial",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"material",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"emissiveColor",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"emissiveTextureMapping",new Yn.SFString),new X(d.inputOutput,"emissiveTexture",new Yn.SFNode),new X(d.inputOutput,"normalScale",new Yn.SFFloat(1)),new X(d.inputOutput,"normalTextureMapping",new Yn.SFString),new X(d.inputOutput,"normalTexture",new Yn.SFNode),new X(d.inputOutput,"transparency",new Yn.SFFloat)]),enumerable:!0}});const Sb=bb;i.add("UnlitMaterial","x_ite/Components/Shape/UnlitMaterial",Sb);const Tb=Sb,vb={name:"Shape",concreteNodes:[Vw,zw,qw,$w,rb,lb,db,_b,wb,Tb],abstractNodes:[kl,Uw,Zw,tb,gb]};i.add("Shape","x_ite/Components/Shape",vb);const Ob=vb;var Eb=n(464);function Nb(e){Hs.call(this,e),fu.call(this,e),this.addType(d.X3DSoundProcessingNode),this.addChildObjects(d.inputOutput,"loop",new Yn.SFBool(!0),d.inputOutput,"active",new Yn.SFBool);const t=this.getBrowser().getAudioContext();this.childNodes=[],this.gainNode=new GainNode(t)}Object.assign(Object.setPrototypeOf(Nb.prototype,Hs.prototype),fu.prototype,{initialize(){Hs.prototype.initialize.call(this),fu.prototype.initialize.call(this),this._active.addInterest("set_gain__",this),this._gain.addInterest("set_gain__",this),this._channelCount.addInterest("set_channelCount__",this),this._channelCountMode.addInterest("set_channelCountMode__",this),this._channelInterpretation.addInterest("set_channelInterpretation__",this),this._children.addInterest("set_children__",this),this._active.addInterest("set_active__",this),this.set_gain__(),this.set_channelCount__(),this.set_channelCountMode__(),this.set_channelInterpretation__(),this.set_children__()},getAudioSource(){return this.gainNode},getSoundProcessor(){return this.gainNode},set_gain__(){this.gainNode.gain.value=this._active.getValue()?this._gain.getValue():1},set_channelCount__(){this.getSoundProcessor().channelCount=Math.max(this._channelCount.getValue(),1)},set_channelCountMode__:function(){const e=new Set(["max","clamped-max","explicit"]);return function(){const t=this._channelCountMode.getValue().toLowerCase().replaceAll("_","-");this.getSoundProcessor().channelCountMode=e.has(t)?t:"max"}}(),set_channelInterpretation__:function(){const e=new Set(["speakers","discrete"]);return function(){const t=this._channelInterpretation.getValue().toLowerCase();this.getSoundProcessor().channelInterpretation=e.has(t)?t:"speakers"}}(),set_children__(){this.set_disconnect__(),this.childNodes.length=0;for(const e of this._children){const t=ql(d.X3DChildNode,e);if(!t)continue;const i=t.getType();for(let e=i.length-1;e>=0;--e){switch(i[e]){case d.X3DSoundChannelNode:case d.X3DSoundProcessingNode:case d.X3DSoundSourceNode:this.childNodes.push(t);break;default:continue}break}}this.set_active__()},set_disconnect__(){for(const e of this.childNodes)Eb.try((()=>e.getAudioSource().disconnect(this.gainNode)));for(const e of this.childNodes)Eb.try((()=>e.getAudioSource().disconnect(this.getSoundProcessor())))},set_active__(){if(this.set_disconnect__(),this._active.getValue())for(const e of this.childNodes)Eb.try((()=>e.getAudioSource().connect(this.getSoundProcessor())),!0);else for(const e of this.childNodes)Eb.try((()=>e.getAudioSource().connect(this.gainNode)),!0)},set_start(){this._active.getValue()||(this._active=!0)},set_pause(){this._active.getValue()&&(this._active=!1)},set_resume(){this._active.getValue()||(this._active=!0)},set_stop(){this._active.getValue()&&(this._active=!1)},set_time(){this._elapsedTime=this.getElapsedTime()},dispose(){fu.prototype.dispose.call(this),Hs.prototype.dispose.call(this)}}),Object.defineProperties(Nb,{typeName:{value:"X3DSoundProcessingNode",enumerable:!0},componentName:{value:"Sound",enumerable:!0}});const Cb=Nb;i.add("X3DSoundProcessingNode","x_ite/Components/Sound/X3DSoundProcessingNode",Cb);const Fb=Cb;function Ib(e){Fb.call(this,e),this.addType(d.Analyser);const t=this.getBrowser().getAudioContext();this.analyzerNode=new AnalyserNode(t),this.byteFrequencyData=new Uint8Array(this.analyzerNode.frequencyBinCount),this.byteTimeDomainData=new Uint8Array(this.analyzerNode.frequencyBinCount),this.analyzerNode.connect(this.getAudioSource())}Object.assign(Object.setPrototypeOf(Ib.prototype,Fb.prototype),{initialize(){Fb.prototype.initialize.call(this),this._fftSize.addInterest("set_fftSize__",this),this._minDecibels.addInterest("set_decibels__",this),this._maxDecibels.addInterest("set_decibels__",this),this._smoothingTimeConstant.addInterest("set_smoothingTimeConstant__",this),this.set_fftSize__(),this.set_decibels__(),this.set_smoothingTimeConstant__()},getSoundProcessor(){return this.analyzerNode},set_fftSize__(){this.analyzerNode.fftSize=g.clamp(g.nextPowerOfTwo(this._fftSize.getValue()),32,32768),this._frequencyBinCount=this.analyzerNode.frequencyBinCount},set_decibels__(){const e=Math.min(this._minDecibels.getValue(),0),t=Math.min(this._maxDecibels.getValue(),0);this.analyzerNode.minDecibels=Math.min(e,t),this.analyzerNode.maxDecibels=Math.max(e,t)},set_smoothingTimeConstant__(){this.analyzerNode.smoothingTimeConstant=g.clamp(this._smoothingTimeConstant.getValue(),0,1)},set_time(){Fb.prototype.set_time.call(this);const e=this.analyzerNode,t=e.frequencyBinCount;this.byteFrequencyData.length!==t&&(this.byteFrequencyData=new Uint8Array(t),this.byteTimeDomainData=new Uint8Array(t)),this._byteFrequencyData.length=t,this._byteTimeDomainData.length=t,this._floatFrequencyData.length=t,this._floatTimeDomainData.length=t,e.getByteFrequencyData(this.byteFrequencyData),e.getByteTimeDomainData(this.byteTimeDomainData),this._byteFrequencyData.getValue().set(this.byteFrequencyData),this._byteTimeDomainData.getValue().set(this.byteTimeDomainData),e.getFloatFrequencyData(this._floatFrequencyData.shrinkToFit()),e.getFloatTimeDomainData(this._floatTimeDomainData.shrinkToFit()),this._byteFrequencyData.addEvent(),this._byteTimeDomainData.addEvent(),this._floatFrequencyData.addEvent(),this._floatTimeDomainData.addEvent()}}),Object.defineProperties(Ib,{typeName:{value:"Analyser",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"fftSize",new Yn.SFInt32(2048)),new X(d.inputOutput,"minDecibels",new Yn.SFFloat(-100)),new X(d.inputOutput,"maxDecibels",new Yn.SFFloat(-30)),new X(d.inputOutput,"smoothingTimeConstant",new Yn.SFFloat(.8)),new X(d.inputOutput,"tailTime",new Yn.SFTime),new X(d.outputOnly,"frequencyBinCount",new Yn.SFInt32),new X(d.outputOnly,"byteFrequencyData",new Yn.MFInt32),new X(d.outputOnly,"byteTimeDomainData",new Yn.MFInt32),new X(d.outputOnly,"floatFrequencyData",new Yn.MFFloat),new X(d.outputOnly,"floatTimeDomainData",new Yn.MFFloat),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Mb=Ib;i.add("Analyser","x_ite/Components/Sound/Analyser",Mb);const Db=Mb;function Pb(e){Hs.call(this,e),fu.call(this,e),this.addType(d.X3DSoundSourceNode);const t=this.getBrowser().getAudioContext();this.gainNode=new GainNode(t),this.mediaElement=null}Object.assign(Object.setPrototypeOf(Pb.prototype,Hs.prototype),fu.prototype,{initialize(){Hs.prototype.initialize.call(this),fu.prototype.initialize.call(this),this._gain.addInterest("set_gain__",this),this.set_gain__()},getAudioSource(){return this.gainNode},setMediaElement(e){this.mediaElement?.pause(),this.mediaElement=e,e&&(this.set_loop(),this._duration_changed=this.mediaElement.duration,this.resetElapsedTime(),this._isActive.getValue()?this._isPaused.getValue()?this.set_pause():this.getLiveState()?this.set_start():this.set_pause():this.set_stop())},set_gain__(){this.gainNode.gain.value=this._gain.getValue()},set_pitch(){},set_loop(){this.mediaElement&&(this.mediaElement.loop=this._loop.getValue())},set_start(){this.mediaElement&&(this.mediaElement.currentTime=0,this.mediaElement.play().catch((()=>this.getBrowser().startAudioElement(this.mediaElement))))},set_pause(){this.mediaElement?.pause()},set_resume(){this.mediaElement?.play().catch(Function.prototype)},set_stop(){this.mediaElement?.pause()},set_end(){this._loop.getValue()||this.stop()},set_time(){this._elapsedTime=this.getElapsedTime(),this.mediaElement&&(this.mediaElement.currentTime<this.mediaElement.duration||this.set_end())},dispose(){fu.prototype.dispose.call(this),Hs.prototype.dispose.call(this)}}),Object.defineProperties(Pb,{typeName:{value:"X3DSoundSourceNode",enumerable:!0},componentName:{value:"Sound",enumerable:!0}});const Rb=Pb;i.add("X3DSoundSourceNode","x_ite/Components/Sound/X3DSoundSourceNode",Rb);const Ab=Rb;var Vb=n(464);function Lb(e){Ab.call(this,e),Sr.call(this,e),this.addType(d.AudioClip);const t=this.getBrowser().getAudioContext();this.urlStack=new Yn.MFString,this.audio=Vb("<audio></audio>"),this.sourceNode=t.createMediaElementSource(this.audio[0]),this.sourceNode.connect(this.getAudioSource())}Object.assign(Object.setPrototypeOf(Lb.prototype,Ab.prototype),Sr.prototype,{initialize(){Ab.prototype.initialize.call(this),Sr.prototype.initialize.call(this),this.audio.on("abort error",this.setError.bind(this)).on("suspend stalled",this.setTimeout.bind(this)).prop("crossOrigin","Anonymous").prop("preload","auto"),this.requestImmediateLoad().catch(Function.prototype)},set_live__(){Ab.prototype.set_live__.call(this),Sr.prototype.set_live__.call(this)},unloadData(){this.setMediaElement(null)},loadData(){this.setMediaElement(null),this.urlStack.setValue(this._url),this.audio.on("canplaythrough",this.setAudio.bind(this)),this.loadNext()},loadNext(){if(0===this.urlStack.length)return this.audio.off("canplaythrough"),this._duration_changed=-1,void this.setLoadState(d.FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getBaseURL()),"data:"!==this.URL.protocol&&(this.getCache()||this.URL.searchParams.set("_",Date.now())),this.audio.attr("src",this.URL.href),this.audio.get(0).load()},setTimeout(e){setTimeout((()=>{this.checkLoadState()===d.IN_PROGRESS_STATE&&this.setError(e)}),3e3)},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading audio '${decodeURI(this.URL.href)}'`,e.type),this.loadNext()},setAudio(){try{b,this.audio.unbind("canplaythrough"),this.setMediaElement(this.audio[0]),this.setLoadState(d.COMPLETE_STATE)}catch(e){this.setError({type:e.message})}},dispose(){Sr.prototype.dispose.call(this),Ab.prototype.dispose.call(this)}}),Object.defineProperties(Lb,{typeName:{value:"AudioClip",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"source",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"pitch",new Yn.SFFloat(1)),new X(d.inputOutput,"loop",new Yn.SFBool),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.outputOnly,"duration_changed",new Yn.SFTime(-1))]),enumerable:!0}});const Bb=Lb;i.add("AudioClip","x_ite/Components/Sound/AudioClip",Bb);const Ub=Bb;function Xb(e){Hs.call(this,e),this.addType(d.X3DSoundNode)}Object.setPrototypeOf(Xb.prototype,Hs.prototype),Object.defineProperties(Xb,{typeName:{value:"X3DSoundNode",enumerable:!0},componentName:{value:"Sound",enumerable:!0}});const kb=Xb;i.add("X3DSoundNode","x_ite/Components/Sound/X3DSoundNode",kb);const jb=kb;var zb=n(464);function Gb(e){jb.call(this,e),this.addType(d.X3DSoundDestinationNode);const t=this.getBrowser().getAudioContext();this.childNodes=[],this.gainNode=new GainNode(t)}Object.assign(Object.setPrototypeOf(Gb.prototype,jb.prototype),{initialize(){jb.prototype.initialize.call(this),this.getLive().addInterest("set_enabled__",this),this._enabled.addInterest("set_enabled__",this),this._gain.addInterest("set_gain__",this),this._children.addInterest("set_children__",this),this.set_enabled__(),this.set_gain__(),this.set_children__()},getAudioSource(){return this.gainNode},set_enabled__(){this._enabled.getValue()&&this.getLive().getValue()?(this._channelCount.addInterest("set_channelCount__",this),this._channelCountMode.addInterest("set_channelCountMode__",this),this._channelInterpretation.addInterest("set_channelInterpretation__",this),this.gainNode.connect(this.getSoundDestination()),this.set_channelCount__(),this.set_channelCountMode__(),this.set_channelInterpretation__()):(this._channelCount.removeInterest("set_channelCount__",this),this._channelCountMode.removeInterest("set_channelCountMode__",this),this._channelInterpretation.removeInterest("set_channelInterpretation__",this),this.gainNode.disconnect()),this._isActive=this._enabled},set_gain__(){this.gainNode.gain.value=this._gain.getValue()},set_channelCount__(){this.getSoundDestination().channelCount=Math.max(this._channelCount.getValue(),1)},set_channelCountMode__:function(){const e=new Set(["max","clamped-max","explicit"]);return function(){const t=this._channelCountMode.getValue().toLowerCase().replaceAll("_","-");this.getSoundDestination().channelCountMode=e.has(t)?t:"max"}}(),set_channelInterpretation__:function(){const e=new Set(["speakers","discrete"]);return function(){const t=this._channelInterpretation.getValue().toLowerCase();this.getSoundDestination().channelInterpretation=e.has(t)?t:"speakers"}}(),set_children__(){for(const e of this.childNodes)zb.try((()=>e.getAudioSource().disconnect(this.gainNode)));this.childNodes.length=0;for(const e of this._children){const t=ql(d.X3DChildNode,e);if(!t)continue;const i=t.getType();for(let e=i.length-1;e>=0;--e){switch(i[e]){case d.X3DSoundChannelNode:case d.X3DSoundProcessingNode:case d.X3DSoundSourceNode:this.childNodes.push(t);break;default:continue}break}}for(const e of this.childNodes)zb.try((()=>e.getAudioSource().connect(this.gainNode)),!0)}}),Object.defineProperties(Gb,{typeName:{value:"X3DSoundDestinationNode",enumerable:!0},componentName:{value:"Sound",enumerable:!0}});const Hb=Gb;i.add("X3DSoundDestinationNode","x_ite/Components/Sound/X3DSoundDestinationNode",Hb);const qb=Hb;function Yb(e){qb.call(this,e),this.addType(d.AudioDestination),this.audioElement=new Audio}Object.assign(Object.setPrototypeOf(Yb.prototype,qb.prototype),{initialize(){qb.prototype.initialize.call(this);const e=this.getBrowser().getAudioContext();this._mediaDeviceID.addInterest("set_mediaDeviceID__",this),this._maxChannelCount=e.destination.maxChannelCount,this.set_mediaDeviceID__()},getSoundDestination(){return this.mediaStreamDestination},set_enabled__(){const e=this._enabled.getValue()&&this.getLive().getValue();if(!!this.mediaStreamDestination!==e){if(e){const e=this.getBrowser().getAudioContext();this.mediaStreamDestination=e.createMediaStreamDestination(),this.audioElement.srcObject=this.mediaStreamDestination.stream,this.audioElement.play().catch((()=>this.getBrowser().startAudioElement(this.audioElement)))}else{this.audioElement.pause();for(const e of this.mediaStreamDestination.stream.getAudioTracks())e.stop();for(const e of this.mediaStreamDestination.stream.getVideoTracks())e.stop();this.mediaStreamDestination=null}qb.prototype.set_enabled__.call(this)}},set_mediaDeviceID__(){this.audioElement.setSinkId&&this.audioElement.setSinkId(this._mediaDeviceID.getValue()).catch((e=>{console.error(e.message),this.audioElement.setSinkId("default").catch(Function.prototype)}))}}),Object.defineProperties(Yb,{typeName:{value:"AudioDestination",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"mediaDeviceID",new Yn.SFString),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"maxChannelCount",new Yn.SFInt32),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Wb=Yb;i.add("AudioDestination","x_ite/Components/Sound/AudioDestination",Wb);const $b=Wb;function Jb(e){Fb.call(this,e),this.addType(d.BiquadFilter)}Object.setPrototypeOf(Jb.prototype,Fb.prototype),Object.defineProperties(Jb,{typeName:{value:"BiquadFilter",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"frequency",new Yn.SFFloat(350)),new X(d.inputOutput,"detune",new Yn.SFFloat(0)),new X(d.inputOutput,"type",new Yn.SFString("LOWPASS")),new X(d.inputOutput,"qualityFactor",new Yn.SFFloat(1)),new X(d.inputOutput,"tailTime",new Yn.SFTime),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const Kb=Jb;i.add("BiquadFilter","x_ite/Components/Sound/BiquadFilter",Kb);const Zb=Kb;function Qb(e){Ab.call(this,e),Sr.call(this,e),this.addType(d.BufferAudioSource)}Object.assign(Object.setPrototypeOf(Qb.prototype,Ab.prototype),Sr.prototype,{initialize(){Ab.prototype.initialize.call(this),Sr.prototype.initialize.call(this)},dispose(){Sr.prototype.dispose.call(this),Ab.prototype.dispose.call(this)}}),Object.defineProperties(Qb,{typeName:{value:"BufferAudioSource",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"detune",new Yn.SFFloat(0)),new X(d.inputOutput,"buffer",new Yn.MFFloat),new X(d.inputOutput,"bufferDuration",new Yn.SFTime),new X(d.outputOnly,"bufferLength",new Yn.SFInt32),new X(d.inputOutput,"numberOfChannels",new Yn.SFInt32),new X(d.inputOutput,"sampleRate",new Yn.SFFloat(0)),new X(d.inputOutput,"playbackRate",new Yn.SFFloat(1)),new X(d.inputOutput,"loopStart",new Yn.SFTime),new X(d.inputOutput,"loopEnd",new Yn.SFTime),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"loop",new Yn.SFBool),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime)]),enumerable:!0}});const eS=Qb;i.add("BufferAudioSource","x_ite/Components/Sound/BufferAudioSource",eS);const tS=eS;function iS(e){jb.call(this,e),this.addType(d.X3DSoundChannelNode)}Object.setPrototypeOf(iS.prototype,jb.prototype),Object.defineProperties(iS,{typeName:{value:"X3DSoundChannelNode",enumerable:!0},componentName:{value:"Sound",enumerable:!0}});const nS=iS;i.add("X3DSoundChannelNode","x_ite/Components/Sound/X3DSoundChannelNode",nS);const sS=nS;function rS(e){sS.call(this,e),this.addType(d.ChannelMerger)}Object.setPrototypeOf(rS.prototype,sS.prototype),Object.defineProperties(rS,{typeName:{value:"ChannelMerger",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const oS=rS;i.add("ChannelMerger","x_ite/Components/Sound/ChannelMerger",oS);const aS=oS;function lS(e){sS.call(this,e),this.addType(d.ChannelSelector)}Object.setPrototypeOf(lS.prototype,sS.prototype),Object.defineProperties(lS,{typeName:{value:"ChannelSelector",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"channelSelection",new Yn.SFInt32(0)),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const uS=lS;i.add("ChannelSelector","x_ite/Components/Sound/ChannelSelector",uS);const hS=uS;function dS(e){sS.call(this,e),this.addType(d.ChannelSplitter)}Object.setPrototypeOf(dS.prototype,sS.prototype),Object.defineProperties(dS,{typeName:{value:"ChannelSplitter",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"children",new Yn.MFNode),new X(d.inputOutput,"outputs",new Yn.MFNode)]),enumerable:!0}});const cS=dS;i.add("ChannelSplitter","x_ite/Components/Sound/ChannelSplitter",cS);const pS=cS;function gS(e){Fb.call(this,e),this.addType(d.Convolver)}Object.setPrototypeOf(gS.prototype,Fb.prototype),Object.defineProperties(gS,{typeName:{value:"Convolver",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"buffer",new Yn.MFFloat),new X(d.inputOutput,"normalize",new Yn.SFBool),new X(d.inputOutput,"tailTime",new Yn.SFTime),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const fS=gS;i.add("Convolver","x_ite/Components/Sound/Convolver",fS);const mS=fS;function _S(e){Fb.call(this,e),this.addType(d.Delay)}Object.setPrototypeOf(_S.prototype,Fb.prototype),Object.defineProperties(_S,{typeName:{value:"Delay",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"delayTime",new Yn.SFTime),new X(d.inputOutput,"maxDelayTime",new Yn.SFTime(1)),new X(d.inputOutput,"tailTime",new Yn.SFTime),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const xS=_S;i.add("Delay","x_ite/Components/Sound/Delay",xS);const yS=xS;function wS(e){Fb.call(this,e),this.addType(d.DynamicsCompressor)}Object.setPrototypeOf(wS.prototype,Fb.prototype),Object.defineProperties(wS,{typeName:{value:"DynamicsCompressor",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"attack",new Yn.SFFloat(.003)),new X(d.inputOutput,"knee",new Yn.SFFloat(30)),new X(d.inputOutput,"ratio",new Yn.SFFloat(12)),new X(d.inputOutput,"reduction",new Yn.SFFloat),new X(d.inputOutput,"release",new Yn.SFTime(.25)),new X(d.inputOutput,"threshold",new Yn.SFFloat(-24)),new X(d.inputOutput,"tailTime",new Yn.SFTime),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const bS=wS;i.add("DynamicsCompressor","x_ite/Components/Sound/DynamicsCompressor",bS);const SS=bS;function TS(e){Fb.call(this,e),this.addType(d.Gain)}Object.setPrototypeOf(TS.prototype,Fb.prototype),Object.defineProperties(TS,{typeName:{value:"Gain",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"tailTime",new Yn.SFTime),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const vS=TS;i.add("Gain","x_ite/Components/Sound/Gain",vS);const OS=vS;function ES(e){Ab.call(this,e),this.addType(d.ListenerPointSource),this.addChildObjects(d.inputOutput,"loop",new Yn.SFBool),this._position.setUnit("length")}Object.setPrototypeOf(ES.prototype,Ab.prototype),Object.defineProperties(ES,{typeName:{value:"ListenerPointSource",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"position",new Yn.SFVec3f),new X(d.inputOutput,"orientation",new Yn.SFRotation),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"dopplerEnabled",new Yn.SFBool),new X(d.inputOutput,"interauralDistance",new Yn.SFFloat),new X(d.inputOutput,"trackCurrentView",new Yn.SFBool),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime)]),enumerable:!0}});const NS=ES;i.add("ListenerPointSource","x_ite/Components/Sound/ListenerPointSource",NS);const CS=NS;var FS=n(464);function IS(e){Ab.call(this,e),this.addType(d.MicrophoneSource),this.addChildObjects(d.inputOutput,"loop",new Yn.SFBool(!0))}Object.assign(Object.setPrototypeOf(IS.prototype,Ab.prototype),{initialize(){Ab.prototype.initialize.call(this),this._mediaDeviceID.addInterest("set_mediaDeviceID__",this)},set_mediaDeviceID__(){this.set_stop(),this._isActive.getValue()&&this.set_start()},set_start(){navigator.mediaDevices&&(this.restore=!1,navigator.mediaDevices.getUserMedia({audio:{deviceId:this._mediaDeviceID.getValue()}}).then((e=>{const t=this.getBrowser().getAudioContext();this.mediaStreamSource=t.createMediaStreamSource(e),this._isActive.getValue()?this._isPaused.getValue()||!this.getLive().getValue()?this.set_pause():this.set_resume():this.set_stop()})).catch((e=>{console.error(e.message)})))},set_pause(){if(this.mediaStreamSource)if(this.getLive().getValue()){FS.try((()=>this.mediaStreamSource.disconnect(this.getAudioSource())));for(const e of this.mediaStreamSource.mediaStream.getAudioTracks())e.enabled=!1;for(const e of this.mediaStreamSource.mediaStream.getVideoTracks())e.enabled=!1}else this.set_stop(!0)},set_resume(){if(this.restore)return this.set_start();if(this.mediaStreamSource){this.mediaStreamSource.connect(this.getAudioSource());for(const e of this.mediaStreamSource.mediaStream.getAudioTracks())e.enabled=!0;for(const e of this.mediaStreamSource.mediaStream.getVideoTracks())e.enabled=!0}},set_stop(e=!1){if(this.mediaStreamSource){FS.try((()=>this.mediaStreamSource.disconnect(this.getAudioSource())));for(const e of this.mediaStreamSource.mediaStream.getAudioTracks())e.stop();for(const e of this.mediaStreamSource.mediaStream.getVideoTracks())e.stop();this.mediaStreamSource=null,this.restore=e}}}),Object.defineProperties(IS,{typeName:{value:"MicrophoneSource",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"mediaDeviceID",new Yn.SFString),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime)]),enumerable:!0}});const MS=IS;i.add("MicrophoneSource","x_ite/Components/Sound/MicrophoneSource",MS);const DS=MS;function PS(e){Ab.call(this,e),this.addType(d.OscillatorSource),this.addChildObjects(d.inputOutput,"loop",new Yn.SFBool);const t=this.getBrowser().getAudioContext();this.oscillatorNode=new OscillatorNode(t),this.mergerNode=new ChannelMergerNode(t,{numberOfInputs:2})}Object.assign(Object.setPrototypeOf(PS.prototype,Ab.prototype),{initialize(){Ab.prototype.initialize.call(this),this._detune.addInterest("set_detune__",this),this._frequency.addInterest("set_frequency__",this),this._periodicWave.addInterest("set_periodicWave__",this),this.set_periodicWave__()},set_type__:function(){const e=new Set(["sine","square","sawtooth","triangle"]);return function(){this.periodicWaveNode._optionsReal.removeInterest("set_periodicWaveOptions__",this),this.periodicWaveNode._optionsImag.removeInterest("set_periodicWaveOptions__",this);const t=this.periodicWaveNode._type.getValue().toLowerCase();"custom"===t?(this.periodicWaveNode._optionsReal.addInterest("set_periodicWaveOptions__",this),this.periodicWaveNode._optionsImag.addInterest("set_periodicWaveOptions__",this),this.set_periodicWaveOptions__()):this.oscillatorNode.type=e.has(t)?t:"square"}}(),set_frequency__(){this.oscillatorNode.frequency.value=this._frequency.getValue()},set_detune__(){this.oscillatorNode.detune.value=this._detune.getValue()},set_periodicWave__(){this.periodicWaveNode?._type.removeInterest("set_type__",this),this.periodicWaveNode=ql(d.PeriodicWave,this._periodicWave)??this.getBrowser().getDefaultPeriodicWave(),this.periodicWaveNode._type.addInterest("set_type__",this),this.set_type__()},set_periodicWaveOptions__(){this.oscillatorNode.setPeriodicWave(this.periodicWaveNode.createPeriodicWave())},set_start(){const e=this.getBrowser().getAudioContext();this.oscillatorNode=new OscillatorNode(e),this.set_type__(),this.set_frequency__(),this.set_detune__(),this.oscillatorNode.connect(this.mergerNode,0,0),this.oscillatorNode.connect(this.mergerNode,0,1),this.mergerNode.connect(this.getAudioSource()),this.oscillatorNode.start()},set_pause(){this.mergerNode.disconnect()},set_resume(){this.mergerNode.connect(this.getAudioSource())},set_stop(){this.oscillatorNode.stop(),this.oscillatorNode.disconnect()}}),Object.defineProperties(PS,{typeName:{value:"OscillatorSource",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"frequency",new Yn.SFFloat),new X(d.inputOutput,"detune",new Yn.SFFloat),new X(d.inputOutput,"periodicWave",new Yn.SFNode),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime)]),enumerable:!0}});const RS=PS;i.add("OscillatorSource","x_ite/Components/Sound/OscillatorSource",RS);const AS=RS;function VS(e){jb.call(this,e),this.addType(d.PeriodicWave),this.real=new Float32Array(2),this.imag=new Float32Array(2)}Object.assign(Object.setPrototypeOf(VS.prototype,jb.prototype),{createPeriodicWave(){const e=this.getBrowser().getAudioContext(),t=this._optionsReal.shrinkToFit(),i=this._optionsImag.shrinkToFit(),n=Math.max(t.length,i.length,2);return this.real.length!==n&&(this.real=new Float32Array(n),this.imag=new Float32Array(n)),this.real.set(t),this.imag.set(i),e.createPeriodicWave(this.real,this.imag)}}),Object.defineProperties(VS,{typeName:{value:"PeriodicWave",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"periodicWave",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"type",new Yn.SFString("SQUARE")),new X(d.inputOutput,"optionsReal",new Yn.MFFloat),new X(d.inputOutput,"optionsImag",new Yn.MFFloat)]),enumerable:!0}});const LS=VS;i.add("PeriodicWave","x_ite/Components/Sound/PeriodicWave",LS);const BS=LS;function US(e){jb.call(this,e),this.addType(d.Sound),this.addChildObjects(d.outputOnly,"traversed",new Yn.SFBool(!0)),this._location.setUnit("length"),this._minBack.setUnit("length"),this._minFront.setUnit("length"),this._maxBack.setUnit("length"),this._maxFront.setUnit("length"),this.childNodes=[],this.currentTraversed=!0}Object.assign(Object.setPrototypeOf(US.prototype,jb.prototype),{initialize(){jb.prototype.initialize.call(this);const e=this.getBrowser().getAudioContext(),t=new ChannelSplitterNode(e,{numberOfOutputs:2}),i=new ChannelMergerNode(e,{numberOfInputs:2}),n=new GainNode(e,{gain:0}),s=new GainNode(e,{gain:0});t.connect(n,0),t.connect(s,1),n.connect(i,0,0),s.connect(i,0,1),i.connect(e.destination),this.splitterNode=t,this.gainLeftNode=n,this.gainRightNode=s,this.getLive().addInterest("set_live__",this),this._traversed.addInterest("set_live__",this),this._source.addInterest("set_children__",this),this._children.addInterest("set_children__",this),this.set_live__(),this.set_children__()},setTraversed(e){e?!1===this._traversed.getValue()&&(this._traversed=!0):this.currentTraversed!==this._traversed.getValue()&&(this._traversed=this.currentTraversed),this.currentTraversed=e},getTraversed(){return this.currentTraversed},setVolume(e,t=.5){this.gainLeftNode.gain.value=e*(1-t**2),this.gainRightNode.gain.value=e*(1-(1-t)**2)},set_live__(){this.getLive().getValue()&&this._traversed.getValue()?this.getBrowser().sensorEvents().addInterest("update",this):(this.getBrowser().sensorEvents().removeInterest("update",this),this.setVolume(0))},set_children__(){for(const e of this.childNodes)e.getAudioSource().disconnect(this.splitterNode);this.childNodes.length=0;const e=ql(d.X3DSoundSourceNode,this._source);e&&this.childNodes.push(e);for(const e of this._children){const t=ql(d.X3DChildNode,e);if(!t)continue;const i=t.getType();for(let e=i.length-1;e>=0;--e){switch(i[e]){case d.X3DSoundChannelNode:case d.X3DSoundProcessingNode:case d.X3DSoundSourceNode:this.childNodes.push(t);break;default:continue}break}}for(const e of this.childNodes)e.getAudioSource().connect(this.splitterNode)},update(){this.getTraversed()||this.setVolume(0),this.setTraversed(!1)},traverse:(()=>{const e={distance:0,intersection:new bt(0,0,0)},t={distance:0,intersection:new bt(0,0,0)};return function(i,n){if(i!==Ia.DISPLAY)return;if(!this.childNodes.length)return;this.setTraversed(!0);const s=n.getModelViewMatrix().get();if(this.getEllipsoidParameter(s,Math.max(this._maxBack.getValue(),0),Math.max(this._maxFront.getValue(),0),t),t.distance<1){this.getEllipsoidParameter(s,Math.max(this._minBack.getValue(),0),Math.max(this._minFront.getValue(),0),e);const i=this.getPan(s);if(e.distance<1)this.setVolume(g.clamp(this._intensity.getValue(),0,1),i);else{const n=t.intersection.magnitude(),s=t.intersection.distance(e.intersection),r=Math.min(n/s,1),o=g.clamp(this._intensity.getValue(),0,1)*r;this.setVolume(o,i)}}else this.setVolume(0)}})(),getEllipsoidParameter:(()=>{const e=new bt(0,0,0),t=new ci,i=new ci,n=new ai,s=new bt(1,1,1),r=new cm(1,bt.Zero),o=new bt(0,0,0),a=new ja(bt.Zero,bt.zAxis),l=new bt(0,0,0),u=new bt(0,0,0);return function(h,d,c,p){if(0==d||0==c)return t.multVecMatrix(p.intersection.assign(this._location.getValue())),void(p.distance=1);const g=(d+c)/2,f=g-d,m=Math.sqrt(g*g-f*f);e.set(0,0,f),s.set(m,m,g),n.setFromToVec(bt.zAxis,this._direction.getValue()),t.assign(h).translate(this._location.getValue()).rotate(n).translate(e).scale(s),i.assign(t).inverse();const _=i.origin;e.negate().divVec(s),o.assign(e).subtract(_).normalize(),a.set(_,o),r.intersectsLine(a,l,u),p.intersection.assign(t.multVecMatrix(l)),p.distance=_.magnitude()}})(),getPan:function(){const e=new bt(0,0,0);return function(t){if(!this._spatialize.getValue())return.5;const i=t.multVecMatrix(e.assign(this._location.getValue())).normalize();return Math.acos(g.clamp(-i.dot(bt.xAxis),-1,1))/Math.PI}}()}),Object.defineProperties(US,{typeName:{value:"Sound",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.initializeOnly,"spatialize",new Yn.SFBool(!0)),new X(d.inputOutput,"intensity",new Yn.SFFloat(1)),new X(d.inputOutput,"location",new Yn.SFVec3f),new X(d.inputOutput,"direction",new Yn.SFVec3f(0,0,1)),new X(d.inputOutput,"minBack",new Yn.SFFloat(1)),new X(d.inputOutput,"minFront",new Yn.SFFloat(1)),new X(d.inputOutput,"maxBack",new Yn.SFFloat(10)),new X(d.inputOutput,"maxFront",new Yn.SFFloat(10)),new X(d.inputOutput,"priority",new Yn.SFFloat),new X(d.inputOutput,"source",new Yn.SFNode),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const XS=US;i.add("Sound","x_ite/Components/Sound/Sound",XS);const kS=XS;function jS(e){jb.call(this,e),this.addType(d.SpatialSound),this._location.setUnit("length")}Object.setPrototypeOf(jS.prototype,jb.prototype),Object.defineProperties(jS,{typeName:{value:"SpatialSound",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.initializeOnly,"spatialize",new Yn.SFBool(!0)),new X(d.inputOutput,"coneInnerAngle",new Yn.SFFloat(6.2832)),new X(d.inputOutput,"coneOuterAngle",new Yn.SFFloat(6.2832)),new X(d.inputOutput,"coneOuterGain",new Yn.SFFloat(0)),new X(d.inputOutput,"direction",new Yn.SFVec3f(0,0,1)),new X(d.inputOutput,"distanceModel",new Yn.SFString("INVERSE")),new X(d.inputOutput,"dopplerEnabled",new Yn.SFBool),new X(d.inputOutput,"enableHRTF",new Yn.SFBool),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"intensity",new Yn.SFFloat(1)),new X(d.inputOutput,"location",new Yn.SFVec3f),new X(d.inputOutput,"maxDistance",new Yn.SFFloat(1e4)),new X(d.inputOutput,"priority",new Yn.SFFloat),new X(d.inputOutput,"referenceDistance",new Yn.SFFloat(1)),new X(d.inputOutput,"rolloffFactor",new Yn.SFFloat(1)),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const zS=jS;i.add("SpatialSound","x_ite/Components/Sound/SpatialSound",zS);const GS=zS;function HS(e){qb.call(this,e),this.addType(d.StreamAudioDestination);const t=this.getBrowser().getAudioContext();this.mediaStreamDestination=t.createMediaStreamDestination()}Object.assign(Object.setPrototypeOf(HS.prototype,qb.prototype),{initialize(){qb.prototype.initialize.call(this),this._streamIdentifier[0]=this.mediaStreamDestination.stream.id},getSoundDestination(){return this.mediaStreamDestination}}),Object.defineProperties(HS,{typeName:{value:"StreamAudioDestination",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"streamIdentifier",new Yn.MFString),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const qS=HS;i.add("StreamAudioDestination","x_ite/Components/Sound/StreamAudioDestination",qS);const YS=qS;function WS(e){Ab.call(this,e),this.addType(d.StreamAudioSource),this.addChildObjects(d.inputOutput,"loop",new Yn.SFBool)}Object.setPrototypeOf(WS.prototype,Ab.prototype),Object.defineProperties(WS,{typeName:{value:"StreamAudioSource",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"streamIdentifier",new Yn.MFString),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime)]),enumerable:!0}});const $S=WS;i.add("StreamAudioSource","x_ite/Components/Sound/StreamAudioSource",$S);const JS=$S;function KS(e){Fb.call(this,e),this.addType(d.WaveShaper)}Object.setPrototypeOf(KS.prototype,Fb.prototype),Object.defineProperties(KS,{typeName:{value:"WaveShaper",enumerable:!0},componentName:{value:"Sound",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["4.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"curve",new Yn.MFFloat),new X(d.inputOutput,"oversample",new Yn.SFString("NONE")),new X(d.inputOutput,"tailTime",new Yn.SFTime),new X(d.inputOutput,"channelCount",new Yn.SFInt32),new X(d.inputOutput,"channelCountMode",new Yn.SFString("MAX")),new X(d.inputOutput,"channelInterpretation",new Yn.SFString("SPEAKERS")),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.inputOutput,"children",new Yn.MFNode)]),enumerable:!0}});const ZS=KS;i.add("WaveShaper","x_ite/Components/Sound/WaveShaper",ZS);const QS={name:"Sound",concreteNodes:[Db,Ub,$b,Zb,tS,aS,hS,pS,mS,yS,SS,OS,CS,DS,AS,BS,kS,GS,YS,JS,ZS],abstractNodes:[sS,qb,jb,Fb,Ab]};i.add("Sound","x_ite/Components/Sound",QS);const eT=QS;const tT=function(e,t){let i=1,n=0,s=!1;Object.defineProperties(e,{currentTime:{get(){return!s&&n<this.cycle?this.duration:t._elapsedTime*i%this.duration},set:Function.prototype},duration:{get(){return this.get_duration_ms()/1e3}},loop:{get:()=>s,set(e){n=this.cycle,s=e}},cycle:{get(){return Math.floor(t._elapsedTime/this.duration)}},currentFrame:{get(){const e=this.get_length();return this.get_frames()[Math.max(Math.ceil(this.currentTime/this.duration*e)-1,0)]}},play:{value(){return n=this.cycle,Promise.resolve()}},playbackRate:{get:()=>i,set(e){i=e}}})};i.add("GIFMedia","x_ite/Browser/Texturing/GIFMedia",tT);const iT=tT;var nT=n(464),sT=n(49);function rT(e){Ql.call(this,e),Ab.call(this,e),Sr.call(this,e),this.addType(d.MovieTexture);const t=this.getBrowser().getAudioContext();this.urlStack=new Yn.MFString,this.video=nT("<video></video>"),this.sourceNode=t.createMediaElementSource(this.video[0]),this.sourceNode.connect(this.getAudioSource())}Object.assign(Object.setPrototypeOf(rT.prototype,Ql.prototype),Ab.prototype,Sr.prototype,{initialize(){Ql.prototype.initialize.call(this),Ab.prototype.initialize.call(this),Sr.prototype.initialize.call(this),this._speed.addInterest("set_speed__",this),this.video.on("abort error",this.setError.bind(this)).on("suspend stalled",this.setTimeout.bind(this)).prop("crossOrigin","Anonymous").prop("preload","auto"),this.requestImmediateLoad().catch(Function.prototype)},set_live__(){Ab.prototype.set_live__.call(this),Sr.prototype.set_live__.call(this)},unloadData(){this.clearTexture()},loadData(){delete this.gif,this.setMediaElement(null),this.urlStack.setValue(this._url),this.video.on("canplaythrough",this.setVideo.bind(this)),this.loadNext()},loadNext(){if(0===this.urlStack.length)return this.video.off("canplaythrough"),this._duration_changed=-1,this.clearTexture(),void this.setLoadState(d.FAILED_STATE);if(this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getBaseURL()),"data:"!==this.URL.protocol&&(this.getCache()||this.URL.searchParams.set("_",Date.now())),this.URL.pathname.endsWith(".gif")){const e=nT("<img></img>").appendTo(nT("<div></div>")),t=new sT({gif:e[0],on_error:e=>this.setError({type:e})});t.load_url(this.URL,this.setGif.bind(this,t)),this.setTimeout({type:"timeout"})}else this.video.attr("src",this.URL.href),this.video.get(0).load()},setTimeout(e){setTimeout((()=>{this.checkLoadState()===d.IN_PROGRESS_STATE&&this.setError(e)}),3e3)},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading movie '${decodeURI(this.URL.href)}'`,e.type),this.loadNext()},setVideo(){try{b,this.video.unbind("canplaythrough");const e=this.video[0],t=e.videoWidth,i=e.videoHeight;if(!g.isPowerOfTwo(t)||!g.isPowerOfTwo(i))throw new Error("The movie texture is a non power-of-two texture.");this.setMediaElement(this.video[0]),this.setTexture(t,i,!1,e,!0),this.setLoadState(d.COMPLETE_STATE),this.set_speed__()}catch(e){this.setError({type:e.message})}},setGif(e){try{this.gif=e,iT(e,this),e.pause(),this.setMediaElement(e),this.setTexture(e.get_canvas().width,e.get_canvas().height,!1,e.get_frames()[0].data,!0),this.setLoadState(d.COMPLETE_STATE),this.set_speed__()}catch(e){this.setError({type:e.message})}},set_speed__(){this.gif&&(this.gif.playbackRate=this._speed.getValue()),this.video[0].playbackRate=this._speed.getValue()},set_time(){Ab.prototype.set_time.call(this),this.checkLoadState()===d.COMPLETE_STATE&&(this.gif?this.updateTexture(this.gif.currentFrame.data,!0):this.updateTexture(this.video[0],!0))},traverse:Ql.prototype.traverse,dispose(){Sr.prototype.dispose.call(this),Ab.prototype.dispose.call(this),Ql.prototype.dispose.call(this)}}),Object.defineProperties(rT,{typeName:{value:"MovieTexture",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"enabled",new Yn.SFBool(!0)),new X(d.inputOutput,"load",new Yn.SFBool(!0)),new X(d.inputOutput,"url",new Yn.MFString),new X(d.inputOutput,"autoRefresh",new Yn.SFTime),new X(d.inputOutput,"autoRefreshTimeLimit",new Yn.SFTime(3600)),new X(d.inputOutput,"gain",new Yn.SFFloat(1)),new X(d.inputOutput,"speed",new Yn.SFFloat(1)),new X(d.inputOutput,"pitch",new Yn.SFFloat(1)),new X(d.inputOutput,"loop",new Yn.SFBool),new X(d.inputOutput,"startTime",new Yn.SFTime),new X(d.inputOutput,"resumeTime",new Yn.SFTime),new X(d.inputOutput,"pauseTime",new Yn.SFTime),new X(d.inputOutput,"stopTime",new Yn.SFTime),new X(d.outputOnly,"isPaused",new Yn.SFBool),new X(d.outputOnly,"isActive",new Yn.SFBool),new X(d.outputOnly,"elapsedTime",new Yn.SFTime),new X(d.outputOnly,"duration_changed",new Yn.SFTime(-1)),new X(d.initializeOnly,"repeatS",new Yn.SFBool(!0)),new X(d.initializeOnly,"repeatT",new Yn.SFBool(!0)),new X(d.initializeOnly,"textureProperties",new Yn.SFNode)]),enumerable:!0}});const oT=rT;i.add("MovieTexture","x_ite/Components/Texturing/MovieTexture",oT);const aT=oT;function lT(e){Gl.call(this,e),this.addType(d.MultiTexture),this.addChildObjects(d.outputOnly,"loadState",new Yn.SFInt32(d.NOT_STARTED_STATE));const t=this.getBrowser();this.maxTextures=t.getMaxTextures(),this.color=new Float32Array(4),this.modes=[],this.alphaModes=[],this.sources=[],this.functions=[],this.textureNodes=[]}Object.assign(Object.setPrototypeOf(lT.prototype,Gl.prototype),{initialize(){Gl.prototype.initialize.call(this),this._color.addInterest("set_color__",this),this._alpha.addInterest("set_alpha__",this),this._mode.addInterest("set_mode__",this),this._source.addInterest("set_source__",this),this._function.addInterest("set_function__",this),this._texture.addInterest("set_texture__",this),this.set_color__(),this.set_alpha__(),this.set_mode__(),this.set_source__(),this.set_function__(),this.set_texture__(),this._loadState=d.COMPLETE_STATE},getCount(){return Math.min(this.maxTextures,this.textureNodes.length)},getMode(e){return e<this.modes.length?this.modes[e]:ix.MODULATE},getAlphaMode(e){return e<this.alphaModes.length?this.alphaModes[e]:ix.MODULATE},getSource(e){return e<this.sources.length?this.sources[e]:rx.DEFAULT},getFunction(e){return e<this.functions.length?this.functions[e]:lx.DEFAULT},set_color__(){this.color[0]=this._color.r,this.color[1]=this._color.g,this.color[2]=this._color.b},set_alpha__(){this.color[3]=this._alpha},set_mode__:(()=>{const e=new Map([["REPLACE",ix.REPLACE],["MODULATE",ix.MODULATE],["MODULATE2X",ix.MODULATE2X],["MODULATE4X",ix.MODULATE4X],["ADD",ix.ADD],["ADDSIGNED",ix.ADDSIGNED],["ADDSIGNED2X",ix.ADDSIGNED2X],["ADDSMOOTH",ix.ADDSMOOTH],["SUBTRACT",ix.SUBTRACT],["BLENDDIFFUSEALPHA",ix.BLENDDIFFUSEALPHA],["BLENDTEXTUREALPHA",ix.BLENDTEXTUREALPHA],["BLENDFACTORALPHA",ix.BLENDFACTORALPHA],["BLENDCURRENTALPHA",ix.BLENDCURRENTALPHA],["MODULATEALPHA_ADDCOLOR",ix.MODULATEALPHA_ADDCOLOR],["MODULATEINVALPHA_ADDCOLOR",ix.MODULATEINVALPHA_ADDCOLOR],["MODULATEINVCOLOR_ADDALPHA",ix.MODULATEINVCOLOR_ADDALPHA],["DOTPRODUCT3",ix.DOTPRODUCT3],["SELECTARG1",ix.SELECTARG1],["SELECTARG2",ix.SELECTARG2],["OFF",ix.OFF]]);return function(){this.modes.length=0,this.alphaModes.length=0;for(const t of this._mode){const i=t.split(",");for(let e=0,t=i.length;e<t;++e)i[e]=i[e].trim();0===i.length&&i.push("MODULATE"),i.length<2&&i.push(i[0]);const n=e.get(i[0]);void 0!==n?this.modes.push(n):this.modes.push(ix.MODULATE);const s=e.get(i[1]);void 0!==s?this.alphaModes.push(s):this.alphaModes.push(ix.MODULATE)}}})(),set_source__:(()=>{const e=new Map([["DIFFUSE",rx.DIFFUSE],["SPECULAR",rx.SPECULAR],["FACTOR",rx.FACTOR]]);return function(){this.sources.length=0;for(const t of this._source){const i=e.get(t);void 0!==i?this.sources.push(i):this.sources.push(rx.DEFAULT)}}})(),set_function__:(()=>{const e=new Map([["COMPLEMENT",lx.COMPLEMENT],["ALPHAREPLICATE",lx.ALPHAREPLICATE]]);return function(){this.functions.length=0;for(const t of this._function){const i=e.get(t);void 0!==i?this.functions.push(i):this.functions.push(lx.DEFAULT)}}})(),set_texture__(){this.textureNodes.length=0;for(const e of this._texture){const t=ql(d.X3DSingleTextureNode,e);t&&this.textureNodes.push(t)}},updateTextureBits(e){const t=this.maxTextures,i=this.textureNodes,n=Math.min(t,i.length);for(let t=0;t<n;++t)i[t].updateTextureBits(e,t);e.set(2*t,1)},getShaderOptions(e){const t=this.textureNodes,i=Math.min(this.maxTextures,t.length);for(let n=0;n<i;++n)t[n].getShaderOptions(e,n)},traverse(e,t){for(const i of this.textureNodes)i.traverse(e,t)},setShaderUniforms(e,t,i){const n=this.textureNodes,s=Math.min(this.maxTextures,n.length);e.uniform4fv(t.x3d_MultiTextureColor,this.color);for(let r=0;r<s;++r)n[r].setShaderUniforms(e,t,i,t.x3d_Texture[r]),e.uniform1i(t.x3d_MultiTextureMode[r],this.getMode(r)),e.uniform1i(t.x3d_MultiTextureAlphaMode[r],this.getAlphaMode(r)),e.uniform1i(t.x3d_MultiTextureSource[r],this.getSource(r)),e.uniform1i(t.x3d_MultiTextureFunction[r],this.getFunction(r))}}),Object.defineProperties(lT,{typeName:{value:"MultiTexture",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"color",new Yn.SFColor(1,1,1)),new X(d.inputOutput,"alpha",new Yn.SFFloat(1)),new X(d.inputOutput,"mode",new Yn.MFString),new X(d.inputOutput,"source",new Yn.MFString),new X(d.inputOutput,"function",new Yn.MFString),new X(d.inputOutput,"texture",new Yn.MFNode)]),enumerable:!0}});const uT=lT;i.add("MultiTexture","x_ite/Components/Texturing/MultiTexture",uT);const hT=uT;function dT(e){Zh.call(this,e),this.addType(d.X3DTextureCoordinateNode)}Object.setPrototypeOf(dT.prototype,Zh.prototype),Object.defineProperties(dT,{typeName:{value:"X3DTextureCoordinateNode",enumerable:!0},componentName:{value:"Texturing",enumerable:!0}});const cT=dT;i.add("X3DTextureCoordinateNode","x_ite/Components/Texturing/X3DTextureCoordinateNode",cT);const pT=cT;function gT(e){pT.call(this,e),this.addType(d.MultiTextureCoordinate);const t=this.getBrowser();this.maxTexCoords=t.getMaxTexCoords(),this.textureCoordinateNodes=[]}Object.assign(Object.setPrototypeOf(gT.prototype,pT.prototype),{initialize(){pT.prototype.initialize.call(this),this._texCoord.addInterest("set_texCoord__",this),this.set_texCoord__()},set_texCoord__(){const e=this.textureCoordinateNodes;for(const t of e)t.removeInterest("addNodeEvent",this);e.length=0;for(const t of this._texCoord){const i=ql(d.X3DSingleTextureCoordinateNode,t);i&&e.push(i)}for(const t of e)t.addInterest("addNodeEvent",this)},getCount(){return Math.min(this.maxTexCoords,this.textureCoordinateNodes.length)},isEmpty:()=>!0,getSize:()=>0,init(e){const t=this.textureCoordinateNodes,i=Math.min(this.maxTexCoords,t.length);for(let n=0;n<i;++n)t[n].init(e)},addPoint(e,t){const i=this.textureCoordinateNodes,n=Math.min(this.maxTexCoords,i.length);for(let s=0;s<n;++s)i[s].addPointToChannel(e,t[s])},addPoints(e){for(const t of this.textureCoordinateNodes)return t.addPoints(e);return e},getTextureCoordinateMapping(e){const t=this.textureCoordinateNodes,i=Math.min(this.maxTexCoords,t.length);for(let n=0;n<i;++n)t[n].getTextureCoordinateMapping(e,n)},setShaderUniforms(e,t){const i=this.textureCoordinateNodes,n=Math.min(this.maxTexCoords,i.length);if(n)for(let s=0;s<n;++s)i[s].setShaderUniforms(e,t,s);else this.getBrowser().getDefaultTextureCoordinate().setShaderUniforms(e,t,0)}}),Object.defineProperties(gT,{typeName:{value:"MultiTextureCoordinate",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"texCoord",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"texCoord",new Yn.MFNode)]),enumerable:!0}});const fT=gT;i.add("MultiTextureCoordinate","x_ite/Components/Texturing/MultiTextureCoordinate",fT);const mT=fT;function _T(e){kl.call(this,e),this.addType(d.X3DTextureTransformNode)}Object.setPrototypeOf(_T.prototype,kl.prototype),Object.defineProperties(_T,{typeName:{value:"X3DTextureTransformNode",enumerable:!0},componentName:{value:"Texturing",enumerable:!0}});const xT=_T;i.add("X3DTextureTransformNode","x_ite/Components/Texturing/X3DTextureTransformNode",xT);const yT=xT;function wT(e){yT.call(this,e),this.addType(d.MultiTextureTransform);const t=this.getBrowser();this.maxTextureTransforms=t.getMaxTextureTransforms(),this.textureTransformNodes=[]}Object.assign(Object.setPrototypeOf(wT.prototype,yT.prototype),{initialize(){yT.prototype.initialize.call(this),this._textureTransform.addInterest("set_textureTransform__",this),this.set_textureTransform__()},set_textureTransform__(){const e=this.textureTransformNodes;e.length=0;for(const t of this._textureTransform){const i=ql(d.X3DSingleTextureTransformNode,t);i&&e.push(i)}e.length||e.push(this.getBrowser().getDefaultTextureTransform())},getCount(){return Math.min(this.maxTextureTransforms,this.textureTransformNodes.length)},getTextureTransformMapping(e){const t=this.textureTransformNodes,i=Math.min(this.maxTextureTransforms,t.length);for(let n=0;n<i;++n)t[n].getTextureTransformMapping(e,n)},setShaderUniforms(e,t){const i=this.textureTransformNodes,n=Math.min(this.maxTextureTransforms,i.length);for(let s=0;s<n;++s)i[s].setShaderUniforms(e,t,s)},transformPoint(e){return this.textureTransformNodes[0].transformPoint(e)}}),Object.defineProperties(wT,{typeName:{value:"MultiTextureTransform",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"textureTransform",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"textureTransform",new Yn.MFNode)]),enumerable:!0}});const bT=wT;i.add("MultiTextureTransform","x_ite/Components/Texturing/MultiTextureTransform",bT);const ST=bT;var TT=n(464);function vT(e){Ql.call(this,e),this.addType(d.PixelTexture),this.addChildObjects(d.outputOnly,"loadState",new Yn.SFInt32(d.NOT_STARTED_STATE))}Object.assign(Object.setPrototypeOf(vT.prototype,Ql.prototype),{initialize(){Ql.prototype.initialize.call(this),this._image.addInterest("set_image__",this),this.canvas1=TT("<canvas></canvas>"),this.canvas2=TT("<canvas></canvas>"),this.set_image__()},checkLoadState(){return this._loadState.getValue()},convert(e,t,i,n){switch(t){case 1:for(let t=0,s=0;t<n;++t,s+=4){const n=i[t];e[s]=e[s+1]=e[s+2]=255&n,e[s+3]=255}break;case 2:for(let t=0,s=0;t<n;++t,s+=4){const n=i[t];e[s]=e[s+1]=e[s+2]=n>>>8&255,e[s+3]=255&n}break;case 3:for(let t=0,s=0;t<n;++t,s+=4){const n=i[t];e[s]=n>>>16&255,e[s+1]=n>>>8&255,e[s+2]=255&n,e[s+3]=255}break;case 4:for(let t=0,s=0;t<n;++t,s+=4){const n=i[t];e[s]=n>>>24,e[s+1]=n>>>16&255,e[s+2]=n>>>8&255,e[s+3]=255&n}}},resize(e,t,i,n,s){const r=new Uint8Array(n*s*4),o=n/t,a=s/i;for(let i=0;i<s;++i){const s=Math.floor(i/a)*t,l=i*n;for(let t=0;t<n;++t){const i=4*(s+Math.floor(t/o)),n=4*(l+t);r[n]=e[i],r[n+1]=e[i+1],r[n+2]=e[i+2],r[n+3]=e[i+3]}}return r},set_image__(){const e=this.getBrowser().getContext(),t=this._image.comp,i=this._image.array,n=!(t%2);let s=this._image.width,r=this._image.height,o=null;if(s>0&&r>0&&t>0&&t<5){if(e.getVersion()>=2||g.isPowerOfTwo(s)&&g.isPowerOfTwo(r))o=new Uint8Array(s*r*4),this.convert(o,t,i.getValue(),i.length);else if(Math.max(s,r)<this.getBrowser().getMinTextureSize()&&!this._textureProperties.getValue()){o=new Uint8Array(s*r*4),this.convert(o,t,i.getValue(),i.length);const e=s,n=r;s=8*g.nextPowerOfTwo(e),r=8*g.nextPowerOfTwo(n),o=this.resize(o,e,n,s,r)}else{const e=this.canvas1[0],n=this.canvas2[0],a=e.getContext("2d",{willReadFrequently:!0}),l=n.getContext("2d",{willReadFrequently:!0}),u=a.createImageData(s,r);e.width=s,e.height=r,this.convert(u.data,t,i,i.length),a.putImageData(u,0,0),s=g.nextPowerOfTwo(s),r=g.nextPowerOfTwo(r),n.width=s,n.height=r,l.clearRect(0,0,s,r),l.drawImage(e,0,0,e.width,e.height,0,0,s,r),o=l.getImageData(0,0,s,r).data}this.setTexture(s,r,n,new Uint8Array(o.buffer),!1),this._loadState=d.COMPLETE_STATE}else this.clearTexture(),this._loadState=d.FAILED_STATE}}),Object.defineProperties(vT,{typeName:{value:"PixelTexture",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"description",new Yn.SFString),new X(d.inputOutput,"image",new Yn.SFImage),new X(d.initializeOnly,"repeatS",new Yn.SFBool(!0)),new X(d.initializeOnly,"repeatT",new Yn.SFBool(!0)),new X(d.initializeOnly,"textureProperties",new Yn.SFNode)]),enumerable:!0}});const OT=vT;i.add("PixelTexture","x_ite/Components/Texturing/PixelTexture",OT);const ET=OT;function NT(e){pT.call(this,e),this.addType(d.X3DSingleTextureCoordinateNode),this.texCoordArray=new Yn.MFFloat}Object.assign(Object.setPrototypeOf(NT.prototype,pT.prototype),{getCount:()=>1,init(e){this.texCoordArray.length=0,e.push(this.texCoordArray)},addPoint(e,t){this.addPointToChannel(e,t[0])},getTextureCoordinateMapping(e,t=0){e.set(this._mapping.getValue()||t,t)},setShaderUniforms(e,t,i=0){e.uniform1i(t.x3d_TextureCoordinateGeneratorMode[i],0)}}),Object.defineProperties(NT,{typeName:{value:"X3DSingleTextureCoordinateNode",enumerable:!0},componentName:{value:"Texturing",enumerable:!0}});const CT=NT;i.add("X3DSingleTextureCoordinateNode","x_ite/Components/Texturing/X3DSingleTextureCoordinateNode",CT);const FT=CT;function IT(e){FT.call(this,e),this.addType(d.TextureCoordinate)}Object.assign(Object.setPrototypeOf(IT.prototype,FT.prototype),{initialize(){FT.prototype.initialize.call(this),this._point.addInterest("set_point__",this),this.set_point__()},set_point__(){this.point=this._point.getValue(),this.length=this._point.length},isEmpty(){return 0===this.length},getSize(){return this.length},addPointToChannel(e,t){if(e>=0&&this.length){const i=this.point,n=e%this.length*2;t.push(i[n],i[n+1],0,1)}else t.push(0,0,0,1)},addPoints(e){const t=this.point,i=this.length;for(let n=0,s=0;n<i;++n,s+=2)e.push(t[s],t[s+1],0,1);return e}}),Object.defineProperties(IT,{typeName:{value:"TextureCoordinate",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"texCoord",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"mapping",new Yn.SFString),new X(d.inputOutput,"point",new Yn.MFVec2f)]),enumerable:!0}});const MT=IT;i.add("TextureCoordinate","x_ite/Components/Texturing/TextureCoordinate",MT);const DT=MT;function PT(e){FT.call(this,e),this.addType(d.TextureCoordinateGenerator),this.mode=dx.SPHERE,this.parameter=new Float32Array(6)}Object.assign(Object.setPrototypeOf(PT.prototype,FT.prototype),{initialize(){FT.prototype.initialize.call(this),this._mode.addInterest("set_mode__",this),this._parameter.addInterest("set_parameter__",this),this.set_mode__(),this.set_parameter__()},set_mode__:(()=>{const e=new Map([["SPHERE",dx.SPHERE],["CAMERASPACENORMAL",dx.CAMERASPACENORMAL],["CAMERASPACEPOSITION",dx.CAMERASPACEPOSITION],["CAMERASPACEREFLECTIONVECTOR",dx.CAMERASPACEREFLECTIONVECTOR],["SPHERE-LOCAL",dx.SPHERE_LOCAL],["COORD",dx.COORD],["COORD-EYE",dx.COORD_EYE],["NOISE",dx.NOISE],["NOISE-EYE",dx.NOISE_EYE],["SPHERE-REFLECT",dx.SPHERE_REFLECT],["SPHERE-REFLECT-LOCAL",dx.SPHERE_REFLECT_LOCAL]]);return function(){this.mode=e.get(this._mode.getValue()),void 0===this.mode&&(this.mode=dx.SPHERE)}})(),set_parameter__(){const e=Math.min(this.parameter.length,this._parameter.length);for(let t=0;t<e;++t)this.parameter[t]=this._parameter[t];this.parameter.fill(0,e)},addPointToChannel(e,t){t.push(0,0,0,1)},addPoints:e=>e,setShaderUniforms(e,t,i=0){e.uniform1i(t.x3d_TextureCoordinateGeneratorMode[i],this.mode),e.uniform1fv(t.x3d_TextureCoordinateGeneratorParameter[i],this.parameter)}}),Object.defineProperties(PT,{typeName:{value:"TextureCoordinateGenerator",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"texCoord",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"mapping",new Yn.SFString),new X(d.inputOutput,"mode",new Yn.SFString("SPHERE")),new X(d.inputOutput,"parameter",new Yn.MFFloat)]),enumerable:!0}});const RT=PT;i.add("TextureCoordinateGenerator","x_ite/Components/Texturing/TextureCoordinateGenerator",RT);const AT=RT;function VT(e){bs.call(this,e),this.addType(d.TextureProperties),e.getSpecificationVersion()<=3.3&&(this._minificationFilter="DEFAULT",this._magnificationFilter="DEFAULT",this._textureCompression="DEFAULT")}Object.assign(Object.setPrototypeOf(VT.prototype,bs.prototype),{getBorderWidth(){return g.clamp(this._borderWidth.getValue(),0,1)},getBoundaryMode:(()=>{const e=new Map([["CLAMP","CLAMP_TO_EDGE"],["CLAMP_TO_EDGE","CLAMP_TO_EDGE"],["CLAMP_TO_BOUNDARY","CLAMP_TO_EDGE"],["MIRRORED_REPEAT","MIRRORED_REPEAT"],["REPEAT","REPEAT"]]);return function(t){const i=e.get(t);return void 0!==i?i:"REPEAT"}})(),getBoundaryModeS(){return this.getBoundaryMode(this._boundaryModeS.getValue())},getBoundaryModeT(){return this.getBoundaryMode(this._boundaryModeT.getValue())},getBoundaryModeR(){return this.getBoundaryMode(this._boundaryModeR.getValue())},getMinificationFilter:(()=>{const e=new Map([["AVG_PIXEL_AVG_MIPMAP","LINEAR_MIPMAP_LINEAR"],["AVG_PIXEL","LINEAR"],["AVG_PIXEL_NEAREST_MIPMAP","LINEAR_MIPMAP_NEAREST"],["NEAREST_PIXEL_AVG_MIPMAP","NEAREST_MIPMAP_LINEAR"],["NEAREST_PIXEL_NEAREST_MIPMAP","NEAREST_MIPMAP_NEAREST"],["NEAREST_PIXEL","NEAREST"],["NICEST","LINEAR_MIPMAP_LINEAR"],["FASTEST","NEAREST"]]);return function(){if(this._generateMipMaps.getValue()){const t=e.get(this._minificationFilter.getValue());return void 0!==t?t:this.getBrowser().getDefaultTextureProperties().getMinificationFilter()}return"LINEAR"}})(),getMagnificationFilter:(()=>{const e=new Map([["AVG_PIXEL","LINEAR"],["NEAREST_PIXEL","NEAREST"],["NICEST","LINEAR"],["FASTEST","NEAREST"]]);return function(){const t=e.get(this._magnificationFilter.getValue());return void 0!==t?t:this.getBrowser().getDefaultTextureProperties().getMagnificationFilter()}})(),getTextureCompression:(()=>{const e=new Map([["DEFAULT","RGBA"],["NICEST","RGBA"],["FASTEST","RGBA"],["LOW","RGBA"],["MEDIUM","RGBA"],["HIGH","RGBA"]]);return function(){const t=this.getBrowser().getContext(),i=t.getExtension("WEBGL_compressed_texture_etc"),n=i?i[e.get(this._textureCompression.getValue())]:void 0;return void 0!==n?n:t.RGBA}})()}),Object.defineProperties(VT,{typeName:{value:"TextureProperties",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"textureProperties",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"borderColor",new Yn.SFColorRGBA),new X(d.inputOutput,"borderWidth",new Yn.SFInt32),new X(d.inputOutput,"anisotropicDegree",new Yn.SFFloat(1)),new X(d.initializeOnly,"generateMipMaps",new Yn.SFBool),new X(d.inputOutput,"minificationFilter",new Yn.SFString("FASTEST")),new X(d.inputOutput,"magnificationFilter",new Yn.SFString("FASTEST")),new X(d.inputOutput,"boundaryModeS",new Yn.SFString("REPEAT")),new X(d.inputOutput,"boundaryModeT",new Yn.SFString("REPEAT")),new X(d.inputOutput,"boundaryModeR",new Yn.SFString("REPEAT")),new X(d.inputOutput,"textureCompression",new Yn.SFString("FASTEST")),new X(d.inputOutput,"texturePriority",new Yn.SFFloat)]),enumerable:!0}});const LT=VT;i.add("TextureProperties","x_ite/Components/Texturing/TextureProperties",LT);const BT=LT;function UT(e){yT.call(this,e),this.addType(d.X3DSingleTextureTransformNode),this.matrixArray=new Float32Array(ci.Identity)}Object.assign(Object.setPrototypeOf(UT.prototype,yT.prototype),{getCount:()=>1,setMatrix(e){this.matrixArray.set(e)},getTextureTransformMapping(e,t=0){e.set(this._mapping.getValue()||t,t)},setShaderUniforms(e,t,i=0){e.uniformMatrix4fv(t.x3d_TextureMatrix[i],!1,this.matrixArray)},transformPoint(e){return ci.prototype.multVecMatrix.call(this.matrixArray,e)}}),Object.defineProperties(UT,{typeName:{value:"X3DSingleTextureTransformNode",enumerable:!0},componentName:{value:"Texturing",enumerable:!0}});const XT=UT;i.add("X3DSingleTextureTransformNode","x_ite/Components/Texturing/X3DSingleTextureTransformNode",XT);const kT=XT;function jT(e){kT.call(this,e),this.addType(d.TextureTransform),this._rotation.setUnit("angle"),this.matrix=new ci}Object.assign(Object.setPrototypeOf(jT.prototype,kT.prototype),{initialize(){kT.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},getMatrix(){return this.matrix},eventsProcessed:(()=>{const e=new ft(0,0),t=new Pt;return function(){const i=this._translation.getValue(),n=this._rotation.getValue(),s=this._scale.getValue(),r=this._center.getValue(),o=this.matrix;t.identity(),r.equals(ft.Zero)||t.translate(e.assign(r).negate()),s.equals(ft.One)||t.scale(s),0!==n&&t.rotate(n),r.equals(ft.Zero)||t.translate(r),i.equals(ft.Zero)||t.translate(i),o[0]=t[0],o[1]=t[1],o[4]=t[3],o[5]=t[4],o[12]=t[6],o[13]=t[7],this.setMatrix(o)}})()}),Object.defineProperties(jT,{typeName:{value:"TextureTransform",enumerable:!0},componentName:{value:"Texturing",enumerable:!0},containerField:{value:"textureTransform",enumerable:!0},specificationRange:{value:Object.freeze(["2.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"metadata",new Yn.SFNode),new X(d.inputOutput,"mapping",new Yn.SFString),new X(d.inputOutput,"translation",new Yn.SFVec2f),new X(d.inputOutput,"rotation",new Yn.SFFloat),new X(d.inputOutput,"scale",new Yn.SFVec2f(1,1)),new X(d.inputOutput,"center",new Yn.SFVec2f)]),enumerable:!0}});const zT=jT;i.add("TextureTransform","x_ite/Components/Texturing/TextureTransform",zT);const GT=zT,HT={name:"Texturing",concreteNodes:[nu,aT,hT,mT,ST,ET,DT,AT,BT,GT],abstractNodes:[FT,$l,kT,Ql,pT,Gl,yT]};i.add("Texturing","x_ite/Components/Texturing",HT);const qT=HT,YT={name:"Time",concreteNodes:[xu],abstractNodes:[fu]};i.add("Time","x_ite/Components/Time",YT);const WT=YT,$T=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_frag_depth","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_debug_shaders","WEBGL_depth_texture","WEBGL_draw_buffers","WEBGL_lose_context","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_sRGB","WEBGL_color_buffer_float","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","EXT_float_blend","OES_fbo_render_mipmap","WEBGL_get_buffer_sub_data_async","WEBGL_multiview","WEBGL_security_sensitive_resources","WEBGL_shared_resources","EXT_clip_cull_distance","WEBGL_debug","WEBGL_dynamic_texture","WEBGL_subarray_uploads","WEBGL_texture_multisample","WEBGL_texture_source_iframe","WEBGL_video_texture","EXT_texture_storage","OES_depth24","WEBGL_debug_shader_precision","WEBGL_draw_elements_no_range_check","WEBGL_subscribe_uniform","WEBGL_texture_from_depth_video"],JT={create(e,t,i,n){const s={preserveDrawingBuffer:i};let r=null;if(t>=2&&!r&&(r=e.getContext("webgl2",{...s,antialias:!1}),r&&(r.getVersion=()=>2)),t>=1&&!r&&(r=e.getContext("webgl",s)||e.getContext("experimental-webgl",s),r)){r.getVersion=()=>1;{const e=r.getExtension("OES_vertex_array_object");r.bindVertexArray=e.bindVertexArrayOES.bind(e),r.createVertexArray=e.createVertexArrayOES.bind(e),r.deleteVertexArray=e.deleteVertexArrayOES.bind(e),r.isVertexArray=e.isVertexArrayOES.bind(e)}}if(!r)throw new Error("Couldn't create WebGL context.");for(const e of $T)r.getExtension(e);const o=r.getParameter(r.ALIASED_LINE_WIDTH_RANGE);if(1===o[0]&&1===o[1]?(r.lineWidth=Function.prototype,r.HAS_FEATURE_TRANSFORMED_LINES=r.getVersion()>=2):r.HAS_FEATURE_TRANSFORMED_LINES=!1,r.HAS_FEATURE_DEPTH_TEXTURE=r.getVersion()>=2||!!r.getExtension("WEBGL_depth_texture"),r.HAS_FEATURE_FRAG_DEPTH=r.getVersion()>=2||!!r.getExtension("EXT_frag_depth"),1===r.getVersion()){const e=r.getExtension("WEBGL_color_buffer_float"),t=r.getExtension("WEBGL_draw_buffers");r.RGBA32F=e.RGBA32F_EXT,r.MAX_COLOR_ATTACHMENTS=t.MAX_COLOR_ATTACHMENTS_WEBGL,r.drawBuffers=t.drawBuffersWEBGL.bind(t);for(let e=0,i=r.getParameter(r.MAX_COLOR_ATTACHMENTS);e<i;++e){const i=t.COLOR_ATTACHMENT0_WEBGL+e;void 0===r[`COLOR_ATTACHMENT${e}`]&&(r[`COLOR_ATTACHMENT${e}`]=i)}}if(n){const e=r.getExtension("EXT_color_buffer_half_float");Object.defineProperty(r,"RGBA32F",{value:1===r.getVersion()?e.RGBA16F_EXT:r.RGBA16F})}return Object.assign(r,1===r.getVersion()?{readPixelsAsync:r.readPixels}:{clientWaitAsync(e,t,i){return new Promise(((n,s)=>{const r=()=>{switch(this.clientWaitSync(e,t,0)){case this.WAIT_FAILED:return void s(new Error("clientWaitSync: WAIT_FAILED"));case this.TIMEOUT_EXPIRED:return void setTimeout(r,i);default:return void n()}};setTimeout(r)}))},getBufferSubDataAsync:async function(e,t,i,n,s,r){const o=this.fenceSync(this.SYNC_GPU_COMMANDS_COMPLETE,0);this.flush(),await this.clientWaitAsync(o,0,10),this.deleteSync(o),this.bindBuffer(e,t),this.getBufferSubData(e,i,n,s,r),this.bindBuffer(e,null)},readPixelsAsync:async function(e,t,i,n,s,r,o,a){const l=this.createBuffer();this.bindBuffer(this.PIXEL_PACK_BUFFER,l),this.bufferData(this.PIXEL_PACK_BUFFER,o.byteLength,this.STREAM_READ),this.readPixels(e,t,i,n,s,r,0),this.bindBuffer(this.PIXEL_PACK_BUFFER,null),await this.getBufferSubDataAsync(this.PIXEL_PACK_BUFFER,l,0,o,a),this.deleteBuffer(l)}}),r}},KT=JT;i.add("Context","x_ite/Browser/Core/Context",KT);const ZT=KT,QT='msgid ""\nmsgstr ""\n"Project-Id-Version: X_ITE\n"\n"POT-Creation-Date: 2015-12-23 04:56+0100\n"\n"PO-Revision-Date: 2015-12-23 04:57+0100\n"\n"Last-Translator: Holger Seelig <holger.seelig@yahoo.de>\n"\n"Language-Team: \n"\n"Language: de\n"\n"MIME-Version: 1.0\n"\n"Content-Type: text/plain; charset=UTF-8\n"\n"Content-Transfer-Encoding: 8bit\n"\n"X-Generator: Poedit 1.8.4\n"\n"X-Poedit-Basepath: ../x_ite\n"\n"Plural-Forms: nplurals=2; plural=(n != 1);\n"\n"X-Poedit-SourceCharset: UTF-8\n"\n"X-Poedit-SearchPath-0: .\n"\n\nmsgid "Less Properties"\nmsgstr "Weniger Eigenschaften"\n\nmsgid "More Properties"\nmsgstr "Mehr Eigenschaften"\n\nmsgid "Frame rate"\nmsgstr "Bildrate"\n\nmsgid "fps"\nmsgstr "BpS"\n\nmsgid "Speed"\nmsgstr "Geschwindigkeit"\n\nmsgid "m/s"\nmsgstr ""\n\nmsgid "km/h"\nmsgstr ""\n\nmsgid "Browser"\nmsgstr ""\n\nmsgid "ms"\nmsgstr ""\n\nmsgid "X3D total"\nmsgstr "X3D gesamt"\n\nmsgid "Event Processing"\nmsgstr "Ereignisverarbeitung"\n\nmsgid "Pointer"\nmsgstr "Zeigegerät"\n\nmsgid "Camera"\nmsgstr "Kamera"\n\nmsgid "Collision Detection"\nmsgstr "Kollisionserkennung"\n\nmsgid "Rendering"\nmsgstr "Rendering"\n\nmsgid "Number of Shapes"\nmsgstr "Anzahl der Formen"\n\nmsgid "Number of Sensors"\nmsgstr "Anzahl der Sensoren"\n\nmsgid "Browser Timings"\nmsgstr "Zeitberechnung"\n\nmsgid "X_ITE Browser"\nmsgstr ""\n\nmsgid "Viewpoints"\nmsgstr "Ansichtspunkte"\n\nmsgid "Available Viewers"\nmsgstr "Verfügbare Betrachter"\n\nmsgid "Straighten Horizon"\nmsgstr "Horizont gerade richten"\n\nmsgid "Primitive Quality"\nmsgstr "Qualität der Grundobjekte"\n\nmsgid "High"\nmsgstr "Hoch"\n\nmsgid "high"\nmsgstr "hoch"\n\nmsgid "Medium"\nmsgstr "Mittel"\n\nmsgid "medium"\nmsgstr "mittel"\n\nmsgid "Low"\nmsgstr "Niedrig"\n\nmsgid "low"\nmsgstr "niedrig"\n\nmsgid "Texture Quality"\nmsgstr "Textur Qualität"\n\nmsgid "Display Rubberband"\nmsgstr "Gummiband anzeigen"\n\nmsgid "Rubberband"\nmsgstr "Gummiband"\n\nmsgid "on"\nmsgstr "an"\n\nmsgid "off"\nmsgstr "aus"\n\nmsgid "Mute Browser"\nmsgstr "Browser stumm schalten"\n\nmsgid "Browser muted"\nmsgstr "Browser stumm geschalten"\n\nmsgid "Browser unmuted"\nmsgstr "Browser Ton an"\n\nmsgid "Leave Fullscreen"\nmsgstr "Vollbild verlassen"\n\nmsgid "Fullscreen"\nmsgstr "Vollbild"\n\nmsgid "About X_ITE"\nmsgstr "Über X_ITE"\n\nmsgid "Examine Viewer"\nmsgstr "Untersuchen"\n\nmsgid "Walk Viewer"\nmsgstr "Laufen"\n\nmsgid "Fly Viewer"\nmsgstr "Fliegen"\n\nmsgid "Plane Viewer"\nmsgstr "Ebenen Betrachter"\n\nmsgid "Look At Viewer"\nmsgstr "Auf Objekte zielen"\n\nmsgid "None Viewer"\nmsgstr "Kein Betrachter"\n\nmsgid "Points"\nmsgstr "Punkte"\n\nmsgid "Flat"\nmsgstr "Flach"\n\nmsgid "Wireframe"\nmsgstr "Drahtgittermodel"\n\nmsgid "Loading %1 file"\nmsgstr "Lade %1 Datei"\n\nmsgid "Loading %1 files"\nmsgstr "Lade %1 Dateien"\n\nmsgid "Loading done"\nmsgstr "Fertig mit Laden"\n\nmsgid "Failed loading world."\nmsgstr "Laden der Dateien fehlgeschlagen."\n\nmsgid "Show World Info"\nmsgstr "World Info anzeigen"\n\nmsgid "Viewpoint is copied to clipboard."\nmsgstr "Ansichtspunkt wurde in die Zwischenablage kopiert."\n';i.add("de.po","locale/de.po",QT);const ev=QT,tv='msgid ""\nmsgstr ""\n"Project-Id-Version: X_ITE\n"\n"POT-Creation-Date: 2015-12-23 04:58+0100\n"\n"PO-Revision-Date: 2015-12-23 05:07+0100\n"\n"Last-Translator: Holger Seelig <holger.seelig@yahoo.de>\n"\n"Language-Team: \n"\n"Language: fr\n"\n"MIME-Version: 1.0\n"\n"Content-Type: text/plain; charset=UTF-8\n"\n"Content-Transfer-Encoding: 8bit\n"\n"X-Generator: Poedit 1.8.4\n"\n"X-Poedit-Basepath: ../x_ite\n"\n"Plural-Forms: nplurals=2; plural=(n != 1);\n"\n"X-Poedit-SourceCharset: UTF-8\n"\n"X-Poedit-SearchPath-0: .\n"\n\nmsgid "Less Properties"\nmsgstr "Moins de Propriétés"\n\nmsgid "More Properties"\nmsgstr "Plus de Propriétés"\n\nmsgid "Frame rate"\nmsgstr "Fréquence d\'Images"\n\nmsgid "fps"\nmsgstr "fps"\n\nmsgid "Speed"\nmsgstr "Vélocité"\n\nmsgid "m/s"\nmsgstr ""\n\nmsgid "km/h"\nmsgstr ""\n\nmsgid "Browser"\nmsgstr "X_ITE Navigateur"\n\nmsgid "ms"\nmsgstr ""\n\nmsgid "X3D total"\nmsgstr "X3D total"\n\nmsgid "Event Processing"\nmsgstr "Traitement des Événements"\n\nmsgid "Pointer"\nmsgstr "Pointeur"\n\nmsgid "Camera"\nmsgstr "Caméra"\n\nmsgid "Collision Detection"\nmsgstr "Détection des Collisions"\n\nmsgid "Rendering"\nmsgstr "Rendement"\n\nmsgid "Number of Shapes"\nmsgstr "Nombre de Formes"\n\nmsgid "Number of Sensors"\nmsgstr "Nombre de Senseurs"\n\nmsgid "Browser Timings"\nmsgstr "Calcul du Temps"\n\nmsgid "X_ITE Browser"\nmsgstr "X_ITE Navigateur"\n\nmsgid "Viewpoints"\nmsgstr "Points de Vue"\n\nmsgid "Available Viewers"\nmsgstr "Visionneurs disponibles"\n\nmsgid "Straighten Horizon"\nmsgstr "Redresser l\'Horizon"\n\nmsgid "Primitive Quality"\nmsgstr "Qualité des Objets simples"\n\nmsgid "High"\nmsgstr "Haut"\n\nmsgid "high"\nmsgstr "haut"\n\nmsgid "Medium"\nmsgstr "Moyenne"\n\nmsgid "medium"\nmsgstr "moyenne"\n\nmsgid "Low"\nmsgstr "Faible"\n\nmsgid "low"\nmsgstr "faible"\n\nmsgid "Texture Quality"\nmsgstr "Qualité des Textures"\n\nmsgid "Display Rubberband"\nmsgstr "Présenter le Bande élastique"\n\nmsgid "Rubberband"\nmsgstr "Bande élastique"\n\nmsgid "on"\nmsgstr "marche"\n\nmsgid "off"\nmsgstr "arrêt"\n\nmsgid "Mute Browser"\nmsgstr "Rendre Navigateur muet"\n\nmsgid "Browser muted"\nmsgstr "Navigateur muet"\n\nmsgid "Browser unmuted"\nmsgstr "Son de Navigateur réactivé"\n\nmsgid "Leave Fullscreen"\nmsgstr "Laisser le plein Écran"\n\nmsgid "Fullscreen"\nmsgstr "Plein Écran"\n\nmsgid "About X_ITE"\nmsgstr "À propos de X_ITE"\n\nmsgid "Examine Viewer"\nmsgstr "Examiner"\n\nmsgid "Walk Viewer"\nmsgstr "Aller"\n\nmsgid "Fly Viewer"\nmsgstr "Voler"\n\nmsgid "Plane Viewer"\nmsgstr "Visionneur de la Plaine"\n\nmsgid "Look At Viewer"\nmsgstr "Regarder un Objet de près"\n\nmsgid "None Viewer"\nmsgstr "Pas de Visionneur"\n\nmsgid "Flat"\nmsgstr "Plat"\n\nmsgid "Wireframe"\nmsgstr "Image filaire"\n\nmsgid "Loading %1 file"\nmsgstr "Télécharger %1 Fichier"\n\nmsgid "Loading %1 files"\nmsgstr "Télécharger %1 Fichiers"\n\nmsgid "Loading done"\nmsgstr "Téléchargement fini"\n\nmsgid "Failed loading world."\nmsgstr "Le chargement des Fichiers a échoué."\n\nmsgid "Show World Info"\nmsgstr "Afficher World Info"\n\nmsgid "Viewpoint is copied to clipboard."\nmsgstr "Le point de Vue est copié dans le Presse-Papiers."\n';i.add("fr.po","locale/fr.po",tv);const iv={en:"C",de:ev,fr:tv},nv=/msgid\s+"(.*?)"\nmsgstr\s+"(.*?)"\n/g,sv=function(){for(const e of navigator.languages){const t=e.split("-")[0];if(iv[t])return t}return(navigator.language||navigator.userLanguage).split("-")[0]}();!function(e){if(iv[e]){const n=function(e,t){const i=[];let n=null;for(;n=e.exec(t);)i.push(n);return i}(nv,iv[e]),s=iv[e]={};for(var t=0,i=n.length;t<i;++t)n[t][2].length&&(s[n[t][1]]=n[t][2])}}(sv);const rv=function(e){const t=iv[sv];if(void 0===t)return e;const i=t[e];return void 0===i?e:i};i.add("gettext","locale/gettext",rv);const ov=rv;var av=n(464);function lv(e){ds.call(this,e),this.localStorage=this.getBrowser().getLocalStorage().addNameSpace("BrowserTimings."),this.fps=new Ga}Object.assign(Object.setPrototypeOf(lv.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this),this.getBrowser().getBrowserOptions()._Timings.addInterest("set_enabled__",this),this.localStorage.setDefaultValues({type:"LESS"}),this.element=av("<div></div>").hide().addClass("x_ite-private-browser-timings").appendTo(this.getBrowser().getSurface()),this.table=av("<table></table>").appendTo(this.element),this.header=av("<thead></thead>").append(av("<tr></tr>").append(av("<th colspan='2'></th>").text(ov("Browser Timings")))).appendTo(this.table),this.body=av("<tbody></tbody>").appendTo(this.table),this.footer=av("<tfoot></tfoot>").append(av("<tr></tr>").append(av("<td colspan='2'></td>"))).appendTo(this.table),this.button=av("<button></button>").attr("type","button").appendTo(this.footer.find("td")),this.frameRate=av("<td></td>"),this.speed=av("<td></td>"),this.frameRate=av("<td></td>"),this.speed=av("<td></td>"),this.browserTime=av("<td></td>"),this.x3dTotal=av("<td></td>"),this.eventProcessing=av("<td></td>"),this.pointerTime=av("<td></td>"),this.cameraTime=av("<td></td>"),this.pickingTime=av("<td></td>"),this.collisionTime=av("<td></td>"),this.renderTime=av("<td></td>"),this.numShapes=av("<td></td>"),this.sensors=av("<td></td>"),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Frame rate")+":")).append(this.frameRate)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Speed")+":")).append(this.speed).addClass("x_ite-private-more")),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Browser")+":")).append(this.browserTime)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("X3D total")+":")).append(this.x3dTotal)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Event Processing")+":")).append(this.eventProcessing)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Pointer")+":")).append(this.pointerTime)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Camera")+":")).append(this.cameraTime)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Picking")+":")).append(this.pickingTime)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Collision Detection")+":")).append(this.collisionTime)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Rendering")+":")).append(this.renderTime)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Number of Shapes")+":")).append(this.numShapes)),this.body.append(av("<tr></tr>").append(av("<td></td>").text(ov("Number of Sensors")+":")).append(this.sensors)),this.button.on("click touchend",this.set_type__.bind(this)),this.localStorage.type="MORE"===this.localStorage.type?"LESS":"MORE",this.set_type__()},set_enabled__(){this.getBrowser().getBrowserOption("Timings")?(this.element.stop(!0,!0).fadeIn(),this.fps.reset(),this.getBrowser().prepareEvents().addInterest("update",this),this.update(),this.build()):(this.element.stop(!0,!0).fadeOut(),this.getBrowser().prepareEvents().removeInterest("update",this))},set_type__(){"MORE"===this.localStorage.type?(this.localStorage.type="LESS",this.table.addClass("less"),this.table.removeClass("more")):(this.localStorage.type="MORE",this.table.addClass("more"),this.table.removeClass("less")),this.set_button__(),this.build()},set_button__(){"MORE"===this.localStorage.type?this.button.text(ov("Less Properties")):this.button.text(ov("More Properties"))},update(){this.fps.stop(),this.fps.elapsedTime>1e3&&(this.build(),this.fps.reset()),this.fps.start()},build(){const e=this.getBrowser();if(this.frameRate.text(`${uv(1e3/this.fps.averageTime)} ${ov("fps")}`),this.speed.text(`${uv(this.getSpeed(e.currentSpeed))} ${this.getSpeedUnit(e.currentSpeed)}`),"MORE"!==this.localStorage.type||!e.getWorld())return;const t=e.getWorld().getLayerSet().getLayers(),i=e.getActiveLayer(),n=i&&e.getCollisionCount()?i.getCollisionTime().averageTime:0,s=e.getCollisionTime().averageTime+n,r=Math.max(0,e.getBrowserTime().averageTime-(e.getCameraTime().averageTime+e.getCollisionTime().averageTime+e.getDisplayTime().averageTime)),o=e.prepareEvents().getInterests().size-1,a=e.sensorEvents().getInterests().size,l=t.reduce(((e,t)=>e+t.getNumOpaqueShapes()),0),u=t.reduce(((e,t)=>e+t.getNumTransparentShapes()),0);this.browserTime.text(`${uv(e.getSystemTime().averageTime)} ${ov("ms")}`),this.x3dTotal.text(`${uv(e.getBrowserTime().averageTime)} ${ov("ms")}`),this.eventProcessing.text(`${uv(r)} ${ov("ms")}`),this.pointerTime.text(`${uv(e.getPointingTime().averageTime)} ${ov("ms")}`),this.cameraTime.text(`${uv(e.getCameraTime().averageTime)} ${ov("ms")}`),this.pickingTime.text(`${uv(e.getPickingTime().averageTime)} ${ov("ms")}`),this.collisionTime.text(`${uv(s)} ${ov("ms")}`),this.renderTime.text(`${uv(e.getDisplayTime().averageTime)} ${ov("ms")}`),this.numShapes.text(`${l} + ${u}`),this.sensors.text(o+a),e.getSystemTime().reset(),e.getBrowserTime().reset(),e.getPointingTime().reset(),e.getCameraTime().reset(),e.getPickingTime().reset(),e.getCollisionTime().reset(),e.getDisplayTime().reset(),i?.getCollisionTime().reset()},getSpeed:e=>e<15?e:3.6*e,getSpeedUnit:e=>ov(e<15?"m/s":"km/h")}),Object.defineProperties(lv,{typeName:{value:"BrowserTimings",enumerable:!0}});const uv=(()=>{const e=new Intl.NumberFormat(navigator.language||navigator.userLanguage,{notation:"standard",minimumFractionDigits:2,maximumFractionDigits:2}).format;return function(t){return e(Number.isFinite(t)?t:0)}})(),hv=lv;i.add("BrowserTimings","x_ite/Browser/Core/BrowserTimings",hv);const dv=hv;let cv=0;const pv={LOW:cv++,MEDIUM:cv++,HIGH:cv++};i.add("PrimitiveQuality","x_ite/Browser/Core/PrimitiveQuality",pv);const gv=pv;let fv=0;const mv={LOW:fv++,MEDIUM:fv++,HIGH:fv++};i.add("TextureQuality","x_ite/Browser/Core/TextureQuality",mv);const _v=mv;var xv=n(464);function yv(e){ds.call(this,e),this.addAlias("AntiAliased",this._Antialiased);const t=this.getBrowser();this.localStorage=t.getLocalStorage().addNameSpace("BrowserOptions."),this.textureQuality=_v.MEDIUM,this.primitiveQuality=gv.MEDIUM,this.shading=bl.GOURAUD}Object.assign(Object.setPrototypeOf(yv.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this),this.localStorage.setDefaultValues({Rubberband:this._Rubberband.getValue(),PrimitiveQuality:this._PrimitiveQuality.getValue(),TextureQuality:this._TextureQuality.getValue(),StraightenHorizon:this._StraightenHorizon.getValue(),Timings:this._Timings.getValue()}),this._Rubberband.addInterest("set_rubberband__",this),this._Antialiased.addInterest("set_antialiased__",this),this._PrimitiveQuality.addInterest("set_primitiveQuality__",this),this._TextureQuality.addInterest("set_textureQuality__",this),this._Shading.addInterest("set_shading__",this),this._StraightenHorizon.addInterest("set_straightenHorizon__",this),this._AutoUpdate.addInterest("set_autoUpdate__",this),this._ContentScale.addInterest("set_contentScale__",this),this._LogarithmicDepthBuffer.addInterest("set_logarithmicDepthBuffer__",this),this._Multisampling.addInterest("set_multisampling__",this),this._OrderIndependentTransparency.addInterest("set_orderIndependentTransparency__",this),this._Timings.addInterest("set_timings__",this),this.set_antialiased__(this._Antialiased),this.set_shading__(this._Shading),this.set_contentScale__(this._ContentScale),this.set_logarithmicDepthBuffer__(this._LogarithmicDepthBuffer),this.set_multisampling__(this._Multisampling),this.set_orderIndependentTransparency__(this._OrderIndependentTransparency),this.reset()},reset:(()=>{const e=new Set(["Antialiased","AutoUpdate","Cache","ContentScale","ContextMenu","Debug","Multisampling","Notifications","OrderIndependentTransparency","SplashScreen"]),t=new Map([["AutoUpdate","Update"]]),i=new Set(["PrimitiveQuality","Rubberband","StraightenHorizon","TextureQuality","Timings"]);return function(){const n=this.getBrowser(),s=this.localStorage;for(const{name:r,value:o}of this.getFieldDefinitions()){if(e.has(r)){const e=xv.toLowerCaseFirst(t.get(r)??r),i=n.getElement().attr(e);if(void 0!==i){n.attributeChangedCallback(e,null,i);continue}}if(i.has(r)){const e=s[r],t=this.getField(r);e!==t.getValue()&&t.setValue(e);continue}const a=this.getField(r);a.equals(o)||a.assign(o)}}})(),getPrimitiveQuality(){return this.primitiveQuality},getShading(){return this.shading},getTextureQuality(){return this.textureQuality},set_rubberband__(e){this.localStorage.Rubberband=e.getValue()},set_antialiased__(){this.set_multisampling__(this._Multisampling)},set_primitiveQuality__(e){const t=this.getBrowser(),i=e.getValue().toUpperCase();this.localStorage.PrimitiveQuality=i,this.primitiveQuality=xv.enum(gv,i,gv.MEDIUM),"function"==typeof t.setPrimitiveQuality2D&&t.setPrimitiveQuality2D(this.primitiveQuality),"function"==typeof t.setPrimitiveQuality3D&&t.setPrimitiveQuality3D(this.primitiveQuality)},set_textureQuality__(e){const t=this.getBrowser(),i=e.getValue().toUpperCase();this.localStorage.TextureQuality=i,this.textureQuality=xv.enum(_v,i,_v.MEDIUM),"function"==typeof t.setTextureQuality&&t.setTextureQuality(this.textureQuality)},set_shading__:(()=>{const e={[bl.POINT]:"POINT",[bl.WIREFRAME]:"WIREFRAME",[bl.FLAT]:"FLAT",[bl.GOURAUD]:"GOURAUD",[bl.PHONG]:"PHONG"};return function(t){const i=this.getBrowser(),n=t.getValue().toUpperCase().replace("POINTSET","POINT");this.shading=xv.enum(bl,n,bl.GOURAUD),i.getRenderingProperties()._Shading=e[this.shading],i.setShading(this.shading)}})(),set_straightenHorizon__(e){this.localStorage.StraightenHorizon=e.getValue(),e.getValue()&&this.getBrowser().getActiveLayer()?.straightenView()},set_autoUpdate__(e){const t=["resize","scroll","load"].map((e=>`${e}.${this.getTypeName()}${this.getId()}`)).join(" ");if(e.getValue()){const e=this.getBrowser(),i=e.getElement(),n=()=>{i.isInViewport()?e.isLive()||e.beginUpdate():e.isLive()&&e.endUpdate()};xv(window).on(t,n),n()}else xv(window).off(t)},set_contentScale__(e){const t=this.getBrowser();this.removeUpdateContentScale&&this.removeUpdateContentScale(),-1===e.getValue()?this.updateContentScale():t.getRenderingProperties()._ContentScale=Math.max(e.getValue(),0)||1,t.reshape()},updateContentScale(){const e=this.getBrowser(),t=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),i=this.updateContentScale.bind(this);this.removeUpdateContentScale&&this.removeUpdateContentScale(),this.removeUpdateContentScale=function(){t.removeEventListener("change",i)},t.addEventListener("change",i),e.getRenderingProperties()._ContentScale=window.devicePixelRatio,e.reshape()},set_logarithmicDepthBuffer__(e){const t=this.getBrowser(),i=t.getContext();t.getRenderingProperties()._LogarithmicDepthBuffer=e.getValue()&&i.HAS_FEATURE_FRAG_DEPTH},set_multisampling__(e){const t=this.getBrowser(),i=g.clamp(e.getValue(),0,t.getMaxSamples());t.getRenderingProperties()._Multisampling=this._Antialiased.getValue()?i:0,t.getRenderingProperties()._Antialiased=i>0,t.reshape()},set_orderIndependentTransparency__(){const e=this.getBrowser();e.getShaders().clear(),e.reshape()},set_timings__(e){this.localStorage.Timings=e.getValue()}}),Object.defineProperties(yv,{typeName:{value:"BrowserOptions",enumerable:!0},fieldDefinitions:{value:new J([new X(d.inputOutput,"SplashScreen",new Yn.SFBool(!0)),new X(d.inputOutput,"Dashboard",new Yn.SFBool(!0)),new X(d.inputOutput,"Rubberband",new Yn.SFBool(!0)),new X(d.inputOutput,"EnableInlineViewpoints",new Yn.SFBool(!0)),new X(d.inputOutput,"Antialiased",new Yn.SFBool(!0)),new X(d.inputOutput,"TextureQuality",new Yn.SFString("MEDIUM")),new X(d.inputOutput,"PrimitiveQuality",new Yn.SFString("MEDIUM")),new X(d.inputOutput,"QualityWhenMoving",new Yn.SFString("SAME")),new X(d.inputOutput,"Shading",new Yn.SFString("GOURAUD")),new X(d.inputOutput,"MotionBlur",new Yn.SFBool),new X(d.inputOutput,"AutoUpdate",new Yn.SFBool),new X(d.inputOutput,"Cache",new Yn.SFBool(!0)),new X(d.inputOutput,"ContentScale",new Yn.SFDouble(1)),new X(d.inputOutput,"ContextMenu",new Yn.SFBool(!0)),new X(d.inputOutput,"Debug",new Yn.SFBool),new X(d.inputOutput,"Gravity",new Yn.SFDouble(9.80665)),new X(d.inputOutput,"LoadUrlObjects",new Yn.SFBool(!0)),new X(d.inputOutput,"LogarithmicDepthBuffer",new Yn.SFBool),new X(d.inputOutput,"Notifications",new Yn.SFBool(!0)),new X(d.inputOutput,"Multisampling",new Yn.SFInt32(4)),new X(d.inputOutput,"OrderIndependentTransparency",new Yn.SFBool),new X(d.inputOutput,"StraightenHorizon",new Yn.SFBool(!0)),new X(d.inputOutput,"Timings",new Yn.SFBool)]),enumerable:!0}});const wv=yv;i.add("BrowserOptions","x_ite/Browser/Core/BrowserOptions",wv);const bv=wv;function Sv(e){ds.call(this,e)}Object.setPrototypeOf(Sv.prototype,ds.prototype),Object.defineProperties(Sv,{typeName:{value:"BrowserProperties",enumerable:!0},fieldDefinitions:{value:new J([new X(d.initializeOnly,"ABSTRACT_NODES",new Yn.SFBool(!0)),new X(d.initializeOnly,"CONCRETE_NODES",new Yn.SFBool(!0)),new X(d.initializeOnly,"EXTERNAL_INTERACTIONS",new Yn.SFBool(!0)),new X(d.initializeOnly,"PROTOTYPE_CREATE",new Yn.SFBool(!0)),new X(d.initializeOnly,"DOM_IMPORT",new Yn.SFBool(!0)),new X(d.initializeOnly,"XML_ENCODING",new Yn.SFBool(!0)),new X(d.initializeOnly,"CLASSIC_VRML_ENCODING",new Yn.SFBool(!0)),new X(d.initializeOnly,"BINARY_ENCODING",new Yn.SFBool)]),enumerable:!0}});const Tv=Sv;i.add("BrowserProperties","x_ite/Browser/Core/BrowserProperties",Tv);const vv=Tv;function Ov(e){ds.call(this,e),this.addAlias("AntiAliased",this._Antialiased)}Object.assign(Object.setPrototypeOf(Ov.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this);const e=this.getBrowser();this._MaxTextureSize=e.getMaxTextureSize(),this._TextureUnits=e.getMaxCombinedTextureUnits(),this._MaxLights=e.getMaxLights(),this._ColorDepth=e.getColorDepth(),this._TextureMemory=e.getTextureMemory(),this._MaxSamples=e.getMaxSamples()}}),Object.defineProperties(Ov,{typeName:{value:"RenderingProperties",enumerable:!0},fieldDefinitions:{value:new J([new X(d.outputOnly,"Shading",new Yn.SFString),new X(d.outputOnly,"MaxTextureSize",new Yn.SFInt32),new X(d.outputOnly,"TextureUnits",new Yn.SFInt32),new X(d.outputOnly,"MaxLights",new Yn.SFInt32),new X(d.outputOnly,"Antialiased",new Yn.SFBool(!0)),new X(d.outputOnly,"ColorDepth",new Yn.SFInt32),new X(d.outputOnly,"TextureMemory",new Yn.SFDouble),new X(d.outputOnly,"ContentScale",new Yn.SFDouble(1)),new X(d.outputOnly,"LogarithmicDepthBuffer",new Yn.SFBool),new X(d.outputOnly,"MaxSamples",new Yn.SFInt32),new X(d.outputOnly,"Multisampling",new Yn.SFInt32(4))]),enumerable:!0}});const Ev=Ov;i.add("RenderingProperties","x_ite/Browser/Core/RenderingProperties",Ev);const Nv=Ev;var Cv=n(464);function Fv(e){ds.call(this,e),this.addChildObjects(d.inputOutput,"string",new Ui)}Cv.fn.textWidth=function(e){const t=Cv(this).children(),i="<span>"+Cv(this).html()+"</span>";Cv(this).html(i);const n=Cv(this).find("span:first").width();return Cv(this).empty(),Cv(this).append(t),n},Object.assign(Object.setPrototypeOf(Fv.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this),this.element=Cv("<div></div>").hide().addClass("x_ite-private-notification").appendTo(this.getBrowser().getSurface()).animate({width:0}),Cv("<span></span>").appendTo(this.element),this._string.addInterest("set_string__",this)},set_string__(){this.getBrowser().getBrowserOption("Notifications")&&0!==this._string.length&&(this.element.children().text(this._string.getValue()),this.element.stop(!0,!0).fadeIn(0).animate({width:this.element.textWidth()}).animate({delay:1},5e3).animate({width:0}).fadeOut(0))}}),Object.defineProperties(Fv,{typeName:{value:"Notification",enumerable:!0}});const Iv=Fv;i.add("Notification","x_ite/Browser/Core/Notification",Iv);const Mv=Iv;n(734);var Dv=n(464);const Pv=Symbol();function Rv(e){ds.call(this,e),this[Pv]=null}Object.assign(Object.setPrototypeOf(Rv.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this);const e=this.getBrowser();this.init({element:e.getElement(),appendTo:e.getShadow(),build:this.build.bind(this),animation:{duration:500,show:"fadeIn",hide:"fadeOut"}})},getUserMenu(){return this[Pv]},setUserMenu(e){this[Pv]=e},createUserMenu(){const e={};if("function"==typeof this[Pv]){const t=this[Pv]();if(Dv.isPlainObject(t))for(const i in t)e["user-"+i]=t[i]}return e},build(e){const t=this.getBrowser(),i=t.getElement().fullScreen();if(!t.getBrowserOption("ContextMenu"))return;const n={className:"x_ite-private-menu",items:{title:{name:t.getName()+" Browser v"+t.getVersion(),className:"context-menu-title context-menu-not-selectable"},separator0:"--------",viewpoints:{name:ov("Viewpoints"),className:"context-menu-icon x_ite-private-icon-viewpoint",items:this.getViewpoints()},"available-viewers":{name:ov("Available Viewers"),items:this.getAvailableViewers()},"straighten-horizon":{name:ov("Straighten Horizon"),type:"checkbox",selected:t.getBrowserOption("StraightenHorizon"),events:{click:e=>{const i=Dv(e.target).is(":checked");t.setBrowserOption("StraightenHorizon",i),t.getNotification()._string=i?ov("Straighten Horizon")+": "+ov("on"):ov("Straighten Horizon")+": "+ov("off")}}},"display-rubberband":{name:ov("Display Rubberband"),type:"checkbox",selected:t.getBrowserOption("Rubberband"),events:{click:e=>{const i=Dv(e.target).is(":checked");t.setBrowserOption("Rubberband",i),t.getNotification()._string=i?ov("Rubberband")+": "+ov("on"):ov("Rubberband")+": "+ov("off")}}},separator1:"--------","primitive-quality":{name:ov("Primitive Quality"),className:"context-menu-icon x_ite-private-icon-primitive-quality",items:{high:{name:ov("High"),type:"radio",radio:"primitive-quality",selected:"HIGH"===t.getBrowserOption("PrimitiveQuality"),events:{click:()=>{t.setBrowserOption("PrimitiveQuality","HIGH"),t.getNotification()._string=ov("Primitive Quality")+": "+ov("high")}}},medium:{name:ov("Medium"),type:"radio",radio:"primitive-quality",selected:"MEDIUM"===t.getBrowserOption("PrimitiveQuality"),events:{click:()=>{t.setBrowserOption("PrimitiveQuality","MEDIUM"),t.getNotification()._string=ov("Primitive Quality")+": "+ov("medium")}}},low:{name:ov("Low"),type:"radio",radio:"primitive-quality",selected:"LOW"===t.getBrowserOption("PrimitiveQuality"),events:{click:()=>{t.setBrowserOption("PrimitiveQuality","LOW"),t.getNotification()._string=ov("Primitive Quality")+": "+ov("low")}}}}},"texture-quality":{name:ov("Texture Quality"),className:"context-menu-icon x_ite-private-icon-texture-quality",items:{high:{name:ov("High"),type:"radio",radio:"texture-quality",selected:"HIGH"===t.getBrowserOption("TextureQuality"),events:{click:()=>{t.setBrowserOption("TextureQuality","HIGH"),t.getNotification()._string=ov("Texture Quality")+": "+ov("high")}}},medium:{name:ov("Medium"),type:"radio",radio:"texture-quality",selected:"MEDIUM"===t.getBrowserOption("TextureQuality"),events:{click:()=>{t.setBrowserOption("TextureQuality","MEDIUM"),t.getNotification()._string=ov("Texture Quality")+": "+ov("medium")}}},low:{name:ov("Low"),type:"radio",radio:"texture-quality",selected:"LOW"===t.getBrowserOption("TextureQuality"),events:{click:()=>{t.setBrowserOption("TextureQuality","LOW"),t.getNotification()._string=ov("Texture Quality")+": "+ov("low")}}}}},shading:{name:ov("Shading"),className:"context-menu-icon x_ite-private-icon-shading",items:{point:{name:ov("Points"),type:"radio",radio:"shading",selected:"POINT"===t.getBrowserOption("Shading"),events:{click:()=>{t.setBrowserOption("Shading","POINT"),t.getNotification()._string=ov("Shading")+": "+ov("Points")}}},wireframe:{name:ov("Wireframe"),type:"radio",radio:"shading",selected:"WIREFRAME"===t.getBrowserOption("Shading"),events:{click:()=>{t.setBrowserOption("Shading","WIREFRAME"),t.getNotification()._string=ov("Shading")+": "+ov("Wireframe")}}},flat:{name:ov("Flat"),type:"radio",radio:"shading",selected:"FLAT"===t.getBrowserOption("Shading"),events:{click:()=>{t.setBrowserOption("Shading","FLAT"),t.getNotification()._string=ov("Shading")+": "+ov("Flat")}}},gouraud:{name:ov("Gouraud"),type:"radio",radio:"shading",selected:"GOURAUD"===t.getBrowserOption("Shading"),events:{click:()=>{t.setBrowserOption("Shading","GOURAUD"),t.getNotification()._string=ov("Shading")+": "+ov("Gouraud")}}},phong:{name:ov("Phong"),type:"radio",radio:"shading",selected:"PHONG"===t.getBrowserOption("Shading"),events:{click:()=>{t.setBrowserOption("Shading","PHONG"),t.getNotification()._string=ov("Shading")+": "+ov("Phong")}}}}},separator2:"--------","browser-timings":{name:ov("Browser Timings"),type:"checkbox",selected:t.getBrowserOption("Timings"),events:{click:e=>{t.setBrowserOption("Timings",Dv(e.target).is(":checked")),t.getSurface().focus()}}},fullscreen:{name:ov(i?"Leave Fullscreen":"Fullscreen"),className:"context-menu-icon "+(i?"x_ite-private-icon-leave-fullscreen":"x_ite-private-icon-enter-fullscreen"),callback:()=>{t.getElement().toggleFullScreen()}},separator3:"--------"}};Object.assign(n.items,this.createUserMenu()),Object.assign(n.items,{separator4:"--------","world-info":{name:ov("Show World Info"),className:"context-menu-icon x_ite-private-icon-world-info",callback(){t.getShadow().find(".x_ite-private-world-info").remove();const e=t.getShadow().find(".x_ite-private-browser"),i=Dv("<div></div>").addClass("x_ite-private-world-info-overlay").appendTo(e),n=Dv("<div></div>").addClass("x_ite-private-world-info").appendTo(i),s=t.getExecutionContext().getWorldInfos()[0],r=s.title,o=s.info;Dv("<div></div>").addClass("x_ite-private-world-info-top").text("World Info").appendTo(n),r.length&&Dv("<div></div>").addClass("x_ite-private-world-info-title").text(r).appendTo(n);for(const e of o)Dv("<div></div>").addClass("x_ite-private-world-info-info").text(e).appendTo(n);i.on("click",(function(){i.remove()}))}},about:{name:ov("About X_ITE"),className:"context-menu-icon x_ite-private-icon-help-about",callback(){window.open(t.getProviderURL())}}}),Dv.isEmptyObject(n.items.viewpoints.items)&&delete n.items.viewpoints,Object.keys(n.items["available-viewers"].items).length<2&&delete n.items["available-viewers"],t.getCurrentViewer().match(/^(?:EXAMINE|FLY)$/)||delete n.items["straighten-horizon"],t.getBrowserOption("Debug")||delete n.items.shading;const s=t.getExecutionContext().getWorldInfos()[0];return(!s||0===s.title.length&&0===s.info.length)&&delete n.items["world-info"],n},getViewpoints(){const e=this.getBrowser(),t=e.getActiveLayer();if(!t)return{};const i=e.getBrowserOption("EnableInlineViewpoints"),n=e.currentScene,s=t.getViewpoints().get(),r=t.getViewpoint(),o={};for(const t of s){const s=t.getDescriptions().join(" » ");if(""===s)continue;if(!i&&t.getScene()!==n)continue;const a={name:s,callback:()=>{e.bindViewpoint(e.getActiveLayer(),t),e.getSurface().focus()}};t===r&&(a.className="context-menu-selected"),o["Viewpoint"+t.getId()]=a}return o},getAvailableViewers(){const e=this.getBrowser(),t=e._viewer.getValue(),i=e._availableViewers,n={};for(const s of i)n[s]={name:ov(this.getViewerName(s)),className:"context-menu-icon x_ite-private-icon-"+s.toLowerCase()+"-viewer",callback:()=>{e._viewer=s,e.getNotification()._string=ov(this.getViewerName(s)),e.getSurface().focus()}},s===t&&(n[s].className+=" context-menu-selected");return n},getViewerName(e){switch(e){case"EXAMINE":return ov("Examine Viewer");case"WALK":return ov("Walk Viewer");case"FLY":return ov("Fly Viewer");case"PLANE":return ov("Plane Viewer");case"LOOKAT":return ov("Look At Viewer");case"NONE":return ov("None Viewer")}},init(e){this.show=this.createRoot.bind(this,e),e.element.on("contextmenu",this.show)},show(e){},hide(e){},createRoot(e,t){const i=e.build(t);if(!i)return;const n=Dv("<div></div>").addClass("context-menu-layer").addClass(i.className).appendTo(e.appendTo),s=this.hide=()=>(delete this.hide,n.remove(),r[e.animation.hide](e.animation.duration,(function(){r.remove(),e.events&&"function"==typeof e.events.hide&&e.events.hide()})),!1),r=Dv("<ul></ul>").hide().addClass("context-menu-root").addClass("context-menu-list").addClass(i.className).appendTo(e.appendTo).offset({left:t.pageX,top:t.pageY});for(const e in i.items)r.append(this.createItem(i.items[e],"context-menu-root",e,2,s));return r[e.animation.show](e.animation.duration),r.offset({left:t.pageX,top:t.pageY}),r.offset().left-Dv(document).scrollLeft()+r.outerWidth()>Dv(window).width()&&r.offset({left:Dv(document).scrollLeft()+Math.max(0,Dv(window).width()-r.outerWidth())}),r.offset().top-Dv(document).scrollTop()+r.outerHeight()>Dv(window).height()&&r.offset({top:Dv(document).scrollTop()+Math.max(0,Dv(window).height()-r.outerHeight())}),r.find("ul").each(((e,t)=>{const i=(t=Dv(t)).outerWidth()+r.outerWidth(),n=r.offset().left-Dv(document).scrollLeft()+i>Dv(window).width()?"right":"left";t.css("width",t.outerWidth()),t.css(n,t.parent().closest("ul").width()),t.outerHeight()>=Dv(window).height()&&t.css({"max-height":"100vh","overflow-y":"scroll"})})),r.find("li").on("mouseenter touchstart",(function(e){e.stopImmediatePropagation();const t=Dv(e.target).closest("li").children("ul");if(!t.length)return;t.css("top","");const i=t.offset().top+t.outerHeight()-Dv(window).scrollTop()-Dv(window).height();i>0&&t.offset({top:t.offset().top-i})})),n.on("click contextmenu",s),r.on("contextmenu",s),e.events&&"function"==typeof e.events.show&&e.events.show(r),!1},createItem(e,t,i,n,s){const r=Dv("<li></li>").addClass("context-menu-item");switch(typeof e){case"string":e.match(/^-+$/)&&r.addClass(["context-menu-separator","context-menu-not-selectable"]);break;case"object":switch(e.className&&r.addClass(e.className),e.type){case"radio":case"checkbox":{const i=Dv("<label></label>").appendTo(r),n=Dv("<input></input>").appendTo(i);n.attr("type",e.type).attr("name","context-menu-input-"+(e.radio||t)),Dv("<span></span>").text(e.name).appendTo(i),e.selected&&n.attr("checked","checked");for(const t in e.events)"function"==typeof e.events[t]&&n.on(t,e.events[t]);r.addClass("context-menu-input");break}default:e.name&&Dv("<span></span>").text(e.name).appendTo(r),"function"==typeof e.callback&&r.on("click",e.callback).on("click",s)}}if("object"==typeof e.items&&n<3){const t=Dv("<ul></ul>").addClass("context-menu-list").css({"z-index":n}).appendTo(r);for(const r in e.items)t.append(this.createItem(e.items[r],i,r,n+1,s));r.addClass("context-menu-submenu")}return r}}),Object.defineProperties(Rv,{typeName:{value:"ContextMenu",enumerable:!0}});const Av=Rv;i.add("ContextMenu","x_ite/Browser/Core/ContextMenu",Av);const Vv=Av;function Lv(e,t,i,n,s=!1,r=[]){Object.defineProperties(this,{name:{value:e,enumerable:!0},level:{value:t,enumerable:!0},title:{value:i,enumerable:!0},providerURL:{value:n||so.getProviderURL(s&&e),enumerable:!0},external:{value:s},dependencies:{value:r}})}Object.assign(Object.setPrototypeOf(Lv.prototype,C.prototype),{toVRMLStream(e){e.string+=e.Indent(),e.string+="COMPONENT",e.string+=e.Space(),e.string+=this.name,e.string+=e.TidySpace(),e.string+=":",e.string+=e.TidySpace(),e.string+=this.level},toXMLStream(e){e.string+=e.Indent(),e.string+="<component",e.string+=e.Space(),e.string+="name='",e.string+=this.name,e.string+="'",e.string+=e.Space(),e.string+="level='",e.string+=this.level,e.string+="'",e.string+=e.closingTags?"></component>":"/>"},toJSONStream(e){e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=this.name,e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@level",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+=this.level,e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}});for(const e of Object.keys(Lv.prototype))Object.defineProperty(Lv.prototype,e,{enumerable:!1});Object.defineProperties(Lv,{typeName:{value:"ComponentInfo",enumerable:!0}}),Object.defineProperties(Lv.prototype,{providerUrl:{get:function(){return this.providerURL}}});const Bv=Lv;i.add("ComponentInfo","x_ite/Configuration/ComponentInfo",Bv);const Uv=Bv;function Xv(e=[]){return Y.call(this,Array.from(e,(e=>[e.name,e])),Uv)}Object.assign(Object.setPrototypeOf(Xv.prototype,Y.prototype),{add(e,{level:t,title:i,providerURL:n,external:s=!1,dependencies:r=[]}){Y.prototype.add.call(this,e,new Uv(e,t,i,n,s,r))}});for(const e of Object.keys(Xv.prototype))Object.defineProperty(Xv.prototype,e,{enumerable:!1});Object.defineProperties(Xv,{typeName:{value:"ComponentInfoArray",enumerable:!0}});const kv=Xv;i.add("ComponentInfoArray","x_ite/Configuration/ComponentInfoArray",kv);const jv=kv;function zv(e,t,i){Object.defineProperties(this,{category:{value:e,enumerable:!0},name:{value:t,enumerable:!0},conversionFactor:{value:i,enumerable:!0}})}Object.assign(Object.setPrototypeOf(zv.prototype,C.prototype),{toVRMLStream(e){e.string+=e.Indent(),e.string+="UNIT",e.string+=e.Space(),e.string+=this.category,e.string+=e.Space(),e.string+=this.name,e.string+=e.Space(),e.string+=this.conversionFactor},toXMLStream(e){e.string+=e.Indent(),e.string+="<unit",e.string+=e.Space(),e.string+="category='",e.string+=this.category,e.string+="'",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(this.name),e.string+="'",e.string+=e.Space(),e.string+="conversionFactor='",e.string+=this.conversionFactor,e.string+="'",e.string+=e.closingTags?"></unit>":"/>"},toJSONStream(e,t){if(1===this.conversionFactor)throw new Error("conversionFactor is 1");e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@category",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=this.category,e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this.name),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@conversionFactor",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+=this.conversionFactor,e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}});for(const e of Object.keys(zv.prototype))Object.defineProperty(zv.prototype,e,{enumerable:!1});Object.defineProperty(zv.prototype,"conversion_factor",{get(){return this.conversionFactor}}),Object.defineProperties(zv,{typeName:{value:"UnitInfo",enumerable:!0}});const Gv=zv;i.add("UnitInfo","x_ite/Configuration/UnitInfo",Gv);const Hv=Gv;function qv(e=[]){return Y.call(this,Array.from(e,(e=>[e.category,e])),Hv)}Object.setPrototypeOf(qv.prototype,Y.prototype);for(const e of Object.keys(qv.prototype))Object.defineProperty(qv.prototype,e,{enumerable:!1});Object.defineProperties(qv,{typeName:{value:"UnitInfoArray",enumerable:!0}});const Yv=qv;i.add("UnitInfoArray","x_ite/Configuration/UnitInfoArray",Yv);const Wv=Yv,$v=Symbol(),Jv=Symbol();function Kv(e,t){C.call(this),this[$v]=e,this[Jv]=t}Object.assign(Object.setPrototypeOf(Kv.prototype,C.prototype),{getExportedName(){return this[$v]},getLocalNode(){return this[Jv]},toVRMLStream(e){const t=e.LocalName(this[Jv]);e.string+=e.Indent(),e.string+="EXPORT",e.string+=e.Space(),e.string+=t,this[$v]!==t&&(e.string+=e.Space(),e.string+="AS",e.string+=e.Space(),e.string+=this[$v])},toXMLStream(e){const t=e.LocalName(this[Jv]);e.string+=e.Indent(),e.string+="<EXPORT",e.string+=e.Space(),e.string+="localDEF='",e.string+=e.XMLEncode(t),e.string+="'",this[$v]!==t&&(e.string+=e.Space(),e.string+="AS='",e.string+=e.XMLEncode(this[$v]),e.string+="'"),e.string+=e.closingTags?"></EXPORT>":"/>"},toJSONStream(e){const t=e.LocalName(this[Jv]);e.string+=e.Indent(),e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="EXPORT",e.string+='"',e.string+=":",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@localDEF",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(t),e.string+='"',this[$v]!==t?(e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@AS",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(this[$v]),e.string+='"',e.string+=e.TidyBreak()):e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}});for(const e of Object.keys(Kv.prototype))Object.defineProperty(Kv.prototype,e,{enumerable:!1});Object.defineProperties(Kv.prototype,{exportedName:{get(){return this[$v]},enumerable:!0},localNode:{get(){return yi.get(this[Jv])},enumerable:!0}}),Object.defineProperties(Kv,{typeName:{value:"X3DExportedNode",enumerable:!0}});const Zv=Kv;i.add("X3DExportedNode","x_ite/Execution/X3DExportedNode",Zv);const Qv=Zv;function eO(e=[]){return Y.call(this,Array.from(e,(e=>[e.getExportedName(),e])),Qv)}Object.setPrototypeOf(eO.prototype,Y.prototype);for(const e of Object.keys(eO.prototype))Object.defineProperty(eO.prototype,e,{enumerable:!1});Object.defineProperties(eO,{typeName:{value:"ExportedNodesArray",enumerable:!0}});const tO=eO;i.add("ExportedNodesArray","x_ite/Execution/ExportedNodesArray",tO);const iO=tO,nO=Symbol(),sO=Symbol(),rO=Symbol(),oO=Symbol(),aO=Symbol(),lO=Symbol(),uO=Symbol(),hO=Symbol(),dO=Symbol(),cO="4.0";function pO(e){Xh.call(this,this,null,e),this.addType(d.X3DScene),this.addChildObjects(d.outputOnly,"profile_changed",new Yn.SFTime,d.outputOnly,"metadata_changed",new Yn.SFTime,d.outputOnly,"initLoadCount",new Yn.SFInt32,d.outputOnly,"loadCount",new Yn.SFInt32),this[nO]=cO,this[sO]="SCRIPTED",this[rO]=null,this[oO]=new jv([]),this[aO]=location.toString(),this[lO]=new Wv,this[lO].add("angle",new Hv("angle","radian",1)),this[lO].add("force",new Hv("force","newton",1)),this[lO].add("length",new Hv("length","metre",1)),this[lO].add("mass",new Hv("mass","kilogram",1)),this[uO]=new Map,this[hO]=new iO,this[dO]=new Set,this[oO].addParent(this),this[lO].addParent(this),this[hO].addParent(this),this.getRootNodes().setAccessType(d.inputOutput),this.setLive(!1)}Object.assign(Object.setPrototypeOf(pO.prototype,Xh.prototype),{isMainScene(){return this===this.getExecutionContext()},isScene:()=>!0,setSpecificationVersion(e){this[nO]=String(e)},getSpecificationVersion(){return this[nO]},setEncoding(e){this[sO]=String(e)},getEncoding(){return this[sO]},setWorldURL(e){this[aO]=String(e)},getWorldURL(){return this[aO]},getBaseURL(){return this[aO].match(/^(?:data|blob):/)?this.isMainScene()?this.getBrowser().getBaseURL():this.getExecutionContext().getBaseURL():this[aO]},setProfile(e){this[rO]=e,this._profile_changed=this.getBrowser().getCurrentTime()},getProfile(){return this[rO]},hasComponent(e,t=0){if(!this[rO])return!0;if(e instanceof Uv)var{name:e,level:t}=e;const i=this[rO].components.get(e)??this[oO].get(e);return!!i&&t<=i.level},addComponent(e){this[oO].add(e.name,e),this._components_changed=this.getBrowser().getCurrentTime()},updateComponent(e){this[oO].update(e.name,e.name,e),this._components_changed=this.getBrowser().getCurrentTime()},removeComponent(e){this[oO].remove(e),this._components_changed=this.getBrowser().getCurrentTime()},getComponents(){return this[oO]},updateUnit(e,t,i){this[lO].has(e)&&(this[lO].update(e,e,new Hv(e,String(t),Number(i))),this._units_changed=this.getBrowser().getCurrentTime())},getUnit(e){return this[lO].get(e)},getUnits(){return this[lO]},fromUnit(e,t){switch(e){case"angle":case"force":case"length":case"mass":return t*this.getUnits().get(e).conversionFactor;case"acceleration:":case"speed":return t*this.getUnits().get("length").conversionFactor;case"angularRate":return t*this.getUnits().get("angle").conversionFactor;case"area":return t*this.getUnits().get("length").conversionFactor**2;case"volume":return t*this.getUnits().get("length").conversionFactor**3}return t},toUnit(e,t){switch(e){case"angle":case"force":case"length":case"mass":return t/this.getUnits().get(e).conversionFactor;case"acceleration:":case"speed":return t/this.getUnits().get("length").conversionFactor;case"angularRate":return t/this.getUnits().get("angle").conversionFactor;case"area":return t/this.getUnits().get("length").conversionFactor**2;case"volume":return t/this.getUnits().get("length").conversionFactor**3}return t},setMetaData(e,t){if(!(e=String(e)).length)throw new Error("Couldn't add metadata: name is empty.");if(Array.isArray(t)||(t=[String(t)]),!t.length)throw new Error("Couldn't add metadata: values length is 0.");this[uO].set(e,t.map((e=>String(e)))),this._metadata_changed=this.getBrowser().getCurrentTime()},addMetaData(e,t){if(e=String(e),t=String(t),!e.length)throw new Error("Couldn't add metadata: name is empty.");let i=this[uO].get(e);i||this[uO].set(e,i=[]),i.push(t)},removeMetaData(e){e=String(e),this[uO].delete(e),this._metadata_changed=this.getBrowser().getCurrentTime()},getMetaData(e){e=String(e);const t=this[uO].get(e);if(t)return Array.from(t)},getMetaDatas(){return new Map(this[uO])},addExportedNode(e,t){if(e=String(e),this[hO].has(e))throw new Error(`Couldn't add exported node: exported name '${e}' already in use.`);this.updateExportedNode(e,t),this._exportedNodes_changed=this.getBrowser().getCurrentTime()},updateExportedNode(e,t){if(e=String(e),t=ql(d.X3DNode,t,!1),0===e.length)throw new Error("Couldn't update exported node: node exported name is empty.");if(!t)throw new Error("Couldn't update exported node: node must be of type X3DNode.");this.removeExportedNode(e);const i=new Qv(e,t);this[hO].add(e,i),this._exportedNodes_changed=this.getBrowser().getCurrentTime()},removeExportedNode(e){e=String(e),this[hO].remove(e),this._exportedNodes_changed=this.getBrowser().getCurrentTime()},getExportedNode(e){e=String(e);const t=this[hO].get(e);if(t)return yi.get(t.getLocalNode());throw new Error(`Exported node '${e}' not found.`)},getExportedNodes(){return this[hO]},getUniqueExportName(e){return ir(this[hO],e)},addRootNode(e){e=yi.get(ql(d.X3DNode,e,!1));const t=this.getRootNodes();for(const i of t)if(i.equals(e))return;t.push(e)},removeRootNode(e){e=yi.get(ql(d.X3DNode,e,!1));const t=this.getRootNodes();t.assign(t.filter((t=>t!==e)))},setRootNodes(e){if(!(e instanceof Yn.MFNode))throw new Error("Value must be of type MFNode.");this.getRootNodes().assign(e)},toVRMLStream(e){e.string+=e.Indent(),e.string+="#X3D V",e.string+=cO,e.string+=e.Space(),e.string+="utf8",e.string+=e.Space(),e.string+=this.getBrowser().name,e.string+=e.Space(),e.string+="V",e.string+=this.getBrowser().version,e.string+=e.ForceBreak(),e.string+=e.ForceBreak();const t=this.getProfile();t&&(t.toVRMLStream(e),e.string+=e.Break(),e.string+=e.TidyBreak());const i=this.getComponents();i.length&&(i.toVRMLStream(e),e.string+=e.TidyBreak());const n=this.getUnits().filter((e=>1!==e.conversionFactor));if(n.length){for(const t of n)t.toVRMLStream(e),e.string+=e.Break();e.string+=e.TidyBreak()}const s=this.getMetaDatas();if(s.size){for(const[t,i]of s)for(const n of i)e.string+=e.Indent(),e.string+="META",e.string+=e.Space(),e.string+=new Yn.SFString(t).toString(),e.string+=e.Space(),e.string+=new Yn.SFString(n).toString(),e.string+=e.Break();e.string+=e.TidyBreak()}const r=this.getExportedNodes();e.PushExecutionContext(this),e.EnterScope(),e.ExportedNodes(r),Xh.prototype.toVRMLStream.call(this,e),r.length&&(e.string+=e.TidyBreak(),r.toVRMLStream(e)),e.LeaveScope(),e.PopExecutionContext()},toXMLStream(e){if(e.html||(e.string+=e.Indent(),e.string+='<?xml version="1.0" encoding="UTF-8"?>',e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D ',e.string+=cO,e.string+='//EN" "http://www.web3d.org/specifications/x3d-',e.string+=cO,e.string+='.dtd">',e.string+=e.TidyBreak()),e.string+=e.Indent(),e.string+="<X3D",e.string+=e.Space(),e.string+="profile='",e.string+=this.getProfile()?this.getProfile().name:"Full",e.string+="'",e.string+=e.Space(),e.string+="version='",e.string+=cO,e.string+="'",e.string+=e.Space(),e.string+="xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'",e.string+=e.Space(),e.string+="xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-",e.string+=cO,e.string+=".xsd'>",e.string+=e.TidyBreak(),e.IncIndent(),this.getComponents().length||this.getUnits().some((e=>1!==e.conversionFactor))||this.getMetaDatas().size){e.string+=e.Indent(),e.string+="<head>",e.string+=e.TidyBreak(),e.IncIndent(),this.getComponents().toXMLStream(e);for(const t of this.getUnits())1!==t.conversionFactor&&(t.toXMLStream(e),e.string+=e.TidyBreak());for(const[t,i]of this.getMetaDatas())for(const n of i)e.string+=e.Indent(),e.string+="<meta",e.string+=e.Space(),e.string+="name='",e.string+=e.XMLEncode(t),e.string+="'",e.string+=e.Space(),e.string+="content='",e.string+=e.XMLEncode(n),e.string+="'",e.string+=e.closingTags?"></meta>":"/>",e.string+=e.TidyBreak();e.DecIndent(),e.string+=e.Indent(),e.string+="</head>",e.string+=e.TidyBreak()}if(this.getExternProtoDeclarations().length||this.getProtoDeclarations().length||this.getRootNodes().length){e.string+=e.Indent(),e.string+="<Scene>",e.string+=e.TidyBreak(),e.IncIndent();const t=this.getExportedNodes();e.PushExecutionContext(this),e.EnterScope(),e.ExportedNodes(t),Xh.prototype.toXMLStream.call(this,e),t.toXMLStream(e),e.LeaveScope(),e.PopExecutionContext(),e.DecIndent(),e.string+=e.Indent(),e.string+="</Scene>",e.string+=e.TidyBreak()}else e.string+=e.Indent(),e.string+="<Scene/>",e.string+=e.TidyBreak();e.DecIndent(),e.string+=e.Indent(),e.string+="</X3D>",e.string+=e.TidyBreak()},toJSONStream(e){e.string+=e.Indent(),e.string+="{",e.string+=e.TidySpace(),e.string+='"',e.string+="X3D",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="encoding",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+="UTF-8",e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@profile",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=this.getProfile()?this.getProfile().name:"Full",e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@version",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=cO,e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@xsd:noNamespaceSchemaLocation",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+="http://www.web3d.org/specifications/x3d-",e.string+=cO,e.string+=".xsd",e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="JSON schema",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+="http://www.web3d.org/specifications/x3d-",e.string+=cO,e.string+="-JSONSchema.json",e.string+='"',e.string+=",",e.string+=e.TidyBreak();const t=this.getUnits().some((e=>1!==e.conversionFactor));if(this.getComponents().length||t||this.getMetaDatas().size){let i=!1;if(e.string+=e.Indent(),e.string+='"',e.string+="head",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),this.getMetaDatas().size){i&&(e.string+=",",e.string+=e.TidyBreak()),e.string+=e.Indent(),e.string+='"',e.string+="meta",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();for(const[t,[i,n]]of[...this.getMetaDatas()].entries())for(const[s,r]of n.entries())e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(i),e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@content",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=e.JSONEncode(r),e.string+='"',e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",t===this.getMetaDatas().size-1&&s===n.length-1||(e.string+=","),e.string+=e.TidyBreak();e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",i=!0}this.getComponents().length&&(i&&(e.string+=",",e.string+=e.TidyBreak()),e.string+=e.Indent(),e.string+='"',e.string+="component",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),this.getComponents().toJSONStream(e),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",i=!0),t&&(i&&(e.string+=",",e.string+=e.TidyBreak()),e.string+=e.Indent(),e.string+='"',e.string+="unit",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),this.getUnits().toJSONStream(e),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",i=!0),e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=",",e.string+=e.TidyBreak()}e.string+=e.Indent(),e.string+='"',e.string+="Scene",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="-children",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+="[",e.string+=e.TidyBreak(),e.string+=e.IncIndent();const i=this.getExportedNodes();e.PushExecutionContext(this),e.EnterScope(),e.ExportedNodes(i),Xh.prototype.toJSONStream.call(this,e),this.getExportedNodes().toJSONStream(e,!0),e.JSONRemoveComma(),e.LeaveScope(),e.PopExecutionContext(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="]",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}",e.string+=e.TidyBreak()}},{setExecutionContext(e){if(!this.isMainScene()){const e=this.getScene();for(const t of this[dO])e.removeLoadingObject(t)}if(Xh.prototype.setExecutionContext.call(this,e),!this.isMainScene()){const e=this.getScene();for(const t of this[dO])e.addLoadingObject(t)}},addInitLoadCount(e){this._initLoadCount=this._initLoadCount.getValue()+1},removeInitLoadCount(e){this._initLoadCount=this._initLoadCount.getValue()-1},getLoadingObjects(){return this[dO]},addLoadingObject(e){if(this[dO].has(e))return;this[dO].add(e),this._loadCount=this[dO].size;const t=this.getBrowser(),i=this.getScene();this!==t.getExecutionContext()&&this.loader!==t.loader||t.addLoadingObject(e),this.isMainScene()||i.addLoadingObject(e)},removeLoadingObject(e){if(!this[dO].has(e))return;this[dO].delete(e),this._loadCount=this[dO].size;const t=this.getBrowser(),i=this.getScene();this!==t.getExecutionContext()&&this.loader!==t.loader||t.removeLoadingObject(e),this.isMainScene()||i.removeLoadingObject(e)}});for(const e of Object.keys(pO.prototype))Object.defineProperty(pO.prototype,e,{enumerable:!1});Object.defineProperties(pO.prototype,{specificationVersion:{get:pO.prototype.getSpecificationVersion,enumerable:!0},encoding:{get:pO.prototype.getEncoding,enumerable:!0},profile:{get:pO.prototype.getProfile,enumerable:!0},profile_changed:{get(){return this._profile_changed},enumerable:!1},components:{get:pO.prototype.getComponents,enumerable:!0},worldURL:{get:pO.prototype.getWorldURL,enumerable:!0},units:{get:pO.prototype.getUnits,enumerable:!0},metadata_changed:{get(){return this._metadata_changed},enumerable:!1},rootNodes:{get:pO.prototype.getRootNodes,set:pO.prototype.setRootNodes,enumerable:!0},exportedNodes:{get:pO.prototype.getExportedNodes,enumerable:!0},sceneGraph_changed:{get(){return this._sceneGraph_changed},enumerable:!1}}),Object.defineProperties(pO,{typeName:{value:"X3DScene",enumerable:!0}}),d.addNode(pO);const gO=pO;i.add("X3DScene","x_ite/Execution/X3DScene",gO);const fO=gO,mO=new WeakMap,_O=new WeakMap,xO=new WeakMap,yO={get(e,t){const i=e[t];if(void 0!==i)return i;const n=e.getStorage()[e.getNameSpace()+t];if(void 0===n||"undefined"===n||null===n)return e.getDefaultValue(t);return JSON.parse(n)},set:(e,t,i)=>(void 0===i?e.getStorage().removeItem(e.getNameSpace()+t):e.getStorage()[e.getNameSpace()+t]=JSON.stringify(i),!0)};function wO(e,t){return this.target=this,mO.set(this,e),_O.set(this,t),xO.set(this,{}),new Proxy(this,yO)}Object.assign(wO.prototype,{getStorage(){return mO.get(this.target)},getNameSpace(){return _O.get(this.target)},addNameSpace(e){return new wO(this.getStorage(),this.getNameSpace()+e)},setDefaultValues(e){Object.assign(xO.get(this.target),e)},getDefaultValue(e){const t=xO.get(this.target)[e];return void 0===t?void 0:JSON.parse(JSON.stringify(t))},clear(){const e=this.getStorage(),t=this.getNameSpace();for(const i of Object.keys(e))i.startsWith(t)&&e.removeItem(i)}});const bO=wO;i.add("DataStorage","standard/Utility/DataStorage",bO);const SO=bO;var TO=n(464);const vO=Symbol(),OO=Symbol(),EO=Symbol(),NO=Symbol(),CO=Symbol(),FO=Symbol(),IO=Symbol(),MO=Symbol(),DO=Symbol(),PO=Symbol(),RO=Symbol(),AO=Symbol(),VO=Symbol(),LO=Symbol(),BO=Symbol(),UO=Symbol(),XO=Symbol(),kO=Symbol(),jO=Symbol();let zO=0;function GO(e){const t=TO("<div></div>").addClass("x_ite-private-browser").attr("tabindex",0),i=TO("<div></div>").addClass("x_ite-private-surface").appendTo(t),n=TO("<div></div>").hide().addClass("x_ite-private-splash-screen").appendTo(t),s=(TO("<div></div>").addClass("x_ite-private-spinner").appendTo(n),TO("<div></div>").addClass("x_ite-private-progress").appendTo(n));if("x3d-canvas"===e.prop("nodeName").toLowerCase()){const i=TO(e[0].attachShadow({mode:"open",delegatesFocus:!0})),n=TO("<link/>");n.on("load",(()=>t.show())).attr("rel","stylesheet").attr("type","text/css").attr("href",new URL("x_ite.css",so.getScriptURL()).href),this[EO]=i.append(n).append(t.hide())}else this[EO]=e.prepend(t);TO("<div></div>").addClass("x_ite-private-x_ite").html(this.getName()+"<span class='x_ite-private-x3d'>X3D</span>").appendTo(s),TO("<div></div>").addClass("x_ite-private-progressbar").appendTo(s).append(TO("<div></div>")),TO("<div></div>").addClass("x_ite-private-spinner-text").appendTo(s),this[vO]=++zO,this[MO]=new SO(localStorage,"X_ITE.X3DBrowser("+this[vO]+")."),this[DO]=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this[OO]=e,this[NO]=i,this[CO]=TO("<canvas></canvas>").addClass("x_ite-private-canvas").prependTo(i),this[FO]=ZT.create(this[CO][0],2,"true"===e.attr("preserveDrawingBuffer"),this[DO]),this[IO]=n,this[VO]=new Nv(this.getPrivateScene()),this[RO]=new bv(this.getPrivateScene()),this[AO]=new vv(this.getPrivateScene()),this[PO]=new dv(this.getPrivateScene()),this[LO]=new Mv(this.getPrivateScene()),this[BO]=new Vv(this.getPrivateScene());const r=TO("<div></div>").hide().css("height","10in").appendTo(TO("body"));this[jO]=r.height()/720||1,r.remove(),this.addChildObjects(d.outputOnly,"controlKey",new Yn.SFBool,d.outputOnly,"shiftKey",new Yn.SFBool,d.outputOnly,"altKey",new Yn.SFBool,d.outputOnly,"altGrKey",new Yn.SFBool)}Object.assign(GO.prototype,{initialize(){this[VO].setup(),this[RO].setup(),this[AO].setup(),this[PO].setup(),this[LO].setup(),this[BO].setup(),Object.defineProperties(this.getElement().get(0),{browser:{value:this,enumerable:!0},src:{get:()=>this.getExecutionContext().getWorldURL(),set:e=>{this.loadURL(new Yn.MFString(e)).catch((e=>console.error(e)))},enumerable:!0},url:{get:()=>new Yn.MFString(this.getExecutionContext().getWorldURL()),set:e=>{this.loadURL(e).catch((e=>console.error(e)))},enumerable:!0}}),this.getElement().on("keydown.X3DCoreContext",this[XO].bind(this)).on("keyup.X3DCoreContext",this[kO].bind(this))},getInstanceId(){return this[vO]},isStrict:()=>!1,getElement(){return this[OO]},getShadow(){return this[EO]},getSurface(){return this[NO]},getSplashScreen(){return this[IO]},getCanvas(){return this[CO]},getContext(){return this[FO]},getMobile(){return this[DO]},getLocalStorage(){return this[MO]},getBrowserTimings(){return this[PO]},getBrowserOptions(){return this[RO]},getBrowserProperties(){return this[AO]},getRenderingProperties(){return this[VO]},getNotification(){return this[LO]},getContextMenu(){return this[BO]},getPrivateScene(){return this[UO]||(this[UO]=new fO(this),this[UO].setLive(!0),this[UO].setup()),this[UO]},getPixelPerPoint(){return this[jO]*this.getRenderingProperty("ContentScale")},connectedCallback(){},attributeChangedCallback(e,t,i){switch(e){case"antialiased":this.setBrowserOption("Antialiased",this.parseBooleanAttribute(i,!0));break;case"baseURL":case"baseurl":this.setBaseURL(i);break;case"cache":this.setBrowserOption("Cache",this.parseBooleanAttribute(i,!0));break;case"contentScale":case"contentscale":this.setBrowserOption("ContentScale","auto"===i?-1:parseFloat(i));break;case"contextMenu":case"contextmenu":this.setBrowserOption("ContextMenu",this.parseBooleanAttribute(i,!0));break;case"debug":this.setBrowserOption("Debug",this.parseBooleanAttribute(i,!1));break;case"multisampling":{const e=parseInt(i);this.setBrowserOption("Multisampling",isNaN(e)?4:e);break}case"notifications":this.setBrowserOption("Notifications",this.parseBooleanAttribute(i,!0));break;case"oninitialized":case"onshutdown":try{this.getElement()[0][e]=new Function("event",i)}catch(e){console.error(e)}break;case"orderIndependentTransparency":case"orderindependenttransparency":this.setBrowserOption("OrderIndependentTransparency",this.parseBooleanAttribute(i,!1));break;case"splashScreen":case"splashscreen":this.setBrowserOption("SplashScreen",this.parseBooleanAttribute(i,!0)),this.getBrowserOption("SplashScreen")||(this.getCanvas().show(),this.getSplashScreen().stop(!0,!0).hide());break;case"src":i&&this.loadURL(new Yn.MFString(i)).catch((e=>console.error(e)));break;case"timings":this.setBrowserOption("Timings",this.parseBooleanAttribute(i,!1));break;case"update":"auto"===i?this.setBrowserOption("AutoUpdate",!0):(this.setBrowserOption("AutoUpdate",!1),this.parseBooleanAttribute(i,!0)?this.beginUpdate():this.endUpdate());break;case"url":i&&this.loadURL(this.parseUrlAttribute(i)).catch((e=>console.error(e)))}},parseBooleanAttribute:(e,t)=>"true"===e||"false"!==e&&t,parseUrlAttribute(e){try{const t=new Yn.MFString;return t.fromString("["+e+"]",this.getExecutionContext()),t}catch{throw new Error("Couldn't parse url attribute.")}},callBrowserEventHandler:(()=>{const e=new Set(["error","load"]);return function(t){const i=this.getElement()[0];for(const n of t.split(" ")){const t=new CustomEvent(n);try{e.has(n)||i[`on${n}`]?.(t)}catch(e){console.error(e)}i.dispatchEvent(t)}}})(),getShiftKey(){return this._shiftKey.getValue()},getControlKey(){return this._controlKey.getValue()},getAltKey(){return this._altKey.getValue()},getAltGrKey(){return this._altGrKey.getValue()},[XO](e){switch(e.keyCode){case 16:this._shiftKey=!0;break;case 17:this._controlKey=!0;break;case 18:this._altKey=!0;break;case 49:this.getBrowserOption("Debug")&&this.getControlKey()&&(e.preventDefault(),this.setBrowserOption("Shading","POINT"),this.getNotification()._string="Shading: Pointset");break;case 50:this.getBrowserOption("Debug")&&this.getControlKey()&&(e.preventDefault(),this.setBrowserOption("Shading","WIREFRAME"),this.getNotification()._string="Shading: Wireframe");break;case 51:this.getBrowserOption("Debug")&&this.getControlKey()&&(e.preventDefault(),this.setBrowserOption("Shading","FLAT"),this.getNotification()._string="Shading: Flat");break;case 52:this.getBrowserOption("Debug")&&this.getControlKey()&&(e.preventDefault(),this.setBrowserOption("Shading","GOURAUD"),this.getNotification()._string="Shading: Gouraud");break;case 53:this.getBrowserOption("Debug")&&this.getControlKey()&&(e.preventDefault(),this.setBrowserOption("Shading","PHONG"),this.getNotification()._string="Shading: Phong");break;case 83:this.getBrowserOption("Debug")&&this.getControlKey()&&(e.preventDefault(),this.isLive()?this.endUpdate():this.beginUpdate(),this.getNotification()._string=this.getLive().getValue()?"Begin Update":"End Update");break;case 225:this._altGrKey=!0;break;case 171:case 187:this.getControlKey()&&(e.preventDefault(),this.setBrowserOption("Timings",!this.getBrowserOption("Timings")));break;case 36:e.preventDefault(),this.firstViewpoint();break;case 35:e.preventDefault(),this.lastViewpoint();break;case 33:e.preventDefault(),this.previousViewpoint();break;case 34:e.preventDefault(),this.nextViewpoint();break;case 119:if(this.getShiftKey()){e.preventDefault();const t=this.getActiveViewpoint();if(!t)break;const i=this.getPrivateScene().createNode(t.getTypeName());switch(t.getTypeName()){case"Viewpoint":i.position=t.getUserPosition(),i.orientation=t.getUserOrientation(),i.centerOfRotation=t.getUserCenterOfRotation(),i.fieldOfView=t.getFieldOfView();break;case"OrthoViewpoint":i.position=t.getUserPosition(),i.orientation=t.getUserOrientation(),i.centerOfRotation=t.getUserCenterOfRotation(),i.fieldOfView=new Yn.MFFloat(t.getMinimumX(),t.getMinimumY(),t.getMaximumX(),t.getMaximumY());break;case"GeoViewpoint":{const e=t._geoOrigin,n=new bt(0,0,0);if(e.getValue()&&"GeoOrigin"===e.getNodeTypeName()){const t=this.getPrivateScene().createNode("GeoOrigin");i.geoOrigin=t,t.geoSystem=e.geoSystem,t.geoCoords=e.geoCoords,t.rotateYUp=e.rotateYUp}i.geoSystem=t._geoSystem,i.position=t.getGeoCoord(t.getUserPosition(),n),i.orientation=t.getUserOrientation(),i.centerOfRotation=t.getGeoCoord(t.getUserCenterOfRotation(),n),i.fieldOfView=t.getFieldOfView();break}}let n;switch(this.getExecutionContext().getEncoding()){case"ASCII":case"VRML":n=i.toVRMLString();break;case"JSON":n=i.toJSONString();break;default:n=i.toXMLString()}n+="\n",this.copyToClipboard(n),this.getNotification()._string=ov("Viewpoint copied to clipboard."),console.log("Viewpoint copied to clipboard."),console.debug(n)}}},[kO](e){switch(e.which){case 16:this._shiftKey=!1;break;case 17:this._controlKey=!1;break;case 18:this._altKey=!1;break;case 225:this._altGrKey=!1}},copyToClipboard(e){const t=TO("<textarea></textarea>");this.getShadow().find(".x_ite-private-browser").prepend(t),t.text(e).trigger("select"),document.execCommand("copy"),t.remove()},dispose(){this[FO].getExtension("WEBGL_lose_context")?.loseContext()}});const HO=GO;i.add("X3DCoreContext","x_ite/Browser/Core/X3DCoreContext",HO);const qO=HO,YO=Symbol();function WO(){}Object.assign(WO.prototype,{getBackgroundTextureProperties(){return this[YO]=new BT(this.getPrivateScene()),this[YO]._boundaryModeS="CLAMP_TO_EDGE",this[YO]._boundaryModeT="CLAMP_TO_EDGE",this[YO]._boundaryModeR="CLAMP_TO_EDGE",this[YO]._minificationFilter="NICEST",this[YO]._magnificationFilter="NICEST",this[YO]._textureCompression="DEFAULT",this[YO].setup(),this.getBackgroundTextureProperties=function(){return this[YO]},Object.defineProperty(this,"getBackgroundTextureProperties",{enumerable:!1}),this[YO]}});const $O=WO;i.add("X3DEnvironmentalEffectsContext","x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext",$O);const JO=$O;function KO(e){ds.call(this,e)}Object.assign(Object.setPrototypeOf(KO.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this)},getGeometry(){if(this.geometry)return this.geometry;this.geometry=new lp(this.getExecutionContext()),this.geometry._texCoord=new DT(this.getExecutionContext()),this.geometry._coord=new Vm(this.getExecutionContext());const e=this.geometry,t=this.geometry._texCoord.getValue(),i=this.geometry._coord.getValue();return e._texCoordIndex=new Yn.MFInt32(0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1),e._coordIndex=new Yn.MFInt32(0,1,2,3,-1,5,4,7,6,-1,1,5,6,2,-1,4,0,3,7,-1,4,5,1,0,-1,3,2,6,7,-1),t._point=new Yn.MFVec2f(new Yn.SFVec2f(1,1),new Yn.SFVec2f(0,1),new Yn.SFVec2f(0,0),new Yn.SFVec2f(1,0)),i._point=new Yn.MFVec3f(new Yn.SFVec3f(1,1,1),new Yn.SFVec3f(-1,1,1),new Yn.SFVec3f(-1,-1,1),new Yn.SFVec3f(1,-1,1),new Yn.SFVec3f(1,1,-1),new Yn.SFVec3f(-1,1,-1),new Yn.SFVec3f(-1,-1,-1),new Yn.SFVec3f(1,-1,-1)),t.setup(),i.setup(),e.setup(),this.geometry}}),Object.defineProperties(KO,{typeName:{value:"BoxOptions",enumerable:!0}});const ZO=KO;i.add("BoxOptions","x_ite/Browser/Geometry3D/BoxOptions",ZO);const QO=ZO;function eE(e){ds.call(this,e),this.addChildObjects(d.inputOutput,"xDimension",new Yn.SFInt32(20),d.inputOutput,"yDimension",new Yn.SFInt32(1))}Object.setPrototypeOf(eE.prototype,ds.prototype),Object.defineProperties(eE,{typeName:{value:"ConeOptions",enumerable:!0}});const tE=eE;i.add("ConeOptions","x_ite/Browser/Geometry3D/ConeOptions",tE);const iE=tE;function nE(e){ds.call(this,e),this.addChildObjects(d.inputOutput,"xDimension",new Yn.SFInt32(20),d.inputOutput,"yDimension",new Yn.SFInt32(1))}Object.setPrototypeOf(nE.prototype,ds.prototype),Object.defineProperties(nE,{typeName:{value:"CylinderOptions",enumerable:!0}});const sE=nE;i.add("CylinderOptions","x_ite/Browser/Geometry3D/CylinderOptions",sE);const rE=sE;function oE(e){ds.call(this,e),this.addChildObjects(d.inputOutput,"xDimension",new Yn.SFInt32(32),d.inputOutput,"yDimension",new Yn.SFInt32(15))}Object.assign(Object.setPrototypeOf(oE.prototype,ds.prototype),{initialize(){ds.prototype.initialize.call(this),this.addInterest("eventsProcessed",this)},getGeometry(){return this.geometry||this.eventsProcessed(),this.geometry},createTexCoordIndex(){const e=this._xDimension.getValue()+1,t=this._yDimension.getValue(),i=this.geometry._texCoordIndex;for(let t=0,n=e-1;t<n;++t)i.push(t),i.push(t+e-1),i.push(t+e),i.push(-1);for(let n=e-1,s=0,r=t-3;s<r;++s,++n)for(let t=0,s=e-1;t<s;++t,++n)i.push(n),i.push(n+e),i.push(n+e+1),i.push(n+1),i.push(-1);let n=(t-2)*e-1;for(let t=0,s=e-1;t<s;++t,++n)i.push(n+e),i.push(n+1),i.push(n),i.push(-1)},createTexCoord(){const e=this._xDimension.getValue()+1,t=this._yDimension.getValue(),i=this.geometry._texCoord.getValue()._point,n=-.5/(e-1);for(let t=1;t<e;++t){const s=t/(e-1)+n;i.push(new ft(s,1))}for(let n=1,s=t-1;n<s;++n){const s=1-n/(t-1);for(let t=0;t<e;++t){const n=t/(e-1);i.push(new ft(n,s))}}for(let t=1;t<e;++t){const s=t/(e-1)+n;i.push(new ft(s,0))}},createCoordIndex(){const e=this._xDimension.getValue()+1,t=this._yDimension.getValue(),i=this.geometry._coordIndex;let n=1;for(const t=e-1;n<t;++n)i.push(0),i.push(n),i.push(n+1),i.push(-1);i.push(0),i.push(n),i.push(1),i.push(-1);let s=1;for(let n=0,r=t-3;n<r;++n,++s){for(let t=0,n=e-2;t<n;++t,++s)i.push(s),i.push(s+e-1),i.push(s+e),i.push(s+1),i.push(-1);i.push(s),i.push(s+e-1),i.push(s+1),i.push(s-e+2),i.push(-1)}const r=s+e-1;for(let t=0,n=e-2;t<n;++t,++s)i.push(r),i.push(s+1),i.push(s),i.push(-1);i.push(r),i.push(r-e+1),i.push(s),i.push(-1)},createPoints(){const e=this._xDimension.getValue()+1,t=this._yDimension.getValue(),i=this.geometry._coord.getValue()._point;i.push(new bt(0,1,0));for(let n=1,s=t-1;n<s;++n){const t=Vo.Polar(1,-Math.PI*n/s);for(let n=0,s=e-1;n<s;++n){const e=Vo.Polar(t.imag,2*Math.PI*n/s);i.push(new bt(e.imag,t.real,e.real))}}i.push(new bt(0,-1,0))},eventsProcessed(){this.geometry=new lp(this.getExecutionContext()),this.geometry._texCoord=new DT(this.getExecutionContext()),this.geometry._coord=new Vm(this.getExecutionContext()),this.createTexCoordIndex(),this.createTexCoord(),this.createCoordIndex(),this.createPoints();const e=this.geometry,t=this.geometry._texCoord.getValue(),i=this.geometry._coord.getValue();e._creaseAngle=Math.PI,t.setup(),i.setup(),e.setup()}}),Object.defineProperties(oE,{typeName:{value:"QuadSphereOptions",enumerable:!0}});const aE=oE;i.add("QuadSphereOptions","x_ite/Browser/Geometry3D/QuadSphereOptions",aE);const lE=aE;function uE(){}function hE(e,t){const i=new t(this.getPrivateScene());return i.setup(),this[e]=function(){return i},Object.defineProperty(this,e,{enumerable:!1}),i}Object.assign(uE.prototype,{initialize(){this.setPrimitiveQuality3D(this.getBrowserOptions().getPrimitiveQuality())},getBoxOptions(){return hE.call(this,"getBoxOptions",QO)},getConeOptions(){return hE.call(this,"getConeOptions",iE)},getCylinderOptions(){return hE.call(this,"getCylinderOptions",rE)},getSphereOptions(){return hE.call(this,"getSphereOptions",lE)},setPrimitiveQuality3D(e){const t=this.getConeOptions(),i=this.getCylinderOptions(),n=this.getSphereOptions();switch(e){case gv.LOW:t._xDimension=16,i._xDimension=16,n._xDimension=20,n._yDimension=9;break;case gv.MEDIUM:t._xDimension=20,i._xDimension=20,n._xDimension=32,n._yDimension=15;break;case gv.HIGH:t._xDimension=32,i._xDimension=32,n._xDimension=64,n._yDimension=31}}});const dE=uE;i.add("X3DGeometry3DContext","x_ite/Browser/Geometry3D/X3DGeometry3DContext",dE);const cE=dE,pE=Symbol();function gE(){}Object.assign(gE.prototype,{getBBoxNode(){const e=new _b(this.getPrivateScene()),t=new jm(this.getPrivateScene()),i=new Vm(this.getPrivateScene());return e._geometry=t,t._coordIndex=[0,1,2,3,0,-1,4,5,6,7,4,-1,0,4,-1,1,5,-1,2,6,-1,3,7,-1],t._coord=i,i._point=[.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,-.5,-.5,.5,-.5,-.5,-.5,-.5,.5,-.5,-.5],i.setup(),t.setup(),e.setup(),this[pE]=e,this.getBBoxNode=function(){return this[pE]},Object.defineProperty(this,"getBBoxNode",{enumerable:!1}),e}});const fE=gE;i.add("X3DGroupingContext","x_ite/Browser/Grouping/X3DGroupingContext",fE);const mE=fE,_E=Symbol();function xE(){this[_E]=new Fg(this.getPrivateScene())}Object.assign(xE.prototype,{initialize(){this[_E].setPrivate(!0),this[_E].setup()},getDefaultViewport(){return this[_E]}});const yE=xE;i.add("X3DLayeringContext","x_ite/Browser/Layering/X3DLayeringContext",yE);const wE=yE,bE=Symbol(),SE=Symbol();function TE(){const e=this.getContext(),t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this[bE]=t>8?8:2,this[SE]=[]}Object.assign(TE.prototype,{getMaxLights(){return this[bE]},popShadowBuffer(e){try{const t=this[SE][e];if(t){if(t.length)return t.pop()}else this[SE][e]=[];return new Na(this,e,e,!0)}catch(e){return console.error(e),null}},pushShadowBuffer(e){e&&this[SE][e.getWidth()].push(e)}});const vE=TE;i.add("X3DLightingContext","x_ite/Browser/Lighting/X3DLightingContext",vE);const OE=vE;function EE(e,t){ds.call(this,e),this.navigationInfo=t}Object.assign(Object.setPrototypeOf(EE.prototype,ds.prototype),{getActiveLayer(){return this.getBrowser().getActiveLayer()},getViewport(){return this.getBrowser().getActiveLayer().getViewport().getRectangle()},getNavigationInfo(){return this.navigationInfo},getActiveViewpoint(){return this.getBrowser().getActiveLayer().getViewpoint()},getStraightenHorizon(){return this.getBrowser().getBrowserOption("StraightenHorizon")},getButton(e){return 0===e&&this.getBrowser().getAltKey()?1:e},isPointerInRectangle:(()=>{const e=new ft(0,0);return function(t,i){const n=this.getBrowser(),s=this.getViewport();return n.isPointerInRectangle(s,e.set(t,i))}})(),getPointOnCenterPlane:(()=>{const e=new bt(0,0,-1),t=new bt(0,0,0),i=new bt(0,0,0);return function(n,s,r){const o=this.getNavigationInfo(),a=this.getActiveViewpoint(),l=this.getViewport(),u=a.getProjectionMatrixWithLimits(o.getNearValue(),o.getFarValue(a),l);if(va.unProjectPoint(n,s,.9,ci.Identity,u,l,i),a instanceof mf)return r.set(i.x,i.y,-this.getDistanceToCenter(t).magnitude());const h=i.normalize();return r.assign(h).multiply(this.getDistanceToCenter(t).magnitude()/h.dot(e))}})(),getDistanceToCenter(e,t){const i=this.getActiveViewpoint();return e.assign(i.getPosition()).add(t||i._positionOffset.getValue()).subtract(i.getUserCenterOfRotation())},trackballProjectToSphere(e,t,i){const n=this.getViewport();return e=(e-n[0])/n[2]-.5,t=(t-n[1])/n[3]-.5,i.set(e,t,function(e,t,i){const n=Math.hypot(t,i);if(n<e*Math.sqrt(.5))return Math.sqrt(e*e-n*n);const s=e/Math.sqrt(2);return s*s/n}(.5,e,t))},lookAtPoint(e,t,i){if(!this.touch(e,t))return;const n=this.getActiveViewpoint(),s=this.getBrowser().getHit();n.lookAtPoint(this.getActiveLayer(),s.point,1,.381966,i)},lookAtBBox(e,t,i){if(!this.touch(e,t))return;const n=this.getActiveViewpoint(),s=this.getBrowser().getHit(),r=s.shapeNode.getBBox(new Ua).multRight(s.modelViewMatrix).multRight(n.getCameraSpaceMatrix());n.lookAtBBox(this.getActiveLayer(),r,1,.381966,i)},touch(e,t){return this.getBrowser().touch(e,t)}});const NE=EE;i.add("X3DViewer","x_ite/Browser/Navigation/X3DViewer",NE);const CE=NE;n(520);var FE=n(464);const IE=/Mac OS X/i.test(navigator.userAgent),ME=IE?1/120:.05;function DE(e,t){CE.call(this,e,t),this.button=-1,this.orientationOffset=new ai,this.fromVector=new bt(0,0,0),this.toVector=new bt(0,0,0),this.fromPoint=new bt(0,0,0),this.toPoint=new bt(0,0,0),this.rotation=new ai,this.direction=new bt(0,0,0),this.axis=new bt(0,0,0),this.pressTime=0,this.motionTime=0,this.touchMode=0,this.touch1=new ft(0,0),this.touch2=new ft(0,0),this.tapStart=0,this.dblTapInterval=.4,this.initialPositionOffset=new bt(0,0,0),this.initialOrientationOffset=new ai,this.positionChaser=new _c(e),this.centerOfRotationChaser=new _c(e),this.rotationChaser=new uc(e),this.timeSensor=new xu(e)}Object.assign(Object.setPrototypeOf(DE.prototype,CE.prototype),{initialize(){CE.prototype.initialize.call(this);const e=this.getBrowser(),t=e.getSurface();this.getNavigationInfo()._transitionStart.addInterest("disconnect",this),e.getBrowserOptions()._StraightenHorizon.addInterest("disconnect",this),e._activeViewpoint.addInterest("set_activeViewpoint__",this),t.on("mousedown.ExamineViewer",this.mousedown.bind(this)),t.on("mouseup.ExamineViewer",this.mouseup.bind(this)),t.on("dblclick.ExamineViewer",this.dblclick.bind(this)),t.on("mousewheel.ExamineViewer",this.mousewheel.bind(this)),t.on("touchstart.ExamineViewer",this.touchstart.bind(this)),t.on("touchend.ExamineViewer",this.touchend.bind(this)),this.positionChaser._duration=.2,this.positionChaser.setup(),this.centerOfRotationChaser._duration=.2,this.centerOfRotationChaser.setup(),this.rotationChaser._duration=.2,this.rotationChaser.setup(),this.timeSensor._loop=!0,this.timeSensor._stopTime=e.getCurrentTime(),this.timeSensor.setup(),this.timeSensor._fraction_changed.addInterest("spin",this),this.set_activeViewpoint__()},set_activeViewpoint__(){if(this.getStraightenHorizon()){const e=this.getActiveViewpoint();e&&(e._orientationOffset=this.getOrientationOffset(ai.Identity,e._orientationOffset.getValue(),!1))}this.disconnect()},mousedown(e){if(this.button>=0)return;this.pressTime=Date.now();const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);if(this.isPointerInRectangle(t,i))switch(this.getButton(e.button)){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,FE(document).on("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),FE(document).on("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),FE(document).on("touchend.ExamineViewer"+this.getId(),this.touchend.bind(this)),FE(document).on("touchmove.ExamineViewer"+this.getId(),this.touchmove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.trackballProjectToSphere(t,i,this.fromVector),this.rotation.assign(ai.Identity),this.motionTime=0,this._isActive=!0;break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,FE(document).on("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),FE(document).on("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),FE(document).on("touchend.ExamineViewer"+this.getId(),this.touchend.bind(this)),FE(document).on("touchmove.ExamineViewer"+this.getId(),this.touchmove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(t,i,this.fromPoint),this._isActive=!0}},mouseup(e){if(e.button===this.button)switch(this.button=-1,FE(document).off(".ExamineViewer"+this.getId()),this.getButton(e.button)){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.getBrowser().setCursor("DEFAULT"),Math.abs(this.rotation.angle)>.003&&Date.now()-this.motionTime<40&&this.addSpinning(this.rotation),this._isActive=!1;break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.getBrowser().setCursor("DEFAULT"),this._isActive=!1}},dblclick(e){e.preventDefault(),e.stopImmediatePropagation();const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);this.disconnect(),this.lookAtBBox(t,i,this.getStraightenHorizon())},mousemove:(()=>{const e=new bt(0,0,0);return function(t){const{x:i,y:n}=this.getBrowser().getPointerFromEvent(t);switch(this.getButton(this.button)){case 0:{t.preventDefault(),t.stopImmediatePropagation();const e=this.trackballProjectToSphere(i,n,this.toVector);if(this.rotation.setFromToVec(e,this.fromVector),Math.abs(this.rotation.angle)<.003&&Date.now()-this.pressTime<50)return;this.addRotate(this.rotation),this.fromVector.assign(e),this.motionTime=Date.now();break}case 1:{t.preventDefault(),t.stopImmediatePropagation();const s=this.getActiveViewpoint(),r=this.getPointOnCenterPlane(i,n,this.toPoint),o=s.getUserOrientation().multVecRot(e.assign(this.fromPoint).subtract(r));this.addMove(o,o),this.fromPoint.assign(r);break}}}})(),mousewheel:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i){const{x:n,y:s}=this.getBrowser().getPointerFromEvent(i);if(!this.isPointerInRectangle(n,s))return;i.preventDefault(),i.stopImmediatePropagation();const r=this.getBrowser(),o=this.getActiveViewpoint();r.prepareEvents().removeInterest("spin",this),o.transitionStop(),this.getDistanceToCenter(e).multiply(i.zoomFactor||ME),o.getUserOrientation().multVecRot(t.set(0,0,e.magnitude())),i.deltaY>0?this.addMove(t.negate(),bt.Zero):i.deltaY<0&&this.addMove(t,bt.Zero)}})(),touchstart(e){const t=e.originalEvent.touches;switch(t.length){case 1:e.button=0,e.pageX=t[0].pageX,e.pageY=t[0].pageY,this.mousedown(e),this.touch1.set(t[0].pageX,t[0].pageY);break;case 2:this.touchend(e),e.button=1,e.pageX=(t[0].pageX+t[1].pageX)/2,e.pageY=(t[0].pageY+t[1].pageY)/2,this.mousedown(e),this.touch1.set(t[0].pageX,t[0].pageY),this.touch2.set(t[1].pageX,t[1].pageY);break;case 3:this.touchend(e)}},touchend(e){switch(this.button){case 0:e.button=0,e.pageX=this.touch1.x,e.pageY=this.touch1.y,this.mouseup(e),this.tapedTwice?this.dblclick(e):(this.tapedTwice=!0,setTimeout((()=>this.tapedTwice=!1),300));break;case 1:this.touchMode=0,e.button=1,this.mouseup(e)}},touchmove:(()=>{const e=new ft(0,0),t=new ft(0,0);return function(i){const n=i.originalEvent.touches;switch(n.length){case 1:i.pageX=n[0].pageX,i.pageY=n[0].pageY,this.mousemove(i);break;case 2:{e.set(n[0].pageX,n[0].pageY).subtract(this.touch1).normalize(),t.set(n[1].pageX,n[1].pageY).subtract(this.touch2).normalize();const s=e.dot(t)>.7,r=e.dot(t)<-.7;switch(this.touchMode||(s?1:r?2:0)){case 1:this.touchMode=1,i.pageX=(n[0].pageX+n[1].pageX)/2,i.pageY=(n[0].pageY+n[1].pageY)/2,this.mousemove(i);break;case 2:{this.touchMode=2;const e=this.touch1.distance(this.touch2);this.touch1.set(n[0].pageX,n[0].pageY),this.touch2.set(n[1].pageX,n[1].pageY);const t=this.touch1.distance(this.touch2)-e;i.deltaY=t,i.zoomFactor=Math.abs(t)/FE(window).width(),i.pageX=(n[0].pageX+n[1].pageX)/2,i.pageY=(n[0].pageY+n[1].pageY)/2,this.mousewheel(i);break}}this.touch1.set(n[0].pageX,n[0].pageY),this.touch2.set(n[1].pageX,n[1].pageY);break}}}})(),set_positionOffset__(e){this.getActiveViewpoint()._positionOffset=e},set_centerOfRotationOffset__(e){this.getActiveViewpoint()._centerOfRotationOffset=e},set_rotation__(e){const t=this.getActiveViewpoint();t._orientationOffset=this.getOrientationOffset(e.getValue(),this.initialOrientationOffset,!1),t._positionOffset=this.getPositionOffset(this.initialPositionOffset,this.initialOrientationOffset,t._orientationOffset.getValue())},addRotate:(()=>{const e=new ai;return function(t){const i=this.getActiveViewpoint();if(this.rotationChaser._isActive.getValue()&&this.rotationChaser._value_changed.hasInterest("set_rotation__",this))try{e.assign(this.rotationChaser._set_destination.getValue()).multLeft(t),this.getOrientationOffset(e,this.initialOrientationOffset,!0),this.rotationChaser._set_destination=e}catch{t=this.getHorizonRotation(t),e.assign(this.rotationChaser._set_destination.getValue()).multLeft(t),this.rotationChaser._set_destination=e}else try{this.initialOrientationOffset.assign(i._orientationOffset.getValue()),this.initialPositionOffset.assign(i._positionOffset.getValue()),this.getOrientationOffset(t,this.initialOrientationOffset,!0),this.rotationChaser._set_value=ai.Identity,this.rotationChaser._set_destination=t}catch{this.rotationChaser._set_value=ai.Identity,this.rotationChaser._set_destination=this.getHorizonRotation(t)}this.disconnect(),this.rotationChaser._value_changed.addInterest("set_rotation__",this)}})(),addSpinning(e){if(this.disconnect(),this.getStraightenHorizon()){const t=this.getActiveViewpoint(),i=t.getUserPosition(),n=t.getUserCenterOfRotation(),s=i.copy().subtract(n),r=this.getHorizonRotation(e),o=t.getUpVector(!0);this.axis.assign(o),r.getAxis(new bt(0,0,0)).dot(bt.yAxis)<0!=r.angle<0&&this.axis.negate(),this.timeSensor._cycleInterval=Math.PI/(.4*e.angle*30),this.timeSensor._startTime=this.getBrowser().getCurrentTime();const a=t.getLookAtRotation(i,n);this.direction.assign(s),this.orientationOffset.assign(t.getUserOrientation()).multRight(a.inverse())}else this.getBrowser().prepareEvents().addInterest("spin",this),this.rotation.assign(e)},spin:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new ai,n=new ai;return function(){const s=this.getActiveViewpoint();if(this.getStraightenHorizon()){const n=s.getUserCenterOfRotation(),r=this.timeSensor._fraction_changed.getValue(),o=new ai(this.axis,2*Math.PI*r).multVecRot(e.assign(this.direction)).add(n),a=s.getLookAtRotation(o,s.getUserCenterOfRotation());t.assign(o).subtract(s.getPosition()),i.assign(s.getOrientation()).inverse().multRight(this.orientationOffset).multRight(a),s._positionOffset=t,s._orientationOffset=i}else n.assign(ai.Identity).slerp(this.rotation,24/this.getBrowser().getCurrentFrameRate()),this.orientationOffset.assign(s._orientationOffset.getValue()),s._orientationOffset=this.getOrientationOffset(n,this.orientationOffset),s._positionOffset=this.getPositionOffset(s._positionOffset.getValue(),this.orientationOffset,s._orientationOffset.getValue())}})(),addMove:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n){const s=this.getActiveViewpoint();this.positionChaser._isActive.getValue()&&this.positionChaser._value_changed.hasInterest("set_positionOffset__",this)?(e.assign(this.positionChaser._set_destination.getValue()).add(i),this.positionChaser._set_destination=e):(e.assign(s._positionOffset.getValue()).add(i),this.positionChaser._set_value=s._positionOffset,this.positionChaser._set_destination=e),this.centerOfRotationChaser._isActive.getValue()&&this.centerOfRotationChaser._value_changed.hasInterest("set_centerOfRotationOffset__",this)?(t.assign(this.centerOfRotationChaser._set_destination.getValue()).add(n),this.centerOfRotationChaser._set_destination=t):(t.assign(s._centerOfRotationOffset.getValue()).add(n),this.centerOfRotationChaser._set_value=s._centerOfRotationOffset,this.centerOfRotationChaser._set_destination=t),this.disconnect(),this.positionChaser._value_changed.addInterest("set_positionOffset__",this),this.centerOfRotationChaser._value_changed.addInterest("set_centerOfRotationOffset__",this)}})(),getPositionOffset:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new ai;return function(n,s,r){return this.getDistanceToCenter(e,n),i.assign(s).inverse().multRight(r).multVecRot(t.assign(e)).subtract(e).add(n)}})(),getOrientationOffset:(()=>{const e=new ai,t=new ai,i=new bt(0,0,0);return function(n,s,r){const o=this.getActiveViewpoint(),a=this.getStraightenHorizon();e.assign(n).multRight(o.getOrientation()).multRight(s),a&&o.straightenHorizon(e);const l=t.assign(o.getOrientation()).inverse().multRight(e);if(a){if(!r)return l;const t=e.multVecRot(i.assign(bt.zAxis));if(Math.abs(o.getUpVector(!0).dot(t))<.97)return l;throw new Error("Critical angle")}return l}})(),getHorizonRotation:(()=>{const e=new bt(0,0,0);return function(t){const i=t.multVecRot(e.assign(bt.zAxis)),n=bt.yAxis.copy().cross(i).copy().cross(bt.yAxis);return new ai(bt.zAxis,n)}})(),disconnect(){const e=this.getBrowser();this.positionChaser._value_changed.removeInterest("set_positionOffset__",this),this.centerOfRotationChaser._value_changed.removeInterest("set_centerOfRotationOffset__",this),this.rotationChaser._value_changed.removeInterest("set_rotation__",this),this.timeSensor._stopTime=e.getCurrentTime(),e.prepareEvents().removeInterest("spin",this)},dispose(){const e=this.getBrowser();this.disconnect(),this.getNavigationInfo()._transitionStart.removeInterest("disconnect",this),e.getBrowserOptions()._StraightenHorizon.removeInterest("disconnect",this),e._activeViewpoint.removeInterest("set_activeViewpoint__",this),e.getSurface().off(".ExamineViewer"),FE(document).off(".ExamineViewer"+this.getId())}}),Object.defineProperties(DE,{typeName:{value:"ExamineViewer",enumerable:!0},fieldDefinitions:{value:new J([new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const PE=DE;i.add("ExamineViewer","x_ite/Browser/Navigation/ExamineViewer",PE);const RE=PE;n(520);var AE=n(464);const VE=/Mac OS X/i.test(navigator.userAgent),LE=.007,BE=VE?Math.PI/512:Math.PI/32;function UE(e,t){CE.call(this,e,t);const i=this.getBrowser().getContext();this.button=-1,this.fromVector=new bt(0,0,0),this.toVector=new bt(0,0,0),this.direction=new bt(0,0,0),this.startTime=0,this.event=null,this.lookAround=!1,this.orientationChaser=new uc(e),this.lineIndexBuffer=i.createBuffer(),this.lineColorBuffer=i.createBuffer(),this.lineVertexBuffer=i.createBuffer(),this.lineVertexArrayObject=new xl(i),this.lineVertexArray=new Float32Array(32).fill(1),this.geometryContext=new Ml({geometryType:2,colorMaterial:!0}),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this.lineIndexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,new Uint8Array([0,1,2,0,2,3,4,5,6,4,6,7]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,this.lineColorBuffer),i.bufferData(i.ARRAY_BUFFER,new Float32Array([0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),i.STATIC_DRAW)}Object.assign(Object.setPrototypeOf(UE.prototype,CE.prototype),{initialize(){CE.prototype.initialize.call(this);const e=this.getBrowser(),t=e.getSurface();t.on("mousedown.X3DFlyViewer",this.mousedown.bind(this)),t.on("mouseup.X3DFlyViewer",this.mouseup.bind(this)),t.on("mousewheel.X3DFlyViewer",this.mousewheel.bind(this)),t.on("touchstart.X3DFlyViewer",this.touchstart.bind(this)),t.on("touchend.X3DFlyViewer",this.touchend.bind(this)),e._controlKey.addInterest("set_controlKey__",this),this.orientationChaser._duration=.3,this.orientationChaser.setup()},addCollision(){},removeCollision(){},set_controlKey__(){this.event&&0===this.event.button&&(this.button=-1,this.mousedown(this.event))},mousedown(e){if(this.button>=0)return;this.event=e;const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);if(this.isPointerInRectangle(t,i))switch(this.getButton(e.button)){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,AE(document).on("mouseup.X3DFlyViewer"+this.getId(),this.mouseup.bind(this)),AE(document).on("mousemove.X3DFlyViewer"+this.getId(),this.mousemove.bind(this)),AE(document).on("touchend.X3DFlyViewer"+this.getId(),this.touchend.bind(this)),AE(document).on("touchmove.X3DFlyViewer"+this.getId(),this.touchmove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.addCollision(),this.getBrowser().getControlKey()||this.lookAround?this.trackballProjectToSphere(t,i,this.fromVector):(this.fromVector.set(t,0,-i),this.toVector.assign(this.fromVector),this.getFlyDirection(this.fromVector,this.toVector,this.direction),this.addFly(),this.getBrowser().getBrowserOption("Rubberband")&&this.getBrowser().finishedEvents().addInterest("display",this,0)),this._isActive=!0;break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,AE(document).on("mouseup.X3DFlyViewer"+this.getId(),this.mouseup.bind(this)),AE(document).on("mousemove.X3DFlyViewer"+this.getId(),this.mousemove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.addCollision(),this.fromVector.set(t,i,0),this.toVector.assign(this.fromVector),this.direction.set(0,0,0),this.addPan(),this.getBrowser().getBrowserOption("Rubberband")&&this.getBrowser().finishedEvents().addInterest("display",this,1),this._isActive=!0}},mouseup(e){e.preventDefault(),e.button===this.button&&(this.event=null,this.button=-1,AE(document).off(".X3DFlyViewer"+this.getId()),this.disconnect(),this.getBrowser().setCursor("DEFAULT"),this.removeCollision(),this._isActive=!1)},mousemove(e){const t=this.getBrowser();t.addBrowserEvent(),this.event=e;const{x:i,y:n}=this.getBrowser().getPointerFromEvent(e);switch(this.getButton(this.button)){case 0:if(t.getControlKey()||this.lookAround){e.preventDefault(),e.stopImmediatePropagation();const t=this.trackballProjectToSphere(i,n,this.toVector);this.addRotation(this.fromVector,t),this.fromVector.assign(t);break}this.toVector.set(i,0,-n),this.getFlyDirection(this.fromVector,this.toVector,this.direction),this.direction.divide(t.getRenderingProperty("ContentScale"));break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.toVector.set(i,n,0),this.direction.assign(this.toVector).subtract(this.fromVector),this.direction.divide(t.getRenderingProperty("ContentScale"))}},mousewheel(e){const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);if(!this.isPointerInRectangle(t,i))return;e.preventDefault(),e.stopImmediatePropagation();this.getActiveViewpoint().transitionStop(),e.deltaY>0?this.addRoll(-BE):e.deltaY<0&&this.addRoll(BE)},touchstart(e){const t=e.originalEvent.touches;switch(t.length){case 1:e.button=0,e.pageX=t[0].pageX,e.pageY=t[0].pageY,this.mousedown(e);break;case 2:this.touchend(e),this.lookAround=!0,e.button=0,e.pageX=(t[0].pageX+t[1].pageX)/2,e.pageY=(t[0].pageY+t[1].pageY)/2,this.mousedown(e);break;case 3:this.touchend(e)}},touchend(e){if(0===this.button)this.lookAround=!1,e.button=0,this.mouseup(e)},touchmove(e){const t=e.originalEvent.touches;switch(t.length){case 1:e.button=0,e.pageX=t[0].pageX,e.pageY=t[0].pageY,this.mousemove(e);break;case 2:e.button=0,e.pageX=(t[0].pageX+t[1].pageX)/2,e.pageY=(t[0].pageY+t[1].pageY)/2,this.mousemove(e)}},fly:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new ai,s=new ai,r=new ai;return function(){const o=this.getNavigationInfo(),a=this.getActiveViewpoint(),l=Date.now(),u=(l-this.startTime)/1e3;e.assign(a.getUpVector()),this.direction.z>0?r.setFromToVec(this.direction,i.set(0,0,1)):r.setFromToVec(i.set(0,0,-1),this.direction);const h=this.direction.magnitude();let d=1-r.angle/(Math.PI/2);d*=o._speed.getValue(),d*=a.getSpeedFactor(),d*=this.getBrowser().getShiftKey()?.028:LE,d*=u;const c=this.getTranslationOffset(t.assign(this.direction).multiply(d));this.getActiveLayer().constrainTranslation(c,!0),a._positionOffset=c.add(a._positionOffset.getValue());const p=1.4*u*(h/(h+40))**2;n.assign(ai.Identity).slerp(r,p).multRight(a.getUserOrientation()),this.getStraightenHorizon()&&a.straightenHorizon(n),s.assign(a.getOrientation()).inverse().multRight(n),a._orientationOffset=s,this.startTime=l}})(),pan:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(){const i=this.getNavigationInfo(),n=this.getActiveViewpoint(),s=Date.now(),r=(s-this.startTime)/1e3,o=n.getUpVector();this.constrainPanDirection(e.assign(this.direction));let a=1;a*=i._speed.getValue(),a*=n.getSpeedFactor(),a*=this.getBrowser().getShiftKey()?.0098:.007,a*=r;const l=n.getUserOrientation().multRight(new ai(n.getUserOrientation().multVecRot(t.assign(bt.yAxis)),o)).multVecRot(e.multiply(a));this.getActiveLayer().constrainTranslation(l,!0),n._positionOffset=l.add(n._positionOffset.getValue()),this.startTime=s}})(),set_orientationOffset__(e){this.getActiveViewpoint()._orientationOffset=e},addFly(){this.startTime||(this.getBrowser().prepareEvents().addInterest("fly",this),this.getBrowser().addBrowserEvent(),this.startTime=Date.now())},addPan(){this.startTime||(this.disconnect(),this.getBrowser().prepareEvents().addInterest("pan",this),this.getBrowser().addBrowserEvent(),this.startTime=Date.now())},addRoll:(()=>{const e=new ai,t=new ai;return function(i){const n=this.getActiveViewpoint();this.orientationChaser._isActive.getValue()&&this.orientationChaser._value_changed.hasInterest("set_orientationOffset__",this)?(e.assign(n.getOrientation()).inverse().multRight(t.set(1,0,0,i)).multRight(n.getOrientation()).multRight(this.orientationChaser._set_destination.getValue()),this.orientationChaser._set_destination=e):(e.assign(n.getOrientation()).inverse().multRight(t.set(1,0,0,i)).multRight(n.getUserOrientation()),this.orientationChaser._set_value=n._orientationOffset,this.orientationChaser._set_destination=e),this.disconnect(),this.orientationChaser._value_changed.addInterest("set_orientationOffset__",this)}})(),addRotation:(()=>{const e=new ai,t=new ai;return function(i,n){const s=this.getActiveViewpoint();this.orientationChaser._isActive.getValue()&&this.orientationChaser._value_changed.hasInterest("set_orientationOffset__",this)?(e.setFromToVec(n,i).multRight(s.getOrientation()).multRight(this.orientationChaser._set_destination.getValue()),this.getStraightenHorizon()&&s.straightenHorizon(e),t.assign(s.getOrientation()).inverse().multRight(e),this.orientationChaser._set_destination=t):(e.setFromToVec(n,i).multRight(s.getUserOrientation()),this.getStraightenHorizon()&&s.straightenHorizon(e),t.assign(s.getOrientation()).inverse().multRight(e),this.orientationChaser._set_value=s._orientationOffset,this.orientationChaser._set_destination=t),this.disconnect(),this.orientationChaser._value_changed.addInterest("set_orientationOffset__",this)}})(),display:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0),i=new bt(0,0,0),n=new bt(0,0,0),s=new ci,r=new Float32Array(ci.Identity),o=new Float32Array(ci.Identity),a=[];return function(l){const u=this.getBrowser(),h=u.getContext(),d=u.getViewport(),c=d[2],p=d[3],g=u.getRenderingProperty("ContentScale");switch(r.set(Va.ortho(0,c,0,p,-1,1,s)),l){case 0:e.set(this.fromVector.x,-this.fromVector.z,0),t.set(this.toVector.x,-this.toVector.z,0);break;case 1:e.set(this.fromVector.x,this.fromVector.y,0),t.set(this.toVector.x,this.toVector.y,0)}i.assign(t).subtract(e).normalize().multiply(g).set(-i.y,i.x,0),this.lineVertexArray.set(n.assign(e).add(i),0),this.lineVertexArray.set(n.assign(e).subtract(i),4),this.lineVertexArray.set(n.assign(t).subtract(i),8),this.lineVertexArray.set(n.assign(t).add(i),12),i.assign(t).subtract(e).normalize().multiply(g/2).set(-i.y,i.x,0),this.lineVertexArray.set(n.assign(e).add(i),16),this.lineVertexArray.set(n.assign(e).subtract(i),20),this.lineVertexArray.set(n.assign(t).subtract(i),24),this.lineVertexArray.set(n.assign(t).add(i),28),h.bindBuffer(h.ARRAY_BUFFER,this.lineVertexBuffer),h.bufferData(h.ARRAY_BUFFER,this.lineVertexArray,h.DYNAMIC_DRAW);const f=u.getDefaultMaterial().getShader(this.geometryContext);f.enable(h),f.setClipPlanes(h,a),h.uniformMatrix4fv(f.x3d_ProjectionMatrix,!1,r),h.uniformMatrix4fv(f.x3d_ModelViewMatrix,!1,o),h.uniform3f(f.x3d_EmissiveColor,0,0,0),h.uniform1f(f.x3d_Transparency,0),this.lineVertexArrayObject.enable(f)&&(h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,this.lineIndexBuffer),f.enableColorAttribute(h,this.lineColorBuffer,0,0),f.enableVertexAttribute(h,this.lineVertexBuffer,0,0)),h.disable(h.DEPTH_TEST),h.enable(h.CULL_FACE),h.frontFace(h.CCW),h.drawElements(h.TRIANGLES,12,h.UNSIGNED_BYTE,0),h.enable(h.DEPTH_TEST)}})(),disconnect(){const e=this.getBrowser();e.addBrowserEvent(),e.prepareEvents().removeInterest("fly",this),e.prepareEvents().removeInterest("pan",this),e.finishedEvents().removeInterest("display",this),this.orientationChaser._value_changed.removeInterest("set_orientationOffset__",this),this.startTime=0},dispose(){const e=this.getBrowser().getContext();e.deleteBuffer(this.lineVertexBuffer),this.lineVertexArrayObject.delete(e),this.disconnect(),this.getBrowser()._controlKey.removeInterest("set_controlKey__",this),this.getBrowser().getSurface().off(".X3DFlyViewer"),AE(document).off(".X3DFlyViewer"+this.getId())}});const XE=UE;i.add("X3DFlyViewer","x_ite/Browser/Navigation/X3DFlyViewer",XE);const kE=XE;function jE(e,t){kE.call(this,e,t)}Object.assign(Object.setPrototypeOf(jE.prototype,kE.prototype),{initialize(){kE.prototype.initialize.call(this),this.getBrowser().addCollision(this)},getStraightenHorizon:()=>!0,getFlyDirection:(e,t,i)=>i.assign(t).subtract(e),getTranslationOffset:(()=>{const e=new bt(0,0,0),t=new ai,i=new ai;return function(n){const s=this.getActiveViewpoint(),r=s.getUpVector();t.assign(s.getUserOrientation()),t.multVecRot(e.assign(bt.yAxis)),i.setFromToVec(e,r);return t.multRight(i).multVecRot(n)}})(),constrainPanDirection:e=>(e.y<0&&(e.y=0),e),dispose(){this.getBrowser().removeCollision(this),kE.prototype.dispose.call(this)}}),Object.defineProperties(jE,{typeName:{value:"WalkViewer",enumerable:!0},fieldDefinitions:{value:new J([new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const zE=jE;i.add("WalkViewer","x_ite/Browser/Navigation/WalkViewer",zE);const GE=zE;function HE(e,t){kE.call(this,e,t)}Object.assign(Object.setPrototypeOf(HE.prototype,kE.prototype),{addCollision(){this.getBrowser().addCollision(this)},removeCollision(){this.getBrowser().removeCollision(this)},getFlyDirection:(e,t,i)=>i.assign(t).subtract(e),getTranslationOffset(e){return this.getActiveViewpoint().getUserOrientation().multVecRot(e)},constrainPanDirection:e=>e}),Object.defineProperties(HE,{typeName:{value:"FlyViewer",enumerable:!0},fieldDefinitions:{value:new J([new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const qE=HE;i.add("FlyViewer","x_ite/Browser/Navigation/FlyViewer",qE);const YE=qE;n(520);var WE=n(464);const $E=/Mac OS X/i.test(navigator.userAgent)?1/160:.05,JE=new bt(0,0,0),KE=new bt(0,0,0),ZE=new bt(0,0,0);function QE(e,t){CE.call(this,e,t),this.button=-1,this.fromPoint=new bt(0,0,0),this.toPoint=new bt(0,0,0)}Object.assign(Object.setPrototypeOf(QE.prototype,CE.prototype),{initialize(){CE.prototype.initialize.call(this);const e=this.getBrowser().getSurface();e.on("mousedown.PlaneViewer",this.mousedown.bind(this)),e.on("mouseup.PlaneViewer",this.mouseup.bind(this)),e.on("mousemove.PlaneViewer",this.mousemove.bind(this)),e.on("mousewheel.PlaneViewer",this.mousewheel.bind(this))},mousedown(e){if(this.button>=0)return;const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);if(this.isPointerInRectangle(t,i)&&1===this.getButton(e.button))e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,this.getBrowser().getSurface().off("mousemove.PlaneViewer"),WE(document).on("mouseup.PlaneViewer"+this.getId(),this.mouseup.bind(this)),WE(document).on("mousemove.PlaneViewer"+this.getId(),this.mousemove.bind(this)),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(t,i,this.fromPoint),this._isActive=!0},mouseup(e){e.preventDefault(),e.stopImmediatePropagation(),e.button===this.button&&(this.button=-1,WE(document).off(".PlaneViewer"+this.getId()),this.getBrowser().getSurface().on("mousemove.PlaneViewer",this.mousemove.bind(this)),this.getBrowser().setCursor("DEFAULT"),this._isActive=!1)},mousemove(e){const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);switch(this.getButton(this.button)){case 1:{e.preventDefault(),e.stopImmediatePropagation();const n=this.getActiveViewpoint(),s=this.getPointOnCenterPlane(t,i,this.toPoint),r=n.getUserOrientation().multVecRot(this.fromPoint.subtract(s));n._positionOffset=KE.assign(n._positionOffset.getValue()).add(r),n._centerOfRotationOffset=ZE.assign(n._centerOfRotationOffset.getValue()).add(r),this.fromPoint.assign(s);break}}},mousewheel(e){const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);if(!this.isPointerInRectangle(t,i))return;e.preventDefault(),e.stopImmediatePropagation();const n=this.getActiveViewpoint(),s=this.getPointOnCenterPlane(t,i,this.fromPoint);n.transitionStop(),e.deltaY>0?n._fieldOfViewScale=Math.max(1e-5,n._fieldOfViewScale.getValue()*(1-$E)):e.deltaY<0&&(n._fieldOfViewScale=n._fieldOfViewScale.getValue()*(1+$E),this.constrainFieldOfViewScale());const r=this.getPointOnCenterPlane(t,i,this.toPoint),o=n.getUserOrientation().multVecRot(JE.assign(s).subtract(r));n._positionOffset=KE.assign(n._positionOffset.getValue()).add(o),n._centerOfRotationOffset=ZE.assign(n._centerOfRotationOffset.getValue()).add(o)},constrainFieldOfViewScale(){const e=this.getActiveViewpoint();e.getTypeName().match(/^(?:Viewpoint|GeoViewpoint)$/)&&e._fieldOfView.getValue()*e._fieldOfViewScale.getValue()>=Math.PI&&(e._fieldOfViewScale=(Math.PI-.001)/e._fieldOfView.getValue())},dispose(){this.getBrowser().getSurface().off(".PlaneViewer"),WE(document).off(".PlaneViewer"+this.getId())}}),Object.defineProperties(QE,{typeName:{value:"PlaneViewer",enumerable:!0},fieldDefinitions:{value:new J([new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const eN=QE;i.add("PlaneViewer","x_ite/Browser/Navigation/PlaneViewer",eN);const tN=eN;function iN(e,t){CE.call(this,e,t)}Object.setPrototypeOf(iN.prototype,CE.prototype),Object.defineProperties(iN,{typeName:{value:"NoneViewer",enumerable:!0},fieldDefinitions:{value:new J([new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const nN=iN;i.add("NoneViewer","x_ite/Browser/Navigation/NoneViewer",nN);const sN=nN;n(520);var rN=n(464);const oN=/Mac OS X/i.test(navigator.userAgent)?1/120:.05;function aN(e,t){CE.call(this,e,t),this.button=-1,this.fromVector=new bt(0,0,0),this.toVector=new bt(0,0,0),this.touch1=new ft(0,0),this.touch2=new ft(0,0),this.tapStart=0,this.dblTapInterval=.4,this.positionChaser=new _c(e),this.centerOfRotationChaser=new _c(e),this.orientationChaser=new uc(e)}Object.assign(Object.setPrototypeOf(aN.prototype,CE.prototype),{initialize(){CE.prototype.initialize.call(this);const e=this.getBrowser().getSurface();e.on("mousedown.LookAtViewer",this.mousedown.bind(this)),e.on("mouseup.LookAtViewer",this.mouseup.bind(this)),e.on("dblclick.LookAtViewer",this.dblclick.bind(this)),e.on("mousewheel.LookAtViewer",this.mousewheel.bind(this)),e.on("touchstart.LookAtViewer",this.touchstart.bind(this)),e.on("touchend.LookAtViewer",this.touchend.bind(this)),this.positionChaser._duration=.3,this.positionChaser.setup(),this.centerOfRotationChaser._duration=.3,this.centerOfRotationChaser.setup(),this.orientationChaser._duration=.3,this.orientationChaser.setup()},mousedown(e){if(this.button>=0)return;const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);if(this.isPointerInRectangle(t,i)&&0===e.button)e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,rN(document).on("mouseup.LookAtViewer"+this.getId(),this.mouseup.bind(this)),rN(document).on("mousemove.LookAtViewer"+this.getId(),this.mousemove.bind(this)),rN(document).on("touchend.LookAtViewer"+this.getId(),this.mouseup.bind(this)),rN(document).on("touchmove.LookAtViewer"+this.getId(),this.touchmove.bind(this)),this.getActiveViewpoint().transitionStop(),this.trackballProjectToSphere(t,i,this.fromVector),this._isActive=!0},mouseup(e){if(e.button===this.button&&(this.button=-1,rN(document).off(".LookAtViewer"+this.getId()),0===e.button))e.preventDefault(),e.stopImmediatePropagation(),this._isActive=!1},dblclick(e){e.preventDefault(),e.stopImmediatePropagation();const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);this.disconnect(),this.lookAtPoint(t,i,this.getStraightenHorizon())},mousemove(e){this.getBrowser().addBrowserEvent(),this.event=e;const{x:t,y:i}=this.getBrowser().getPointerFromEvent(e);switch(this.button){case 0:{e.preventDefault(),e.stopImmediatePropagation();const n=this.trackballProjectToSphere(t,i,this.toVector);this.addRotation(this.fromVector,n),this.fromVector.assign(n);break}}},mousewheel:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i){const{x:n,y:s}=this.getBrowser().getPointerFromEvent(i);if(!this.isPointerInRectangle(n,s))return;i.preventDefault(),i.stopImmediatePropagation();const r=this.getActiveViewpoint();r.transitionStop(),this.getDistanceToCenter(e).multiply(i.zoomFactor||oN),r.getUserOrientation().multVecRot(t.set(0,0,e.magnitude())),i.deltaY>0?this.addMove(t.negate(),bt.Zero):i.deltaY<0&&this.addMove(t,bt.Zero)}})(),touchstart(e){const t=e.originalEvent.touches;switch(t.length){case 1:this.touch1.set(t[0].pageX,t[0].pageY);break;case 2:this.touchend(e),e.button=0,e.pageX=(t[0].pageX+t[1].pageX)/2,e.pageY=(t[0].pageY+t[1].pageY)/2,this.mousedown(e),this.touch1.set(t[0].pageX,t[0].pageY),this.touch2.set(t[1].pageX,t[1].pageY);break;case 3:this.touchend(e)}},touchend(e){if(0===this.button)this.mouseup(e);this.getBrowser().getCurrentTime()-this.tapStart<this.dblTapInterval&&(e.button=1,e.pageX=this.touch1.x,e.pageY=this.touch1.y,this.dblclick(e)),this.tapStart=this.getBrowser().getCurrentTime()},touchmove:(()=>{const e=new ft(0,0),t=new ft(0,0);return function(i){const n=i.originalEvent.touches;switch(n.length){case 1:break;case 2:{e.set(n[0].pageX,n[0].pageY).subtract(this.touch1).normalize(),t.set(n[1].pageX,n[1].pageY).subtract(this.touch2).normalize();const s=e.dot(t)>.7,r=e.dot(t)<-.7;if(s)i.button=0,i.pageX=(n[0].pageX+n[1].pageX)/2,i.pageY=(n[0].pageY+n[1].pageY)/2,this.mousemove(i);else if(r){const e=this.touch1.distance(this.touch2);this.touch1.set(n[0].pageX,n[0].pageY),this.touch2.set(n[1].pageX,n[1].pageY);const t=this.touch1.distance(this.touch2)-e;i.deltaY=t,i.zoomFactor=Math.abs(t)/rN(window).width(),i.pageX=(n[0].pageX+n[1].pageX)/2,i.pageY=(n[0].pageY+n[1].pageY)/2,this.mousewheel(i)}this.touch1.set(n[0].pageX,n[0].pageY),this.touch2.set(n[1].pageX,n[1].pageY);break}}}})(),set_positionOffset__(e){this.getActiveViewpoint()._positionOffset=e},set_centerOfRotationOffset__(e){this.getActiveViewpoint()._centerOfRotationOffset=e},set_orientationOffset__(e){this.getActiveViewpoint()._orientationOffset=e},addMove:(()=>{const e=new bt(0,0,0),t=new bt(0,0,0);return function(i,n){const s=this.getActiveViewpoint();this.positionChaser._isActive.getValue()&&this.positionChaser._value_changed.hasInterest("set_positionOffset__",this)?(e.assign(this.positionChaser._set_destination.getValue()).add(i),this.positionChaser._set_destination=e):(e.assign(s._positionOffset.getValue()).add(i),this.positionChaser._set_value=s._positionOffset,this.positionChaser._set_destination=e),this.centerOfRotationChaser._isActive.getValue()&&this.centerOfRotationChaser._value_changed.hasInterest("set_centerOfRotationOffset__",this)?(t.assign(this.centerOfRotationChaser._set_destination.getValue()).add(n),this.centerOfRotationChaser._set_destination=t):(t.assign(s._centerOfRotationOffset.getValue()).add(n),this.centerOfRotationChaser._set_value=s._centerOfRotationOffset,this.centerOfRotationChaser._set_destination=t),this.disconnect(),this.positionChaser._value_changed.addInterest("set_positionOffset__",this),this.centerOfRotationChaser._value_changed.addInterest("set_centerOfRotationOffset__",this)}})(),addRotation:(()=>{const e=new ai,t=new ai;return function(i,n){const s=this.getActiveViewpoint();this.orientationChaser._isActive.getValue()&&this.orientationChaser._value_changed.hasInterest("set_orientationOffset__",this)?(e.setFromToVec(n,i).multRight(s.getOrientation()).multRight(this.orientationChaser._set_destination.getValue()),s.straightenHorizon(e),t.assign(s.getOrientation()).inverse().multRight(e),this.orientationChaser._set_destination=t):(e.setFromToVec(n,i).multRight(s.getUserOrientation()),s.straightenHorizon(e),t.assign(s.getOrientation()).inverse().multRight(e),this.orientationChaser._set_value=s._orientationOffset,this.orientationChaser._set_destination=t),this.disconnect(),this.orientationChaser._value_changed.addInterest("set_orientationOffset__",this)}})(),disconnect(){this.orientationChaser._value_changed.removeInterest("set_orientationOffset__",this),this.positionChaser._value_changed.removeInterest("set_positionOffset__",this),this.centerOfRotationChaser._value_changed.removeInterest("set_centerOfRotationOffset__",this)},dispose(){this.getBrowser().getSurface().off(".LookAtViewer"),rN(document).off(".LookAtViewer"+this.getId())}}),Object.defineProperties(aN,{typeName:{value:"LookAtViewer",enumerable:!0},fieldDefinitions:{value:new J([new X(d.outputOnly,"isActive",new Yn.SFBool)]),enumerable:!0}});const lN=aN;i.add("LookAtViewer","x_ite/Browser/Navigation/LookAtViewer",lN);const uN=lN,hN=Symbol(),dN=Symbol(),cN=Symbol();function pN(){this.addChildObjects(d.outputOnly,"activeLayer",new Yn.SFNode,d.outputOnly,"activeNavigationInfo",new Yn.SFNode,d.outputOnly,"activeViewpoint",new Yn.SFNode,d.outputOnly,"availableViewers",new Yn.MFString,d.outputOnly,"viewer",new Yn.SFString("EXAMINE")),this[hN]=new Set,this[dN]=new sN(this.getPrivateScene())}Object.assign(pN.prototype,{initialize(){this._viewer.addInterest("set_viewer__",this),this.initialized().addInterest("set_world__",this),this.shutdown().addInterest("remove_world__",this),this[cN]=function(e){const t=new Ug(e.getPrivateScene());t.setup();const i=t.getLights().pop();return i.set(t,null,ci.Identity),i.dispose=Function.prototype,i}(this),this[dN].setup()},getHeadlight(){return this[cN]},getActiveLayer(){return this._activeLayer.getValue()},getActiveNavigationInfo(){return this._activeNavigationInfo.getValue()},getActiveViewpoint(){return this._activeViewpoint.getValue()},getCurrentViewer(){return this._viewer.getValue()},getViewer(){return this[dN]},addCollision(e){this[hN].add(e)},removeCollision(e){this[hN].delete(e)},getCollisionCount(){return this[hN].size},remove_world__(){this.getWorld()._activeLayer.removeInterest("set_activeLayer__",this)},set_world__(){this.getWorld()._activeLayer.addInterest("set_activeLayer__",this),this.set_activeLayer__()},set_activeLayer__(){this._activeLayer.getValue()&&(this._activeLayer.getValue().getNavigationInfoStack().removeInterest("set_activeNavigationInfo__",this),this._activeLayer.getValue().getViewpointStack().removeInterest("set_activeViewpoint__",this)),this._activeLayer=this.getWorld().getActiveLayer(),this._activeLayer.getValue()&&(this._activeLayer.getValue().getNavigationInfoStack().addInterest("set_activeNavigationInfo__",this),this._activeLayer.getValue().getViewpointStack().addInterest("set_activeViewpoint__",this)),this.set_activeNavigationInfo__(),this.set_activeViewpoint__()},set_activeNavigationInfo__(){this._activeNavigationInfo.getValue()?._viewer.removeFieldInterest(this._viewer),this._activeLayer.getValue()?(this._activeNavigationInfo=this._activeLayer.getValue().getNavigationInfo(),this._activeNavigationInfo.getValue()._viewer.addFieldInterest(this._viewer),this._viewer=this._activeNavigationInfo.getValue()._viewer):(this._activeNavigationInfo=null,this._viewer="NONE")},set_activeViewpoint__(){this._activeLayer.getValue()?this._activeViewpoint=this._activeLayer.getValue().getViewpoint():this._activeViewpoint=null},set_viewer__(e){const t=this._activeNavigationInfo.getValue();switch(t?this._availableViewers=t._availableViewers:this._availableViewers.length=0,this[dN]?.dispose(),e.getValue()){case"EXAMINE":default:this[dN]=new RE(this.getPrivateScene(),t);break;case"WALK":this[dN]=new GE(this.getPrivateScene(),t);break;case"FLY":this[dN]=new YE(this.getPrivateScene(),t);break;case"PLANE":case"PLANE_create3000.github.io":case"PLANE_create3000.de":this[dN]=new tN(this.getPrivateScene(),t);break;case"NONE":this[dN]=new sN(this.getPrivateScene(),t);break;case"LOOKAT":this[dN]=new uN(this.getPrivateScene(),t)}this[dN].setup()},dispose(){this[dN]?.dispose()}});const gN=pN;i.add("X3DNavigationContext","x_ite/Browser/Navigation/X3DNavigationContext",gN);const fN=gN,mN=Symbol(),_N=Symbol(),xN=Symbol(),yN=Symbol(),wN=Symbol(),bN=Symbol(),SN=Symbol();function TN(e){let t=e.prop("baseURI");return t.startsWith("about:")&&(t=document.baseURI),t}function vN(){this.addChildObjects(d.outputOnly,"loadCount",new Yn.SFInt32),this[mN]=TN(this.getElement()),this[_N]=0,this[xN]=0,this[yN]=new Set,this[wN]=!1}Object.assign(vN.prototype,{initialize(){this._loadCount.addInterest(bN,this)},getProviderURL:()=>so.getProviderURL(),getBaseURL(){return this[mN]},setBaseURL(e){const t=TN(this.getElement()),i=new URL(e,t);this[mN]=i.protocol.match(/^(?:data|blob):$/)?t:i.href},getBrowserLoading(){return this[wN]},setBrowserLoading(e){this[wN]=e,e?(this[yN].has(this)||this.resetLoadCount(),this.getShadow().find(".x_ite-private-world-info").remove(),this.getBrowserOption("SplashScreen")&&(this.getContextMenu().hide(),this.getCanvas().hide(),this.getSplashScreen().stop(!0,!0).show())):this.getBrowserOption("SplashScreen")&&(this.getCanvas().show(),this.getSplashScreen().stop(!0,!0).show().fadeOut(2e3))},getLoadingObjects(){return this[yN]},addLoadingObject(e){this[yN].has(e)||(++this[xN],this[yN].add(e),this.setLoadCount(this[yN].size),this.setCursor("DEFAULT"))},removeLoadingObject(e){this[yN].has(e)&&(this[yN].delete(e),this.setLoadCount(this[yN].size),this.setCursor(this.getCursor()))},getDisplayLoadCount(){return[...this[yN]].reduce(((e,t)=>e+!(t.isPrivate?.()??1)),0)},setLoadCount(e){this._loadCount=e},resetLoadCount(){this._loadCount=0,this[_N]=0,this[xN]=0,this[yN].clear();for(const e of this.getPrivateScene().getLoadingObjects())this.addLoadingObject(e)},[bN](){const e=this.getDisplayLoadCount();if(this._loadCount.getValue()||this[wN])var t=ov(1===(e||1)?"Loading %1 file":"Loading %1 files").replace("%1",e||1);else{t=ov("Loading done");this.setCursor("DEFAULT")}this[wN]?(this.getSplashScreen().find(".x_ite-private-spinner-text").text(t),this.getSplashScreen().find(".x_ite-private-progressbar div").css("width",100-100*this._loadCount.getValue()/this[xN]+"%")):e!==this[_N]&&(this.getNotification()._string=t),this[_N]=e},getDefaultScene(){return this[SN]=this.createScene(),this[SN].setLive(!0),this.getDefaultScene=function(){return this[SN]},Object.defineProperty(this,"getDefaultScene",{enumerable:!1}),this[SN]}});const ON=vN;i.add("X3DNetworkingContext","x_ite/Browser/Networking/X3DNetworkingContext",ON);const EN=ON,NN=Symbol(),CN=Symbol(),FN=Symbol(),IN=Symbol(),MN=Symbol();function DN(){this[NN]=new Set,this[CN]=[new Set],this[FN]=[],this[IN]=[!1],this[MN]=new Ga}Object.assign(DN.prototype,{addTransformSensor(e){this[NN].add(e),this.enablePicking()},removeTransformSensor(e){this[NN].delete(e),this.enablePicking()},addPickSensor(e){this[CN][0].add(e),this.enablePicking()},removePickSensor(e){this[CN][0].delete(e),this.enablePicking()},getPickSensors(){return this[CN]},getPickingHierarchy(){return this[FN]},getPickable(){return this[IN]},enablePicking(){this[NN].size||this[CN][0].size?this._sensorEvents.addInterest("picking",this):this._sensorEvents.removeInterest("picking",this)},picking(){this[MN].start(),this.getWorld().traverse(Ia.PICKING);for(const e of this[NN])e.process();for(const e of this[CN][0])e.process();this[MN].stop()},getPickingTime(){return this[MN]}});const PN=DN;i.add("X3DPickingContext","x_ite/Browser/Picking/X3DPickingContext",PN);const RN=PN;n(520);var AN=n(464);function VN(e){ds.call(this,e),this.cursor="DEFAULT",this.isOver=!1,this.motionTime=0}Object.assign(Object.setPrototypeOf(VN.prototype,ds.prototype),{initialize(){const e=this.getBrowser().getSurface();e.on("mousedown.PointingDevice"+this.getId(),this.mousedown.bind(this)),e.on("mouseup.PointingDevice"+this.getId(),this.mouseup.bind(this)),e.on("dblclick.PointingDevice"+this.getId(),this.dblclick.bind(this)),e.on("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),e.on("mouseout.PointingDevice"+this.getId(),this.onmouseout.bind(this)),e.on("touchstart.PointingDevice"+this.getId(),this.touchstart.bind(this)),e.on("touchend.PointingDevice"+this.getId(),this.touchend.bind(this))},mousewheel(e){},mousedown(e){const t=this.getBrowser(),i=t.getSurface();if(t.getElement().focus(),!(t.getShiftKey()&&t.getControlKey()||0!==e.button)){const{x:n,y:s}=t.getPointerFromEvent(e);i.off("mousemove.PointingDevice"+this.getId()),AN(document).on("mouseup.PointingDevice"+this.getId(),this.mouseup.bind(this)).on("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)).on("touchend.PointingDevice"+this.getId(),this.touchend.bind(this)).on("touchmove.PointingDevice"+this.getId(),this.touchmove.bind(this)),t.buttonPressEvent(n,s)&&(e.preventDefault(),e.stopImmediatePropagation(),t.setCursor("HAND"),t.finishedEvents().addInterest("onverifymotion",this,n,s))}},mouseup(e){if(e.preventDefault(),0===e.button){const t=this.getBrowser(),i=t.getSurface(),{x:n,y:s}=t.getPointerFromEvent(e);AN(document).off(".PointingDevice"+this.getId()),i.on("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),t.buttonReleaseEvent(),t.setCursor(this.isOver?"HAND":"DEFAULT"),t.finishedEvents().addInterest("onverifymotion",this,n,s),t.addBrowserEvent(),this.cursor="DEFAULT"}},dblclick(e){this.isOver&&e.stopImmediatePropagation()},mousemove(e){e.preventDefault();const t=this.getBrowser();if(this.motionTime===t.getCurrentTime())return;this.motionTime=t.getCurrentTime();const{x:i,y:n}=t.getPointerFromEvent(e);this.onmotion(i,n)},touchstart(e){const t=e.originalEvent.touches;switch(t.length){case 1:{e.button=0,e.pageX=t[0].pageX,e.pageY=t[0].pageY,this.mousedown(e);const i=this.getBrowser().getHit();0!==i.id&&0!==i.sensors.length||(this.touchX=e.pageX,this.touchY=e.pageY,this.touchTimeout=setTimeout(this.showContextMenu.bind(this,e),1200));break}case 2:this.touchend(e)}},touchend(e){e.button=0,this.mouseup(e),clearTimeout(this.touchTimeout)},touchmove(e){const t=e.originalEvent.touches;if(1===t.length)e.button=0,e.pageX=t[0].pageX,e.pageY=t[0].pageY,this.mousemove(e),Math.hypot(this.touchX-e.pageX,this.touchY-e.pageY)>7&&clearTimeout(this.touchTimeout)},onmotion(e,t){const i=this.getBrowser();i.motionNotifyEvent(e,t)?this.isOver||(this.isOver=!0,this.cursor=i.getCursor(),i.setCursor("HAND")):this.isOver&&(this.isOver=!1,i.setCursor(this.cursor))},onmouseout(e){this.getBrowser().leaveNotifyEvent()},onverifymotion(e,t){this.getBrowser().finishedEvents().removeInterest("onverifymotion",this),this.onmotion(e,t)},showContextMenu(e){this.getBrowser().getContextMenu().show(e)}}),Object.defineProperties(VN,{typeName:{value:"PointingDevice",enumerable:!0}});const LN=VN;i.add("PointingDevice","x_ite/Browser/PointingDeviceSensor/PointingDevice",LN);const BN=LN;function UN(e){const t=e.getContext();this.context=t,this.array=new Float32Array(4),this.lastBuffer=t.getParameter(t.FRAMEBUFFER_BINDING),this.frameBuffer=t.createFramebuffer(),this.colorBuffers=[],this.frameBuffers=[];for(let e=0;e<3;++e)this.colorBuffers[e]=t.createRenderbuffer(),this.frameBuffers[e]=t.createFramebuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.colorBuffers[e]),t.renderbufferStorage(t.RENDERBUFFER,t.RGBA32F,1,1),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,this.colorBuffers[e]),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffers[e]),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,this.colorBuffers[e]);if(t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.drawBuffers([t.COLOR_ATTACHMENT0,t.COLOR_ATTACHMENT1,t.COLOR_ATTACHMENT2]),t.HAS_FEATURE_DEPTH_TEXTURE){this.depthTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.depthTexture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST);const e=t.getVersion()>=2?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT;t.texImage2D(t.TEXTURE_2D,0,e,1,1,0,t.DEPTH_COMPONENT,t.UNSIGNED_INT,null),t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,this.depthTexture,0)}else this.depthBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.depthBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,this.depthBuffer);const i=t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE;if(t.bindFramebuffer(t.FRAMEBUFFER,this.lastBuffer),!i)throw new Error("Couldn't create frame buffer.")}Object.assign(UN.prototype,{bind(){const e=this.context;this.lastBuffer=e.getParameter(e.FRAMEBUFFER_BINDING),e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},unbind(){const e=this.context;e.bindFramebuffer(e.FRAMEBUFFER,this.lastBuffer)},getHit(e){const{context:t,array:i}=this;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffers[0]),t.readPixels(0,0,1,1,t.RGBA,t.FLOAT,i),e.id=i[3],e.point.set(i[0],i[1],i[2]),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffers[1]),t.readPixels(0,0,1,1,t.RGBA,t.FLOAT,i),e.normal.set(i[0],i[1],i[2]),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffers[2]),t.readPixels(0,0,1,1,t.RGBA,t.FLOAT,i),e.texCoord.set(i[0],i[1],i[2],i[3]),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer)},dispose(){const e=this.context;e.deleteFramebuffer(this.frameBuffer);for(const t of this.frameBuffers)e.deleteFramebuffer(t);for(const t of this.colorBuffers)e.deleteRenderbuffer(t);e.deleteRenderbuffer(this.depthBuffer),e.deleteTexture(this.depthTexture)}});const XN=UN;i.add("PointingBuffer","x_ite/Rendering/PointingBuffer",XN);const kN=XN,jN=Symbol(),zN=Symbol(),GN=Symbol(),HN=Symbol(),qN=Symbol(),YN=Symbol(),WN=Symbol(),$N=Symbol(),JN=Symbol(),KN=Symbol(),ZN=Symbol(),QN=Symbol(),eC=Symbol();function tC(){this[jN]=new BN(this.getPrivateScene()),this[zN]=new Set,this[HN]=new ft(0,0),this[YN]=[],this[WN]=[],this[$N]=null,this[JN]=new Ga,this[KN]=new kN(this),this[ZN]=new Map,this[eC]=[],this[qN]={id:0,pointer:this[HN],hitRay:null,sensors:[],modelViewMatrix:new ci,point:new bt(0,0,0),normal:new bt(0,0,0),texCoord:new jt(0,0,0,0),layerNode:null,shapeNode:null}}Object.assign(tC.prototype,{initialize(){this.setCursor("DEFAULT"),this[jN].setup()},getPointingTime(){return this[JN]},addPointingDeviceSensor(e){this[zN].add(e)},removePointingDeviceSensor(e){this[zN].delete(e)},setCursor(e){const t=this.getSurface();switch(this[GN]=e,e){case"HAND":t.css("cursor","pointer");break;case"MOVE":t.css("cursor","move");break;case"CROSSHAIR":t.css("cursor","crosshair");break;default:this.getDisplayLoadCount()?t.css("cursor","wait"):this[jN]?.isOver?t.css("cursor","pointer"):t.css("cursor","default")}},getCursor(){return this[GN]},getPointer(){return this[HN]},getPointerFromEvent({pageX:e,pageY:t}){const i=this.getSurface().offset(),n=this.getSurface()[0].getBoundingClientRect(),s=this.getViewport(),r=(e-i.left)/n.width*s[2],o=(1-(t-i.top)/n.height)*s[3];return new ft(r,o)},isPointerInRectangle(e,t=this[HN]){return t.x>=e.x&&t.x<=e.x+e.z&&t.y>=e.y&&t.y<=e.y+e.w},getPointingLayer(){return this[$N]},getHit(){return this[qN]},addPointingShape(e){const t=++this[QN];return this[eC][t]=e,t},buttonPressEvent(e,t){if(!this[zN].size)return!1;if(!this.touch(e,t))return!1;const i=this[qN];this[WN]=i.sensors,this[$N]=i.layerNode;for(const e of this[WN])e.set_active__(!0,i);return!!i.sensors.length},buttonReleaseEvent(){if(this[zN].size){for(const e of this[WN])e.set_active__(!1,null);this[WN]=Array.prototype,this[$N]=null}},motionNotifyEvent(e,t){return!!this[zN].size&&(this.touch(e,t),this.motion(),!!this[qN].sensors.length)},leaveNotifyEvent(){},touch(e,t){if(this[JN].start(),this.getViewer()._isActive.getValue())return this[JN].reset(),!1;const i=this[qN];if(this[QN]=0,this[HN].set(e,t),this[KN].bind(),this.getWorld().traverse(Ia.POINTER),this[KN].getHit(i),this[KN].unbind(),Number.isInteger(i.id)&&i.id>0&&i.id<=this[QN]){const e=this[eC][i.id],t=e.shapeNode,n=t.getAppearance(),s=t.getGeometryContext();i.hitRay=e.renderObject.getHitRay(),i.sensors=e.sensors.slice(),i.layerNode=e.renderObject,i.shapeNode=t,i.modelViewMatrix.assign(e.modelViewMatrix),s.hasNormals?i.modelViewMatrix.submatrix.inverse().transpose().multVecMatrix(i.normal).normalize():i.normal.assign(bt.zAxis),n.getTextureTransform().transformPoint(i.texCoord)}else i.id=0,i.hitRay=this[$N]?this[$N].getHitRay():null,i.sensors=Array.prototype,i.layerNode=this[$N],i.shapeNode=null,i.modelViewMatrix.assign(ci.Identity);return this.addBrowserEvent(),this[JN].stop(),!!i.id},motion(){const e=this[qN];if(e.id)var t=this[YN].filter((t=>!e.sensors.find((e=>t.node===e.node))));else t=this[YN];for(const i of t)i.set_over__(!1,e);if(e.id){this[YN]=e.sensors;for(const t of this[YN])t.set_over__(!0,e)}else this[YN]=Array.prototype;for(const t of this[WN])t.set_motion__(e)},getPointingShader(e,t,i){const n=t.getGeometryContext();let s="";if(s+=e,s+=".",s+=t.getShapeKey(),s+=n.geometryType,s+=i?1:0,n.geometryType>=2)s+="0.0.0";else{const e=t.getAppearance();s+=e.getStyleProperties(n.geometryType)?1:0,s+=".",s+=e.getTextureBits().toString(4),s+=".",s+=e.getMaterial().getTextureBits().toString(4)}return this[ZN].get(s)||this.createPointingShader(s,e,t,i)},createPointingShader(e,t,i,n){const s=i.getAppearance(),r=i.getGeometryContext(),o=[];t&&(o.push("X3D_CLIP_PLANES"),o.push("X3D_NUM_CLIP_PLANES "+t)),i.getShapeKey()>0&&o.push("X3D_PARTICLE_SYSTEM"),o.push(`X3D_GEOMETRY_${r.geometryType}D`),s.getStyleProperties(r.geometryType)&&o.push("X3D_STYLE_PROPERTIES"),n&&o.push("X3D_SKINNING");const a=this.createShader("PointingShader","Pointing","Pointing",o);return this[ZN].set(e,a),a}});const iC=tC;i.add("X3DPointingDeviceSensorContext","x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext",iC);const nC=iC;function sC(e,t,i,n,s){const r=e.getContext();if(1===r.getVersion()||0===t||0===i)return rC;this.context=r,this.width=t,this.height=i,this.samples=n,this.oit=s,this.lastBuffer=[],this.lastBuffer.push(r.getParameter(r.FRAMEBUFFER_BINDING)),this.frameBuffer=r.createFramebuffer(),r.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer),this.colorBuffer=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,this.colorBuffer),n?r.renderbufferStorageMultisample(r.RENDERBUFFER,n,r.RGBA8,t,i):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA8,t,i),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,this.colorBuffer),this.depthBuffer=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,this.depthBuffer),n?r.renderbufferStorageMultisample(r.RENDERBUFFER,n,r.DEPTH_COMPONENT24,t,i):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT24,t,i),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,this.depthBuffer);const o=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;if(r.bindFramebuffer(r.FRAMEBUFFER,this.lastBuffer.pop()),!o)throw new Error("Couldn't create frame buffer.");if(!s)return;this.lastBuffer.push(r.getParameter(r.FRAMEBUFFER_BINDING)),this.oitFrameBuffer=r.createFramebuffer(),r.bindFramebuffer(r.FRAMEBUFFER,this.oitFrameBuffer),r.drawBuffers([r.COLOR_ATTACHMENT0,r.COLOR_ATTACHMENT1]),n?(this.accumRevealageBuffer=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,this.accumRevealageBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n,r.RGBA32F,t,i),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,this.accumRevealageBuffer),this.alphaBuffer=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,this.alphaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n,r.RGBA32F,t,i),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT1,r.RENDERBUFFER,this.alphaBuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,this.depthBuffer),this.accumRevealageTextureBuffer=r.createFramebuffer(),r.bindFramebuffer(r.FRAMEBUFFER,this.accumRevealageTextureBuffer),this.accumRevealageTexture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.accumRevealageTexture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,r.RGBA32F,t,i,0,r.RGBA,r.FLOAT,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.accumRevealageTexture,0),this.alphaTextureBuffer=r.createFramebuffer(),r.bindFramebuffer(r.FRAMEBUFFER,this.alphaTextureBuffer),this.alphaTexture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.alphaTexture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,r.RGBA32F,t,i,0,r.RGBA,r.FLOAT,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.alphaTexture,0)):(this.accumRevealageTexture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.accumRevealageTexture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,r.RGBA32F,t,i,0,r.RGBA,r.FLOAT,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.accumRevealageTexture,0),this.alphaTexture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.alphaTexture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,r.RGBA32F,t,i,0,r.RGBA,r.FLOAT,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT1,r.TEXTURE_2D,this.alphaTexture,0),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,this.depthBuffer));const a=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;if(r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,this.lastBuffer.pop()),!a)throw new Error("Couldn't create frame buffer.");this.shaderNode=e.getComposeShader(),this.program=this.shaderNode.getProgram(),r.useProgram(this.program);const l=r.getUniformLocation(this.program,"x3d_AccumRevealageTexture"),u=r.getUniformLocation(this.program,"x3d_AlphaTexture");r.uniform1i(l,0),r.uniform1i(u,1),this.quadArray=r.createVertexArray(),this.quadBuffer=r.createBuffer(),r.bindVertexArray(this.quadArray),r.bindBuffer(r.ARRAY_BUFFER,this.quadBuffer),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,1,-1,-1,1,-1,-1,1,1,-1,1,1]),r.STATIC_DRAW),r.vertexAttribPointer(0,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(null)}Object.assign(sC.prototype,{getWidth(){return this.width},getHeight(){return this.height},getSamples(){return this.samples},getOrderIndependentTransparency(){return this.oit},bind(){const{context:e,lastBuffer:t,frameBuffer:i}=this;t.push(e.getParameter(e.FRAMEBUFFER_BINDING)),e.bindFramebuffer(e.FRAMEBUFFER,i),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},bindForOrderIndependentTransparency(){const{context:e,lastBuffer:t,oitFrameBuffer:i}=this;t.push(e.getParameter(e.FRAMEBUFFER_BINDING)),e.bindFramebuffer(e.FRAMEBUFFER,i),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),e.blendFuncSeparate(e.ONE,e.ONE,e.ZERO,e.ONE_MINUS_SRC_ALPHA)},blit(){const{context:e,width:t,height:i,samples:n}=this;e.viewport(0,0,t,i),e.scissor(0,0,t,i),e.bindFramebuffer(e.READ_FRAMEBUFFER,this.frameBuffer),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.blitFramebuffer(0,0,t,i,0,0,t,i,e.COLOR_BUFFER_BIT,n?e.LINEAR:e.NEAREST)},compose(){const{context:e,width:t,height:i,samples:n,program:s}=this;e.viewport(0,0,t,i),e.scissor(0,0,t,i),n&&(e.bindFramebuffer(e.READ_FRAMEBUFFER,this.oitFrameBuffer),e.readBuffer(e.COLOR_ATTACHMENT0),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.accumRevealageTextureBuffer),e.blitFramebuffer(0,0,t,i,0,0,t,i,e.COLOR_BUFFER_BIT,e.LINEAR),e.readBuffer(e.COLOR_ATTACHMENT1),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.alphaTextureBuffer),e.blitFramebuffer(0,0,t,i,0,0,t,i,e.COLOR_BUFFER_BIT,e.LINEAR)),e.useProgram(s),e.activeTexture(e.TEXTURE0+0),e.bindTexture(e.TEXTURE_2D,this.accumRevealageTexture),e.activeTexture(e.TEXTURE0+1),e.bindTexture(e.TEXTURE_2D,this.alphaTexture),e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.disable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.enable(e.CULL_FACE),e.frontFace(e.CCW),e.bindVertexArray(this.quadArray),e.drawArrays(e.TRIANGLES,0,6),e.disable(e.BLEND),e.enable(e.DEPTH_TEST)},unbind(){const{context:e,lastBuffer:t}=this;e.bindFramebuffer(e.FRAMEBUFFER,t.pop())},dispose(){const e=this.context;e.deleteFramebuffer(this.frameBuffer),e.deleteRenderbuffer(this.colorBuffer),e.deleteRenderbuffer(this.depthBuffer),e.deleteFramebuffer(this.oitFrameBuffer),e.deleteFramebuffer(this.accumRevealageTextureBuffer),e.deleteFramebuffer(this.alphaTextureBuffer),e.deleteRenderbuffer(this.accumRevealageBuffer),e.deleteRenderbuffer(this.alphaBuffer),e.deleteTexture(this.accumRevealageTexture),e.deleteTexture(this.alphaTexture),e.deleteVertexArray(this.quadArray),e.deleteBuffer(this.quadBuffer)}});const rC={getWidth:Function.prototype,getHeight:Function.prototype,getSamples:Function.prototype,getOrderIndependentTransparency:Function.prototype,bind:Function.prototype,clear:Function.prototype,blit:Function.prototype,compose:Function.prototype,unbind:Function.prototype,dispose:Function.prototype},oC=sC;i.add("MultiSampleFrameBuffer","x_ite/Rendering/MultiSampleFrameBuffer",oC);const aC=oC;var lC=n(464),uC=n(153);const hC=Symbol(),dC=Symbol(),cC=Symbol(),pC=Symbol(),gC=Symbol(),fC=Symbol();function mC(){this[hC]=new jt(0,0,300,150),this[dC]=new aC(this,300,150,4),this[pC]=[],this[fC]=new Map}Object.assign(mC.prototype,{initialize(){const e=this.getContext();e.enable(e.SCISSOR_TEST),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clearDepth(1),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),lC(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",this.onfullscreen.bind(this)),this[cC]=new uC(this.getSurface(),this.reshape.bind(this)),this.getSurface().css("position",""),this.reshape()},getRenderer(){const e=this.getContext();if(!navigator.userAgent.match(/Firefox/)){const t=e.getExtension("WEBGL_debug_renderer_info");if(t)return e.getParameter(t.UNMASKED_RENDERER_WEBGL)}return e.getParameter(e.RENDERER)},getVendor(){const e=this.getContext();if(!navigator.userAgent.match(/Firefox/)){const t=e.getExtension("WEBGL_debug_renderer_info");if(t)return e.getParameter(t.UNMASKED_VENDOR_WEBGL)}return e.getParameter(e.VENDOR)},getWebGLVersion(){const e=this.getContext();return e.getParameter(e.VERSION)},getMaxSamples(){const e=this.getContext();return e.getVersion()>1?e.getParameter(e.MAX_SAMPLES):0},getMaxClipPlanes:()=>6,getDepthSize(){const e=this.getContext();return e.getParameter(e.DEPTH_BITS)},getColorDepth(){const e=this.getContext();return e.getParameter(e.RED_BITS)+e.getParameter(e.BLUE_BITS)+e.getParameter(e.GREEN_BITS)+e.getParameter(e.ALPHA_BITS)},getViewport(){return this[hC]},getLocalObjects(){return this[pC]},getFrameBuffer(){return this[dC]},getComposeShader(){return this[gC]?this[gC]:this[gC]=this.createShader("ComposeShader","Compose","Compose")},getDepthShader(e,t,i){const n=t.getGeometryContext();let s="";if(s+=e,s+=".",s+=t.getShapeKey(),s+=n.geometryType,s+=i?1:0,n.geometryType>=2)s+="0.0.0";else{const e=t.getAppearance();s+=e.getStyleProperties(n.geometryType)?1:0,s+=".",s+=e.getTextureBits().toString(4),s+=".",s+=e.getMaterial().getTextureBits().toString(4)}return this[fC].get(s)||this.createDepthShader(s,e,t,i)},createDepthShader(e,t,i,n){const s=i.getAppearance(),r=i.getGeometryContext(),o=[];t&&(o.push("X3D_CLIP_PLANES"),o.push("X3D_NUM_CLIP_PLANES "+t)),i.getShapeKey()>0&&o.push("X3D_PARTICLE_SYSTEM"),o.push(`X3D_GEOMETRY_${r.geometryType}D`),s.getStyleProperties(r.geometryType)&&o.push("X3D_STYLE_PROPERTIES"),n&&o.push("X3D_SKINNING");const a=this.createShader("DepthShader","Depth","Depth",o);return this[fC].set(e,a),a},reshape(){const e=this.getCanvas(),t=this.getRenderingProperty("ContentScale"),i=this.getRenderingProperty("Multisampling"),n=this.getBrowserOption("OrderIndependentTransparency"),s=e.width()*t,r=e.height()*t,o=e[0];o.width=s,o.height=r,this[hC][2]=s,this[hC][3]=r,s===this[dC].getWidth()&&r===this[dC].getHeight()&&i===this[dC].getSamples()&&n===this[dC].getOrderIndependentTransparency()||(this[dC].dispose(),this[dC]=new aC(this,s,r,i,n)),this.addBrowserEvent()},onfullscreen(){const e=this.getElement();e.fullScreen()?e.addClass("x_ite-fullscreen"):e.removeClass("x_ite-fullscreen")}});const _C=mC;i.add("X3DRenderingContext","x_ite/Browser/Rendering/X3DRenderingContext",_C);const xC=_C,yC=Symbol();function wC(){this[yC]=[this]}Object.assign(wC.prototype,{isExternal(){return 1===this[yC].length},getScriptStack(){return this[yC]}});const bC=wC;i.add("X3DScriptingContext","x_ite/Browser/Scripting/X3DScriptingContext",bC);const SC=bC,TC=Symbol(),vC=Symbol(),OC=Symbol();function EC(){this[TC]=!1,this[vC]=new Map,this[OC]=new Map}Object.assign(EC.prototype,{initialize(){this.setShading(this.getBrowserOptions().getShading())},getShadingLanguageVersion(){const e=this.getContext();return e.getParameter(e.SHADING_LANGUAGE_VERSION)},getMaxVertexUniformVectors(){const e=this.getContext();return e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)},getMaxFragmentUniformVectors(){const e=this.getContext();return e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)},getMaxVertexAttribs(){const e=this.getContext();return e.getParameter(e.MAX_VERTEX_ATTRIBS)},getMaxVaryingVectors(){const e=this.getContext();return e.getParameter(e.MAX_VARYING_VECTORS)},getWireframe(){return this[TC]},getPrimitiveMode(e){return this[vC].get(e)},getShaders(){return this[OC]},setShading(e){const t=this.getContext();switch(e){case bl.POINT:this[TC]=!1,this[vC].set(t.POINTS,t.POINTS),this[vC].set(t.LINES,t.POINTS),this[vC].set(t.TRIANGLES,t.POINTS);break;case bl.WIREFRAME:this[TC]=!0,this[vC].set(t.POINTS,t.POINTS),this[vC].set(t.LINES,t.LINES),this[vC].set(t.TRIANGLES,t.LINE_LOOP);break;default:this[TC]=!1,this[vC].set(t.POINTS,t.POINTS),this[vC].set(t.LINES,t.LINES),this[vC].set(t.TRIANGLES,t.TRIANGLES)}},createShader(e,t,i=t,n=[],s=[],r=[]){this.getBrowserOption("Debug")&&console.info("Initializing "+e);const o=this.getContext().getVersion(),a=new Fw(this.getPrivateScene());a._url.push(encodeURI(t.startsWith("data:")?t:"data:x-shader/x-vertex,"+ww.vertex[o][t])),a.setPrivate(!0),a.setName(e+"Vertex"),a.setOptions(n),a.setup();const l=new Fw(this.getPrivateScene());l._type="FRAGMENT",l._url.push(encodeURI(i.startsWith("data:")?i:"data:x-shader/x-fragment,"+ww.fragment[o][i])),l.setPrivate(!0),l.setName(e+"Fragment"),l.setOptions(n),l.setup();const u=new P_(this.getPrivateScene());return u._language="GLSL",u._parts.push(a),u._parts.push(l),u.setPrivate(!0),u.setName(e),u.setUniformNames(s),u.setTransformFeedbackVaryings(r),u.setup(),u}});const NC=EC;i.add("X3DShadersContext","x_ite/Browser/Shaders/X3DShadersContext",NC);const CC=NC,FC=Symbol(),IC=Symbol(),MC=Symbol(),DC=Symbol(),PC=Symbol(),RC=Symbol(),AC=Symbol(),VC=Symbol(),LC=Symbol();function BC(){this[IC]=[]}Object.assign(BC.prototype,{getDefaultAppearance(){return this[MC]=new zw(this.getPrivateScene()),this[MC].setPrivate(!0),this[MC].setup(),this.getDefaultAppearance=function(){return this[MC]},Object.defineProperty(this,"getDefaultAppearance",{enumerable:!1}),this[MC]},getLineStippleScale(){return 1/(32*this.getPixelPerPoint())},getDefaultPointProperties(){return this[DC]=new db(this.getPrivateScene()),this[DC].setPrivate(!0),this[DC].setup(),this.getDefaultPointProperties=function(){return this[DC]},Object.defineProperty(this,"getDefaultPointProperties",{enumerable:!1}),this[DC]},getDefaultLineProperties(){return this[PC]=new $w(this.getPrivateScene()),this[PC]._applied=!1,this[PC].setPrivate(!0),this[PC].setup(),this.getDefaultLineProperties=function(){return this[PC]},Object.defineProperty(this,"getDefaultLineProperties",{enumerable:!1}),this[PC]},getDefaultMaterial(){return this[RC]=new Tb(this.getPrivateScene()),this[RC].setPrivate(!0),this[RC].setup(),this.getDefaultMaterial=function(){return this[RC]},Object.defineProperty(this,"getDefaultMaterial",{enumerable:!1}),this[RC]},getLinetypeTexture(){return this[FC]=new nu(this.getPrivateScene()),this[FC]._url[0]=so.getLinetypeURL(),this[FC]._textureProperties=this.getLineFillTextureProperties(),this[FC].setPrivate(!0),this[FC].setup(),this.getLinetypeTexture=function(){return this[FC]},Object.defineProperty(this,"getLinetypeTexture",{enumerable:!1}),this[FC]},getHatchStyleTexture(e){let t=this[IC][e];return t||(t=this[IC][e]=new nu(this.getPrivateScene()),t._url[0]=so.getHatchingURL(e),t._textureProperties=this.getLineFillTextureProperties(),t.setPrivate(!0),t.setup(),t)},getLineFillTextureProperties(){return this[AC]=new BT(this.getPrivateScene()),this[AC]._minificationFilter="NEAREST_PIXEL",this[AC]._magnificationFilter="NEAREST_PIXEL",this[AC]._textureCompression="DEFAULT",this[AC].setPrivate(!0),this[AC].setup(),this.getLineFillTextureProperties=function(){return this[AC]},Object.defineProperty(this,"getLineFillTextureProperties",{enumerable:!1}),this[AC]},getLineTransformShader(){return this[VC]=this.createShader("LineTransformShader","LineTransform","LineTransform",[],["viewport","modelViewProjectionMatrix","invModelViewProjectionMatrix","scale"],["coordIndex0","lineStipple0","fogDepth0","color0","normal0","vertex0","coordIndex1","lineStipple1","fogDepth1","color1","normal1","vertex1","coordIndex2","lineStipple2","fogDepth2","color2","normal2","vertex2"]),this.getLineTransformShader=function(){return this[VC]},Object.defineProperty(this,"getLineTransformShader",{enumerable:!1}),this[VC]},getLineTransformFeedback(){const e=this.getContext();return this[LC]=e.createTransformFeedback(),this.getLineTransformFeedback=function(){return this[LC]},Object.defineProperty(this,"getLineTransformFeedback",{enumerable:!1}),this[LC]}});const UC=BC;i.add("X3DShapeContext","x_ite/Browser/Shape/X3DShapeContext",UC);const XC=UC,kC=Symbol(),jC=Symbol();function zC(){this[kC]=new AudioContext}Object.assign(zC.prototype,{initialize(){this.startAudioElement(this[kC],"resume")},getAudioContext(){return this[kC]},getDefaultPeriodicWave(){return this[jC]=new BS(this.getPrivateScene()),this[jC].setPrivate(!0),this[jC].setup(),this.getDefaultPeriodicWave=function(){return this[jC]},Object.defineProperty(this,"getDefaultPeriodicWave",{enumerable:!1}),this[jC]},startAudioElement(e,t="play"){const i=`X3DSoundContext-${C.getId(e)}`,n=["blur","click","contextmenu","dblclick","focus","keydown","keyup","mousedown","mouseup","pointerup","touchend"].map((e=>`${e}.${i}`));this.getElement().on(n.join(" "),(n=>{e[t]().then((()=>this.getElement().off(`.${i}`))).catch(Function.prototype)}))}});const GC=zC;i.add("X3DSoundContext","x_ite/Browser/Sound/X3DSoundContext",GC);const HC=GC,qC=Symbol(),YC=Symbol(),WC=Symbol(),$C=Symbol(),JC=Symbol(),KC=Symbol(),ZC=Symbol(),QC=Symbol(),eF=Symbol(),tF=Symbol(),iF=Symbol(),nF=Symbol(),sF=Symbol(),rF=Symbol();function oF(){const e=this.getContext(),t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this[qC]=t>8?2:1}Object.assign(oF.prototype,{initialize(){const e=this.getContext();e.pixelStorei(e.UNPACK_ALIGNMENT,1);const t=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);this[YC]=[...Array(t).keys()].reverse(),this[WC]=[this[YC].pop()],this[$C]=[this[YC].pop()],this[JC]=[this[YC].pop()];const i=new Uint8Array([255,255,255,255]);this[eF]=e.createTexture(),e.activeTexture(e.TEXTURE0+this[WC][0]),e.bindTexture(e.TEXTURE_2D,this[eF]),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i),e.getVersion()>=2&&(this[tF]=e.createTexture(),e.activeTexture(e.TEXTURE0+this[$C][0]),e.bindTexture(e.TEXTURE_3D,this[tF]),e.texImage3D(e.TEXTURE_3D,0,e.RGBA,1,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i)),this[iF]=e.createTexture(),e.activeTexture(e.TEXTURE0+this[JC][0]),e.bindTexture(e.TEXTURE_CUBE_MAP,this[iF]),e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_Z,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i),e.texImage2D(e.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i),e.texImage2D(e.TEXTURE_CUBE_MAP_NEGATIVE_X,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i),e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i),e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_Y,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i),e.texImage2D(e.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i),this.resetTextureUnits(),this.setTextureQuality(this.getBrowserOptions().getTextureQuality())},getMaxTextures(){return this[qC]},getMaxTextureTransforms:()=>4,getMaxTexCoords:()=>4,getMinTextureSize:()=>16,getMaxTextureSize(){const e=this.getContext();return e.getParameter(e.MAX_TEXTURE_SIZE)},getMaxCombinedTextureUnits(){const e=this.getContext();return e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)},popTexture2DUnit(){return this[KC]>0?(--this[KC],this[WC].pop()):this[YC].pop()},pushTexture2DUnit(e){void 0!==e&&(++this[KC],this[WC].push(e))},getTexture2DUnit(){if(this[KC]>0)return this[WC][--this[KC]];const e=this[YC].pop();return void 0!==e&&this[WC].push(e),e},getTexture3DUnit(){if(this[ZC]>0)return this[$C][--this[ZC]];const e=this[YC].pop();return void 0!==e&&this[$C].push(e),e},getTextureCubeUnit(){if(this[QC]>0)return this[JC][--this[QC]];const e=this[YC].pop();return void 0!==e&&this[JC].push(e),e},getTextureUnit(e){switch(e){case 2:return this.getTexture2DUnit();case 3:return this.getTexture3DUnit();case 4:return this.getTextureCubeUnit()}},resetTextureUnits(){this[KC]=this[WC].length,this[ZC]=this[$C].length,this[QC]=this[JC].length},getDefaultTexture2DUnit(){return this[WC][0]},getDefaultTexture3DUnit(){return this[$C][0]},getDefaultTextureCubeUnit(){return this[JC][0]},getTextureMemory:()=>NaN,getDefaultTextureProperties(){return this[nF]=new BT(this.getPrivateScene()),this[nF]._magnificationFilter="NICEST",this[nF]._minificationFilter="NEAREST_PIXEL_AVG_MIPMAP",this[nF]._generateMipMaps=!0,this[nF]._textureCompression="NICEST",this[nF].setup(),this.getDefaultTextureProperties=function(){return this[nF]},Object.defineProperty(this,"getDefaultTextureProperties",{enumerable:!1}),this[nF]},getDefaultTextureTransform(){return this[sF]=new GT(this.getPrivateScene()),this[sF].setPrivate(!0),this[sF].setup(),this.getDefaultTextureTransform=function(){return this[sF]},Object.defineProperty(this,"getDefaultTextureTransform",{enumerable:!1}),this[sF]},getDefaultTextureCoordinate(){return this[rF]=new DT(this.getPrivateScene()),this[rF].setPrivate(!0),this[rF].setup(),this.getDefaultTextureCoordinate=function(){return this[rF]},Object.defineProperty(this,"getDefaultTextureCoordinate",{enumerable:!1}),this[rF]},setTextureQuality(e){const t=this.getDefaultTextureProperties();switch(e){case _v.LOW:t._magnificationFilter="AVG_PIXEL",t._minificationFilter="AVG_PIXEL",t._textureCompression="FASTEST",t._generateMipMaps=!0;break;case _v.MEDIUM:t._magnificationFilter="NICEST",t._minificationFilter="NEAREST_PIXEL_AVG_MIPMAP",t._textureCompression="NICEST",t._generateMipMaps=!0;break;case _v.HIGH:t._magnificationFilter="NICEST",t._minificationFilter="NICEST",t._textureCompression="NICEST",t._generateMipMaps=!0}}});const aF=oF;i.add("X3DTexturingContext","x_ite/Browser/Texturing/X3DTexturingContext",aF);const lF=aF,uF=Symbol(),hF=Symbol(),dF=Symbol(),cF=Symbol();function pF(){this[uF]=Date.now()/1e3,this[hF]=60,this[dF]=new bt(0,0,0),this[cF]=0}Object.assign(pF.prototype,{getCurrentTime(){return this[uF]},getCurrentFrameRate(){return this[hF]},getCurrentSpeed(){return this[cF]},advanceTime:(()=>{const e=new bt(0,0,0);return function(){const t=Date.now()/1e3,i=t-this[uF];if(this[uF]=t,this[hF]=i?1/i:60,this.getWorld()&&this.getActiveLayer()){const t=this.getActiveLayer().getViewpoint().getCameraSpaceMatrix();e.assign(this[dF]),this[dF].set(t[12],t[13],t[14]),this[cF]=e.subtract(this[dF]).magnitude()*this[hF]}else this[cF]=0}})()});const gF=pF;i.add("X3DTimeContext","x_ite/Browser/Time/X3DTimeContext",gF);const fF=gF,mF=Symbol(),_F=Symbol(),xF=Symbol(),yF=Symbol();function wF(){this[mF]=[],this[_F]=[],this[xF]=[],this[yF]=[]}Object.assign(wF.prototype,{initialize(){},addTaintedField(e,t){this[mF].push(e,t)},addTaintedNode(e){this[xF].push(e)},[Symbol.for("X_ITE.X3DRoutingContext.processEvents")](){do{do{const e=this[mF];this[mF]=this[_F],this[mF].length=0;for(let t=0,i=e.length;t<i;t+=2)e[t].processEvent(e[t+1]);this[_F]=e}while(this[mF].length);do{const e=this[xF];this[xF]=this[yF],this[xF].length=0;for(const t of e)t.processEvent();this[yF]=e}while(!this[mF].length&&this[xF].length)}while(this[mF].length)},dispose(){}});const bF=wF;i.add("X3DRoutingContext","x_ite/Routing/X3DRoutingContext",bF);const SF=bF;function TF(e=[]){return Y.call(this,Array.from(e,(e=>[e.typeName,e])),Function)}Object.assign(Object.setPrototypeOf(TF.prototype,Y.prototype),{add(e,t){d.addNode(t),Y.prototype.add.call(this,e,t)}});for(const e of Object.keys(TF.prototype))Object.defineProperty(TF.prototype,e,{enumerable:!1});Object.defineProperties(TF,{typeName:{value:"AbstractNodesArray",enumerable:!0}});const vF=TF;i.add("AbstractNodesArray","x_ite/Configuration/AbstractNodesArray",vF);const OF=vF,EF=new OF;i.add("AbstractNodes","x_ite/Configuration/AbstractNodes",EF);const NF=EF;function CF(e=[]){return Y.call(this,Array.from(e,(e=>[e.typeName,e])),Function)}Object.assign(Object.setPrototypeOf(CF.prototype,Y.prototype),{add(e,t){d.addNode(t),Kn.addConcreteNode(t),Y.prototype.add.call(this,e,t)},update(e,t,i){d.addNode(i),Kn.addConcreteNode(i),Y.prototype.update.call(this,e,t,i)}});for(const e of Object.keys(CF.prototype))Object.defineProperty(CF.prototype,e,{enumerable:!1});Object.defineProperties(CF,{typeName:{value:"ConcreteNodesArray",enumerable:!0}});const FF=CF;i.add("ConcreteNodesArray","x_ite/Configuration/ConcreteNodesArray",FF);const IF=FF,MF=new IF;i.add("ConcreteNodes","x_ite/Configuration/ConcreteNodes",MF);const DF=MF,PF=Symbol(),RF=Symbol(),AF=Symbol(),VF=Symbol(),LF=Symbol(),BF=Symbol(),UF=Symbol(),XF=Symbol(),kF=Symbol(),jF=Symbol(),zF=Symbol(),GF=Symbol.for("X_ITE.X3DRoutingContext.processEvents"),HF=new Set,qF=[];function YF(e){ds.call(this,this),SF.call(this),SC.call(this),qO.call(this,e),EN.call(this),lF.call(this),CC.call(this),xC.call(this),XC.call(this),mE.call(this),cE.call(this),nC.call(this),fN.call(this),wE.call(this),JO.call(this),OE.call(this),RN.call(this),HC.call(this),fF.call(this),HF.add(this);for(const e of qF)e.call(this);this.addChildObjects(d.outputOnly,"initialized",new ji,d.outputOnly,"shutdown",new ji,d.outputOnly,"prepareEvents",new ji,d.outputOnly,"timeEvents",new ji,d.outputOnly,"sensorEvents",new ji,d.outputOnly,"displayEvents",new ji,d.outputOnly,"finishedEvents",new ji),this[RF]=0,this[BF]=0,this[LF]=this[VF].bind(this),this[UF]=new Ga,this[XF]=new Ga,this[kF]=new Ga,this[jF]=new Ga,this[zF]=new Ga}Object.assign(Object.setPrototypeOf(YF.prototype,ds.prototype),qO.prototype,JO.prototype,cE.prototype,mE.prototype,wE.prototype,OE.prototype,fN.prototype,EN.prototype,RN.prototype,nC.prototype,xC.prototype,SF.prototype,SC.prototype,CC.prototype,XC.prototype,HC.prototype,lF.prototype,fF.prototype,{initialize(){ds.prototype.initialize?.call(this),SF.prototype.initialize?.call(this),SC.prototype.initialize?.call(this),qO.prototype.initialize?.call(this),EN.prototype.initialize?.call(this),lF.prototype.initialize?.call(this),CC.prototype.initialize?.call(this),xC.prototype.initialize?.call(this),XC.prototype.initialize?.call(this),mE.prototype.initialize?.call(this),cE.prototype.initialize?.call(this),nC.prototype.initialize?.call(this),fN.prototype.initialize?.call(this),wE.prototype.initialize?.call(this),JO.prototype.initialize?.call(this),OE.prototype.initialize?.call(this),RN.prototype.initialize?.call(this),HC.prototype.initialize?.call(this),fF.prototype.initialize?.call(this);for(const e of qF)e.prototype.initialize?.call(this)},initialized(){return this._initialized},shutdown(){return this._shutdown},prepareEvents(){return this._prepareEvents},timeEvents(){return this._timeEvents},sensorEvents(){return this._sensorEvents},displayEvents(){return this._displayEvents},finishedEvents(){return this._finishedEvents},getBrowser(){return this},getWorld(){return this[PF]},getExecutionContext(){return this[PF].getExecutionContext()},setExecutionContext(e){this[PF]=new sh(e),this[PF].setup()},addBrowserEvent(){this[RF]!==this.getCurrentTime()&&(this[RF]=this.getCurrentTime(),requestAnimationFrame(this[LF]))},[AF](e){return e===this[BF]?(requestAnimationFrame(this[LF]),!0):(this[BF]=e,!1)},[VF](e){this[AF](e)||(this[UF].stop(),this[XF].start(),this.advanceTime(),this.addTaintedField(this._prepareEvents),this[GF](),this.addTaintedField(this._timeEvents),this[GF](),this[kF].start(),this[PF].traverse(Ia.CAMERA),this[kF].stop(),this[jF].start(),this.getCollisionCount()&&this[PF].traverse(Ia.COLLISION),this[jF].stop(),this.addTaintedField(this._sensorEvents),this[GF](),this[zF].start(),this.addTaintedField(this._displayEvents),this[GF](),this.getFrameBuffer().bind(),this[PF].traverse(Ia.DISPLAY),this.addTaintedField(this._finishedEvents),this[GF](),this.getFrameBuffer().blit(),this[zF].stop(),this[XF].stop(),this[UF].start())},getSystemTime(){return this[UF]},getBrowserTime(){return this[XF]},getCameraTime(){return this[kF]},getCollisionTime(){return this[jF]},getDisplayTime(){return this[zF]},dispose(){HF.delete(this);for(const e of qF)e.prototype.dispose?.call(this);fF.prototype.dispose?.call(this),HC.prototype.dispose?.call(this),RN.prototype.dispose?.call(this),OE.prototype.dispose?.call(this),JO.prototype.dispose?.call(this),wE.prototype.dispose?.call(this),fN.prototype.dispose?.call(this),nC.prototype.dispose?.call(this),cE.prototype.dispose?.call(this),mE.prototype.dispose?.call(this),XC.prototype.dispose?.call(this),xC.prototype.dispose?.call(this),CC.prototype.dispose?.call(this),lF.prototype.dispose?.call(this),EN.prototype.dispose?.call(this),qO.prototype.dispose?.call(this),SC.prototype.dispose?.call(this),SF.prototype.dispose?.call(this),ds.prototype.dispose?.call(this)}});for(const e of Object.keys(YF.prototype))Object.defineProperty(YF.prototype,e,{enumerable:!1});Object.assign(YF,{addComponent({name:e,concreteNodes:t,abstractNodes:i,browserContext:n,external:s}){if(t)for(const e of t)DF.add(e.typeName,e);if(i)for(const e of i)NF.add(e.typeName,e);if(n){qF.push(n);const e=Object.keys(n.prototype).filter((e=>!e.match(/^(?:initialize|dispose)$/))).concat(Object.getOwnPropertySymbols(n.prototype));for(const t of e)Object.defineProperty(YF.prototype,t,{value:n.prototype[t],writable:!0})}for(const e of HF){if(t)for(const i of t)e.addConcreteNode(i);if(i)for(const t of i)e.addAbstractNode(t);n&&(n.call(e),n.prototype.initialize?.call(e),e[GF]())}}});const WF=YF;i.add("X3DBrowserContext","x_ite/Browser/X3DBrowserContext",WF);const $F=WF;let JF=!1;const KF={add({name:e,concreteNodes:t,abstractNodes:i,browserContext:n}){$F.addComponent({name:e,concreteNodes:t,abstractNodes:i,browserContext:n,external:JF})}};KF.add($h),KF.add(ld),KF.add(Td),KF.add(kc),KF.add(cp),KF.add(Pp),KF.add(Sg),KF.add(Mg),KF.add(sf),KF.add(wf),KF.add(qf),KF.add(mm),KF.add(S_),KF.add(Pw),KF.add(Ob),KF.add(eT),KF.add(qT),KF.add(WT),JF=!0;const ZF=KF;i.add("Components","x_ite/Components",ZF);var QF=n(464);const eI=class{constructor(e){this.browser=e,this.rootElement=void 0,this.canvasObserver=new MutationObserver((()=>this.processCanvasMutation(e))),this.canvasObserver.observe(e.getElement()[0],{childList:!0}),this.processCanvasMutation(e)}processCanvasMutation(e){this.processRootElement(e,e.getElement().children("X3D").get(-1))}async processRootElement(e,t){try{if(t===this.rootElement)return;if(this.rootElement=t,t){e.setBrowserLoading(!0),e.addLoadingObject(this);const i=e.createScene();this.parser=new Wr(i),this.parser.setInput(t),await new Promise(this.parser.parseIntoScene.bind(this.parser)),e.replaceWorld(i),this.observer=new MutationObserver((e=>{for(const t of e)this.processMutation(t)})),this.observer.observe(t,{attributes:!0,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!0}),this.processInlineElements(t),this.addEventDispatchersAll(t),e.removeLoadingObject(this)}else e.replaceWorld(null)}catch(e){console.error("Error importing document:",e)}}processMutation(e){switch(e.type){case"attributes":this.processAttribute(e,e.target);break;case"childList":for(const t of e.addedNodes)this.processAddedNode(t);for(const t of e.removedNodes)this.processRemovedNode(t)}}processAttribute(e,t){const i=this.parser,n=QF.data(t,"node");if(n){const s=e.attributeName,r=t.attributes.getNamedItem(s);i.nodeAttribute(r,n)}else{const e=t.parentNode,n=QF.data(e,"node");n&&(i.pushExecutionContext(n.getExecutionContext()),i.pushParent(n),i.childElement(t),i.popParent(),i.popExecutionContext())}}processAddedNode(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if("X3D"===e.nodeName)return;if(QF.data(e,"node"))return;const t=e.parentNode,i=this.parser;if(t.nodeName.match(/^(?:Scene|SCENE)$/)){const n=QF.data(t,"node");i.pushExecutionContext(n),i.childElement(e),i.popExecutionContext()}else if(QF.data(t,"node")){const n=QF.data(t,"node"),s=n.getExecutionContext();i.pushExecutionContext(s),i.pushParent(n),i.childElement(e),i.popParent(),i.popExecutionContext()}else{const t=this.browser.currentScene;i.pushExecutionContext(t),i.childElement(e),i.popExecutionContext()}this.processInlineElements(e),this.addEventDispatchers(e),this.addEventDispatchersAll(e)}processRemovedNode(e){const t=QF.data(e,"node");t&&(t.dispose(),QF.data(e,"node",null))}processInlineElements(e){e.nodeName.match(/^(?:Inline|INLINE)$/)&&this.processInlineElement(e);for(const t of e.querySelectorAll("Inline"))this.processInlineElement(t)}processInlineElement(e){const t=QF.data(e,"node");t&&(t._loadState.addInterest("appendInlineChildElement",this,e),this.appendInlineChildElement(e))}appendInlineChildElement(e){const t=QF.data(e,"node");switch(t.checkLoadState()){case d.NOT_STARTED_STATE:case d.FAILED_STATE:for(;e.firstChild;)e.removeChild(e.lastChild);break;case d.COMPLETE_STATE:{for(;e.firstChild;)e.removeChild(e.lastChild);const i=QF.data(t.getInternalScene(),"X3D");i&&e.appendChild(i),this.processInlineElements(i),this.addEventDispatchersAll(i);break}}switch(t.checkLoadState()){case d.COMPLETE_STATE:{const i=new CustomEvent("load",{detail:{node:yi.get(t)}});e.dispatchEvent(i);break}case d.FAILED_STATE:{const i=new CustomEvent("error",{detail:{node:yi.get(t)}});e.dispatchEvent(i);break}}}addEventDispatchersAll(e){const t=e.querySelectorAll("*");for(const e of t)this.addEventDispatchers(e)}addEventDispatchers(e){if("ROUTE"===e.nodeName)return;const t=QF.data(e,"node");if(t){for(const i of t.getPredefinedFields())this.bindFieldCallback(i,e);for(const i of t.getUserDefinedFields())this.bindFieldCallback(i,e)}}bindFieldCallback(e,t){e.isOutput()&&e.addInterest("fieldCallback",this,t)}fieldCallback(e,t){const i=QF.data(e,"node");if(!i)return;const n=new CustomEvent(t.getName(),{detail:{node:yi.get(i),value:t.valueOf()}});e.dispatchEvent(n)}};i.add("DOMIntegration","x_ite/Browser/DOMIntegration",eI);const tI=eI;function iI(e,t,i,n){Object.defineProperties(this,{name:{value:e,enumerable:!0},title:{value:t,enumerable:!0},providerURL:{value:i,enumerable:!0},components:{value:n,enumerable:!0}})}Object.assign(Object.setPrototypeOf(iI.prototype,C.prototype),{toVRMLStream(e){e.string+=e.Indent(),e.string+="PROFILE",e.string+=e.Space(),e.string+=this.name},toXMLStream(e){e.string+=this.name},toJSONStream(e){e.string+=this.name}});for(const e of Object.keys(iI.prototype))Object.defineProperty(iI.prototype,e,{enumerable:!1});Object.defineProperties(iI,{typeName:{value:"ProfileInfo",enumerable:!0}}),Object.defineProperties(iI.prototype,{providerUrl:{get:function(){return this.providerURL}}});const nI=iI;i.add("ProfileInfo","x_ite/Configuration/ProfileInfo",nI);const sI=nI;function rI(e=[]){return Y.call(this,Array.from(e,(e=>[e.name,e])),sI)}Object.assign(Object.setPrototypeOf(rI.prototype,Y.prototype),{add(e,{title:t,providerURL:i,components:n}){Y.prototype.add.call(this,e,new sI(e,t,i,new jv(n)))}});for(const e of Object.keys(rI.prototype))Object.defineProperty(rI.prototype,e,{enumerable:!1});Object.defineProperties(rI,{typeName:{value:"ProfileInfoArray",enumerable:!0}});const oI=rI;i.add("ProfileInfoArray","x_ite/Configuration/ProfileInfoArray",oI);const aI=oI,lI=new jv([]);lI.add("Annotation",{title:"Annotation",level:2,external:!0}),lI.add("CADGeometry",{title:"CAD geometry",level:2,external:!0}),lI.add("Core",{title:"Core",level:2}),lI.add("CubeMapTexturing",{title:"Cube map environmental texturing",level:3,external:!0}),lI.add("DIS",{title:"Distributed interactive simulation",level:2,external:!0}),lI.add("EnvironmentalEffects",{title:"Environmental effects",level:4}),lI.add("EnvironmentalSensor",{title:"Environmental sensor",level:3}),lI.add("EventUtilities",{title:"Event utilities",level:1,external:!0}),lI.add("Followers",{title:"Followers",level:1}),lI.add("Geometry2D",{title:"Geometry2D",level:2,external:!0}),lI.add("Geometry3D",{title:"Geometry3D",level:4}),lI.add("Geospatial",{title:"Geospatial",level:2,external:!0}),lI.add("Grouping",{title:"Grouping",level:3}),lI.add("HAnim",{title:"Humanoid animation (HAnim)",level:3,external:!0}),lI.alias("H-Anim",lI.get("HAnim")),lI.add("Interpolation",{title:"Interpolation",level:5}),lI.add("KeyDeviceSensor",{title:"Key device sensor",level:2,external:!0}),lI.add("Layering",{title:"Layering",level:1}),lI.add("Layout",{title:"Layout",level:2,external:!0,dependencies:["Text"]}),lI.add("Lighting",{title:"Lighting",level:3}),lI.add("Navigation",{title:"Navigation",level:3}),lI.add("Networking",{title:"Networking",level:4}),lI.add("NURBS",{title:"NURBS",level:4,external:!0}),lI.add("ParticleSystems",{title:"Particle systems",level:3,external:!0}),lI.add("Picking",{title:"Picking",level:3,external:!0,dependencies:["RigidBodyPhysics"]}),lI.add("PointingDeviceSensor",{title:"Pointing device sensor",level:1}),lI.add("Shaders",{title:"Programmable shaders",level:1}),lI.add("TextureProjector",{title:"Texture Projector",level:2,external:!0}),lI.alias("ProjectiveTextureMapping",lI.get("TextureProjector")),lI.add("Rendering",{title:"Rendering",level:5}),lI.add("RigidBodyPhysics",{title:"Rigid body physics",level:2,external:!0}),lI.add("Scripting",{title:"Scripting",level:1,external:!0}),lI.add("Shape",{title:"Shape",level:4}),lI.add("Sound",{title:"Sound",level:3}),lI.add("Text",{title:"Text",level:1,external:!0}),lI.add("Texturing",{title:"Texturing",level:4}),lI.add("Texturing3D",{title:"Texturing3D",level:2,external:!0}),lI.add("Time",{title:"Time",level:2}),lI.add("VolumeRendering",{title:"Volume rendering",level:4,external:!0,dependencies:["CADGeometry","Texturing3D"]}),lI.add("X_ITE",{title:"X_ITE",level:1,external:!0});const uI=lI;i.add("SupportedComponents","x_ite/Configuration/SupportedComponents",uI);const hI=uI,dI=new aI;dI.add("CADInterchange",{title:"Computer-Aided Design (CAD) interchange",providerURL:so.getProviderURL(),components:[hI.get("CADGeometry"),hI.get("Core"),hI.get("Grouping"),hI.get("Lighting"),hI.get("Navigation"),hI.get("Networking"),hI.get("Rendering"),hI.get("Shaders"),hI.get("Shape"),hI.get("Texturing")]}),dI.add("Core",{title:"Core",providerURL:so.getProviderURL(),components:[hI.get("Core")]}),dI.add("Full",{title:"Full",providerURL:so.getProviderURL(),components:[hI.get("CADGeometry"),hI.get("Core"),hI.get("CubeMapTexturing"),hI.get("DIS"),hI.get("EnvironmentalEffects"),hI.get("EnvironmentalSensor"),hI.get("EventUtilities"),hI.get("Followers"),hI.get("Geometry2D"),hI.get("Geometry3D"),hI.get("Geospatial"),hI.get("Grouping"),hI.get("HAnim"),hI.get("Interpolation"),hI.get("KeyDeviceSensor"),hI.get("Layering"),hI.get("Layout"),hI.get("Lighting"),hI.get("Navigation"),hI.get("Networking"),hI.get("NURBS"),hI.get("ParticleSystems"),hI.get("Picking"),hI.get("PointingDeviceSensor"),hI.get("TextureProjector"),hI.get("Rendering"),hI.get("RigidBodyPhysics"),hI.get("Scripting"),hI.get("Shaders"),hI.get("Shape"),hI.get("Sound"),hI.get("Text"),hI.get("Texturing"),hI.get("Texturing3D"),hI.get("Time"),hI.get("VolumeRendering")]}),dI.add("Immersive",{title:"Immersive",providerURL:so.getProviderURL(),components:[hI.get("Core"),hI.get("EnvironmentalEffects"),hI.get("EnvironmentalSensor"),hI.get("EventUtilities"),hI.get("Geometry2D"),hI.get("Geometry3D"),hI.get("Grouping"),hI.get("Interpolation"),hI.get("KeyDeviceSensor"),hI.get("Lighting"),hI.get("Navigation"),hI.get("Networking"),hI.get("PointingDeviceSensor"),hI.get("Rendering"),hI.get("Scripting"),hI.get("Shape"),hI.get("Sound"),hI.get("Text"),hI.get("Texturing"),hI.get("Time")]}),dI.add("Interactive",{title:"Interactive",providerURL:so.getProviderURL(),components:[hI.get("Core"),hI.get("EnvironmentalEffects"),hI.get("EnvironmentalSensor"),hI.get("EventUtilities"),hI.get("Geometry3D"),hI.get("Grouping"),hI.get("Interpolation"),hI.get("KeyDeviceSensor"),hI.get("Lighting"),hI.get("Navigation"),hI.get("Networking"),hI.get("PointingDeviceSensor"),hI.get("Rendering"),hI.get("Shape"),hI.get("Texturing"),hI.get("Time")]}),dI.add("Interchange",{title:"Interchange",providerURL:so.getProviderURL(),components:[hI.get("Core"),hI.get("EnvironmentalEffects"),hI.get("Geometry3D"),hI.get("Grouping"),hI.get("Interpolation"),hI.get("Lighting"),hI.get("Navigation"),hI.get("Networking"),hI.get("Rendering"),hI.get("Shape"),hI.get("Texturing"),hI.get("Time")]}),dI.add("MedicalInterchange",{title:"Medical interchange",providerURL:so.getProviderURL(),components:[hI.get("Core"),hI.get("EnvironmentalEffects"),hI.get("EventUtilities"),hI.get("Geometry2D"),hI.get("Geometry3D"),hI.get("Grouping"),hI.get("Interpolation"),hI.get("Lighting"),hI.get("Navigation"),hI.get("Networking"),hI.get("Rendering"),hI.get("Shape"),hI.get("Text"),hI.get("Texturing"),hI.get("Texturing3D"),hI.get("Time"),hI.get("VolumeRendering")]}),dI.add("MPEG-4",{title:"MPEG-4 interactive",providerURL:so.getProviderURL(),components:[hI.get("Core"),hI.get("EnvironmentalEffects"),hI.get("EnvironmentalSensor"),hI.get("Geometry3D"),hI.get("Grouping"),hI.get("Interpolation"),hI.get("Lighting"),hI.get("Navigation"),hI.get("Networking"),hI.get("PointingDeviceSensor"),hI.get("Rendering"),hI.get("Shape"),hI.get("Texturing"),hI.get("Time")]});const cI=dI;i.add("SupportedProfiles","x_ite/Configuration/SupportedProfiles",cI);const pI=cI;var gI=n(464);const fI=Symbol(),mI=Symbol(),_I=Symbol(),xI=Symbol(),yI=Symbol(),wI=Symbol(),bI=Symbol(),SI=Symbol(),TI=Symbol(),vI=Symbol.for("X_ITE.X3DRoutingContext.processEvents");function OI(e){if((e=gI(e)).prop("browser"))throw new Error("Couldn't create browser, element has already a browser.");$F.call(this,e),this.addType(d.X3DBrowser),this[mI]=pI.copy(),this[_I]=hI.copy(),this[xI]=DF.copy(),this[yI]=NF.copy(),this[TI]=document.getElementsByClassName("x_ite-console"),this[SI]=new Map([[d.CONNECTION_ERROR,new Map],[d.BROWSER_EVENT,new Map],[d.INITIALIZED_EVENT,new Map],[d.SHUTDOWN_EVENT,new Map],[d.INITIALIZED_ERROR,new Map]]),this.setup()}Object.assign(Object.setPrototypeOf(OI.prototype,$F.prototype),{initialize(){$F.prototype.initialize.call(this),this.replaceWorld(this.createScene()).catch(Function.prototype),this[fI]=new tI(this),fs.browser(this),this[vI].call(this),this.getInstanceId()>1||this.getBrowserOption("Debug")&&this.print(this.getWelcomeMessage())},getWelcomeMessage(){return`Welcome to ${this.name} X3D Browser v${this.version}:\n Current Graphics Renderer\n Name: ${this.getVendor()} ${this.getRenderer()}\n WebGL version: ${this.getWebGLVersion()}\n Shading language: ${this.getShadingLanguageVersion()}\n Rendering Properties\n Antialiased: ${this.getRenderingProperty("Antialiased")}\n Max samples: ${this.getMaxSamples()}\n Depth size: ${this.getDepthSize()} bits\n Color depth: ${this.getColorDepth()} bits\n Max clip planes per shape: ${this.getMaxClipPlanes()}\n Max lights per shape: ${this.getMaxLights()}\n Max multi textures per shape: ${this.getMaxTextures()}\n Texture units: ${this.getMaxCombinedTextureUnits()}\n Max texture size: ${this.getMaxTextureSize()} × ${this.getMaxTextureSize()} pixels\n Texture memory: ${this.getTextureMemory()}\n Max vertex uniform vectors: ${this.getMaxVertexUniformVectors()}\n Max fragment uniform vectors: ${this.getMaxFragmentUniformVectors()}\n Max vertex attribs: ${this.getMaxVertexAttribs()}\n Max varying vectors: ${this.getMaxVaryingVectors()}\n`},getName:()=>"X_ITE",getVersion:()=>_s,getDescription(){return this.getNotification()._string.getValue()},setDescription(e){this.getNotification()._string=e},getWorldURL(){return this.currentScene.worldURL},getProfile(e){e=String(e);const t=this[mI].get(e);if(t)return t;throw Error(`Profile '${e}' is not supported.`)},addSupportedProfile:function(e){this[mI].add(e.name,e)},updateSupportedProfile:function(e){this[mI].update(e.name,e.name,e)},removeSupportedProfile(e){return this[mI].remove(String(e))},getSupportedProfile(e){const t=this[mI].get(String(e));if(t)return t;throw new Error(`Supported profile '${e}' does not exists.`)},getSupportedProfiles(){return this[mI]},getComponent(e,t){e=String(e),t|=0;const i=this[_I].get(e);if(i)return new Uv(i.name,g.clamp(t||i.level,1,i.level),i.title,i.providerURL,i.external,i.dependencies);throw Error(`Component '${e}' at level '${t}' is not supported.`)},addSupportedComponent(e){this[_I].add(e.name,e)},updateSupportedComponent(e){this[_I].update(e.name,e.name,e)},removeSupportedComponent(e){this[_I].remove(String(e))},getSupportedComponent(e){const t=this[_I].get(String(e));if(t)return t;throw new Error(`Supported component '${e}' does not exists.`)},getSupportedComponents(){return this[_I]},loadComponents:(()=>{function e(e,i){return Promise.all(e.map((e=>t.call(this,e,i))))}async function t({name:t,providerURL:i,external:s,dependencies:r},o){if(!o.has(t)&&(o.add(t),await e.call(this,r.map((e=>this[_I].get(e))),o),s))switch(io.ENVIRONMENT){case"NODE":n.g.require(n.g.require("url").fileURLToPath(i));break;case"BROWSER":case"MODULE":await import(i)}}return function(...t){const i=[];for(const e of t)e instanceof sI?i.push(...e.components):e instanceof jv?i.push(...e):e instanceof Uv?i.push(e):"string"==typeof e&&i.push(this[_I].get(e));return e.call(this,i,new Set)}})(),addConcreteNode(e){this[xI].add(e.typeName,e)},updateConcreteNode(e){this[xI].update(e.typeName,e.typeName,e)},removeConcreteNode(e){this[xI].remove(String(e))},getConcreteNode(e){const t=this[xI].get(String(e));if(t)return t;throw new Error(`Concrete node '${e}' does not exists.`)},getConcreteNodes(){return this[xI]},addAbstractNode(e){this[yI].add(e.typeName,e)},updateAbstractNode(e){this[yI].update(e.typeName,e.typeName,e)},removeAbstractNode(e){this[yI].remove(String(e))},getAbstractNode(e){const t=this[yI].get(String(e));if(t)return t;throw new Error(`Abstract node '${e}' does not exists.`)},getAbstractNodes(){return this[yI]},createScene(e,...t){const i=new fO(this);if(arguments.length){if(!(e instanceof sI))throw new Error("Couldn't create scene: profile must be of type ProfileInfo.");i.setProfile(e);for(const e of t){if(!(e instanceof Uv))throw new Error("Couldn't create scene: component must be of type ComponentInfo.");i.addComponent(e)}}return i.setup(),i},replaceWorld(e){return new Promise(((t,i)=>{if(this[bI]?.abort(),this[wI]?.("Replacing world aborted."),this[wI]=i,this.initialized().getValue()&&(this.getExecutionContext().setLive(!1),this.shutdown().processInterests(),this.callBrowserCallbacks(d.SHUTDOWN_EVENT),this.callBrowserEventHandler("shutdown")),e instanceof Yn.MFNode){const t=e;e=this.createScene();for(const i of t.filter((e=>e)))e.getLive().addInterest("setLive",i.getValue().getExecutionContext());e.setRootNodes(t)}e instanceof fO||(e=this.createScene()),e.getExecutionContext().getLive().removeInterest("setLive",e),e.setExecutionContext(e),this.setDescription(""),this.setBrowserLoading(!0),this._loadCount.addInterest("checkLoadCount",this,t);for(const t of e.getLoadingObjects())this.addLoadingObject(t);this.setExecutionContext(e),this.getWorld().bindBindables(),e.setLive(this.isLive())}))},checkLoadCount(e,t){t.getValue()||(t.removeInterest("checkLoadCount",this),this.setBrowserLoading(!1),this.initialized().set(this.getCurrentTime()),this.initialized().processInterests(),this.callBrowserCallbacks(d.INITIALIZED_EVENT),this.callBrowserEventHandler("initialized load"),e())},createVrmlFromString(e){const t=this.isExternal(),i=this.currentScene,n=t?this.getBaseURL():i.getWorldURL(),s=new uh(this.getWorld()).createX3DFromString(n,`#VRML V2.0 utf8\n\n${e}`);return t||(i.getLive().addInterest("setLive",s),s.setExecutionContext(i),s.setLive(i.isLive())),s.rootNodes},createX3DFromString:async function(e){e=String(e);const t=this.isExternal(),i=this.currentScene,n=t?this.getBaseURL():i.getWorldURL(),s=new uh(this.getWorld()),r=await new Promise(((t,i)=>{s.createX3DFromString(n,e,t,i)}));return t||(i.getLive().addInterest("setLive",r),r.setExecutionContext(i),r.setLive(i.isLive())),r},createVrmlFromURL(e,t,i){if(t=ql(d.X3DNode,t,!1),i=String(i),!(e instanceof Yn.MFString))throw new Error("Browser.createVrmlFromURL: url must be of type MFString.");if(!t)throw new Error("Browser.createVrmlFromURL: node must be of type X3DNode.");const n=t.getField(i);if(!n.isInput())throw new Error(`Browser.createVrmlFromURL: event named '${i}' must be a input field.`);if(n.getType()!==d.MFNode)throw new Error(`Browser.createVrmlFromURL: event named '${i}' must be of type MFNode.`);const s=this.currentScene,r=this.isExternal(),o=new uh(this.getWorld());this.addLoadingObject(o),o.createX3DFromURL(e,null,(e=>{this.removeLoadingObject(o),e&&(r||(s.getLive().addInterest("setLive",e),e.setExecutionContext(s),e.setLive(s.isLive())),n.setValue(e.rootNodes))}))},createX3DFromURL(e,t,i){if(3===arguments.length)return this.createVrmlFromURL(e,t,i);if(!(e instanceof Yn.MFString))throw new Error("Browser.createX3DFromURL: url must be of type MFString.");return new Promise(((t,i)=>{const n=this.currentScene,s=this.isExternal(),r=new uh(this.getWorld());this.addLoadingObject(r),r.createX3DFromURL(e,null,(e=>{this.removeLoadingObject(r),e?(s||(n.getLive().addInterest("setLive",e),e.setExecutionContext(n),e.setLive(n.isLive())),t(e)):i(new Error("Couldn't load X3D file."))}))}))},loadURL(e,t=new Yn.MFString){return new Promise(((i,n)=>{if(!(e instanceof Yn.MFString))throw new Error("Browser.loadURL: url must be of type MFString.");if(!(t instanceof Yn.MFString))throw new Error("Browser.loadURL: parameter must be of type MFString.");const s=new uh(this.getWorld());s.createX3DFromURL(e,t,(e=>{this[bI]!==s?n(new Error("Loading of X3D file aborted.")):(this.getBrowserOption("SplashScreen")||this.getCanvas().show(),e?(this.addLoadingObject(this),this.replaceWorld(e).then(i).catch(n),this.removeLoadingObject(this),this.removeLoadingObject(s)):(this.callBrowserCallbacks(d.CONNECTION_ERROR),this.callBrowserEventHandler("error"),setTimeout((()=>{this.getSplashScreen().find(".x_ite-private-spinner-text").text(ov("Failed loading world."))})),n(new Error("Couldn't load X3D file."))))}),(e=>{s.ready=!0,this.changeViewpoint(e),this.removeLoadingObject(s),i()}),((e,t)=>{s.ready=!0,t?window.open(e,t):location=e,this.removeLoadingObject(s),i()})),s.ready||(this[bI]?.abort(),this.setBrowserLoading(!0),this.addLoadingObject(this[bI]=s))}))},addBrowserListener(e,t){},removeBrowserListener(e){},addBrowserCallback(...e){switch(e.length){case 2:{const[t,i]=e;this[SI].forEach((e=>e.set(t,i)));break}case 3:{const[t,i,n]=e;this[SI].get(i).set(t,n);break}}},removeBrowserCallback(e,t){2===arguments.length?this[SI].get(t).delete(e):this[SI].forEach((t=>t.delete(e)))},getBrowserCallbacks(e){return 1===arguments.length?this[SI].get(e):new Map([...this[SI]].flatMap((([e,t])=>[...t])))},callBrowserCallbacks:(()=>{const e=[];return function(t){const i=this[SI].get(t);if(i.size)for(const n of w.values(e,i))n(t)}})(),importDocument(e){const t=this.currentScene,i=this.createScene();this.isExternal()||(t.getLive().addInterest("setLive",i),i.setExecutionContext(t),i.setLive(t.isLive()));const n=new Wr(i);return n.setInput(e),new Promise(n.parseIntoScene.bind(n))},importJS(e){const t=this.currentScene,i=this.createScene();this.isExternal()||(t.getLive().addInterest("setLive",i),i.setExecutionContext(t),i.setLive(t.isLive()));const n=new Kr(i);return n.setInput(e),new Promise(n.parseIntoScene.bind(n))},getBrowserProperty(e){return this.getBrowserProperties().getField(e).getValue()},setBrowserOption(e,t){this.getBrowserOptions().getField(e).setValue(t)},getBrowserOption(e){return this.getBrowserOptions().getField(e).getValue()},getRenderingProperty(e){return this.getRenderingProperties().getField(e).getValue()},viewAll(e,t=1){1===arguments.length&&"number"==typeof e&&(t=e),(e=ql(d.X3DLayerNode,e)??this.getActiveLayer())&&e.viewAll(t,1,this.getBrowserOption("StraightenHorizon"))},firstViewpoint(e){const t=(e=ql(d.X3DLayerNode,e)??this.getActiveLayer()).getUserViewpoints();t.length&&this.bindViewpoint(e,t[0])},previousViewpoint(e){if(!(e=ql(d.X3DLayerNode,e)??this.getActiveLayer()))return;const t=e.getUserViewpoints();if(0!==t.length){for(var i=0,n=t.length;i<n&&!t[i]._isBound.getValue();++i);i<t.length?0===i?this.bindViewpoint(e,t.at(-1)):this.bindViewpoint(e,t[i-1]):this.bindViewpoint(e,t.at(-1))}},nextViewpoint(e){if(!(e=ql(d.X3DLayerNode,e)??this.getActiveLayer()))return;const t=e.getUserViewpoints();if(0!==t.length){for(var i=0,n=t.length;i<n&&!t[i]._isBound.getValue();++i);i<t.length?i===t.length-1?this.bindViewpoint(e,t[0]):this.bindViewpoint(e,t[i+1]):this.bindViewpoint(e,t[0])}},lastViewpoint(e){if(!(e=ql(d.X3DLayerNode,e)??this.getActiveLayer()))return;const t=e.getUserViewpoints();t.length&&this.bindViewpoint(e,t.at(-1))},changeViewpoint(e,t){if(1===arguments.length&&(t=String(e),e=this.getActiveLayer()),e=ql(d.X3DLayerNode,e)??this.getActiveLayer())for(const i of e.getViewpoints().get())if(i.getName()===t){this.bindViewpoint(e,i);break}},bindViewpoint(e,t){if(e=ql(d.X3DLayerNode,e),t=ql(d.X3DViewpointNode,t),!e)throw new Error("Browser.bindViewpoint: layerNode must be of type X3DLayerNode.");if(!t)throw new Error("Browser.bindViewpoint: viewpointNode must be of type X3DViewpointNode.");t.setVRMLTransition(!0),t._set_bind=!0},addRoute(e,t,i,n){this.currentScene.addRoute(e,t,i,n)},deleteRoute(e,t,i,n){try{const s=this.currentScene.getRoute(e,t,i,n);s&&this.currentScene.deleteRoute(s)}catch(e){console.error(e)}},beginUpdate(){this.setLive(!0),this.getExecutionContext().setLive(!0),this.advanceTime(),this.addBrowserEvent()},endUpdate(){this.setLive(!1),this.getExecutionContext().setLive(!1)},print(...e){const t=e.join(" ");console.log(t);for(const e of this[TI])e.append(document.createTextNode(t))},println(...e){const t=e.join(" ");console.log(t);for(const e of this[TI])e.append(document.createTextNode(`${t}\n`))},toVRMLStream(e){this.currentScene.toVRMLStream(e)},toXMLStream(e){this.currentScene.toXMLStream(e)},toJSONStream(e){this.currentScene.toJSONStream(e)}});for(const e of Object.keys(OI.prototype))Object.defineProperty(OI.prototype,e,{enumerable:!1});Object.defineProperties(OI.prototype,{name:{get:OI.prototype.getName,enumerable:!0},version:{value:_s,enumerable:!0},providerURL:{get:OI.prototype.getProviderURL,enumerable:!0},providerUrl:{get:OI.prototype.getProviderURL,enumerable:!1},currentFrameRate:{get:OI.prototype.getCurrentFrameRate,enumerable:!0},currentSpeed:{get:OI.prototype.getCurrentSpeed,enumerable:!0},description:{get:OI.prototype.getDescription,set:OI.prototype.setDescription,enumerable:!0},baseURL:{get:OI.prototype.getBaseURL,set:OI.prototype.setBaseURL,enumerable:!0},currentScene:{get(){return this.getScriptStack().at(-1).getExecutionContext()},enumerable:!0},supportedProfiles:{get(){return this[mI]},enumerable:!0},supportedComponents:{get(){return this[_I]},enumerable:!0},concreteNodes:{get(){return this[xI]},enumerable:!0},abstractNodes:{get(){return this[yI]},enumerable:!0}}),Object.defineProperties(OI,{typeName:{value:"X3DBrowser",enumerable:!0}}),d.addNode(OI);const EI=OI;i.add("X3DBrowser","x_ite/Browser/X3DBrowser",EI);const NI=EI;var CI=n(464);class FI extends HTMLElement{constructor(){try{super(),new NI(this)}catch(e){console.error(e),CI(this.shadowRoot).append(CI("<slot></slot>")).children(".x_ite-private-browser").remove()}}connectedCallback(){this.browser?.connectedCallback()}static get observedAttributes(){return["antialiased","baseURL","baseurl","cache","contentScale","contentscale","contextMenu","contextmenu","debug","multisampling","notifications","oninitialized","onshutdown","orderIndependentTransparency","orderindependenttransparency","splashScreen","splashscreen","src","timings","update","url"]}attributeChangedCallback(e,t,i){this.browser?.attributeChangedCallback(e,t,i)}captureStream(...e){return this.browser?.getCanvas()[0].captureStream(...e)}toBlob(...e){return this.browser?.getCanvas()[0].toBlob(...e)}toDataURL(...e){return this.browser?.getCanvas()[0].toDataURL(...e)}}document.createElement("X3DCanvas");const II=FI;i.add("X3DCanvasElement","x_ite/X3DCanvasElement",II);const MI=II;var DI=n(464),PI=n(644);Object.assign(DI,{decodeText:e=>"string"==typeof e?e:(new TextDecoder).decode(e),ungzip(e){try{return PI.ungzip(e,{to:"raw"}).buffer}catch(t){return e}},toLowerCaseFirst:e=>e[0].toLowerCase()+e.slice(1),try(e,t=!1){try{return e()}catch(e){t&&console.error(e.message)}},enum:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i}),Object.assign(DI.fn,{isInViewport(){const e=DI(this),t=DI(window),i=e.offset().top,n=i+e.outerHeight(),s=t.scrollTop(),r=s+t.height();return n>s&&i<r}});const RI=DI;i.add("jquery","lib/jquery",RI);const AI=n(602);i.add("libtess","lib/libtess",AI);var VI=n(464);const LI=VI.Deferred(),BI=VI.Deferred();let UI=!1;function XI(e,t){return new Promise(((i,n)=>{"function"==typeof e&&LI.done(e),"function"==typeof t&&BI.done(t),LI.done(i),BI.done(n),UI||(UI=!0,VI((()=>{try{fs.elements(VI("X3DCanvas"),NI),[...VI("x3d-canvas")].every((e=>e.browser))?LI.resolve():BI.resolve(new Error("Couldn't create browser."))}catch(e){fs.error(VI("X3DCanvas"),e),BI.resolve(e)}})))}))}Object.assign(XI,i,i.Fields,{require(e){if(!i.has(e))throw new Error(`Unknown module '${e}'.`);return i.get(e)},noConflict:(()=>{const e=window.hasOwnProperty("X3D"),t=window.X3D;return function(){return window.X3D===XI&&(e?window.X3D=t:delete window.X3D),XI}})(),getBrowser:e=>VI(e||"x3d-canvas, X3DCanvas").prop("browser"),createBrowser(e,t){const i=document.createElement("x3d-canvas");return arguments.length&&i.browser.loadURL(e,t),i}}),Object.assign(XI,{X3DConstants:d,X3DBrowser:NI,X3DExecutionContext:Xh,X3DScene:fO,ComponentInfo:Uv,ComponentInfoArray:jv,ProfileInfo:sI,ProfileInfoArray:aI,ConcreteNodesArray:IF,AbstractNodesArray:OF,UnitInfo:Hv,UnitInfoArray:Wv,NamedNodesArray:rr,ImportedNodesArray:fr,X3DImportedNode:cr,ExportedNodesArray:iO,X3DExportedNode:Qv,ExternProtoDeclarationArray:_h,ProtoDeclarationArray:wh,X3DExternProtoDeclaration:gh,X3DProtoDeclaration:Lr,X3DProtoDeclarationNode:Or,RouteArray:Mh,X3DRoute:Ch,X3DBaseNode:ds,X3DFieldDefinition:X,FieldDefinitionArray:J,X3DField:he,X3DArrayField:Wi,SFColor:Yn.SFColor,SFColorRGBA:Yn.SFColorRGBA,SFImage:Yn.SFImage,SFMatrix3d:Yn.SFMatrix3d,SFMatrix3f:Yn.SFMatrix3f,SFMatrix4d:Yn.SFMatrix4d,SFMatrix4f:Yn.SFMatrix4f,SFNode:Yn.SFNode,SFRotation:Yn.SFRotation,SFVec2d:Yn.SFVec2d,SFVec2f:Yn.SFVec2f,SFVec3d:Yn.SFVec3d,SFVec3f:Yn.SFVec3f,SFVec4d:Yn.SFVec4d,SFVec4f:Yn.SFVec4f,VrmlMatrix:Yn.VrmlMatrix,MFBool:Yn.MFBool,MFColor:Yn.MFColor,MFColorRGBA:Yn.MFColorRGBA,MFDouble:Yn.MFDouble,MFFloat:Yn.MFFloat,MFImage:Yn.MFImage,MFInt32:Yn.MFInt32,MFMatrix3d:Yn.MFMatrix3d,MFMatrix3f:Yn.MFMatrix3f,MFMatrix4d:Yn.MFMatrix4d,MFMatrix4f:Yn.MFMatrix4f,MFNode:Yn.MFNode,MFRotation:Yn.MFRotation,MFString:Yn.MFString,MFTime:Yn.MFTime,MFVec2d:Yn.MFVec2d,MFVec2f:Yn.MFVec2f,MFVec3d:Yn.MFVec3d,MFVec3f:Yn.MFVec3f,MFVec4d:Yn.MFVec4d,MFVec4f:Yn.MFVec4f});const kI=XI;(()=>{function e(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]}const t=Reflect.getPrototypeOf(Int8Array);for(const i of[Array,String,t])void 0===i.prototype.at&&Object.defineProperty(i.prototype,"at",{value:e,writable:!0,enumerable:!1,configurable:!0})})();const jI=void 0;i.add("shim","shim",jI);window[Symbol.for("X_ITE.X3D-8.12.0")]=kI,customElements.define("x3d-canvas",MI),kI();const zI=kI;i.add("x_ite","x_ite",zI);const GI=zI})();var r=s.Z;export{r as default};