@luma.gl/engine 9.0.0-alpha.5 → 9.0.0-alpha.50

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 (171) hide show
  1. package/LICENSE +3 -1
  2. package/dist/animation/key-frames.d.ts +1 -1
  3. package/dist/animation/key-frames.d.ts.map +1 -1
  4. package/dist/animation/key-frames.js +6 -27
  5. package/dist/animation/key-frames.js.map +1 -1
  6. package/dist/animation/timeline.d.ts +9 -9
  7. package/dist/animation/timeline.d.ts.map +1 -1
  8. package/dist/animation/timeline.js +18 -49
  9. package/dist/animation/timeline.js.map +1 -1
  10. package/dist/{lib → animation-loop}/animation-loop.d.ts +30 -31
  11. package/dist/animation-loop/animation-loop.d.ts.map +1 -0
  12. package/dist/{lib → animation-loop}/animation-loop.js +115 -199
  13. package/dist/animation-loop/animation-loop.js.map +1 -0
  14. package/dist/{lib → animation-loop}/animation-props.d.ts +6 -7
  15. package/dist/animation-loop/animation-props.d.ts.map +1 -0
  16. package/dist/animation-loop/animation-props.js.map +1 -0
  17. package/dist/animation-loop/make-animation-loop.d.ts +6 -0
  18. package/dist/animation-loop/make-animation-loop.d.ts.map +1 -0
  19. package/dist/animation-loop/make-animation-loop.js +28 -0
  20. package/dist/animation-loop/make-animation-loop.js.map +1 -0
  21. package/dist/animation-loop/render-loop.d.ts +23 -0
  22. package/dist/animation-loop/render-loop.d.ts.map +1 -0
  23. package/dist/animation-loop/render-loop.js +7 -0
  24. package/dist/animation-loop/render-loop.js.map +1 -0
  25. package/dist/dist.dev.js +7064 -0
  26. package/dist/geometries/cone-geometry.d.ts +1 -1
  27. package/dist/geometries/cone-geometry.d.ts.map +1 -1
  28. package/dist/geometries/cone-geometry.js +6 -5
  29. package/dist/geometries/cone-geometry.js.map +1 -1
  30. package/dist/geometries/cube-geometry.d.ts +2 -2
  31. package/dist/geometries/cube-geometry.d.ts.map +1 -1
  32. package/dist/geometries/cube-geometry.js +15 -8
  33. package/dist/geometries/cube-geometry.js.map +1 -1
  34. package/dist/geometries/cylinder-geometry.d.ts +1 -1
  35. package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
  36. package/dist/geometries/cylinder-geometry.js +6 -5
  37. package/dist/geometries/cylinder-geometry.js.map +1 -1
  38. package/dist/geometries/ico-sphere-geometry.d.ts +2 -2
  39. package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
  40. package/dist/geometries/ico-sphere-geometry.js +10 -19
  41. package/dist/geometries/ico-sphere-geometry.js.map +1 -1
  42. package/dist/geometries/plane-geometry.d.ts +2 -2
  43. package/dist/geometries/plane-geometry.d.ts.map +1 -1
  44. package/dist/geometries/plane-geometry.js +14 -23
  45. package/dist/geometries/plane-geometry.js.map +1 -1
  46. package/dist/geometries/sphere-geometry.d.ts +2 -2
  47. package/dist/geometries/sphere-geometry.d.ts.map +1 -1
  48. package/dist/geometries/sphere-geometry.js +9 -13
  49. package/dist/geometries/sphere-geometry.js.map +1 -1
  50. package/dist/geometries/truncated-cone-geometry.d.ts +2 -4
  51. package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
  52. package/dist/geometries/truncated-cone-geometry.js +9 -25
  53. package/dist/geometries/truncated-cone-geometry.js.map +1 -1
  54. package/dist/geometry/geometry-table.d.ts +2 -2
  55. package/dist/geometry/geometry-table.d.ts.map +1 -1
  56. package/dist/geometry/geometry-table.js.map +1 -1
  57. package/dist/geometry/geometry-utils.d.ts.map +1 -1
  58. package/dist/geometry/geometry-utils.js +0 -9
  59. package/dist/geometry/geometry-utils.js.map +1 -1
  60. package/dist/geometry/geometry.d.ts +50 -59
  61. package/dist/geometry/geometry.d.ts.map +1 -1
  62. package/dist/geometry/geometry.js +32 -97
  63. package/dist/geometry/geometry.js.map +1 -1
  64. package/dist/geometry/gpu-geometry.d.ts +37 -0
  65. package/dist/geometry/gpu-geometry.d.ts.map +1 -0
  66. package/dist/geometry/gpu-geometry.js +107 -0
  67. package/dist/geometry/gpu-geometry.js.map +1 -0
  68. package/dist/geometry/gpu-table.d.ts +1 -0
  69. package/dist/geometry/gpu-table.d.ts.map +1 -0
  70. package/dist/geometry/gpu-table.js +2 -0
  71. package/dist/geometry/gpu-table.js.map +1 -0
  72. package/dist/index.cjs +2959 -0
  73. package/dist/index.d.ts +26 -9
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +23 -13
  76. package/dist/index.js.map +1 -1
  77. package/dist/lib/clip-space.d.ts +8 -0
  78. package/dist/lib/clip-space.d.ts.map +1 -1
  79. package/dist/lib/clip-space.js +47 -0
  80. package/dist/lib/clip-space.js.map +1 -1
  81. package/dist/lib/pipeline-factory.d.ts +12 -40
  82. package/dist/lib/pipeline-factory.d.ts.map +1 -1
  83. package/dist/lib/pipeline-factory.js +50 -148
  84. package/dist/lib/pipeline-factory.js.map +1 -1
  85. package/dist/model/model.d.ts +192 -0
  86. package/dist/model/model.d.ts.map +1 -0
  87. package/dist/model/model.js +312 -0
  88. package/dist/model/model.js.map +1 -0
  89. package/dist/scenegraph/group-node.d.ts +21 -0
  90. package/dist/scenegraph/group-node.d.ts.map +1 -0
  91. package/dist/scenegraph/group-node.js +94 -0
  92. package/dist/scenegraph/group-node.js.map +1 -0
  93. package/dist/scenegraph/model-node.d.ts +18 -0
  94. package/dist/scenegraph/model-node.d.ts.map +1 -0
  95. package/dist/scenegraph/model-node.js +28 -0
  96. package/dist/scenegraph/model-node.js.map +1 -0
  97. package/dist/scenegraph/scenegraph-node.d.ts +56 -0
  98. package/dist/scenegraph/scenegraph-node.d.ts.map +1 -0
  99. package/dist/scenegraph/scenegraph-node.js +141 -0
  100. package/dist/scenegraph/scenegraph-node.js.map +1 -0
  101. package/dist/shader-inputs.d.ts +62 -0
  102. package/dist/shader-inputs.d.ts.map +1 -0
  103. package/dist/shader-inputs.js +49 -0
  104. package/dist/shader-inputs.js.map +1 -0
  105. package/dist/transform/buffer-transform.d.ts +35 -0
  106. package/dist/transform/buffer-transform.d.ts.map +1 -0
  107. package/dist/transform/buffer-transform.js +62 -0
  108. package/dist/transform/buffer-transform.js.map +1 -0
  109. package/dist/transform/texture-transform.d.ts +57 -0
  110. package/dist/transform/texture-transform.d.ts.map +1 -0
  111. package/dist/transform/texture-transform.js +122 -0
  112. package/dist/transform/texture-transform.js.map +1 -0
  113. package/dist.min.js +286 -0
  114. package/package.json +21 -12
  115. package/src/animation/timeline.ts +16 -15
  116. package/src/{lib → animation-loop}/animation-loop.ts +120 -107
  117. package/src/{lib → animation-loop}/animation-props.ts +5 -5
  118. package/src/animation-loop/make-animation-loop.ts +44 -0
  119. package/src/animation-loop/render-loop.ts +23 -0
  120. package/src/geometries/cone-geometry.ts +1 -1
  121. package/src/geometries/cube-geometry.ts +6 -3
  122. package/src/geometries/cylinder-geometry.ts +2 -2
  123. package/src/geometries/ico-sphere-geometry.ts +7 -6
  124. package/src/geometries/plane-geometry.ts +5 -4
  125. package/src/geometries/sphere-geometry.ts +4 -3
  126. package/src/geometries/truncated-cone-geometry.ts +4 -13
  127. package/src/geometry/geometry-table.ts +1 -1
  128. package/src/geometry/geometry-utils.ts +3 -3
  129. package/src/geometry/geometry.ts +79 -119
  130. package/src/geometry/gpu-geometry.ts +124 -0
  131. package/src/geometry/gpu-table.ts +41 -0
  132. package/src/index.ts +38 -12
  133. package/src/lib/clip-space.ts +22 -21
  134. package/src/lib/pipeline-factory.ts +60 -168
  135. package/src/model/model.ts +549 -0
  136. package/src/scenegraph/group-node.ts +103 -0
  137. package/src/scenegraph/model-node.ts +50 -0
  138. package/src/scenegraph/scenegraph-node.ts +204 -0
  139. package/src/shader-inputs.ts +132 -0
  140. package/src/transform/buffer-transform.ts +94 -0
  141. package/src/transform/texture-transform.ts +169 -0
  142. package/dist/bundle.d.ts +0 -2
  143. package/dist/bundle.d.ts.map +0 -1
  144. package/dist/bundle.js +0 -5
  145. package/dist/bundle.js.map +0 -1
  146. package/dist/geometry/primitive-utils.d.ts +0 -1
  147. package/dist/geometry/primitive-utils.d.ts.map +0 -1
  148. package/dist/geometry/primitive-utils.js +0 -2
  149. package/dist/geometry/primitive-utils.js.map +0 -1
  150. package/dist/lib/animation-loop.d.ts.map +0 -1
  151. package/dist/lib/animation-loop.js.map +0 -1
  152. package/dist/lib/animation-props.d.ts.map +0 -1
  153. package/dist/lib/animation-props.js.map +0 -1
  154. package/dist/lib/model-utils.d.ts +0 -5
  155. package/dist/lib/model-utils.d.ts.map +0 -1
  156. package/dist/lib/model-utils.js +0 -45
  157. package/dist/lib/model-utils.js.map +0 -1
  158. package/dist/lib/model.d.ts +0 -41
  159. package/dist/lib/model.d.ts.map +0 -1
  160. package/dist/lib/model.js +0 -176
  161. package/dist/lib/model.js.map +0 -1
  162. package/dist/lib/render-loop.d.ts +0 -14
  163. package/dist/lib/render-loop.d.ts.map +0 -1
  164. package/dist/lib/render-loop.js +0 -49
  165. package/dist/lib/render-loop.js.map +0 -1
  166. package/src/bundle.ts +0 -4
  167. package/src/geometry/primitive-utils.ts +0 -30
  168. package/src/lib/model-utils.ts +0 -124
  169. package/src/lib/model.ts +0 -179
  170. package/src/lib/render-loop.ts +0 -58
  171. /package/dist/{lib → animation-loop}/animation-props.js +0 -0
package/dist.min.js ADDED
@@ -0,0 +1,286 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if (typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if (typeof define === 'function' && define.amd) define([], factory);
5
+ else if (typeof exports === 'object') exports['luma'] = factory();
6
+ else root['luma'] = factory();})(globalThis, function () {
7
+ "use strict";var __exports__=(()=>{var wr=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var Js=Object.getOwnPropertyNames;var Qs=Object.prototype.hasOwnProperty;var ef=(e,t)=>{for(var r in t)wr(e,r,{get:t[r],enumerable:!0})},tf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Js(t))!Qs.call(e,i)&&i!==r&&wr(e,i,{get:()=>t[i],enumerable:!(n=Zs(t,i))||n.enumerable});return e};var rf=e=>tf(wr({},"__esModule",{value:!0}),e);var ad={};ef(ad,{AnimationLoop:()=>Ht,AnimationLoopTemplate:()=>On,BufferTransform:()=>ka,ClipSpace:()=>is,ConeGeometry:()=>vs,CubeGeometry:()=>_s,CylinderGeometry:()=>Es,GPUGeometry:()=>nr,Geometry:()=>Z,GroupNode:()=>ss,IcoSphereGeometry:()=>Rs,KeyFrames:()=>bn,Model:()=>ae,ModelNode:()=>cs,PipelineFactory:()=>xt,PlaneGeometry:()=>Ns,ScenegraphNode:()=>Ee,SphereGeometry:()=>Gs,TextureTransform:()=>qa,Timeline:()=>vn,TruncatedConeGeometry:()=>Ye,_ShaderInputs:()=>rr,makeAnimationLoop:()=>Ui});function tt(e){return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(e)}function nf(e,t){return sf(e)||af(e,t)||yn(e,t)||of()}function of(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function af(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function sf(e){if(Array.isArray(e))return e}function _r(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=yn(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function yn(e,t){if(e){if(typeof e=="string")return mn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mn(e,t)}}function mn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cf(n.key),n)}}function ff(e,t,r){return t&&dn(e.prototype,t),r&&dn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cf(e){var t=uf(e,"string");return tt(t)==="symbol"?t:String(t)}function uf(e,t){if(tt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var hf=1,pf=1,vn=function(){function e(){lf(this,e),this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}var t=e.prototype;return t.addChannel=function(n){var i=n.delay,o=i===void 0?0:i,a=n.duration,f=a===void 0?Number.POSITIVE_INFINITY:a,s=n.rate,l=s===void 0?1:s,p=n.repeat,y=p===void 0?1:p,g=hf++,w={time:0,delay:o,duration:f,rate:l,repeat:y};return this._setChannelTime(w,this.time),this.channels.set(g,w),g},t.removeChannel=function(n){this.channels.delete(n);var i=_r(this.animations),o;try{for(i.s();!(o=i.n()).done;){var a=nf(o.value,2),f=a[0],s=a[1];s.channel===n&&this.detachAnimation(f)}}catch(l){i.e(l)}finally{i.f()}},t.isFinished=function(n){var i=this.channels.get(n);return i===void 0?!1:this.time>=i.delay+i.duration*i.repeat},t.getTime=function(n){if(n===void 0)return this.time;var i=this.channels.get(n);return i===void 0?-1:i.time},t.setTime=function(n){this.time=Math.max(0,n);var i=this.channels.values(),o=_r(i),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;this._setChannelTime(f,this.time)}}catch(b){o.e(b)}finally{o.f()}var s=this.animations.values(),l=_r(s),p;try{for(l.s();!(p=l.n()).done;){var y=p.value,g=y.animation,w=y.channel;g.setTime(this.getTime(w))}}catch(b){l.e(b)}finally{l.f()}},t.play=function(){this.playing=!0},t.pause=function(){this.playing=!1,this.lastEngineTime=-1},t.reset=function(){this.setTime(0)},t.attachAnimation=function(n,i){var o=pf++;return this.animations.set(o,{animation:n,channel:i}),n.setTime(this.getTime(i)),o},t.detachAnimation=function(n){this.animations.delete(n)},t.update=function(n){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=n),this.setTime(this.time+(n-this.lastEngineTime)),this.lastEngineTime=n)},t._setChannelTime=function(n,i){var o=i-n.delay,a=n.duration*n.repeat;o>=a?n.time=n.duration*n.rate:(n.time=Math.max(0,o)%n.duration,n.time*=n.rate)},ff(e)}();function rt(e){return rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(e)}function gn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,df(n.key),n)}}function mf(e,t,r){return t&&gn(e.prototype,t),r&&gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function df(e){var t=yf(e,"string");return rt(t)==="symbol"?t:String(t)}function yf(e,t){if(rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var bn=function(){function e(r){vf(this,e),this.startIndex=-1,this.endIndex=-1,this.factor=0,this.times=[],this.values=[],this._lastTime=-1,this.setKeyFrames(r),this.setTime(0)}var t=e.prototype;return t.setKeyFrames=function(n){var i=n.length;this.times.length=i,this.values.length=i;for(var o=0;o<i;++o)this.times[o]=n[o][0],this.values[o]=n[o][1];this._calculateKeys(this._lastTime)},t.setTime=function(n){n=Math.max(0,n),n!==this._lastTime&&(this._calculateKeys(n),this._lastTime=n)},t.getStartTime=function(){return this.times[this.startIndex]},t.getEndTime=function(){return this.times[this.endIndex]},t.getStartData=function(){return this.values[this.startIndex]},t.getEndData=function(){return this.values[this.endIndex]},t._calculateKeys=function(n){var i=0,o=this.times.length;for(i=0;i<o-2&&!(this.times[i+1]>n);++i);this.startIndex=i,this.endIndex=i+1;var a=this.times[this.startIndex],f=this.times[this.endIndex];this.factor=Math.min(Math.max(0,(n-a)/(f-a)),1)},mf(e)}();function Ae(e){return Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(e)}function Or(){"use strict";Or=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&Ae(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function wn(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function gf(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){wn(o,n,i,a,f,"next",s)}function f(s){wn(o,n,i,a,f,"throw",s)}a(void 0)})}}function _n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wf(n.key),n)}}function bf(e,t,r){return t&&_n(e.prototype,t),r&&_n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wf(e){var t=_f(e,"string");return Ae(t)==="symbol"?t:String(t)}function _f(e,t){if(Ae(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ae(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Of(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var On=function(){function e(r){Of(this,e)}var t=e.prototype;return t.onInitialize=function(){var r=gf(Or().mark(function i(o){return Or().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",null);case 1:case"end":return f.stop()}},i)}));function n(i){return r.apply(this,arguments)}return n}(),bf(e)}();function Sr(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function J(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Sr()}var Sf=globalThis.self||globalThis.window||globalThis.global,Te=globalThis.window||globalThis.self||globalThis.global,Pf=globalThis.document||{},_e=globalThis.process||{},xf=globalThis.console,md=globalThis.navigator||{};var Nt=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",vd=J();function Ef(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ct=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=Ef(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function Sn(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Pn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function Ft(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,a=e.height*r,f=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),f]}var Ut;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ut||(Ut={}));var Af=10;function xn(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ut[e]||Ut.WHITE)}function En(e,t,r){if(!J&&typeof e=="string"){if(t){let n=xn(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=xn(r);e="\x1B[".concat(n+Af,"m").concat(e,"\x1B[49m")}}return e}function An(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let o of n){let a=i[o];typeof a=="function"&&(t.find(f=>o===f)||(i[o]=a.bind(e)))}}function Me(e,t){if(!e)throw new Error(t||"Assertion failed")}function Oe(){let e;if(J()&&Te.performance){var t,r;e=Te===null||Te===void 0||(t=Te.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in _e){var n;let i=_e===null||_e===void 0||(n=_e.hrtime)===null||n===void 0?void 0:n.call(_e);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Re={debug:J()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Tf={enabled:!0,level:0};function te(){}var Tn={},Mn={once:!0},pe=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Nt,this._startTs=Oe(),this._deltaTs=Oe(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Ct("__probe-".concat(this.id,"__"),Tf),this.timeStamp("".concat(this.id," started")),An(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Oe()-this._startTs).toPrecision(10))}getDelta(){return Number((Oe()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Me(t,r)}warn(t){return this._getLogFunction(0,t,Re.warn,arguments,Mn)}error(t){return this._getLogFunction(0,t,Re.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Re.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Re.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Re.debug||Re.info,arguments,Mn)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||te,n&&[n],{tag:jf(r)}):te}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?J()?Lf({image:i,message:o,scale:a}):Rf({image:i,message:o,scale:a}):te}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||te)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Rn({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||te)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Ln(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=Rn({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,Me(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Oe();let a=o.tag||o.message;if(o.once&&a)if(!Tn[a])Tn[a]=Oe();else return te;return r=Mf(this.id,o.message,o),n.bind(console,r,...o.args)}return te}};pe.VERSION=Nt;function Ln(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Me(Number.isFinite(t)&&t>=0),t}function Rn(e){let{logLevel:t,message:r}=e;e.logLevel=Ln(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return Me(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function Mf(e,t,r){if(typeof t=="string"){let n=r.time?Pn(Sn(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=En(t,r.color,r.background)}return t}function Rf(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),te}function Lf(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=Ft(o,r,n);console.log(...a)},o.src=t,te}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Ft(t,r,n)),te;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Ft(o,r,n)),o.src=t.toDataURL(),te}return te}function jf(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var kd=new pe({id:"@probe.gl/log"});var B=new pe({id:"luma.gl"});function nt(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Se=class{constructor(t,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=nt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(nt()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var me=class{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,i=this.stats[r];return i||(t instanceof Se?i=t:i=new Se(r,n),this.stats[r]=i),i}};function it(e){return it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},it(e)}function jn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Df(n.key),n)}}function If(e,t,r){return t&&jn(e.prototype,t),r&&jn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Df(e){var t=Nf(e,"string");return it(t)==="symbol"?t:String(t)}function Nf(e,t){if(it(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(it(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ff=function(){function e(){Cf(this,e),this.stats=new Map}var t=e.prototype;return t.getStats=function(n){return this.get(n)},t.get=function(n){return this.stats.has(n)||this.stats.set(n,new me({id:n})),this.stats.get(n)},If(e)}(),Le=new Ff;function Uf(){var e=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==e)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(e));return globalThis.luma||(J()&&B.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:B,stats:Le}),e}var In=Uf();function Gf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function de(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:Gf(e)}var Pr={};function z(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Pr[e]=Pr[e]||1;var t=Pr[e]++;return"".concat(e,"-").concat(t)}function ot(e){return ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ot(e)}function Dn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dn(Object(r),!0).forEach(function(n){zf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zf(e,t,r){return t=Cn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cn(n.key),n)}}function kf(e,t,r){return t&&Nn(e.prototype,t),r&&Nn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cn(e){var t=Vf(e,"string");return ot(t)==="symbol"?t:String(t)}function Vf(e,t){if(ot(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ot(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Pe=function(){function e(r,n,i){if(Hf(this,e),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!r)throw new Error("no device");this._device=r,this.props=Kf(n,i);var o=this.props.id!=="undefined"?this.props.id:z(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}var t=e.prototype;return t.destroy=function(){this.destroyResource()},t.delete=function(){return this.destroy(),this},t.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},t.getProps=function(){return this.props},t.attachResource=function(n){this._attachedResources.add(n)},t.detachResource=function(n){this._attachedResources.delete(n)},t.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},t.destroyAttachedResources=function(){for(var n=0,i=Object.values(this._attachedResources);n<i.length;n++){var o=i[n];o.destroy()}this._attachedResources=new Set},t.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},t.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("".concat(i,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").addCount(n),o.get("".concat(i," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").subtractCount(this.allocatedBytes),i.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(i,"s Created")).incrementCount(),n.get("".concat(i,"s Active")).incrementCount()},kf(e)}();Pe.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Kf(e,t){var r=Bf({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function je(e){return je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(e)}var Gn;function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fn(Object(r),!0).forEach(function(n){Wf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wf(e,t,r){return t=Bn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Un(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bn(n.key),n)}}function Yf(e,t,r){return t&&Un(e.prototype,t),r&&Un(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bn(e){var t=Xf(e,"string");return je(t)==="symbol"?t:String(t)}function Xf(e,t){if(je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Er(e,t)}function Er(e,t){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Er(e,t)}function Zf(e){var t=ec();return function(){var n=Gt(e),i;if(t){var o=Gt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Jf(this,i)}}function Jf(e,t){if(t&&(je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qf(e)}function Qf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ec(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gt(e){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gt(e)}Gn=Symbol.toStringTag;var k=function(e){$f(r,e);var t=Zf(r);function r(i,o){var a;qf(this,r);var f=xr({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?f.indexType="uint32":o.data instanceof Uint16Array&&(f.indexType="uint16")),a=t.call(this,i,f,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=o.usage||0,a.indexType=f.indexType,a}var n=r.prototype;return n.write=function(o,a){throw new Error("not implemented")},n.readAsync=function(o,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},Yf(r,[{key:Gn,get:function(){return"Buffer"}}]),r}(Pe);k.defaultProps=xr(xr({},Pe.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});k.MAP_READ=1;k.MAP_WRITE=2;k.COPY_SRC=4;k.COPY_DST=8;k.INDEX=16;k.VERTEX=32;k.UNIFORM=64;k.STORAGE=128;k.INDIRECT=256;k.QUERY_RESOLVE=512;function at(e){return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(e)}var Vn;function zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zn(Object(r),!0).forEach(function(n){tc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tc(e,t,r){return t=Hn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hn(n.key),n)}}function nc(e,t,r){return t&&kn(e.prototype,t),r&&kn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hn(e){var t=ic(e,"string");return at(t)==="symbol"?t:String(t)}function ic(e,t){if(at(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(at(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Vn=Symbol.toStringTag;var st=function(){function e(r){rc(this,e),this.id=void 0,this.statsManager=Le,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Ar(Ar({},e.defaultProps),r),this.id=this.props.id||z(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var i=Ar({},n);return(n.usage||0)&k.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":B.warn("indices buffer content must be of integer type")()),i},nc(e,[{key:Vn,get:function(){return"Device"}}]),e}();st.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(B.get("debug")),break:[],gl:null};st.VERSION=In;function De(e){return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(e)}function Tr(){"use strict";Tr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&De(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kn(Object(r),!0).forEach(function(n){oc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oc(e,t,r){return t=$n(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qn(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function ac(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){qn(o,n,i,a,f,"next",s)}function f(s){qn(o,n,i,a,f,"throw",s)}a(void 0)})}}function sc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=fc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function fc(e,t){if(e){if(typeof e=="string")return Yn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yn(e,t)}}function Yn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$n(n.key),n)}}function cc(e,t,r){return t&&Xn(e.prototype,t),r&&Xn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $n(e){var t=uc(e,"string");return De(t)==="symbol"?t:String(t)}function uc(e,t){if(De(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(De(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ie=new Map,xe=function(){function e(){lc(this,e)}return e.registerDevices=function(r){var n=sc(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;W(o.type&&o.isSupported&&o.create),Ie.set(o.type,o)}}catch(a){n.e(a)}finally{n.f()}},e.getAvailableDevices=function(){return Array.from(Ie).map(function(r){return r.type})},e.getSupportedDevices=function(){return Array.from(Ie).filter(function(r){return r.isSupported()}).map(function(r){return r.type})},e.setDefaultDeviceProps=function(r){Object.assign(st.defaultProps,r)},e.createDevice=function(){var t=ac(Tr().mark(function n(){var i,o,a=arguments;return Tr().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:i=a.length>0&&a[0]!==void 0?a[0]:{},i=Wn(Wn({},st.defaultProps),i),i.gl&&(i.type="webgl"),s.t0=i.type,s.next=s.t0==="webgpu"?6:s.t0==="webgl"||s.t0==="webgl1"||s.t0==="webgl2"?12:s.t0==="best-available"?18:24;break;case 6:if(o=Ie.get("webgpu"),!o){s.next=11;break}return s.next=10,o.create(i);case 10:return s.abrupt("return",s.sent);case 11:return s.abrupt("break",24);case 12:if(o=Ie.get("webgl"),!o){s.next=17;break}return s.next=16,o.create(i);case 16:return s.abrupt("return",s.sent);case 17:return s.abrupt("break",24);case 18:if(o=Ie.get("webgl"),!(o&&o.isSupported())){s.next=23;break}return s.next=22,o.create(i);case 22:return s.abrupt("return",s.sent);case 23:return s.abrupt("break",24);case 24:throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.");case 25:case"end":return s.stop()}},n)}));function r(){return t.apply(this,arguments)}return r}(),cc(e)}();xe.stats=Le;xe.log=B;function Ne(e){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}var ei;function Zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zn(Object(r),!0).forEach(function(n){hc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hc(e,t,r){return t=ti(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ti(n.key),n)}}function mc(e,t,r){return t&&Qn(e.prototype,t),r&&Qn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ti(e){var t=dc(e,"string");return Ne(t)==="symbol"?t:String(t)}function dc(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mr(e,t)}function Mr(e,t){return Mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Mr(e,t)}function vc(e){var t=wc();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return gc(this,i)}}function gc(e,t){if(t&&(Ne(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bc(e)}function bc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bt(e)}ei=Symbol.toStringTag;var Ce=function(e){yc(r,e);var t=vc(r);function r(n,i){var o;return pc(this,r),o=t.call(this,n,i,r.defaultProps),o.hash="",o.vs=void 0,o.fs=void 0,o.shaderLayout=void 0,o.bufferLayout=void 0,o.shaderLayout=o.props.shaderLayout,o.bufferLayout=o.props.bufferLayout||[],o}return mc(r,[{key:ei,get:function(){return"RenderPipeline"}}]),r}(Pe);Ce.defaultProps=Jn(Jn({},Pe.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function _c(e,t){return xc(e)||Pc(e,t)||Sc(e,t)||Oc()}function Oc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sc(e,t){if(e){if(typeof e=="string")return ri(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ri(e,t)}}function ri(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function xc(e){if(Array.isArray(e))return e}function ni(e){var t=_c(Ac[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=Tc[r]*n,f=Ec(r,n);return{dataType:r,components:n,defaultVertexFormat:f,byteLength:a,integer:i,signed:o}}function Ec(e,t){var r;switch(e){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return t<=2?"float16x2":"float16x4"}return t===1?r:"".concat(r,"x").concat(t)}var Ac={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},Tc={f32:4,f16:2,i32:4,u32:4};function oi(e){var t=ii[e],r=Mc(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:ii[e],byteLength:r,integer:i,signed:o,normalized:n}}function Mc(e){var t=Rc[e];return t}var ii={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Rc={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Lc(e,t){return Nc(e)||Dc(e,t)||Ic(e,t)||jc()}function jc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ic(e,t){if(e){if(typeof e=="string")return ai(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ai(e,t)}}function ai(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Dc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Nc(e){if(Array.isArray(e))return e}function Rr(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Lc(r,2),i=n[0],o=n[1],a=i,f=o?parseInt(o):1,s=oi(a),l={type:a,components:f,byteLength:s.byteLength*f,integer:s.integer,signed:s.signed,normalized:s.normalized};return t&&(l.webglOnly=!0),l}function ft(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Cc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Cc(e,t){if(e){if(typeof e=="string")return si(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return si(e,t)}}function si(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lr(e,t){var r={},n=ft(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Fc(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Fc(e,t,r){var n=Uc(e,r),i=Gc(t,r);if(!n)return null;var o=ni(n.type),a=i?.vertexFormat||o.defaultVertexFormat,f=Rr(a);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:a,bufferDataType:f.type,bufferComponents:f.components,normalized:f.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Uc(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||B.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function Gc(e,t){Bc(e);var r=zc(e,t);return r||(r=kc(e,t),r)?r:(B.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Bc(e){var t=ft(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&B.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function zc(e,t){var r=ft(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.format&&i.name===t)return{attributeName:i.name,bufferName:t,stepMode:i.stepMode,vertexFormat:i.format,byteOffset:0,byteStride:i.byteStride||0}}}catch(o){r.e(o)}finally{r.f()}return null}function kc(e,t){var r=ft(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var f=ft(o.attributes||[]),s;try{for(f.s();!(s=f.n()).done;){var l=s.value,p=Rr(l.format);a+=p.byteLength}}catch(g){f.e(g)}finally{f.f()}}var y=(i=o.attributes)===null||i===void 0?void 0:i.find(function(g){return g.attribute===t});if(y)return{attributeName:y.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:y.format,byteOffset:y.byteOffset,byteStride:a}}}catch(g){r.e(g)}finally{r.f()}return null}function W(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var Vc={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function fi(e){var t=Vc[e];return W(e),t}function ci(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}var zt;function ui(e){return(!zt||zt.byteLength<e)&&(zt=new ArrayBuffer(e)),zt}function ct(e){return ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(e)}function li(e,t){return qc(e)||Wc(e,t)||Kc(e,t)||Hc()}function Hc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kc(e,t){if(e){if(typeof e=="string")return hi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hi(e,t)}}function hi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function qc(e){if(Array.isArray(e))return e}function pi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xc(n.key),n)}}function Yc(e,t,r){return t&&pi(e.prototype,t),r&&pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xc(e){var t=$c(e,"string");return ct(t)==="symbol"?t:String(t)}function $c(e,t){if(ct(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ct(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var mi=1024,di=function(){function e(r){Zc(this,e),this.layout={},this.byteLength=void 0;for(var n=0,i=0,o=Object.entries(r);i<o.length;i++){var a=li(o[i],2),f=a[0],s=a[1],l=fi(s),p=l.type,y=l.components;n=ci(n,y);var g=n;n+=y,this.layout[f]={type:p,size:y,offset:g}}n+=(4-n%4)%4;var w=n*4;this.byteLength=Math.max(w,mi)}var t=e.prototype;return t.getData=function(n){for(var i=Math.max(this.byteLength,mi),o=ui(i),a={i32:new Int32Array(o),u32:new Uint32Array(o),f32:new Float32Array(o),f16:new Uint16Array(o)},f=0,s=Object.entries(n);f<s.length;f++){var l=li(s[f],2),p=l[0],y=l[1],g=this.layout[p];if(!g){B.warn("Supplied uniform value ".concat(p," not present in uniform block layout"))();continue}var w=g.type,b=g.size,_=g.offset,x=a[w];if(b===1){if(typeof y!="number"&&typeof y!="boolean"){B.warn("Supplied value for single component uniform ".concat(p," is not a number: ").concat(y))();continue}x[_]=Number(y)}else{var S=de(y);if(!S){B.warn("Supplied value for multi component / array uniform ".concat(p," is not a numeric array: ").concat(y))();continue}x.set(S,_)}}return new Uint8Array(o)},t.has=function(n){return Boolean(this.layout[n])},t.get=function(n){var i=this.layout[n];return i},Yc(e)}();function yi(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(e!==t)return!1;var n=de(e);if(!n)return!1;var i=de(t);if(i&&n.length===i.length){for(var o=0;o<n.length;++o)if(i[o]!==n[o])return!1}return!0}function vi(e){var t=de(e);return t?t.slice():e}function ut(e){return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(e)}function Jc(e,t){return tu(e)||eu(e,t)||wi(e,t)||Qc()}function Qc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function tu(e){if(Array.isArray(e))return e}function ru(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=wi(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function wi(e,t){if(e){if(typeof e=="string")return gi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gi(e,t)}}function gi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iu(n.key),n)}}function nu(e,t,r){return t&&bi(e.prototype,t),r&&bi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function iu(e){var t=ou(e,"string");return ut(t)==="symbol"?t:String(t)}function ou(e,t){if(ut(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ut(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function au(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _i=function(){function e(r){if(au(this,e),this.name=void 0,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.bindingLayout={},this.needsRedraw="initialized",this.name=r?.name,r!=null&&r.name&&r!==null&&r!==void 0&&r.shaderLayout){var n,i=r==null||(n=r.shaderLayout.bindings)===null||n===void 0?void 0:n.find(function(l){return l.type==="uniform"&&l.name===r?.name});if(!i)throw new Error(r?.name);var o=i,a=ru(o.uniforms||[]),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;this.bindingLayout[s.name]=s}}catch(l){a.e(l)}finally{a.f()}}}var t=e.prototype;return t.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=Jc(o[i],2),f=a[0],s=a[1];this._setUniform(f,s),this.needsRedraw||this.setNeedsRedraw("".concat(this.name,".").concat(f,"=").concat(s))}},t.setNeedsRedraw=function(n){this.needsRedraw=this.needsRedraw||n},t.getAllUniforms=function(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}},t._setUniform=function(n,i){yi(this.uniforms[n],i)||(this.uniforms[n]=vi(i),this.modifiedUniforms[n]=!0,this.modified=!0)},nu(e)}();function lt(e){return lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lt(e)}function su(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=xi(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Oi(e,t){return uu(e)||cu(e,t)||xi(e,t)||fu()}function fu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xi(e,t){if(e){if(typeof e=="string")return Si(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Si(e,t)}}function Si(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function uu(e){if(Array.isArray(e))return e}function Pi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hu(n.key),n)}}function lu(e,t,r){return t&&Pi(e.prototype,t),r&&Pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hu(e){var t=pu(e,"string");return lt(t)==="symbol"?t:String(t)}function pu(e,t){if(lt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(lt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var jr=function(){function e(r){mu(this,e),this.uniformBlocks=new Map,this.uniformBufferLayouts=new Map,this.uniformBuffers=new Map;for(var n=0,i=Object.entries(r);n<i.length;n++){var o=Oi(i[n],2),a=o[0],f=o[1],s=a,l=new di(f.uniformTypes||{});this.uniformBufferLayouts.set(s,l);var p=new _i({name:a});p.setUniforms(f.defaultUniforms||{}),this.uniformBlocks.set(s,p)}}var t=e.prototype;return t.destroy=function(){for(var n=0,i=Object.values(this.uniformBuffers);n<i.length;n++){var o=i[n];o.destroy()}},t.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=Oi(o[i],2),f=a[0],s=a[1];this.uniformBlocks.get(f).setUniforms(s)}this.updateUniformBuffers()},t.getUniformBufferByteLength=function(n){return this.uniformBufferLayouts.get(n).byteLength},t.getUniformBufferData=function(n){var i=this.uniformBlocks.get(n).getAllUniforms();return this.uniformBufferLayouts.get(n).getData(i)},t.createUniformBuffer=function(n,i,o){o&&this.setUniforms(o);var a=this.getUniformBufferByteLength(i),f=n.createBuffer({usage:k.UNIFORM,byteLength:a}),s=this.getUniformBufferData(i);return f.write(s),f},t.getManagedUniformBuffer=function(n,i){if(!this.uniformBuffers.get(i)){var o=this.getUniformBufferByteLength(i),a=n.createBuffer({usage:k.UNIFORM,byteLength:o});this.uniformBuffers.set(i,a)}return this.uniformBuffers.get(i)},t.updateUniformBuffers=function(){var n=!1,i=su(this.uniformBlocks.keys()),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=this.updateUniformBuffer(a);n||(n=f)}}catch(s){i.e(s)}finally{i.f()}return n&&B.log(3,"UniformStore.updateUniformBuffers(): ".concat(n))(),n},t.updateUniformBuffer=function(n){var i=this.uniformBlocks.get(n),o=this.uniformBuffers.get(n),a=!1;if(o&&i.needsRedraw){a||(a=i.needsRedraw);var f=this.getUniformBufferData(n),s=this.uniformBuffers.get(n);s.write(f);var l=this.uniformBlocks.get(n).getAllUniforms();B.log(4,"Writing to uniform buffer ".concat(String(n)),f,l)()}return a},lu(e)}();function Ei(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(t.constructor.name)}}function Ir(e,t,r){if(!t||t>4)throw new Error("size ".concat(t));var n=t,i=Ei(e);if(i==="uint8"||i==="sint8"){if(n===1||n===3)throw new Error("size: ".concat(t));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}if(i==="uint16"||i==="sint16"){if(n===1||n===3)throw new Error("size: ".concat(t));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}return n===1?i:"".concat(i,"x").concat(n)}function Ai(e){return de(e)!==null||typeof e=="number"||typeof e=="boolean"}function Dr(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];Ai(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function kt(e){return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function ht(e,t,r){if(e===t)return!0;if(!r||!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ht(e[n],t[n],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(kt(e)==="object"&&kt(t)==="object"){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=0,f=i;a<f.length;a++){var s=f[a];if(!t.hasOwnProperty(s)||!ht(e[s],t[s],r-1))return!1}return!0}return!1}function Nr(e){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function Cr(e){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var Ti=function(t){return"".concat(t)};function Fe(e){return Fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(e)}function du(e,t){return bu(e)||gu(e,t)||vu(e,t)||yu()}function yu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vu(e,t){if(e){if(typeof e=="string")return Mi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mi(e,t)}}function Mi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function bu(e){if(Array.isArray(e))return e}function Ri(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Li(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ri(Object(r),!0).forEach(function(n){wu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wu(e,t,r){return t=Di(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ji(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Di(n.key),n)}}function _u(e,t,r){return t&&ji(e.prototype,t),r&&ji(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Di(e){var t=Ou(e,"string");return Fe(t)==="symbol"?t:String(t)}function Ou(e,t){if(Fe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Su(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fe(){"use strict";fe=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&Fe(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Ii(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Vt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){Ii(o,n,i,a,f,"next",s)}function f(s){Ii(o,n,i,a,f,"throw",s)}a(void 0)})}}var Pu=0,xu={device:null,onAddHTML:function(){return""},onInitialize:function(){var e=Vt(fe().mark(function r(){return fe().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",null);case 1:case"end":return i.stop()}},r)}));function t(){return e.apply(this,arguments)}return t}(),onRender:function(){},onFinalize:function(){},onError:function(t){return console.error(t)},stats:xe.stats.get("animation-loop-".concat(Pu++)),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1},Ht=function(){function e(r){if(Su(this,e),this.device=null,this.canvas=null,this.props=void 0,this.animationProps=null,this.timeline=null,this.stats=void 0,this.cpuTime=void 0,this.gpuTime=void 0,this.frameRate=void 0,this.display=void 0,this.needsRedraw="initialized",this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.props=Li(Li({},xu),r),r=this.props,!r.device)throw new Error("No device provided");var n=this.props.useDevicePixels,i=n===void 0?!0:n;this.stats=r.stats||new me({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:r.autoResizeViewport,autoResizeDrawingBuffer:r.autoResizeDrawingBuffer,useDevicePixels:i}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}var t=e.prototype;return t.destroy=function(){this.stop(),this._setDisplay(null)},t.delete=function(){this.destroy()},t.setNeedsRedraw=function(n){return this.needsRedraw=this.needsRedraw||n,this},t.setProps=function(n){return"autoResizeViewport"in n&&(this.props.autoResizeViewport=n.autoResizeViewport||!1),"autoResizeDrawingBuffer"in n&&(this.props.autoResizeDrawingBuffer=n.autoResizeDrawingBuffer||!1),"useDevicePixels"in n&&(this.props.useDevicePixels=n.useDevicePixels||!1),this},t.start=function(){var r=Vt(fe().mark(function i(){var o,a;return fe().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this._running){s.next=2;break}return s.abrupt("return",this);case 2:if(this._running=!0,s.prev=3,this._initialized){s.next=11;break}return this._initialized=!0,s.next=8,this._initDevice();case 8:return this._initialize(),s.next=11,this.props.onInitialize(this._getAnimationProps());case 11:if(this._running){s.next=13;break}return s.abrupt("return",null);case 13:return o!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),s.abrupt("return",this);case 17:throw s.prev=17,s.t0=s.catch(3),a=s.t0 instanceof Error?s.t0:new Error("Unknown error"),this.props.onError(a),a;case 22:case"end":return s.stop()}},i,this,[[3,17]])}));function n(){return r.apply(this,arguments)}return n}(),t.redraw=function(){var n;return(n=this.device)!==null&&n!==void 0&&n.isLost?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)},t.stop=function(){return this._running&&(this.animationProps&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this},t.attachTimeline=function(n){return this.timeline=n,this.timeline},t.detachTimeline=function(){this.timeline=null},t.waitForRender=function(){var n=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(function(i){n._resolveNextFrame=i})),this._nextFramePromise},t.toDataURL=function(){var r=Vt(fe().mark(function i(){return fe().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return this.setNeedsRedraw("toDataURL"),a.next=3,this.waitForRender();case 3:if(!(this.canvas instanceof HTMLCanvasElement)){a.next=5;break}return a.abrupt("return",this.canvas.toDataURL());case 5:throw new Error("OffscreenCanvas");case 6:case"end":return a.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),t._initialize=function(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()},t._setDisplay=function(n){this.display&&(this.display.destroy(),this.display.animationLoop=null),n&&(n.animationLoop=this),this.display=n},t._requestAnimationFrame=function(){this._running&&(this._animationFrameId=Nr(this._animationFrame.bind(this)))},t._cancelAnimationFrame=function(){this._animationFrameId!==null&&(Cr(this._animationFrameId),this._animationFrameId=null)},t._animationFrame=function(){this._running&&(this.redraw(),this._requestAnimationFrame())},t._renderFrame=function(n){if(this.display){this.display._renderFrame(n);return}this.props.onRender(this._getAnimationProps())},t._clearNeedsRedraw=function(){this.needsRedraw=!1},t._setupFrame=function(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()},t._initializeAnimationProps=function(){var n;if(!this.device)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:(n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0?void 0:n.canvas,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}},t._getAnimationProps=function(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps},t._updateAnimationProps=function(){if(this.animationProps){var n=this._getSizeAndAspect(),i=n.width,o=n.height,a=n.aspect;(i!==this.animationProps.width||o!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),a!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=i,this.animationProps.height=o,this.animationProps.aspect=a,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}},t._initDevice=function(){var r=Vt(fe().mark(function i(){var o;return fe().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.props.device;case 2:if(this.device=f.sent,this.device){f.next=5;break}throw new Error("No device provided");case 5:this.canvas=((o=this.device.canvasContext)===null||o===void 0?void 0:o.canvas)||null;case 6:case"end":return f.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),t._createInfoDiv=function(){if(this.canvas&&this.props.onAddHTML){var n=document.createElement("div");document.body.appendChild(n),n.style.position="relative";var i=document.createElement("div");i.style.position="absolute",i.style.left="10px",i.style.bottom="10px",i.style.width="300px",i.style.background="white",this.canvas instanceof HTMLCanvasElement&&n.appendChild(this.canvas),n.appendChild(i);var o=this.props.onAddHTML(i);o&&(i.innerHTML=o)}},t._getSizeAndAspect=function(){var n,i;if(!this.device)return{width:1,height:1,aspect:1};var o=((n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0?void 0:n.getPixelSize())||[1,1],a=du(o,2),f=a[0],s=a[1],l=1,p=(i=this.device)===null||i===void 0||(i=i.canvasContext)===null||i===void 0?void 0:i.canvas;return p&&p.clientHeight?l=p.clientWidth/p.clientHeight:f>0&&s>0&&(l=f/s),{width:f,height:s,aspect:l}},t._resizeViewport=function(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)},t._resizeCanvasDrawingBuffer=function(){if(this.props.autoResizeDrawingBuffer){var n;(n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0||n.resize({useDevicePixels:this.props.useDevicePixels})}},t._beginFrameTimers=function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()},t._endFrameTimers=function(){this.cpuTime.timeEnd()},t._startEventHandling=function(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))},t._onMousemove=function(n){n instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[n.offsetX,n.offsetY])},t._onMouseleave=function(n){this._getAnimationProps()._mousePosition=null},_u(e)}();function Ue(e){return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(e)}function Fr(){"use strict";Fr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&Ue(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Ni(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Eu(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){Ni(o,n,i,a,f,"next",s)}function f(s){Ni(o,n,i,a,f,"throw",s)}a(void 0)})}}function Ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ci(Object(r),!0).forEach(function(n){Au(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Au(e,t,r){return t=Tu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tu(e){var t=Mu(e,"string");return Ue(t)==="symbol"?t:String(t)}function Mu(e,t){if(Ue(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ue(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ui(e,t){var r=this,n=null,i=t?.device||xe.createDevice(),o=new Ht(Fi(Fi({},t),{},{device:i,onInitialize:function(f){return Eu(Fr().mark(function s(){var l;return Fr().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return n=new e(f),y.next=3,(l=n)===null||l===void 0?void 0:l.onInitialize(f);case 3:return y.abrupt("return",y.sent);case 4:case"end":return y.stop()}},s)}))()},onRender:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onRender(f)},onFinalize:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onFinalize(f)}}));return o.getInfo=function(){return r.AnimationLoopTemplateCtor.info},o}var K=function(t){return"".concat(t)};function ie(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}function Gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gi(Object(r),!0).forEach(function(n){Ru(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ru(e,t,r){return t=Lu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lu(e){var t=ju(e,"string");return ve(t)==="symbol"?t:String(t)}function ju(e,t){if(ve(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ki(e,t){return Cu(e)||Nu(e,t)||Du(e,t)||Iu()}function Iu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Du(e,t){if(e){if(typeof e=="string")return Bi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bi(e,t)}}function Bi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Nu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Cu(e){if(Array.isArray(e))return e}function ve(e){return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(e)}var Ur={number:{type:"number",validate:function(t,r){return Number.isFinite(t)&&ve(r)==="object"&&(r.max===void 0||t<=r.max)&&(r.min===void 0||t>=r.min)}},array:{type:"array",validate:function(t,r){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Vi(e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=ki(n[r],2),o=i[0],a=i[1];t[o]=Fu(a)}return t}function Hi(e,t,r){for(var n={},i=0,o=Object.entries(t);i<o.length;i++){var a=ki(o[i],2),f=a[0],s=a[1];e&&f in e&&!s.private?(s.validate&&ie(s.validate(e[f],s),"".concat(r,": invalid ").concat(f)),n[f]=e[f]):n[f]=s.value}return n}function Fu(e){var t=zi(e);if(t!=="object")return ye(ye({value:e},Ur[t]),{},{type:t});if(ve(e)==="object")return e?e.type!==void 0?ye(ye(ye({},e),Ur[e.type]),{},{type:e.type}):e.value===void 0?{type:"object",value:e}:(t=zi(e.value),ye(ye(ye({},e),Ur[t]),{},{type:t})):{type:"object",value:null};throw new Error("props")}function zi(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":ve(e)}var Ki,Wi;function qi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Yi=K(Ki||(Ki=qi([`#ifdef MODULE_LOGDEPTH
21
+ logdepth_adjustPosition(gl_Position);
22
+ #endif
23
+ `],[`\\
24
+ #ifdef MODULE_LOGDEPTH
25
+ logdepth_adjustPosition(gl_Position);
26
+ #endif
27
+ `]))),Xi=K(Wi||(Wi=qi([`#ifdef MODULE_MATERIAL
28
+ gl_FragColor = material_filterColor(gl_FragColor);
29
+ #endif
30
+
31
+ #ifdef MODULE_LIGHTING
32
+ gl_FragColor = lighting_filterColor(gl_FragColor);
33
+ #endif
34
+
35
+ #ifdef MODULE_FOG
36
+ gl_FragColor = fog_filterColor(gl_FragColor);
37
+ #endif
38
+
39
+ #ifdef MODULE_PICKING
40
+ gl_FragColor = picking_filterHighlightColor(gl_FragColor);
41
+ gl_FragColor = picking_filterPickingColor(gl_FragColor);
42
+ #endif
43
+
44
+ #ifdef MODULE_LOGDEPTH
45
+ logdepth_setFragDepth();
46
+ #endif
47
+ `],[`\\
48
+ #ifdef MODULE_MATERIAL
49
+ gl_FragColor = material_filterColor(gl_FragColor);
50
+ #endif
51
+
52
+ #ifdef MODULE_LIGHTING
53
+ gl_FragColor = lighting_filterColor(gl_FragColor);
54
+ #endif
55
+
56
+ #ifdef MODULE_FOG
57
+ gl_FragColor = fog_filterColor(gl_FragColor);
58
+ #endif
59
+
60
+ #ifdef MODULE_PICKING
61
+ gl_FragColor = picking_filterHighlightColor(gl_FragColor);
62
+ gl_FragColor = picking_filterPickingColor(gl_FragColor);
63
+ #endif
64
+
65
+ #ifdef MODULE_LOGDEPTH
66
+ logdepth_setFragDepth();
67
+ #endif
68
+ `])));var Uu={vertex:Yi,fragment:Xi},$i=/void\s+main\s*\([^)]*\)\s*\{\n?/,Zi=/}\n?[^{}]*$/,Gr=[],pt="__LUMA_INJECT_DECLARATIONS__";function Ji(e){var t={vertex:{},fragment:{}};for(var r in e){var n=e[r],i=Gu(r);typeof n=="string"&&(n={order:0,injection:n}),t[i][r]=n}return t}function Gu(e){var t=e.slice(0,2);switch(t){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(t)}}function mt(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=t==="vertex",o=function(){var s=r[a];s.sort(function(g,w){return g.order-w.order}),Gr.length=s.length;for(var l=0,p=s.length;l<p;++l)Gr[l]=s[l].injection;var y="".concat(Gr.join(`
69
+ `),`
70
+ `);switch(a){case"vs:#decl":i&&(e=e.replace(pt,y));break;case"vs:#main-start":i&&(e=e.replace($i,function(g){return g+y}));break;case"vs:#main-end":i&&(e=e.replace(Zi,function(g){return y+g}));break;case"fs:#decl":i||(e=e.replace(pt,y));break;case"fs:#main-start":i||(e=e.replace($i,function(g){return g+y}));break;case"fs:#main-end":i||(e=e.replace(Zi,function(g){return y+g}));break;default:e=e.replace(a,function(g){return g+y})}};for(var a in r)o();return e=e.replace(pt,""),n&&(e=e.replace(/\}\s*$/,function(f){return f+Uu[t]})),e}function dt(e){return dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(e)}function Qi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zu(n.key),n)}}function Bu(e,t,r){return t&&Qi(e.prototype,t),r&&Qi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zu(e){var t=ku(e,"string");return dt(t)==="symbol"?t:String(t)}function ku(e,t){if(dt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(dt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Hu=1,Kt=function(){e.instantiateModules=function(n){return n.map(function(i){if(i instanceof e)return i;ie(typeof i!="string","Shader module use by name is deprecated. Import shader module '".concat(JSON.stringify(i),"' and use it directly.")),i.name||(console.warn("shader module has no name"),i.name="shader-module-".concat(Hu++));var o=new e(i);return o.dependencies=e.instantiateModules(i.dependencies||[]),o})};function e(r){Vu(this,e),this.name=void 0,this.vs=void 0,this.fs=void 0,this.getModuleUniforms=void 0,this.dependencies=void 0,this.deprecations=void 0,this.defines=void 0,this.injections=void 0,this.uniforms={},this.uniformTypes={};var n=r.name,i=r.vs,o=r.fs,a=r.dependencies,f=a===void 0?[]:a,s=r.uniformPropTypes,l=s===void 0?{}:s,p=r.getUniforms,y=r.deprecations,g=y===void 0?[]:y,w=r.defines,b=w===void 0?{}:w,_=r.inject,x=_===void 0?{}:_;ie(typeof n=="string"),this.name=n,this.vs=i,this.fs=o,this.getModuleUniforms=p,this.dependencies=e.instantiateModules(f),this.deprecations=this._parseDeprecationDefinitions(g),this.defines=b,this.injections=Ji(x),l&&(this.uniforms=Vi(l))}var t=e.prototype;return t.getModuleSource=function(n){var i;switch(n){case"vertex":i=this.vs||"";break;case"fragment":i=this.fs||"";break;default:ie(!1)}var o=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return"// ----- MODULE ".concat(this.name,` ---------------
71
+
72
+ #define MODULE_`).concat(o,`
73
+ `).concat(i,`
74
+
75
+ `)},t.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):Hi(n,this.uniforms,this.name)},t.getDefines=function(){return this.defines},t.checkDeprecations=function(n,i){this.deprecations.forEach(function(o){var a;(a=o.regex)!==null&&a!==void 0&&a.test(n)&&(o.deprecated?i.deprecated(o.old,o.new)():i.removed(o.old,o.new)())})},t._parseDeprecationDefinitions=function(n){return n.forEach(function(i){switch(i.type){case"function":i.regex=new RegExp("\\b".concat(i.old,"\\("));break;default:i.regex=new RegExp("".concat(i.type," ").concat(i.old,";"))}}),n},t._defaultGetUniforms=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={},o=this.uniforms;for(var a in o){var f=o[a];a in n&&!f.private?(f.validate&&ie(f.validate(n[a],f),"".concat(this.name,": invalid ").concat(a)),i[a]=n[a]):i[a]=f.value}return i},Bu(e)}();function eo(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ku(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
76
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Ku(e,t){if(e){if(typeof e=="string")return to(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return to(e,t)}}function to(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yt(e){var t=Kt.instantiateModules(e);return Wu(t)}function Wu(e){var t={},r={};return ro({modules:e,level:0,moduleMap:t,moduleDepth:r}),Object.keys(r).sort(function(n,i){return r[i]-r[n]}).map(function(n){return t[n]})}function ro(e){var t=e.modules,r=e.level,n=e.moduleMap,i=e.moduleDepth;if(r>=5)throw new Error("Possible loop in shader dependency graph");var o=eo(t),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;n[f.name]=f,(i[f.name]===void 0||i[f.name]<r)&&(i[f.name]=r)}}catch(y){o.e(y)}finally{o.f()}var s=eo(t),l;try{for(s.s();!(l=s.n()).done;){var p=l.value;p.dependencies&&ro({modules:p.dependencies,level:r+1,moduleMap:n,moduleDepth:i})}}catch(y){s.e(y)}finally{s.f()}}var no,io,oo,ao,so,fo,co,uo,lo,ho;function oe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function po(e){switch(e?.gpu.toLowerCase()){case"apple":return K(no||(no=oe([`#define APPLE_GPU
77
+ // Apple optimizes away the calculation necessary for emulated fp64
78
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
79
+ #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
80
+ // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
81
+ #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
82
+ `],[`\\
83
+ #define APPLE_GPU
84
+ // Apple optimizes away the calculation necessary for emulated fp64
85
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
86
+ #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
87
+ // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
88
+ #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
89
+ `])));case"nvidia":return K(io||(io=oe([`#define NVIDIA_GPU
90
+ // Nvidia optimizes away the calculation necessary for emulated fp64
91
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
92
+ `],[`\\
93
+ #define NVIDIA_GPU
94
+ // Nvidia optimizes away the calculation necessary for emulated fp64
95
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
96
+ `])));case"intel":return K(oo||(oo=oe([`#define INTEL_GPU
97
+ // Intel optimizes away the calculation necessary for emulated fp64
98
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
99
+ // Intel's built-in 'tan' function doesn't have acceptable precision
100
+ #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
101
+ // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
102
+ #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
103
+ `],[`\\
104
+ #define INTEL_GPU
105
+ // Intel optimizes away the calculation necessary for emulated fp64
106
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
107
+ // Intel's built-in 'tan' function doesn't have acceptable precision
108
+ #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
109
+ // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
110
+ #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
111
+ `])));case"amd":return K(ao||(ao=oe([`#define AMD_GPU
112
+ `],[`\\
113
+ #define AMD_GPU
114
+ `])));default:return K(so||(so=oe([`#define DEFAULT_GPU
115
+ // Prevent driver from optimizing away the calculation necessary for emulated fp64
116
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
117
+ // Headless Chrome's software shader 'tan' function doesn't have acceptable precision
118
+ #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
119
+ // If the GPU doesn't have full 32 bits precision, will causes overflow
120
+ #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
121
+ `],[`\\
122
+ #define DEFAULT_GPU
123
+ // Prevent driver from optimizing away the calculation necessary for emulated fp64
124
+ #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
125
+ // Headless Chrome's software shader 'tan' function doesn't have acceptable precision
126
+ #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
127
+ // If the GPU doesn't have full 32 bits precision, will causes overflow
128
+ #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
129
+ `])))}}function mo(e){var t="";return e.features.has("webgl2")&&(t+=K(fo||(fo=oe([`# define FEATURE_GLSL_DERIVATIVES
130
+ # define FEATURE_GLSL_DRAW_BUFFERS
131
+ # define FEATURE_GLSL_FRAG_DEPTH
132
+ # define FEATURE_GLSL_TEXTURE_LOD
133
+ `],[`\\
134
+ # define FEATURE_GLSL_DERIVATIVES
135
+ # define FEATURE_GLSL_DRAW_BUFFERS
136
+ # define FEATURE_GLSL_FRAG_DEPTH
137
+ # define FEATURE_GLSL_TEXTURE_LOD
138
+ `])))),e.features.has("webgl2")||(e.features.has("glsl-frag-depth")&&(t+=K(co||(co=oe([`
139
+ // FEATURE_GLSL_FRAG_DEPTH => gl_FragDepth is available
140
+ #ifdef GL_EXT_frag_depth
141
+ # extension GL_EXT_frag_depth : enable
142
+ # define FEATURE_GLSL_FRAG_DEPTH
143
+ # define FRAG_DEPTH
144
+ # define gl_FragDepth gl_FragDepthEXT
145
+ #endif
146
+ `],[`\\
147
+
148
+ // FEATURE_GLSL_FRAG_DEPTH => gl_FragDepth is available
149
+ #ifdef GL_EXT_frag_depth
150
+ # extension GL_EXT_frag_depth : enable
151
+ # define FEATURE_GLSL_FRAG_DEPTH
152
+ # define FRAG_DEPTH
153
+ # define gl_FragDepth gl_FragDepthEXT
154
+ #endif
155
+ `])))),e!=null&&e.features.has("glsl-derivatives")&&(t+=K(uo||(uo=oe([`
156
+ // FEATURE_GLSL_DERIVATIVES => dxdF, dxdY and fwidth are available
157
+ #if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
158
+ # extension GL_OES_standard_derivatives : enable
159
+ # define FEATURE_GLSL_DERIVATIVES
160
+ #endif
161
+ `],[`\\
162
+
163
+ // FEATURE_GLSL_DERIVATIVES => dxdF, dxdY and fwidth are available
164
+ #if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
165
+ # extension GL_OES_standard_derivatives : enable
166
+ # define FEATURE_GLSL_DERIVATIVES
167
+ #endif
168
+ `])))),e!=null&&e.features.has("glsl-frag-data")&&(t+=K(lo||(lo=oe([`
169
+ // FEATURE_GLSL_DRAW_BUFFERS => gl_FragData[] is available
170
+ #ifdef GL_EXT_draw_buffers
171
+ # extension GL_EXT_draw_buffers : require
172
+ # define FEATURE_GLSL_DRAW_BUFFERS
173
+ #endif
174
+ `],[`\\
175
+
176
+ // FEATURE_GLSL_DRAW_BUFFERS => gl_FragData[] is available
177
+ #ifdef GL_EXT_draw_buffers
178
+ # extension GL_EXT_draw_buffers : require
179
+ # define FEATURE_GLSL_DRAW_BUFFERS
180
+ #endif
181
+ `])))),e!=null&&e.features.has("glsl-texture-lod")&&(t+=K(ho||(ho=oe([`// TEXTURE_LOD => texture2DLod etc are available
182
+ #ifdef GL_EXT_shader_texture_lod
183
+ # extension GL_EXT_shader_texture_lod : enable
184
+ # define FEATURE_GLSL_TEXTURE_LOD
185
+ # define TEXTURE_LOD
186
+ #endif
187
+ `],[`\\
188
+ // TEXTURE_LOD => texture2DLod etc are available
189
+ #ifdef GL_EXT_shader_texture_lod
190
+ # extension GL_EXT_shader_texture_lod : enable
191
+ # define FEATURE_GLSL_TEXTURE_LOD
192
+ # define TEXTURE_LOD
193
+ #endif
194
+ `]))))),t}function qu(e,t){return $u(e)||Xu(e,t)||go(e,t)||Yu()}function Yu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
195
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function $u(e){if(Array.isArray(e))return e}function Zu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=go(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
196
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function go(e,t){if(e){if(typeof e=="string")return yo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yo(e,t)}}function yo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bo(e,t,r){var n,i=Number(((n=e.match(/^#version[ \t]+(\d+)/m))===null||n===void 0?void 0:n[1])||100);if(i!==300)throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(t){case 300:switch(r){case"vertex":return e=vt(e,Ju),e;case"fragment":return e=vt(e,Qu),e;default:throw new Error(r)}case 100:switch(r){case"vertex":return e=vt(e,el),e;case"fragment":return e=vt(e,Oo),e=rl(e),e;default:throw new Error(r)}default:throw new Error(String(t))}}var wo=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
197
+ `],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],Ju=[].concat(wo,[[Ge("attribute"),"in $1"],[Ge("varying"),"out $1"]]),Qu=[].concat(wo,[[Ge("varying"),"in $1"]]),_o=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],el=[].concat(_o,[[Ge("in"),"attribute $1"],[Ge("out"),"varying $1"]]),Oo=[].concat(_o,[[Ge("in"),"varying $1"]]),tl="gl_FragColor",vo=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/;function vt(e,t){var r=Zu(t),n;try{for(r.s();!(n=r.n()).done;){var i=qu(n.value,2),o=i[0],a=i[1];e=e.replace(o,a)}}catch(f){r.e(f)}finally{r.f()}return e}function rl(e){e=vt(e,Oo);var t=vo.exec(e);if(t){var r=t[1];e=e.replace(vo,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),tl)}return e}function Ge(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}function nl(e,t){return al(e)||ol(e,t)||xo(e,t)||il()}function il(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
198
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ol(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function al(e){if(Array.isArray(e))return e}function Po(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=xo(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
199
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function xo(e,t){if(e){if(typeof e=="string")return So(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return So(e,t)}}function So(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Br(e,t){var r="";for(var n in e){var i=e[n];if(r+="void ".concat(i.signature,` {
200
+ `),i.header&&(r+=" ".concat(i.header)),t[n]){var o=t[n];o.sort(function(l,p){return l.order-p.order});var a=Po(o),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;r+=" ".concat(s.injection,`
201
+ `)}}catch(l){a.e(l)}finally{a.f()}}i.footer&&(r+=" ".concat(i.footer)),r+=`}
202
+ `}return r}function zr(e){var t={vertex:{},fragment:{}},r=Po(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=void 0,a=void 0;typeof i!="string"?(o=i,a=o.hook):(o={},a=i),a=a.trim();var f=a.split(":"),s=nl(f,2),l=s[0],p=s[1],y=a.replace(/\(.+/,""),g=Object.assign(o,{signature:p});switch(l){case"vs":t.vertex[y]=g;break;case"fs":t.fragment[y]=g;break;default:throw new Error(l)}}}catch(w){r.e(w)}finally{r.f()}return t}function Eo(e,t){return{name:sl(e,t),language:"glsl",version:fl(e)}}function sl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=r.exec(e);return n?n[1]:t}function fl(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}if(t!==100&&t!==300)throw new Error("Invalid GLSL version ".concat(t));return t}function gt(e){return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(e)}var Ao;function kr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=cl(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
203
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function cl(e,t){if(e){if(typeof e=="string")return To(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return To(e,t)}}function To(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mo(Object(r),!0).forEach(function(n){ul(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ul(e,t,r){return t=ll(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ll(e){var t=hl(e,"string");return gt(t)==="symbol"?t:String(t)}function hl(e,t){if(gt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Io=`
204
+
205
+ `.concat(pt,`
206
+ `),ml=K(Ao||(Ao=pl([`precision highp float;
207
+ `],[`\\
208
+ precision highp float;
209
+ `])));function Do(e){var t=e.vs,r=e.fs,n=yt(e.modules||[]);switch(e.platformInfo.shaderLanguage){case"glsl":return{vs:Lo(e.platformInfo,ge(ge({},e),{},{source:t,stage:"vertex",modules:n})),fs:Lo(e.platformInfo,ge(ge({},e),{},{source:r,stage:"fragment",modules:n})),getUniforms:jo(n)};case"wgsl":return{vs:Ro(e.platformInfo,ge(ge({},e),{},{source:t,stage:"vertex",modules:n})),fs:Ro(e.platformInfo,ge(ge({},e),{},{source:r,stage:"fragment",modules:n})),getUniforms:jo(n)}}}function Ro(e,t){var r=t.source,n=t.stage,i=t.modules,o=t.defines,a=o===void 0?{}:o,f=t.hookFunctions,s=f===void 0?[]:f,l=t.inject,p=l===void 0?{}:l,y=t.log;ie(typeof r=="string","shader source must be a string");var g=r,w={};i.forEach(function(d){Object.assign(w,d.getDefines())}),Object.assign(w,a);var b="",_=zr(s),x={},S={},R={};for(var E in p){var T=typeof p[E]=="string"?{injection:p[E],order:0}:p[E],M=/^(v|f)s:(#)?([\w-]+)$/.exec(E);if(M){var L=M[2],I=M[3];L?I==="decl"?S[E]=[T]:R[E]=[T]:x[E]=[T]}else R[E]=[T]}var D=kr(i),F;try{for(D.s();!(F=D.n()).done;){var N=F.value;y&&N.checkDeprecations(g,y);var C=N.getModuleSource(n,"wgsl");b+=C;var h=N.injections[n];for(var c in h){var u=/^(v|f)s:#([\w-]+)$/.exec(c);if(u){var m=u[2],v=m==="decl"?S:R;v[c]=v[c]||[],v[c].push(h[c])}else x[c]=x[c]||[],x[c].push(h[c])}}}catch(d){D.e(d)}finally{D.f()}return b+=Io,b=mt(b,n,S),b+=Br(_[n],x),b+=g,b=mt(b,n,R),b}function Lo(e,t){var r=t.id,n=t.source,i=t.stage,o=t.language,a=o===void 0?"glsl":o,f=t.modules,s=t.defines,l=s===void 0?{}:s,p=t.hookFunctions,y=p===void 0?[]:p,g=t.inject,w=g===void 0?{}:g,b=t.prologue,_=b===void 0?!0:b,x=t.log;ie(typeof n=="string","shader source must be a string");var S=a==="glsl"?Eo(n).version:-1,R=e.shaderLanguageVersion,E=S===100?"#version 100":"#version 300 es",T=n.split(`
210
+ `),M=T.slice(1).join(`
211
+ `),L={};f.forEach(function(H){Object.assign(L,H.getDefines())}),Object.assign(L,l);var I="";switch(a){case"wgsl":break;case"glsl":I=_?"".concat(E,`
212
+
213
+ // ----- PROLOGUE -------------------------
214
+ `).concat(dl({id:r,source:n,stage:i}),`
215
+ `,"#define SHADER_TYPE_".concat(i.toUpperCase()),`
216
+ `).concat(po(e),`
217
+ `).concat(mo(e),`
218
+ `).concat(i==="fragment"?ml:"",`
219
+
220
+ // ----- APPLICATION DEFINES -------------------------
221
+
222
+ `).concat(yl(L),`
223
+
224
+ `):"".concat(E,`
225
+ `);break}var D=zr(y),F={},N={},C={};for(var h in w){var c=typeof w[h]=="string"?{injection:w[h],order:0}:w[h],u=/^(v|f)s:(#)?([\w-]+)$/.exec(h);if(u){var m=u[2],v=u[3];m?v==="decl"?N[h]=[c]:C[h]=[c]:F[h]=[c]}else C[h]=[c]}var d=kr(f),O;try{for(d.s();!(O=d.n()).done;){var P=O.value;x&&P.checkDeprecations(M,x);var A=P.getModuleSource(i);I+=A;var U=P.injections[i];for(var j in U){var G=/^(v|f)s:#([\w-]+)$/.exec(j);if(G){var ne=G[2],Q=ne==="decl"?N:C;Q[j]=Q[j]||[],Q[j].push(U[j])}else F[j]=F[j]||[],F[j].push(U[j])}}}catch(H){d.e(H)}finally{d.f()}return I+="// ----- MAIN SHADER SOURCE -------------------------",I+=Io,I=mt(I,i,N),I+=Br(D[i],F),I+=M,I=mt(I,i,C),a==="glsl"&&S!==R&&(I=bo(I,R,i)),I.trim()}function jo(e){return function(r){var n={},i=kr(e),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=a.getUniforms(r,n);Object.assign(n,f)}}catch(s){i.e(s)}finally{i.f()}return n}}function dl(e){var t=e.id,r=e.source,n=e.stage,i=t&&r.indexOf("SHADER_NAME")===-1;return i?`
226
+ #define SHADER_NAME `.concat(t,"_").concat(n,`
227
+
228
+ `):""}function yl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t="";for(var r in e){var n=e[r];(n||Number.isFinite(n))&&(t+="#define ".concat(r.toUpperCase()," ").concat(e[r],`
229
+ `))}return t}function bt(e){return bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(e)}function No(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?No(Object(r),!0).forEach(function(n){vl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):No(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vl(e,t,r){return t=gl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gl(e){var t=bl(e,"string");return bt(t)==="symbol"?t:String(t)}function bl(e,t){if(bt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uo(e){if(!e.vs)throw new Error("no vertex shader");var t=Fo(e.platformInfo,e.vs),r;return e.fs&&(r=Fo(e.platformInfo,e.fs)),Co(Co({},e),{},{vs:t,fs:r})}function Fo(e,t){if(typeof t=="string")return t;switch(e.type){case"webgpu":if(t!=null&&t.wgsl)return t.wgsl;throw new Error("WebGPU does not support GLSL shaders");default:if(t!=null&&t.glsl)return t.glsl;throw new Error("WebGL does not support WGSL shaders")}}function wt(e){return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(e)}function Go(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Go(Object(r),!0).forEach(function(n){wl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Go(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wl(e,t,r){return t=zo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zo(n.key),n)}}function _l(e,t,r){return t&&Bo(e.prototype,t),r&&Bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zo(e){var t=Ol(e,"string");return wt(t)==="symbol"?t:String(t)}function Ol(e,t){if(wt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var qt=function(){function e(){Sl(this,e),this._hookFunctions=[],this._defaultModules=[]}e.getDefaultShaderAssembler=function(){return e.defaultShaderAssembler=e.defaultShaderAssembler||new e,e.defaultShaderAssembler};var t=e.prototype;return t.addDefaultModule=function(n){this._defaultModules.find(function(i){return i.name===(typeof n=="string"?n:n.name)})||this._defaultModules.push(n)},t.removeDefaultModule=function(n){var i=typeof n=="string"?n:n.name;this._defaultModules=this._defaultModules.filter(function(o){return o.name!==i})},t.addShaderHook=function(n,i){i&&(n=Object.assign(i,{hook:n})),this._hookFunctions.push(n)},t.assembleShaders=function(n){var i=this._getModuleList(n.modules),o=this._hookFunctions,a=Uo(n),f=Do(Wt(Wt({platformInfo:n.platformInfo},a),{},{modules:i,hookFunctions:o}));return Wt(Wt({},f),{},{modules:i})},t._getModuleList=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=new Array(this._defaultModules.length+n.length),o={},a=0,f=0,s=this._defaultModules.length;f<s;++f){var l=this._defaultModules[f],p=l.name;i[a++]=l,o[p]=!0}for(var y=0,g=n.length;y<g;++y){var w=n[y],b=w.name;o[b]||(i[a++]=w,o[b]=!0)}return i.length=a,Kt.instantiateModules(i)},_l(e)}();qt.defaultShaderAssembler=void 0;var ko,Vo;function Ho(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Pl=K(ko||(ko=Ho(["void main() {gl_FragColor = vec4(0);}"]))),Ko=K(Vo||(Vo=Ho([`out vec4 transform_output;
230
+ void main() {
231
+ transform_output = vec4(0);
232
+ }`],[`\\
233
+ out vec4 transform_output;
234
+ void main() {
235
+ transform_output = vec4(0);
236
+ }`]))),xl=`#version 300 es
237
+ `.concat(Ko);function _t(e){var t=e||{},r=t.version,n=r===void 0?100:r,i=t.input,o=t.inputChannels,a=t.output;if(!i)return n===300?xl:n>300?"#version ".concat(n,`
238
+ `).concat(Ko):Pl;if(!o)throw new Error("inputChannels");var f=El(o),s=Wo(i,o);return n>=300?"#version ".concat(n," ").concat(n===300?"es":"",`
239
+ in `).concat(f," ").concat(i,`;
240
+ out vec4 `).concat(a,`;
241
+ void main() {
242
+ `).concat(a," = ").concat(s,`;
243
+ }`):"varying ".concat(f," ").concat(i,`;
244
+ void main() {
245
+ gl_FragColor = `).concat(s,`;
246
+ }`)}function El(e){switch(e){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error("invalid channels: ".concat(e))}}function Wo(e,t){switch(t){case 1:return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case 2:return"vec4(".concat(e,", 0.0, 1.0)");case 3:return"vec4(".concat(e,", 1.0)");case 4:return e;default:throw new Error("invalid channels: ".concat(t))}}var cg=1/Math.PI*180,ug=1/180*Math.PI,Al={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Al}};var q=globalThis.mathgl.config;function qo(e,{precision:t=q.precision}={}){return e=Tl(e),"".concat(parseFloat(e.toPrecision(t)))}function Be(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Vr(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if(Be(e)&&Be(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Vr(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function Tl(e){return Math.round(e/q.EPSILON)*q.EPSILON}function Ml(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var ze=class extends Ml(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Be(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+qo(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Vr(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let o=t[i],a=typeof r=="number"?r:r[i];this[i]=o+n*(a-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(q.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function Rl(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Y(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Yt(e,t,r=""){if(q.debug&&!Rl(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function Hr(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var Xt=class extends ze{get x(){return this[0]}set x(t){this[0]=Y(t)}get y(){return this[1]}set y(t){this[1]=Y(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Y(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Y(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Hr(t>=0&&t<this.ELEMENTS,"index is out of range"),Y(this[t])}setComponent(t,r){return Hr(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var ce=typeof Float32Array<"u"?Float32Array:Array;var _g=Math.PI/180;function Ll(){let e=new ce(2);return ce!=Float32Array&&(e[0]=0,e[1]=0),e}function $o(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var Og=function(){let e=Ll();return function(t,r,n,i,o,a){let f,s;for(r||(r=2),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],o(e,e,a),t[f]=e[0],t[f+1]=e[1];return t}}();function Zo(e,t,r){let n=t[0],i=t[1],o=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/o,e[1]=(r[1]*n+r[5]*i)/o,e}function $t(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o||1;return e[0]=(r[0]*n+r[4]*i+r[8]*o)/a,e[1]=(r[1]*n+r[5]*i+r[9]*o)/a,e[2]=(r[2]*n+r[6]*i+r[10]*o)/a,e}function Jo(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function jl(){let e=new ce(3);return ce!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Il(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Qo(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[0],f=r[1],s=r[2];return e[0]=i*s-o*f,e[1]=o*a-n*s,e[2]=n*f-i*a,e}function Zt(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,e}function ea(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function ta(e,t,r){let n=r[0],i=r[1],o=r[2],a=r[3],f=t[0],s=t[1],l=t[2],p=i*l-o*s,y=o*f-n*l,g=n*s-i*f,w=i*g-o*y,b=o*p-n*g,_=n*y-i*p,x=a*2;return p*=x,y*=x,g*=x,w*=2,b*=2,_*=2,e[0]=f+p+w,e[1]=s+y+b,e[2]=l+g+_,e}function ra(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function na(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function ia(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function oa(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],a=t[1],f=t[2],s=Math.sqrt((r*r+n*n+i*i)*(o*o+a*a+f*f)),l=s&&Il(e,t)/s;return Math.acos(Math.min(Math.max(l,-1),1))}var xg=function(){let e=jl();return function(t,r,n,i,o,a){let f,s;for(r||(r=3),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],e[2]=t[f+2],o(e,e,a),t[f]=e[0],t[f+1]=e[1],t[f+2]=e[2];return t}}();var Wr=[0,0,0],Jt,$=class extends Xt{static get ZERO(){return Jt||(Jt=new $(0,0,0),Object.freeze(Jt)),Jt}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Be(t)?this.copy(t):(q.debug&&(Y(t),Y(r),Y(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return q.debug&&(Y(t.x),Y(t.y),Y(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Y(t)}angle(t){return oa(this,t)}cross(t){return Qo(this,this,t),this.check()}rotateX({radians:t,origin:r=Wr}){return ra(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Wr}){return na(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Wr}){return ia(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Zt(this,this,t),this.check()}transformAsVector(t){return $t(this,this,t),this.check()}transformByMatrix3(t){return ea(this,this,t),this.check()}transformByMatrix2(t){return Jo(this,this,t),this.check()}transformByQuaternion(t){return ta(this,this,t),this.check()}};var Qt=class extends ze{toString(){let t="[";if(q.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Y(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function Dl(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function aa(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],a=t[7],f=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=f}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function sa(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],f=t[5],s=t[6],l=t[7],p=t[8],y=t[9],g=t[10],w=t[11],b=t[12],_=t[13],x=t[14],S=t[15],R=r*f-n*a,E=r*s-i*a,T=r*l-o*a,M=n*s-i*f,L=n*l-o*f,I=i*l-o*s,D=p*_-y*b,F=p*x-g*b,N=p*S-w*b,C=y*x-g*_,h=y*S-w*_,c=g*S-w*x,u=R*c-E*h+T*C+M*N-L*F+I*D;return u?(u=1/u,e[0]=(f*c-s*h+l*C)*u,e[1]=(i*h-n*c-o*C)*u,e[2]=(_*I-x*L+S*M)*u,e[3]=(g*L-y*I-w*M)*u,e[4]=(s*N-a*c-l*F)*u,e[5]=(r*c-i*N+o*F)*u,e[6]=(x*T-b*I-S*E)*u,e[7]=(p*I-g*T+w*E)*u,e[8]=(a*h-f*N+l*D)*u,e[9]=(n*N-r*h-o*D)*u,e[10]=(b*L-_*T+S*R)*u,e[11]=(y*T-p*L-w*R)*u,e[12]=(f*F-a*C-s*D)*u,e[13]=(r*C-n*F+i*D)*u,e[14]=(_*E-b*M-x*R)*u,e[15]=(p*M-y*E+g*R)*u,e):null}function fa(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],f=e[6],s=e[7],l=e[8],p=e[9],y=e[10],g=e[11],w=e[12],b=e[13],_=e[14],x=e[15],S=t*a-r*o,R=t*f-n*o,E=r*f-n*a,T=l*b-p*w,M=l*_-y*w,L=p*_-y*b,I=t*L-r*M+n*T,D=o*L-a*M+f*T,F=l*E-p*R+y*S,N=w*E-b*R+_*S;return s*I-i*D+x*F-g*N}function qr(e,t,r){let n=t[0],i=t[1],o=t[2],a=t[3],f=t[4],s=t[5],l=t[6],p=t[7],y=t[8],g=t[9],w=t[10],b=t[11],_=t[12],x=t[13],S=t[14],R=t[15],E=r[0],T=r[1],M=r[2],L=r[3];return e[0]=E*n+T*f+M*y+L*_,e[1]=E*i+T*s+M*g+L*x,e[2]=E*o+T*l+M*w+L*S,e[3]=E*a+T*p+M*b+L*R,E=r[4],T=r[5],M=r[6],L=r[7],e[4]=E*n+T*f+M*y+L*_,e[5]=E*i+T*s+M*g+L*x,e[6]=E*o+T*l+M*w+L*S,e[7]=E*a+T*p+M*b+L*R,E=r[8],T=r[9],M=r[10],L=r[11],e[8]=E*n+T*f+M*y+L*_,e[9]=E*i+T*s+M*g+L*x,e[10]=E*o+T*l+M*w+L*S,e[11]=E*a+T*p+M*b+L*R,E=r[12],T=r[13],M=r[14],L=r[15],e[12]=E*n+T*f+M*y+L*_,e[13]=E*i+T*s+M*g+L*x,e[14]=E*o+T*l+M*w+L*S,e[15]=E*a+T*p+M*b+L*R,e}function ca(e,t,r){let n=r[0],i=r[1],o=r[2],a,f,s,l,p,y,g,w,b,_,x,S;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(a=t[0],f=t[1],s=t[2],l=t[3],p=t[4],y=t[5],g=t[6],w=t[7],b=t[8],_=t[9],x=t[10],S=t[11],e[0]=a,e[1]=f,e[2]=s,e[3]=l,e[4]=p,e[5]=y,e[6]=g,e[7]=w,e[8]=b,e[9]=_,e[10]=x,e[11]=S,e[12]=a*n+p*i+b*o+t[12],e[13]=f*n+y*i+_*o+t[13],e[14]=s*n+g*i+x*o+t[14],e[15]=l*n+w*i+S*o+t[15]),e}function ua(e,t,r){let n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t,r,n){let i=n[0],o=n[1],a=n[2],f=Math.sqrt(i*i+o*o+a*a),s,l,p,y,g,w,b,_,x,S,R,E,T,M,L,I,D,F,N,C,h,c,u,m;return f<1e-6?null:(f=1/f,i*=f,o*=f,a*=f,l=Math.sin(r),s=Math.cos(r),p=1-s,y=t[0],g=t[1],w=t[2],b=t[3],_=t[4],x=t[5],S=t[6],R=t[7],E=t[8],T=t[9],M=t[10],L=t[11],I=i*i*p+s,D=o*i*p+a*l,F=a*i*p-o*l,N=i*o*p-a*l,C=o*o*p+s,h=a*o*p+i*l,c=i*a*p+o*l,u=o*a*p-i*l,m=a*a*p+s,e[0]=y*I+_*D+E*F,e[1]=g*I+x*D+T*F,e[2]=w*I+S*D+M*F,e[3]=b*I+R*D+L*F,e[4]=y*N+_*C+E*h,e[5]=g*N+x*C+T*h,e[6]=w*N+S*C+M*h,e[7]=b*N+R*C+L*h,e[8]=y*c+_*u+E*m,e[9]=g*c+x*u+T*m,e[10]=w*c+S*u+M*m,e[11]=b*c+R*u+L*m,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ha(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],f=t[6],s=t[7],l=t[8],p=t[9],y=t[10],g=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+l*n,e[5]=a*i+p*n,e[6]=f*i+y*n,e[7]=s*i+g*n,e[8]=l*i-o*n,e[9]=p*i-a*n,e[10]=y*i-f*n,e[11]=g*i-s*n,e}function pa(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],f=t[2],s=t[3],l=t[8],p=t[9],y=t[10],g=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-l*n,e[1]=a*i-p*n,e[2]=f*i-y*n,e[3]=s*i-g*n,e[8]=o*n+l*i,e[9]=a*n+p*i,e[10]=f*n+y*i,e[11]=s*n+g*i,e}function ma(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],f=t[2],s=t[3],l=t[4],p=t[5],y=t[6],g=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+l*n,e[1]=a*i+p*n,e[2]=f*i+y*n,e[3]=s*i+g*n,e[4]=l*i-o*n,e[5]=p*i-a*n,e[6]=y*i-f*n,e[7]=g*i-s*n,e}function da(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,f=n+n,s=i+i,l=r*a,p=n*a,y=n*f,g=i*a,w=i*f,b=i*s,_=o*a,x=o*f,S=o*s;return e[0]=1-y-b,e[1]=p+S,e[2]=g-x,e[3]=0,e[4]=p-S,e[5]=1-l-b,e[6]=w+_,e[7]=0,e[8]=g+x,e[9]=w-_,e[10]=1-l-y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ya(e,t,r,n,i,o,a){let f=1/(r-t),s=1/(i-n),l=1/(o-a);return e[0]=o*2*f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*s,e[6]=0,e[7]=0,e[8]=(r+t)*f,e[9]=(i+n)*s,e[10]=(a+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*l,e[15]=0,e}function Nl(e,t,r,n,i){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let a=1/(n-i);e[10]=(i+n)*a,e[14]=2*i*n*a}else e[10]=-1,e[14]=-2*n;return e}var va=Nl;function Cl(e,t,r,n,i,o,a){let f=1/(t-r),s=1/(n-i),l=1/(o-a);return e[0]=-2*f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+r)*f,e[13]=(i+n)*s,e[14]=(a+o)*l,e[15]=1,e}var ga=Cl;function ba(e,t,r,n){let i,o,a,f,s,l,p,y,g,w,b=t[0],_=t[1],x=t[2],S=n[0],R=n[1],E=n[2],T=r[0],M=r[1],L=r[2];return Math.abs(b-T)<1e-6&&Math.abs(_-M)<1e-6&&Math.abs(x-L)<1e-6?Dl(e):(y=b-T,g=_-M,w=x-L,i=1/Math.sqrt(y*y+g*g+w*w),y*=i,g*=i,w*=i,o=R*w-E*g,a=E*y-S*w,f=S*g-R*y,i=Math.sqrt(o*o+a*a+f*f),i?(i=1/i,o*=i,a*=i,f*=i):(o=0,a=0,f=0),s=g*f-w*a,l=w*o-y*f,p=y*a-g*o,i=Math.sqrt(s*s+l*l+p*p),i?(i=1/i,s*=i,l*=i,p*=i):(s=0,l=0,p=0),e[0]=o,e[1]=s,e[2]=y,e[3]=0,e[4]=a,e[5]=l,e[6]=g,e[7]=0,e[8]=f,e[9]=p,e[10]=w,e[11]=0,e[12]=-(o*b+a*_+f*x),e[13]=-(s*b+l*_+p*x),e[14]=-(y*b+g*_+w*x),e[15]=1,e)}function Fl(){let e=new ce(4);return ce!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function wa(e,t,r){let n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e}var Ug=function(){let e=Fl();return function(t,r,n,i,o,a){let f,s;for(r||(r=4),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],e[2]=t[f+2],e[3]=t[f+3],o(e,e,a),t[f]=e[0],t[f+1]=e[1],t[f+2]=e[2],t[f+3]=e[3];return t}}();var $r;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})($r||($r={}));var Ul=45*Math.PI/180,Gl=1,Yr=.1,Xr=500,Bl=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),re=class extends Qt{static get IDENTITY(){return kl()}static get ZERO(){return zl()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return $r}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,o,a,f,s,l,p,y,g,w,b,_,x){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=a,this[6]=f,this[7]=s,this[8]=l,this[9]=p,this[10]=y,this[11]=g,this[12]=w,this[13]=b,this[14]=_,this[15]=x,this.check()}setRowMajor(t,r,n,i,o,a,f,s,l,p,y,g,w,b,_,x){return this[0]=t,this[1]=o,this[2]=l,this[3]=w,this[4]=r,this[5]=a,this[6]=p,this[7]=b,this[8]=n,this[9]=f,this[10]=y,this[11]=_,this[12]=i,this[13]=s,this[14]=g,this[15]=x,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(Bl)}fromObject(t){return this.check()}fromQuaternion(t){return da(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:o,near:a=Yr,far:f=Xr}=t;return f===1/0?Vl(this,r,n,i,o,a):ya(this,r,n,i,o,a,f),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return ba(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:a=Yr,far:f=Xr}=t;return ga(this,r,n,i,o,a,f),this.check()}orthographic(t){let{fovy:r=Ul,aspect:n=Gl,focalDistance:i=1,near:o=Yr,far:a=Xr}=t;_a(r);let f=r/2,s=i*Math.tan(f),l=s*n;return this.ortho({left:-l,right:l,bottom:-s,top:s,near:o,far:a})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return _a(r),va(this,r,n,i,o),this.check()}determinant(){return fa(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],a=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*a,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*a,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],a=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*a,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*a,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*a,t}transpose(){return aa(this,this),this.check()}invert(){return sa(this,this),this.check()}multiplyLeft(t){return qr(this,t,this),this.check()}multiplyRight(t){return qr(this,this,t),this.check()}rotateX(t){return ha(this,this,t),this.check()}rotateY(t){return pa(this,this,t),this.check()}rotateZ(t){return ma(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return la(this,this,t,r),this.check()}scale(t){return ua(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return ca(this,this,t),this.check()}transform(t,r){return t.length===4?(r=wa(r||[-0,-0,-0,-0],t,this),Yt(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=$o(r||[-0,-0],t,this);break;case 3:i=Zt(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Yt(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=Zo(r||[-0,-0],t,this);break;case 3:n=$t(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Yt(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},er,tr;function zl(){return er||(er=new re([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(er)),er}function kl(){return tr||(tr=new re,Object.freeze(tr)),tr}function _a(e){if(e>Math.PI*2)throw Error("expected radians")}function Vl(e,t,r,n,i,o){let a=2*o/(r-t),f=2*o/(i-n),s=(r+t)/(r-t),l=(i+n)/(i-n),p=-1,y=-1,g=-2*o;return e[0]=a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=s,e[9]=l,e[10]=p,e[11]=y,e[12]=0,e[13]=0,e[14]=g,e[15]=0,e}function Ot(e){return Ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ot(e)}function Oa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oa(Object(r),!0).forEach(function(n){Hl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hl(e,t,r){return t=Ea(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kl(e,t){return Xl(e)||Yl(e,t)||ql(e,t)||Wl()}function Wl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
247
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ql(e,t){if(e){if(typeof e=="string")return Pa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pa(e,t)}}function Pa(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Yl(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Xl(e){if(Array.isArray(e))return e}function xa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ea(n.key),n)}}function $l(e,t,r){return t&&xa(e.prototype,t),r&&xa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ea(e){var t=Zl(e,"string");return Ot(t)==="symbol"?t:String(t)}function Zl(e,t){if(Ot(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ot(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var rr=function(){function e(r){Jl(this,e),this.modules=void 0,this.moduleUniforms=void 0,this.moduleBindings=void 0,this.moduleUniformsChanged=void 0;var n=yt(Object.values(r));B.log(1,"Creating ShaderInputs with modules",n.map(function(p){return p.name}))(),this.modules=r,this.moduleUniforms={},this.moduleBindings={};for(var i=0,o=Object.entries(r);i<o.length;i++){var a=Kl(o[i],2),f=a[0],s=a[1],l=f;this.moduleUniforms[l]=s.defaultUniforms||{},this.moduleBindings[l]={}}}var t=e.prototype;return t.destroy=function(){},t.setProps=function(n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a,f=o[i],s=f,l=n[s],p=this.modules[s],y=this.moduleUniforms[s],g=((a=p.getUniforms)===null||a===void 0?void 0:a.call(p,l,this.moduleUniforms[s]))||l;this.moduleUniforms[s]=Sa(Sa({},y),g)}},t.getModules=function(){return Object.values(this.modules)},t.getUniformValues=function(){return this.moduleUniforms},t.getBindings=function(){for(var n={},i=0,o=Object.values(this.moduleBindings);i<o.length;i++){var a=o[i];Object.assign(n,a)}return n},$l(e)}();function St(e){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(e)}function Ql(e,t){return nh(e)||rh(e,t)||th(e,t)||eh()}function eh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
248
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function th(e,t){if(e){if(typeof e=="string")return Aa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Aa(e,t)}}function Aa(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function nh(e){if(Array.isArray(e))return e}function Ta(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oh(n.key),n)}}function ih(e,t,r){return t&&Ta(e.prototype,t),r&&Ta(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function oh(e){var t=ah(e,"string");return St(t)==="symbol"?t:String(t)}function ah(e,t){if(St(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(St(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var nr=function(){function e(r){sh(this,e),this.id=void 0,this.userData={},this.topology=void 0,this.bufferLayout=[],this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.id=r.id||z("geometry"),this.topology=r.topology,this.indices=r.indices||null,this.attributes=r.attributes,this.vertexCount=r.vertexCount,this.bufferLayout=r.bufferLayout||[],this.indices&&W(this.indices.usage===k.INDEX)}var t=e.prototype;return t.destroy=function(){var n;this.indices.destroy(),this.attributes.positions.destroy(),this.attributes.normals.destroy(),this.attributes.texCoords.destroy(),(n=this.attributes.colors)===null||n===void 0||n.destroy()},t.getVertexCount=function(){return this.vertexCount},t.getAttributes=function(){return this.attributes},t.getIndexes=function(){return this.indices},t._calculateVertexCount=function(n){var i=n.byteLength/12;return i},ih(e)}();function Ma(e,t){if(t instanceof nr)return t;var r=fh(e,t),n=ch(e,t),i=n.attributes,o=n.bufferLayout;return new nr({topology:t.topology||"triangle-list",bufferLayout:o,vertexCount:t.vertexCount,indices:r,attributes:i})}function fh(e,t){if(t.indices){var r=t.indices.value;return e.createBuffer({usage:k.INDEX,data:r})}}function ch(e,t){for(var r=[],n={},i=0,o=Object.entries(t.attributes);i<o.length;i++){var a=Ql(o[i],2),f=a[0],s=a[1],l=f;switch(f){case"POSITION":l="positions";break;case"NORMAL":l="normals";break;case"TEXCOORD_0":l="texCoords";break}n[l]=e.createBuffer({data:s.value,id:"".concat(f,"-buffer")});var p=s.value,y=s.size,g=s.normalized;r.push({name:l,format:Ir(p,y,g)})}var w=t._calculateVertexCount(t.attributes,t.indices);return{attributes:n,bufferLayout:r,vertexCount:w}}function Pt(e){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(e)}function Ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ra(Object(r),!0).forEach(function(n){uh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ra(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uh(e,t,r){return t=ja(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function La(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ja(n.key),n)}}function lh(e,t,r){return t&&La(e.prototype,t),r&&La(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ja(e){var t=hh(e,"string");return Pt(t)==="symbol"?t:String(t)}function hh(e,t){if(Pt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ph(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var xt=function(){e.getDefaultPipelineFactory=function(n){return n._lumaData.defaultPipelineFactory=n._lumaData.defaultPipelineFactory||new e(n),n._lumaData.defaultPipelineFactory};function e(r){ph(this,e),this.device=void 0,this._hashCounter=0,this._hashes={},this._useCounts={},this._pipelineCache={},this.device=r}var t=e.prototype;return t.createRenderPipeline=function(n){var i=ue(ue({},e.defaultProps),n),o=this._hashRenderPipeline(ue({},i));if(!this._pipelineCache[o]){var a=this.device.createRenderPipeline(ue(ue({},i),{},{vs:this.device.createShader({stage:"vertex",source:i.vs}),fs:i.fs?this.device.createShader({stage:"fragment",source:i.fs}):null}));a.hash=o,this._pipelineCache[o]=a,this._useCounts[o]=0}return this._useCounts[o]++,this._pipelineCache[o]},t.release=function(n){var i=n.hash;this._useCounts[i]--,this._useCounts[i]===0&&(this._pipelineCache[i].destroy(),delete this._pipelineCache[i],delete this._useCounts[i])},t._createRenderPipeline=function(n){if(!n.fs)throw new Error("fs");var i=this.device.createRenderPipeline(ue(ue({},n),{},{vs:this.device.createShader({stage:"vertex",source:n.vs}),fs:n.fs?this.device.createShader({stage:"fragment",source:n.fs}):null}));return i},t._hashRenderPipeline=function(n){var i=this._getHash(n.vs),o=n.fs?this._getHash(n.fs):0,a="-";switch(this.device.info.type){case"webgpu":var f=this._getHash(JSON.stringify(n.parameters)),s=this._getHash(JSON.stringify(n.bufferLayout));return"".concat(i,"/").concat(o,"V").concat(a,"T").concat(n.topology,"P").concat(f,"BL").concat(s,"}");default:return"".concat(i,"/").concat(o,"V").concat(a)}},t._getHash=function(n){return this._hashes[n]===void 0&&(this._hashes[n]=this._hashCounter++),this._hashes[n]},lh(e)}();xt.defaultProps=ue(ue({},Ce.defaultProps),{},{vs:void 0,fs:void 0});function Et(e){return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(e)}function mh(e){return vh(e)||yh(e)||Jr(e)||dh()}function dh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
249
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yh(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vh(e){if(Array.isArray(e))return Zr(e)}function Fa(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Jr(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
250
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Ia(e,t){return wh(e)||bh(e,t)||Jr(e,t)||gh()}function gh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
251
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jr(e,t){if(e){if(typeof e=="string")return Zr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zr(e,t)}}function Zr(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function wh(e){if(Array.isArray(e))return e}function Da(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Da(Object(r),!0).forEach(function(n){_h(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Da(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _h(e,t,r){return t=Ua(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Na(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ua(n.key),n)}}function Oh(e,t,r){return t&&Na(e.prototype,t),r&&Na(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ua(e){var t=Sh(e,"string");return Et(t)==="symbol"?t:String(t)}function Sh(e,t){if(Et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ph(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ae=function(){function e(r,n){var i,o,a;Ph(this,e),this.device=void 0,this.id=void 0,this.vs=void 0,this.fs=void 0,this.pipelineFactory=void 0,this.userData={},this.parameters=void 0,this.topology=void 0,this.bufferLayout=void 0,this.vertexCount=void 0,this.instanceCount=0,this.indexBuffer=null,this.bufferAttributes={},this.constantAttributes={},this.bindings={},this.uniforms={},this.vertexArray=void 0,this.transformFeedback=null,this.pipeline=void 0,this.shaderInputs=void 0,this._uniformStore=void 0,this._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this.props=be(be({},e.defaultProps),n),n=this.props,this.id=n.id||z("model"),this.device=r,Object.assign(this.userData,n.userData);var f=Object.fromEntries(((i=this.props.modules)===null||i===void 0?void 0:i.map(function(b){return[b.name,b]}))||[]);this.setShaderInputs(n.shaderInputs||new rr(f));var s=xh(r),l=(((o=this.props.modules)===null||o===void 0?void 0:o.length)>0?this.props.modules:(a=this.shaderInputs)===null||a===void 0?void 0:a.getModules())||[],p=this.props.shaderAssembler.assembleShaders(be(be({platformInfo:s},this.props),{},{modules:l})),y=p.vs,g=p.fs,w=p.getUniforms;if(this.vs=y,this.fs=g,this._getModuleUniforms=w,this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&(this._gpuGeometry=this.setGeometry(n.geometry)),this.pipelineFactory=n.pipelineFactory||xt.getDefaultPipelineFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=r.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),n.vertexCount&&this.setVertexCount(n.vertexCount),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.indices)throw new Error("Model.props.indices removed. Use props.indexBuffer");n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniforms(n.uniforms),n.moduleSettings&&(console.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()"),this.updateModuleSettings(n.moduleSettings)),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.pipelineFactory.release(this.pipeline),this._uniformStore.destroy()},t.predraw=function(){this.updateShaderInputs()},t.draw=function(n){this.predraw(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings),this.pipeline.setUniforms(this.uniforms),this.pipeline.draw({renderPass:n,vertexArray:this.vertexArray,vertexCount:this.vertexCount,instanceCount:this.instanceCount,transformFeedback:this.transformFeedback})},t.setGeometry=function(n){var i=n&&Ma(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=Ca(this.bufferLayout,i.bufferLayout),this.vertexArray&&this._setGeometryAttributes(i),i},t._setGeometryAttributes=function(n){this.vertexCount=n.vertexCount,this.setAttributes(n.attributes),this.setIndexBuffer(n.indices)},t.setTopology=function(n){n!==this.topology&&(this.topology=n,this._setPipelineNeedsUpdate("topology"))},t.setBufferLayout=function(n){this.bufferLayout=this._gpuGeometry?Ca(n,this._gpuGeometry.bufferLayout):n,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)},t.setParameters=function(n){ht(n,this.parameters,2)||(this.parameters=n,this._setPipelineNeedsUpdate("parameters"))},t.setVertexCount=function(n){this.vertexCount=n},t.setInstanceCount=function(n){this.instanceCount=n},t.setShaderInputs=function(n){this.shaderInputs=n,this._uniformStore=new jr(this.shaderInputs.modules);for(var i=0,o=Object.keys(this.shaderInputs.modules);i<o.length;i++){var a=o[i],f=this._uniformStore.getManagedUniformBuffer(this.device,a);this.bindings["".concat(a,"Uniforms")]=f}},t.updateShaderInputs=function(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues())},t.updateModuleSettings=function(n){console.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()");var i=Dr(this._getModuleUniforms(n)),o=i.bindings,a=i.uniforms;Object.assign(this.bindings,o),Object.assign(this.uniforms,a)},t.setBindings=function(n){Object.assign(this.bindings,n)},t.setUniforms=function(n){this.pipeline.setUniforms(n),Object.assign(this.uniforms,n)},t.setIndexBuffer=function(n){this.vertexArray.setIndexBuffer(n)},t.setTransformFeedback=function(n){this.transformFeedback=n},t.setAttributes=function(n){var i=this;n.indices&&B.warn("Model:".concat(this.id," setAttributes() - indexBuffer should be set using setIndexBuffer()"));for(var o=function(){var p,y=Ia(f[a],2),g=y[0],w=y[1],b=i.bufferLayout.find(function(M){return M.name===g});if(!b)return B.warn("Model(".concat(i.id,'): Missing layout for buffer "').concat(g,'".'))(),"continue";var _=b.attributes?(p=b.attributes)===null||p===void 0?void 0:p.map(function(M){return M.attribute}):[b.name],x=!1,S=Fa(_),R;try{for(S.s();!(R=S.n()).done;){var E=R.value,T=i._attributeInfos[E];T&&(i.vertexArray.setBuffer(T.location,w),x=!0)}}catch(M){S.e(M)}finally{S.f()}x||B.warn("Model(".concat(i.id,'): Ignoring buffer "').concat(w.id,'" for unknown attribute "').concat(g,'"'))()},a=0,f=Object.entries(n);a<f.length;a++)var s=o()},t.setConstantAttributes=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=Ia(o[i],2),f=a[0],s=a[1],l=this._attributeInfos[f];l?this.vertexArray.setConstant(l.location,s):B.warn('Model "'.concat(this.id,': Ignoring constant supplied for unknown attribute "').concat(f,'"'))()}},t._setPipelineNeedsUpdate=function(n){this._pipelineNeedsUpdate=this._pipelineNeedsUpdate||n},t._updatePipeline=function(){return this._pipelineNeedsUpdate&&(this.pipeline&&B.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1,this.pipeline=this.device.createRenderPipeline(be(be({},this.props),{},{bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:this.device.createShader({id:"{$this.id}-vertex",stage:"vertex",source:this.vs}),fs:this.fs?this.device.createShader({id:"{$this.id}-fragment",stage:"fragment",source:this.fs}):null})),this._attributeInfos=Lr(this.pipeline.shaderLayout,this.bufferLayout)),this.pipeline},Oh(e)}();ae.defaultProps=be(be({},Ce.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],shaderInputs:void 0,pipelineFactory:void 0,transformFeedback:void 0,shaderAssembler:qt.getDefaultShaderAssembler()});function Ca(e,t){var r=mh(e),n=Fa(t),i;try{var o=function(){var f=i.value,s=r.findIndex(function(l){return l.name===f.name});s<0?r.push(f):r[s]=f};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function xh(e){return{type:e.info.type,shaderLanguage:e.info.shadingLanguage,shaderLanguageVersion:e.info.shadingLanguageVersion,gpu:e.info.gpu,features:e.features}}function At(e){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(e)}function Ga(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Eh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ga(Object(r),!0).forEach(function(n){Ah(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ga(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ah(e,t,r){return t=za(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ba(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,za(n.key),n)}}function Th(e,t,r){return t&&Ba(e.prototype,t),r&&Ba(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function za(e){var t=Mh(e,"string");return At(t)==="symbol"?t:String(t)}function Mh(e,t){if(At(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(At(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ka=function(){e.isSupported=function(n){return n.features.has("transform-feedback-webgl2")};function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae.defaultProps;Rh(this,e),this.device=void 0,this.model=void 0,this.transformFeedback=void 0,W(r.features.has("transform-feedback-webgl2"),"Device must support transform feedback"),this.device=r,this.model=new ae(this.device,Eh({id:n.id||"buffer-transform-model",fs:n.fs||_t({version:300}),topology:n.topology||"point-list"},n)),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.model&&this.model.destroy()},t.delete=function(){this.destroy()},t.run=function(n){var i=this.device.beginRenderPass(n);this.model.draw(i),i.end()},t.update=function(){console.warn("TextureTransform#update() not implemented")},t.getBuffer=function(n){return this.transformFeedback.getBuffer(n)},t.readAsync=function(n){var i=this.getBuffer(n);if(i instanceof k)return i.readAsync();var o=i.buffer,a=i.byteOffset,f=a===void 0?0:a,s=i.byteLength,l=s===void 0?o.byteLength:s;return o.readAsync(f,l)},Th(e)}();function Tt(e){return Tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tt(e)}function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ha(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){Lh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lh(e,t,r){return t=Wa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ka(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wa(n.key),n)}}function jh(e,t,r){return t&&Ka(e.prototype,t),r&&Ka(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wa(e){var t=Ih(e,"string");return Tt(t)==="symbol"?t:String(t)}function Ih(e,t){if(Tt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Tt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Nh="transform_output",qa=function(){function e(r,n){Dh(this,e),this.device=void 0,this.model=void 0,this.sampler=void 0,this.currentIndex=0,this.samplerTextureMap=null,this.bindings=[],this.resources={},this.device=r,this.sampler=r.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"nearest",magFilter:"nearest",mipmapFilter:"nearest"}),this.model=new ae(this.device,Ha({id:n.id||"texture-transform-model",fs:n.fs||_t({version:300,input:n.targetTextureVarying,inputChannels:n.targetTextureChannels,output:Nh}),vertexCount:n.vertexCount},n)),this._initialize(n),Object.seal(this)}var t=e.prototype;return t.destroy=function(){},t.delete=function(){this.destroy()},t.run=function(n){var i=this.bindings[this.currentIndex].framebuffer,o=this.device.beginRenderPass(Ha({framebuffer:i},n));this.model.draw(o),o.end()},t.update=function(){console.warn("TextureTransform#update() not implemented")},t.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.packed,o=i===void 0?!1:i;throw new Error("getData() not implemented")},t.getTargetTexture=function(){var n=this.bindings[this.currentIndex].targetTexture;return n},t.getFramebuffer=function(){var n=this.bindings[this.currentIndex];return n.framebuffer},t._initialize=function(n){this._updateBindings(n)},t._updateBindings=function(n){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],n)},t._updateBinding=function(n,i){var o=i.sourceBuffers,a=i.sourceTextures,f=i.targetTexture;if(n||(n={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(n.sourceTextures,a),Object.assign(n.sourceBuffers,o),f){n.targetTexture=f;var s=f.width,l=f.height;n.framebuffer&&n.framebuffer.destroy(),n.framebuffer=this.device.createFramebuffer({id:"transform-framebuffer",width:s,height:l,colorAttachments:[f]}),n.framebuffer.resize({width:s,height:l})}return n},t._setSourceTextureParameters=function(){var n=this.currentIndex,i=this.bindings[n].sourceTextures;for(var o in i)i[o].sampler=this.sampler},jh(e)}();function Mt(e){return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(e)}function Ya(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ch(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ya(Object(r),!0).forEach(function(n){Fh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ya(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fh(e,t,r){return t=Za(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uh(e,t){return kh(e)||zh(e,t)||Bh(e,t)||Gh()}function Gh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
252
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bh(e,t){if(e){if(typeof e=="string")return Xa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xa(e,t)}}function Xa(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function kh(e){if(Array.isArray(e))return e}function $a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Za(n.key),n)}}function Vh(e,t,r){return t&&$a(e.prototype,t),r&&$a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Za(e){var t=Hh(e,"string");return Mt(t)==="symbol"?t:String(t)}function Hh(e,t){if(Mt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Z=function(){function e(r){Kh(this,e),this.id=void 0,this.topology=void 0,this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.userData={};var n=r.attributes,i=n===void 0?{}:n,o=r.indices,a=o===void 0?null:o,f=r.vertexCount,s=f===void 0?null:f;this.id=r.id||z("geometry"),this.topology=r.topology,a&&(this.indices=ArrayBuffer.isView(a)?{value:a,size:1}:a),this.attributes={};for(var l=0,p=Object.entries(i);l<p.length;l++){var y=Uh(p[l],2),g=y[0],w=y[1],b=ArrayBuffer.isView(w)?{value:w}:w;W(ArrayBuffer.isView(b.value),"".concat(this._print(g),": must be typed array or object with value as typed array")),(g==="POSITION"||g==="positions")&&!b.size&&(b.size=3),g==="indices"?(W(!this.indices),this.indices=b):this.attributes[g]=b}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}var t=e.prototype;return t.getVertexCount=function(){return this.vertexCount},t.getAttributes=function(){return this.indices?Ch({indices:this.indices},this.attributes):this.attributes},t._print=function(n){return"Geometry ".concat(this.id," attribute ").concat(n)},t._setAttributes=function(n,i){return this},t._calculateVertexCount=function(n,i){if(i)return i.value.length;for(var o=1/0,a=0,f=Object.values(n);a<f.length;a++){var s=f[a],l=s.value,p=s.size,y=s.constant;!y&&l&&p>=1&&(o=Math.min(o,l.length/p))}return W(Number.isFinite(o)),o},Vh(e)}();function Ve(e){return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ve(e)}var Ja;function Qa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function es(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qa(Object(r),!0).forEach(function(n){Wh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wh(e,t,r){return t=ns(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ts(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ns(n.key),n)}}function qh(e,t,r){return t&&ts(e.prototype,t),r&&ts(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ns(e){var t=Yh(e,"string");return Ve(t)==="symbol"?t:String(t)}function Yh(e,t){if(Ve(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qr(e,t)}function Qr(e,t){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qr(e,t)}function Zh(e){var t=ep();return function(){var n=ir(e),i;if(t){var o=ir(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Jh(this,i)}}function Jh(e,t){if(t&&(Ve(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qh(e)}function Qh(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ep(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ir(e){return ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ir(e)}function tp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rp=Ti(Ja||(Ja=tp([`in vec2 aClipSpacePosition;
253
+ in vec2 aTexCoord;
254
+ in vec2 aCoordinate;
255
+
256
+ out vec2 position;
257
+ out vec2 coordinate;
258
+ out vec2 uv;
259
+
260
+ void main(void) {
261
+ gl_Position = vec4(aClipSpacePosition, 0., 1.);
262
+ position = aClipSpacePosition;
263
+ coordinate = aCoordinate;
264
+ uv = aTexCoord;
265
+ }
266
+ `],[`\\
267
+ in vec2 aClipSpacePosition;
268
+ in vec2 aTexCoord;
269
+ in vec2 aCoordinate;
270
+
271
+ out vec2 position;
272
+ out vec2 coordinate;
273
+ out vec2 uv;
274
+
275
+ void main(void) {
276
+ gl_Position = vec4(aClipSpacePosition, 0., 1.);
277
+ position = aClipSpacePosition;
278
+ coordinate = aCoordinate;
279
+ uv = aTexCoord;
280
+ }
281
+ `]))),rs=[-1,-1,1,-1,-1,1,1,1],is=function(e){$h(r,e);var t=Zh(r);function r(n,i){Xh(this,r);var o=rs.map(function(a){return a===-1?0:a});return t.call(this,n,es(es({},i),{},{vs:rp,vertexCount:4,geometry:new Z({topology:"triangle-strip",vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(rs)},aTexCoord:{size:2,value:new Float32Array(o)},aCoordinate:{size:2,value:new Float32Array(o)}}})}))}return qh(r)}(ae);function Rt(e){return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(e)}function os(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ip(n.key),n)}}function np(e,t,r){return t&&os(e.prototype,t),r&&os(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ip(e){var t=op(e,"string");return Rt(t)==="symbol"?t:String(t)}function op(e,t){if(Rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ap(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ee=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ap(this,e),this.id=void 0,this.matrix=new re,this.display=!0,this.position=new $,this.rotation=new $,this.scale=new $(1,1,1),this.userData={},this.props={};var n=r.id;this.id=n||z(this.constructor.name),this._setScenegraphNodeProps(r)}var t=e.prototype;return t.getBounds=function(){return null},t.destroy=function(){},t.delete=function(){this.destroy()},t.setProps=function(n){return this._setScenegraphNodeProps(n),this},t.toString=function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")},t.setPosition=function(n){return W(n.length===3,"setPosition requires vector argument"),this.position=n,this},t.setRotation=function(n){return W(n.length===3,"setRotation requires vector argument"),this.rotation=n,this},t.setScale=function(n){return W(n.length===3,"setScale requires vector argument"),this.scale=n,this},t.setMatrix=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i?this.matrix.copy(n):this.matrix=n},t.setMatrixComponents=function(n){var i=n.position,o=n.rotation,a=n.scale,f=n.update,s=f===void 0?!0:f;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),s&&this.updateMatrix(),this},t.updateMatrix=function(){var n=this.position,i=this.rotation,o=this.scale;return this.matrix.identity(),this.matrix.translate(n),this.matrix.rotateXYZ(i),this.matrix.scale(o),this},t.update=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.position,o=n.rotation,a=n.scale;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),this.updateMatrix(),this},t.getCoordinateUniforms=function(n,i){W(n),i=i||this.matrix;var o=new re(n).multiplyRight(i),a=o.invert(),f=a.transpose();return{viewMatrix:n,modelMatrix:i,objectMatrix:i,worldMatrix:o,worldInverseMatrix:a,worldInverseTransposeMatrix:f}},t._setScenegraphNodeProps=function(n){"display"in n&&(this.display=n.display),"position"in n&&this.setPosition(n.position),"rotation"in n&&this.setRotation(n.rotation),"scale"in n&&this.setScale(n.scale),"matrix"in n&&this.setMatrix(n.matrix),Object.assign(this.props,n)},np(e)}();function He(e){return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(e)}function sp(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=rn(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
282
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function fp(e){return lp(e)||up(e)||rn(e)||cp()}function cp(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
283
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function up(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lp(e){if(Array.isArray(e))return en(e)}function hp(e,t){return dp(e)||mp(e,t)||rn(e,t)||pp()}function pp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
284
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rn(e,t){if(e){if(typeof e=="string")return en(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return en(e,t)}}function en(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function dp(e){if(Array.isArray(e))return e}function as(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vp(n.key),n)}}function yp(e,t,r){return t&&as(e.prototype,t),r&&as(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vp(e){var t=gp(e,"string");return He(t)==="symbol"?t:String(t)}function gp(e,t){if(He(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(He(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function or(){return typeof Reflect<"u"&&Reflect.get?or=Reflect.get.bind():or=function(t,r,n){var i=wp(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},or.apply(this,arguments)}function wp(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ke(e),e!==null););return e}function _p(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tn(e,t)}function tn(e,t){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tn(e,t)}function Op(e){var t=xp();return function(){var n=Ke(e),i;if(t){var o=Ke(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Sp(this,i)}}function Sp(e,t){if(t&&(He(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pp(e)}function Pp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ke(e)}var ss=function(e){_p(r,e);var t=Op(r);function r(){var i,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bp(this,r),o=Array.isArray(o)?{children:o}:o;var a=o,f=a.children,s=f===void 0?[]:f;return B.assert(s.every(function(l){return l instanceof Ee}),"every child must an instance of ScenegraphNode"),i=t.call(this,o),i.children=void 0,i.children=s,i}var n=r.prototype;return n.getBounds=function(){var o=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(function(a,f){var s=f.worldMatrix,l=a.getBounds();if(l){var p=hp(l,2),y=p[0],g=p[1],w=new $(y).add(g).divide([2,2,2]);s.transformAsPoint(w,w);var b=new $(g).subtract(y).divide([2,2,2]);s.transformAsVector(b,b);for(var _=0;_<8;_++)for(var x=new $(_&1?-1:1,_&2?-1:1,_&4?-1:1).multiply(b).add(w),S=0;S<3;S++)o[0][S]=Math.min(o[0][S],x[S]),o[1][S]=Math.max(o[1][S],x[S])}}),Number.isFinite(o[0][0])?o:null},n.destroy=function(){this.children.forEach(function(o){return o.destroy()}),this.removeAll(),or(Ke(r.prototype),"destroy",this).call(this)},n.add=function(){for(var o=arguments.length,a=new Array(o),f=0;f<o;f++)a[f]=arguments[f];for(var s=0,l=a;s<l.length;s++){var p=l[s];Array.isArray(p)?this.add.apply(this,fp(p)):this.children.push(p)}return this},n.remove=function(o){var a=this.children,f=a.indexOf(o);return f>-1&&a.splice(f,1),this},n.removeAll=function(){return this.children=[],this},n.traverse=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=a.worldMatrix,s=f===void 0?new re:f,l=new re(s).multiplyRight(this.matrix),p=sp(this.children),y;try{for(p.s();!(y=p.n()).done;){var g=y.value;g instanceof r?g.traverse(o,{worldMatrix:l}):o(g,{worldMatrix:l})}}catch(w){p.e(w)}finally{p.f()}},yp(r)}(Ee);function We(e){return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(e)}function fs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ap(n.key),n)}}function Ep(e,t,r){return t&&fs(e.prototype,t),r&&fs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ap(e){var t=Tp(e,"string");return We(t)==="symbol"?t:String(t)}function Tp(e,t){if(We(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(We(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nn(e,t)}function nn(e,t){return nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},nn(e,t)}function Lp(e){var t=Dp();return function(){var n=ar(e),i;if(t){var o=ar(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return jp(this,i)}}function jp(e,t){if(t&&(We(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ip(e)}function Ip(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ar(e){return ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ar(e)}var cs=function(e){Rp(r,e);var t=Lp(r);function r(i){var o;return Mp(this,r),o=t.call(this,i),o.model=void 0,o.bounds=null,o.managedResources=void 0,o.model=i.model,o.managedResources=i.managedResources||[],o.bounds=i.bounds||null,o.setProps(i),o}var n=r.prototype;return n.getBounds=function(){return this.bounds},n.destroy=function(){this.model&&(this.model.destroy(),this.model=null),this.managedResources.forEach(function(o){return o.destroy()}),this.managedResources=[]},n.draw=function(o){return this.model.draw(o)},Ep(r)}(Ee);function qe(e){return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qe(e)}function us(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function on(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?us(Object(r),!0).forEach(function(n){Np(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):us(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Np(e,t,r){return t=hs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ls(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hs(n.key),n)}}function Cp(e,t,r){return t&&ls(e.prototype,t),r&&ls(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hs(e){var t=Fp(e,"string");return qe(t)==="symbol"?t:String(t)}function Fp(e,t){if(qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Up(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&an(e,t)}function an(e,t){return an=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},an(e,t)}function Bp(e){var t=Vp();return function(){var n=sr(e),i;if(t){var o=sr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return zp(this,i)}}function zp(e,t){if(t&&(qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kp(e)}function kp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sr(e)}var Hp={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Ye=function(e){Gp(r,e);var t=Bp(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Up(this,r);var i=n.id,o=i===void 0?z("truncated-code-geometry"):i,a=Kp(n),f=a.indices,s=a.attributes;return t.call(this,on(on({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:on({POSITION:{size:3,value:s.POSITION},NORMAL:{size:3,value:s.NORMAL},TEXCOORD_0:{size:2,value:s.TEXCOORD_0}},n.attributes)}))}return Cp(r)}(Z);function Kp(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.bottomRadius,r=t===void 0?0:t,n=e.topRadius,i=n===void 0?0:n,o=e.height,a=o===void 0?1:o,f=e.nradial,s=f===void 0?10:f,l=e.nvertical,p=l===void 0?10:l,y=e.verticalAxis,g=y===void 0?"y":y,w=e.topCap,b=w===void 0?!1:w,_=e.bottomCap,x=_===void 0?!1:_,S=(b?2:0)+(x?2:0),R=(s+1)*(p+1+S),E=Math.atan2(r-i,a),T=Math.sin,M=Math.cos,L=Math.PI,I=M(E),D=T(E),F=b?-2:0,N=p+(x?2:0),C=s+1,h=new Uint16Array(s*(p+S)*6),c=Hp[g],u=new Float32Array(R*3),m=new Float32Array(R*3),v=new Float32Array(R*2),d=0,O=0,P=F;P<=N;P++){var A=P/p,U=a*A,j=void 0;P<0?(U=0,A=1,j=r):P>p?(U=a,A=1,j=i):j=r+(i-r)*(P/p),(P===-2||P===p+2)&&(j=0,A=0),U-=a/2;for(var G=0;G<C;G++){var ne=T(G*L*2/s),Q=M(G*L*2/s);u[d+c[0]]=ne*j,u[d+c[1]]=U,u[d+c[2]]=Q*j,m[d+c[0]]=P<0||P>p?0:ne*I,m[d+c[1]]=P<0?-1:P>p?1:D,m[d+c[2]]=P<0||P>p?0:Q*I,v[O+0]=G/s,v[O+1]=A,O+=2,d+=3}}for(var H=0;H<p+S;H++)for(var X=0;X<s;X++){var se=(H*s+X)*6;h[se+0]=C*(H+0)+0+X,h[se+1]=C*(H+0)+1+X,h[se+2]=C*(H+1)+1+X,h[se+3]=C*(H+0)+0+X,h[se+4]=C*(H+1)+1+X,h[se+5]=C*(H+1)+0+X}return{indices:h,attributes:{POSITION:u,NORMAL:m,TEXCOORD_0:v}}}function Xe(e){return Xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(e)}function ps(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ms(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ps(Object(r),!0).forEach(function(n){Wp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ps(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wp(e,t,r){return t=ys(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ds(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ys(n.key),n)}}function qp(e,t,r){return t&&ds(e.prototype,t),r&&ds(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ys(e){var t=Yp(e,"string");return Xe(t)==="symbol"?t:String(t)}function Yp(e,t){if(Xe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Xe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $p(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sn(e,t)}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sn(e,t)}function Zp(e){var t=em();return function(){var n=fr(e),i;if(t){var o=fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Jp(this,i)}}function Jp(e,t){if(t&&(Xe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qp(e)}function Qp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function em(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fr(e){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fr(e)}var vs=function(e){$p(r,e);var t=Zp(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xp(this,r);var i=n.id,o=i===void 0?z("cone-geometry"):i,a=n.radius,f=a===void 0?1:a,s=n.cap,l=s===void 0?!0:s;return t.call(this,ms(ms({},n),{},{id:o,topRadius:0,topCap:Boolean(l),bottomCap:Boolean(l),bottomRadius:f}))}return qp(r)}(Ye);function $e(e){return $e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$e(e)}function gs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function we(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gs(Object(r),!0).forEach(function(n){tm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tm(e,t,r){return t=ws(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ws(n.key),n)}}function rm(e,t,r){return t&&bs(e.prototype,t),r&&bs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ws(e){var t=nm(e,"string");return $e(t)==="symbol"?t:String(t)}function nm(e,t){if($e(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($e(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function im(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function om(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fn(e,t)}function fn(e,t){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fn(e,t)}function am(e){var t=cm();return function(){var n=cr(e),i;if(t){var o=cr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return sm(this,i)}}function sm(e,t){if(t&&($e(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fm(e)}function fm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cr(e)}var _s=function(e){om(r,e);var t=am(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};im(this,r);var i=n.id,o=i===void 0?z("cube-geometry"):i,a=n.indices,f=a===void 0?!0:a;return t.call(this,f?we(we({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:um},attributes:we(we({},vm),n.attributes)}):we(we({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:we(we({},gm),n.attributes)}))}return rm(r)}(Z),um=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),lm=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),hm=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),pm=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),mm=new Float32Array([1,-1,1,1,-1,-1,1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,1,1,-1,-1,-1,1,1,1,1,1,1,-1,1,1,1,-1,-1,1,1,1,-1,1,1,1,1,1,1,-1,-1,1,-1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,1,1,1,1,-1,1,-1,-1,1,1,-1,1,1,1,-1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,-1,1,1,1,-1,-1,1,1,-1,-1,1,1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,1,-1,1]),dm=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),ym=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),vm={POSITION:{size:3,value:lm},NORMAL:{size:3,value:hm},TEXCOORD_0:{size:2,value:pm}},gm={POSITION:{size:4,value:mm},TEXCOORD_0:{size:2,value:dm},COLOR_0:{size:3,value:ym}};function Ze(e){return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function Os(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ss(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Os(Object(r),!0).forEach(function(n){bm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Os(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bm(e,t,r){return t=xs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ps(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xs(n.key),n)}}function wm(e,t,r){return t&&Ps(e.prototype,t),r&&Ps(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xs(e){var t=_m(e,"string");return Ze(t)==="symbol"?t:String(t)}function _m(e,t){if(Ze(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ze(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Om(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cn(e,t)}function cn(e,t){return cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cn(e,t)}function Pm(e){var t=Am();return function(){var n=ur(e),i;if(t){var o=ur(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return xm(this,i)}}function xm(e,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Em(e)}function Em(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Am(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ur(e){return ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ur(e)}var Es=function(e){Sm(r,e);var t=Pm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Om(this,r);var i=n.id,o=i===void 0?z("cylinder-geometry"):i,a=n.radius,f=a===void 0?1:a;return t.call(this,Ss(Ss({},n),{},{id:o,bottomRadius:f,topRadius:f}))}return wm(r)}(Ye);function Je(e){return Je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(e)}function As(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?As(Object(r),!0).forEach(function(n){Tm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):As(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tm(e,t,r){return t=Ms(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ts(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ms(n.key),n)}}function Mm(e,t,r){return t&&Ts(e.prototype,t),r&&Ts(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ms(e){var t=Rm(e,"string");return Je(t)==="symbol"?t:String(t)}function Rm(e,t){if(Je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&un(e,t)}function un(e,t){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},un(e,t)}function Im(e){var t=Cm();return function(){var n=hr(e),i;if(t){var o=hr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Dm(this,i)}}function Dm(e,t){if(t&&(Je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nm(e)}function Nm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hr(e){return hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hr(e)}var Fm=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Um=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Rs=function(e){jm(r,e);var t=Im(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lm(this,r);var i=n.id,o=i===void 0?z("ico-sphere-geometry"):i,a=Gm(n),f=a.indices,s=a.attributes;return t.call(this,lr(lr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:lr(lr({},s),n.attributes)}))}return Mm(r)}(Z);function Gm(e){var t=e.iterations,r=t===void 0?0:t,n=Math.PI,i=n*2,o=[].concat(Fm),a=[].concat(Um);o.push(),a.push();for(var f=function(){var vr={};return function(le,he){le*=3,he*=3;var Vs=le<he?le:he,Hs=le>he?le:he,gr="".concat(Vs,"|").concat(Hs);if(gr in vr)return vr[gr];var Ks=o[le],Ws=o[le+1],qs=o[le+2],Ys=o[he],Xs=o[he+1],$s=o[he+2],jt=(Ks+Ys)/2,It=(Ws+Xs)/2,Dt=(qs+$s)/2,br=Math.sqrt(jt*jt+It*It+Dt*Dt);return jt/=br,It/=br,Dt/=br,o.push(jt,It,Dt),vr[gr]=o.length/3-1}}(),s=0;s<r;s++){for(var l=[],p=0;p<a.length;p+=3){var y=f(a[p+0],a[p+1]),g=f(a[p+1],a[p+2]),w=f(a[p+2],a[p+0]);l.push(w,a[p+0],y,y,a[p+1],g,g,a[p+2],w,y,g,w)}a=l}for(var b=new Array(o.length),_=new Array(o.length/3*2),x=a.length,S=x-3;S>=0;S-=3){var R=a[S+0],E=a[S+1],T=a[S+2],M=R*3,L=E*3,I=T*3,D=R*2,F=E*2,N=T*2,C=o[M+0],h=o[M+1],c=o[M+2],u=Math.acos(c/Math.sqrt(C*C+h*h+c*c)),m=Math.atan2(h,C)+n,v=u/n,d=1-m/i,O=o[L+0],P=o[L+1],A=o[L+2],U=Math.acos(A/Math.sqrt(O*O+P*P+A*A)),j=Math.atan2(P,O)+n,G=U/n,ne=1-j/i,Q=o[I+0],H=o[I+1],X=o[I+2],se=Math.acos(X/Math.sqrt(Q*Q+H*H+X*X)),Bs=Math.atan2(H,Q)+n,pn=se/n,Lt=1-Bs/i,zs=[Q-O,H-P,X-A],ks=[C-O,h-P,c-A],ee=new $(zs).cross(ks).normalize(),V=void 0;(d===0||ne===0||Lt===0)&&(d===0||d>.5)&&(ne===0||ne>.5)&&(Lt===0||Lt>.5)&&(o.push(o[M+0],o[M+1],o[M+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=v,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z,o.push(o[L+0],o[L+1],o[L+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=G,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z,o.push(o[I+0],o[I+1],o[I+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=pn,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z),b[M+0]=b[L+0]=b[I+0]=ee.x,b[M+1]=b[L+1]=b[I+1]=ee.y,b[M+2]=b[L+2]=b[I+2]=ee.z,_[D+0]=d,_[D+1]=v,_[F+0]=ne,_[F+1]=G,_[N+0]=Lt,_[N+1]=pn}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(o)},NORMAL:{size:3,value:new Float32Array(b)},TEXCOORD_0:{size:2,value:new Float32Array(_)}}}}function Ls(e){var t=e.indices,r=e.attributes;if(!t)return e;var n=t.value.length,i={};for(var o in r){var a=r[o],f=a.constant,s=a.value,l=a.size;if(!(f||!l)){for(var p=new s.constructor(n*l),y=0;y<n;++y)for(var g=t.value[y],w=0;w<l;w++)p[y*l+w]=s[g*l+w];i[o]={size:l,value:p}}}return{attributes:Object.assign({},r,i)}}function Qe(e){return Qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(e)}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?js(Object(r),!0).forEach(function(n){Bm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):js(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bm(e,t,r){return t=Ds(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Is(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ds(n.key),n)}}function zm(e,t,r){return t&&Is(e.prototype,t),r&&Is(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ds(e){var t=km(e,"string");return Qe(t)==="symbol"?t:String(t)}function km(e,t){if(Qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ln(e,t)}function ln(e,t){return ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ln(e,t)}function Km(e){var t=Ym();return function(){var n=mr(e),i;if(t){var o=mr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wm(this,i)}}function Wm(e,t){if(t&&(Qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qm(e)}function qm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ym(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function mr(e){return mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mr(e)}var Ns=function(e){Hm(r,e);var t=Km(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vm(this,r);var i=n.id,o=i===void 0?z("plane-geometry"):i,a=Xm(n),f=a.indices,s=a.attributes;return t.call(this,pr(pr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:pr(pr({},s),n.attributes)}))}return zm(r)}(Z);function Xm(e){var t=e.type,r=t===void 0?"x,y":t,n=e.offset,i=n===void 0?0:n,o=e.flipCull,a=o===void 0?!1:o,f=e.unpack,s=f===void 0?!1:f,l=r.split(","),p=e["".concat(l[0],"len")]||1,y=e["".concat(l[1],"len")]||1,g=e["n".concat(l[0])]||1,w=e["n".concat(l[1])]||1,b=(g+1)*(w+1),_=new Float32Array(b*3),x=new Float32Array(b*3),S=new Float32Array(b*2);a&&(p=-p);for(var R=0,E=0,T=0;T<=w;T++)for(var M=0;M<=g;M++){var L=M/g,I=T/w;switch(S[R+0]=a?1-L:L,S[R+1]=I,r){case"x,y":_[E+0]=p*L-p*.5,_[E+1]=y*I-y*.5,_[E+2]=i,x[E+0]=0,x[E+1]=0,x[E+2]=a?1:-1;break;case"x,z":_[E+0]=p*L-p*.5,_[E+1]=i,_[E+2]=y*I-y*.5,x[E+0]=0,x[E+1]=a?1:-1,x[E+2]=0;break;case"y,z":_[E+0]=i,_[E+1]=p*L-p*.5,_[E+2]=y*I-y*.5,x[E+0]=a?1:-1,x[E+1]=0,x[E+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}R+=2,E+=3}for(var D=g+1,F=new Uint16Array(g*w*6),N=0;N<w;N++)for(var C=0;C<g;C++){var h=(N*g+C)*6;F[h+0]=(N+0)*D+C,F[h+1]=(N+1)*D+C,F[h+2]=(N+0)*D+C+1,F[h+3]=(N+1)*D+C,F[h+4]=(N+1)*D+C+1,F[h+5]=(N+0)*D+C+1}var c={indices:{size:1,value:F},attributes:{POSITION:{size:3,value:_},NORMAL:{size:3,value:x},TEXCOORD_0:{size:2,value:S}}};return s?Ls(c):c}function et(e){return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(e)}function Cs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cs(Object(r),!0).forEach(function(n){$m(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $m(e,t,r){return t=Us(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Us(n.key),n)}}function Zm(e,t,r){return t&&Fs(e.prototype,t),r&&Fs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Us(e){var t=Jm(e,"string");return et(t)==="symbol"?t:String(t)}function Jm(e,t){if(et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ed(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hn(e,t)}function hn(e,t){return hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hn(e,t)}function td(e){var t=id();return function(){var n=yr(e),i;if(t){var o=yr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return rd(this,i)}}function rd(e,t){if(t&&(et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nd(e)}function nd(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function id(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yr(e){return yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yr(e)}var Gs=function(e){ed(r,e);var t=td(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qm(this,r);var i=n.id,o=i===void 0?z("sphere-geometry"):i,a=od(n),f=a.indices,s=a.attributes;return t.call(this,dr(dr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:dr(dr({},s),n.attributes)}))}return Zm(r)}(Z);function od(e){for(var t=e.nlat,r=t===void 0?10:t,n=e.nlong,i=n===void 0?10:n,o=0,a=Math.PI,f=a-o,s=0,l=2*Math.PI,p=l-s,y=(r+1)*(i+1),g=function(ne,Q,H,X,se){return e.radius||1},w=new Float32Array(y*3),b=new Float32Array(y*3),_=new Float32Array(y*2),x=y>65535?Uint32Array:Uint16Array,S=new x(r*i*6),R=0;R<=r;R++)for(var E=0;E<=i;E++){var T=E/i,M=R/r,L=E+R*(i+1),I=L*2,D=L*3,F=p*T,N=f*M,C=Math.sin(F),h=Math.cos(F),c=Math.sin(N),u=Math.cos(N),m=h*c,v=u,d=C*c,O=g(m,v,d,T,M);w[D+0]=O*m,w[D+1]=O*v,w[D+2]=O*d,b[D+0]=m,b[D+1]=v,b[D+2]=d,_[I+0]=T,_[I+1]=1-M}for(var P=i+1,A=0;A<i;A++)for(var U=0;U<r;U++){var j=(A*r+U)*6;S[j+0]=U*P+A,S[j+1]=U*P+A+1,S[j+2]=(U+1)*P+A,S[j+3]=(U+1)*P+A,S[j+4]=U*P+A+1,S[j+5]=(U+1)*P+A+1}return{indices:{size:1,value:S},attributes:{POSITION:{size:3,value:w},NORMAL:{size:3,value:b},TEXCOORD_0:{size:2,value:_}}}}return rf(ad);})();
285
+ return __exports__;
286
+ });