@loaders.gl/tile-converter 3.3.0-alpha.5 → 3.3.0-alpha.7

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 (176) hide show
  1. package/dist/3d-tiles-attributes-worker.js +2 -3
  2. package/dist/3d-tiles-attributes-worker.js.map +3 -3
  3. package/dist/converter-cli.js +15 -2
  4. package/dist/converter.min.js +23 -20
  5. package/dist/dist.min.js +38236 -46911
  6. package/dist/es5/3d-tiles-attributes-worker.js +3 -6
  7. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -1
  8. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +12 -111
  9. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  10. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +32 -72
  11. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  12. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -8
  13. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -1
  14. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js +0 -5
  15. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  16. package/dist/es5/3d-tiles-converter/json-templates/tileset.js +0 -6
  17. package/dist/es5/3d-tiles-converter/json-templates/tileset.js.map +1 -1
  18. package/dist/es5/bundle.js +0 -1
  19. package/dist/es5/bundle.js.map +1 -1
  20. package/dist/es5/constants.js.map +1 -1
  21. package/dist/es5/converter-cli.js +11 -56
  22. package/dist/es5/converter-cli.js.map +1 -1
  23. package/dist/es5/deps-installer/deps-installer.js +5 -35
  24. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  25. package/dist/es5/i3s-attributes-worker.js +3 -6
  26. package/dist/es5/i3s-attributes-worker.js.map +1 -1
  27. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +2 -28
  28. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  29. package/dist/es5/i3s-converter/helpers/coordinate-converter.js +8 -25
  30. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  31. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js +0 -11
  32. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js.map +1 -1
  33. package/dist/es5/i3s-converter/helpers/feature-attributes.js +5 -34
  34. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
  35. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +13 -45
  36. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  37. package/dist/es5/i3s-converter/helpers/geometry-converter.js +26 -221
  38. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  39. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +2 -16
  40. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  41. package/dist/es5/i3s-converter/helpers/node-debug.js +4 -23
  42. package/dist/es5/i3s-converter/helpers/node-debug.js.map +1 -1
  43. package/dist/es5/i3s-converter/helpers/node-pages.js +50 -86
  44. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
  45. package/dist/es5/i3s-converter/i3s-converter.js +69 -384
  46. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  47. package/dist/es5/i3s-converter/json-templates/layers.js +1 -15
  48. package/dist/es5/i3s-converter/json-templates/layers.js.map +1 -1
  49. package/dist/es5/i3s-converter/json-templates/metadata.js +0 -2
  50. package/dist/es5/i3s-converter/json-templates/metadata.js.map +1 -1
  51. package/dist/es5/i3s-converter/json-templates/node.js +2 -12
  52. package/dist/es5/i3s-converter/json-templates/node.js.map +1 -1
  53. package/dist/es5/i3s-converter/json-templates/scene-server.js +0 -2
  54. package/dist/es5/i3s-converter/json-templates/scene-server.js.map +1 -1
  55. package/dist/es5/i3s-converter/json-templates/shared-resources.js +6 -29
  56. package/dist/es5/i3s-converter/json-templates/shared-resources.js.map +1 -1
  57. package/dist/es5/i3s-converter/json-templates/store.js.map +1 -1
  58. package/dist/es5/i3s-converter/types.js.map +1 -1
  59. package/dist/es5/i3s-server/app.js +0 -5
  60. package/dist/es5/i3s-server/app.js.map +1 -1
  61. package/dist/es5/i3s-server/controllers/index-controller.js +0 -16
  62. package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -1
  63. package/dist/es5/i3s-server/routes/index.js +1 -10
  64. package/dist/es5/i3s-server/routes/index.js.map +1 -1
  65. package/dist/es5/index.js +0 -3
  66. package/dist/es5/index.js.map +1 -1
  67. package/dist/es5/lib/utils/compress-util.js +19 -74
  68. package/dist/es5/lib/utils/compress-util.js.map +1 -1
  69. package/dist/es5/lib/utils/file-utils.js +10 -38
  70. package/dist/es5/lib/utils/file-utils.js.map +1 -1
  71. package/dist/es5/lib/utils/lod-conversion-utils.js +0 -7
  72. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
  73. package/dist/es5/lib/utils/queue.js +0 -14
  74. package/dist/es5/lib/utils/queue.js.map +1 -1
  75. package/dist/es5/lib/utils/statistic-utills.js +1 -46
  76. package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
  77. package/dist/es5/lib/utils/write-queue.js +0 -52
  78. package/dist/es5/lib/utils/write-queue.js.map +1 -1
  79. package/dist/es5/pgm-loader.js +1 -8
  80. package/dist/es5/pgm-loader.js.map +1 -1
  81. package/dist/es5/workers/3d-tiles-attributes-worker.js +1 -8
  82. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -1
  83. package/dist/es5/workers/i3s-attributes-worker.js +1 -9
  84. package/dist/es5/workers/i3s-attributes-worker.js.map +1 -1
  85. package/dist/esm/3d-tiles-attributes-worker.js +3 -1
  86. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -1
  87. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +8 -40
  88. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  89. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +7 -38
  90. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  91. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +1 -0
  92. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -1
  93. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js +1 -4
  94. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  95. package/dist/esm/3d-tiles-converter/json-templates/tileset.js +0 -3
  96. package/dist/esm/3d-tiles-converter/json-templates/tileset.js.map +1 -1
  97. package/dist/esm/bundle.js +1 -1
  98. package/dist/esm/bundle.js.map +1 -1
  99. package/dist/esm/constants.js.map +1 -1
  100. package/dist/esm/converter-cli.js +12 -41
  101. package/dist/esm/converter-cli.js.map +1 -1
  102. package/dist/esm/deps-installer/deps-installer.js +6 -7
  103. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  104. package/dist/esm/i3s-attributes-worker.js +3 -1
  105. package/dist/esm/i3s-attributes-worker.js.map +1 -1
  106. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +4 -23
  107. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  108. package/dist/esm/i3s-converter/helpers/coordinate-converter.js +11 -12
  109. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  110. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js +1 -0
  111. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js.map +1 -1
  112. package/dist/esm/i3s-converter/helpers/feature-attributes.js +6 -20
  113. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
  114. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +3 -22
  115. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  116. package/dist/esm/i3s-converter/helpers/geometry-converter.js +28 -139
  117. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  118. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +7 -12
  119. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  120. package/dist/esm/i3s-converter/helpers/node-debug.js +3 -13
  121. package/dist/esm/i3s-converter/helpers/node-debug.js.map +1 -1
  122. package/dist/esm/i3s-converter/helpers/node-pages.js +2 -21
  123. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
  124. package/dist/esm/i3s-converter/i3s-converter.js +59 -144
  125. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  126. package/dist/esm/i3s-converter/json-templates/layers.js +1 -11
  127. package/dist/esm/i3s-converter/json-templates/layers.js.map +1 -1
  128. package/dist/esm/i3s-converter/json-templates/metadata.js.map +1 -1
  129. package/dist/esm/i3s-converter/json-templates/node.js +0 -4
  130. package/dist/esm/i3s-converter/json-templates/node.js.map +1 -1
  131. package/dist/esm/i3s-converter/json-templates/scene-server.js.map +1 -1
  132. package/dist/esm/i3s-converter/json-templates/shared-resources.js +0 -12
  133. package/dist/esm/i3s-converter/json-templates/shared-resources.js.map +1 -1
  134. package/dist/esm/i3s-converter/json-templates/store.js.map +1 -1
  135. package/dist/esm/i3s-converter/types.js.map +1 -1
  136. package/dist/esm/i3s-server/app.js +0 -5
  137. package/dist/esm/i3s-server/app.js.map +1 -1
  138. package/dist/esm/i3s-server/controllers/index-controller.js +0 -5
  139. package/dist/esm/i3s-server/controllers/index-controller.js.map +1 -1
  140. package/dist/esm/i3s-server/routes/index.js +0 -3
  141. package/dist/esm/i3s-server/routes/index.js.map +1 -1
  142. package/dist/esm/index.js.map +1 -1
  143. package/dist/esm/lib/utils/compress-util.js +19 -12
  144. package/dist/esm/lib/utils/compress-util.js.map +1 -1
  145. package/dist/esm/lib/utils/file-utils.js +10 -8
  146. package/dist/esm/lib/utils/file-utils.js.map +1 -1
  147. package/dist/esm/lib/utils/lod-conversion-utils.js +2 -6
  148. package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
  149. package/dist/esm/lib/utils/queue.js +0 -4
  150. package/dist/esm/lib/utils/queue.js.map +1 -1
  151. package/dist/esm/lib/utils/statistic-utills.js +0 -11
  152. package/dist/esm/lib/utils/statistic-utills.js.map +1 -1
  153. package/dist/esm/lib/utils/write-queue.js +5 -23
  154. package/dist/esm/lib/utils/write-queue.js.map +1 -1
  155. package/dist/esm/pgm-loader.js +3 -1
  156. package/dist/esm/pgm-loader.js.map +1 -1
  157. package/dist/esm/workers/3d-tiles-attributes-worker.js +4 -1
  158. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -1
  159. package/dist/esm/workers/i3s-attributes-worker.js +4 -1
  160. package/dist/esm/workers/i3s-attributes-worker.js.map +1 -1
  161. package/dist/i3s-attributes-worker.js +2 -3
  162. package/dist/i3s-attributes-worker.js.map +3 -3
  163. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
  164. package/dist/i3s-converter/helpers/coordinate-converter.js +8 -6
  165. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  166. package/dist/i3s-converter/helpers/geometry-converter.js +2 -0
  167. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  168. package/dist/i3s-converter/i3s-converter.js +14 -8
  169. package/dist/pgm-loader.d.ts.map +1 -1
  170. package/dist/pgm-loader.js +2 -1
  171. package/package.json +15 -15
  172. package/src/converter-cli.ts +16 -2
  173. package/src/i3s-converter/helpers/coordinate-converter.ts +8 -6
  174. package/src/i3s-converter/helpers/geometry-converter.ts +2 -0
  175. package/src/i3s-converter/i3s-converter.ts +17 -7
  176. package/src/pgm-loader.ts +2 -2
@@ -1,4 +1,3 @@
1
- var ms=Object.create;var Ar=Object.defineProperty,gs=Object.defineProperties,ys=Object.getOwnPropertyDescriptor,Ms=Object.getOwnPropertyDescriptors,xs=Object.getOwnPropertyNames,mn=Object.getOwnPropertySymbols,bs=Object.getPrototypeOf,gn=Object.prototype.hasOwnProperty,_s=Object.prototype.propertyIsEnumerable;var yn=(e,r,t)=>r in e?Ar(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Q=(e,r)=>{for(var t in r||(r={}))gn.call(r,t)&&yn(e,t,r[t]);if(mn)for(var t of mn(r))_s.call(r,t)&&yn(e,t,r[t]);return e},Mn=(e,r)=>gs(e,Ms(r)),Ts=e=>Ar(e,"__esModule",{value:!0});var R=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ks=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of xs(r))!gn.call(e,a)&&a!=="default"&&Ar(e,a,{get:()=>r[a],enumerable:!(t=ys(r,a))||t.enumerable});return e},xn=e=>ks(Ts(Ar(e!=null?ms(bs(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var U=R((Zd,An)=>{function Bs(e){return e&&e.__esModule?e:{default:e}}An.exports=Bs});var te=R((Xd,Ir)=>{function Lr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ir.exports=Lr=function(t){return typeof t}:Ir.exports=Lr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}Ir.exports=Lr});var Et=R((Qd,At)=>{function St(e,r){return At.exports=St=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},St(e,r)}At.exports=St});var Pn=R(($d,En)=>{function Fs(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}En.exports=Fs});var wn=R((Jd,Cr)=>{var zs=Et(),Ys=Pn();function Nr(e,r,t){return Ys()?Cr.exports=Nr=Reflect.construct:Cr.exports=Nr=function(n,i,s){var o=[null];o.push.apply(o,i);var c=Function.bind.apply(n,o),u=new c;return s&&zs(u,s.prototype),u},Nr.apply(null,arguments)}Cr.exports=Nr});var Pt=R((Hd,qn)=>{function Vs(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}qn.exports=Vs});var In=R((Kd,Ln)=>{var Gs=Pt();function Us(e){if(Array.isArray(e))return Gs(e)}Ln.exports=Us});var Cn=R((ep,Nn)=>{function js(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}Nn.exports=js});var wt=R((rp,Wn)=>{var Dn=Pt();function Zs(e,r){if(!!e){if(typeof e=="string")return Dn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Dn(e,r)}}Wn.exports=Zs});var Fn=R((tp,Bn)=>{function Xs(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Bn.exports=Xs});var Yn=R((np,zn)=>{var Qs=In(),$s=Cn(),Js=wt(),Hs=Fn();function Ks(e){return Qs(e)||$s(e)||Js(e)||Hs()}zn.exports=Ks});var ze=R(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.default=eo;function eo(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}});var me=R(F=>{"use strict";var Dr=U();Object.defineProperty(F,"__esModule",{value:!0});F.configure=so;F.formatValue=co;F.isArray=Ye;F.clone=lo;F.toRadians=fo;F.toDegrees=ho;F.radians=Gn;F.degrees=Un;F.sin=po;F.cos=vo;F.tan=mo;F.asin=go;F.acos=yo;F.atan=Mo;F.clamp=xo;F.lerp=jn;F.equals=Zn;F.exactEquals=Xn;F.withEpsilon=bo;F.config=void 0;var Vn=Dr(te()),ro=Dr(wn()),to=Dr(Yn()),no=Dr(ze()),ao=1/Math.PI*180,io=1/180*Math.PI,V={};F.config=V;V.EPSILON=1e-12;V.debug=!1;V.precision=4;V.printTypes=!1;V.printDegrees=!1;V.printRowMajor=!0;function so(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};for(var r in e)(0,no.default)(r in V),V[r]=e[r];return V}function oo(e){return Math.round(e/V.EPSILON)*V.EPSILON}function co(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.precision,a=t===void 0?V.precision||4:t;return e=oo(e),"".concat(parseFloat(e.toPrecision(a)))}function Ye(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uo(e){return e.clone?e.clone():new Array(e.length)}function lo(e){return e.clone?e.clone():(0,ro.default)(Array,(0,to.default)(e))}function _e(e,r,t){if(Ye(e)){t=t||uo(e);for(var a=0;a<t.length&&a<e.length;++a)t[a]=r(e[a],a,t);return t}return r(e)}function fo(e){return Gn(e)}function ho(e){return Un(e)}function Gn(e,r){return _e(e,function(t){return t*io},r)}function Un(e,r){return _e(e,function(t){return t*ao},r)}function po(e){return _e(e,function(r){return Math.sin(r)})}function vo(e){return _e(e,function(r){return Math.cos(r)})}function mo(e){return _e(e,function(r){return Math.tan(r)})}function go(e){return _e(e,function(r){return Math.asin(r)})}function yo(e){return _e(e,function(r){return Math.acos(r)})}function Mo(e){return _e(e,function(r){return Math.atan(r)})}function xo(e,r,t){return _e(e,function(a){return Math.max(r,Math.min(t,a))})}function jn(e,r,t){return Ye(e)?e.map(function(a,n){return jn(a,r[n],t)}):t*r+(1-t)*e}function Zn(e,r,t){var a=V.EPSILON;t&&(V.EPSILON=t);try{if(e===r)return!0;if(Ye(e)&&Ye(r)){if(e.length!==r.length)return!1;for(var n=0;n<e.length;++n)if(!Zn(e[n],r[n]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):Number.isFinite(e)&&Number.isFinite(r)?Math.abs(e-r)<=V.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{V.EPSILON=a}}function Xn(e,r){if(e===r)return!0;if(e&&(0,Vn.default)(e)==="object"&&r&&(0,Vn.default)(r)==="object"){if(e.constructor!==r.constructor)return!1;if(e.exactEquals)return e.exactEquals(r)}if(Ye(e)&&Ye(r)){if(e.length!==r.length)return!1;for(var t=0;t<e.length;++t)if(!Xn(e[t],r[t]))return!1;return!0}return!1}function bo(e,r){var t=V.EPSILON;V.EPSILON=e;var a;try{a=r()}finally{V.EPSILON=t}return a}});var $=R((sp,Qn)=>{function _o(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Qn.exports=_o});var J=R((op,Jn)=>{function $n(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function To(e,r,t){return r&&$n(e.prototype,r),t&&$n(e,t),e}Jn.exports=To});var se=R((cp,Hn)=>{var ko=Et();function Oo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&ko(e,r)}Hn.exports=Oo});var ea=R((up,Kn)=>{function Ro(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Kn.exports=Ro});var oe=R((lp,ra)=>{var So=te(),Ao=ea();function Eo(e,r){return r&&(So(r)==="object"||typeof r=="function")?r:Ao(e)}ra.exports=Eo});var ce=R((fp,It)=>{function Lt(e){return It.exports=Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(e)}It.exports=Lt});var br=R(Wr=>{"use strict";var rr=U();Object.defineProperty(Wr,"__esModule",{value:!0});Wr.default=void 0;var Po=rr($()),wo=rr(J()),qo=rr(se()),Lo=rr(oe()),ta=rr(ce()),xr=me(),Io=rr(ze());function No(e){var r=Co();return function(){var a=(0,ta.default)(e),n;if(r){var i=(0,ta.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Lo.default)(this,n)}}function Co(){if(typeof Reflect=="undefined"||!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 Do(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var Wo=function(e){(0,qo.default)(t,e);var r=No(t);function t(){return(0,Po.default)(this,t),r.apply(this,arguments)}return(0,wo.default)(t,[{key:"ELEMENTS",get:function(){return(0,Io.default)(!1),0}},{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"from",value:function(n){return Array.isArray(n)?this.copy(n):this.fromObject(n)}},{key:"fromArray",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)this[s]=n[s+i];return this.check()}},{key:"to",value:function(n){return n===this?this:(0,xr.isArray)(n)?this.toArray(n):this.toObject(n)}},{key:"toTarget",value:function(n){return n?this.to(n):this}},{key:"toArray",value:function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)n[i+s]=this[s];return n}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(xr.config)}},{key:"formatString",value:function(n){for(var i="",s=0;s<this.ELEMENTS;++s)i+=(s>0?", ":"")+(0,xr.formatValue)(this[s],n);return"".concat(n.printTypes?this.constructor.name:"","[").concat(i,"]")}},{key:"equals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(!(0,xr.equals)(this[i],n[i]))return!1;return!0}},{key:"exactEquals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(this[i]!==n[i])return!1;return!0}},{key:"negate",value:function(){for(var n=0;n<this.ELEMENTS;++n)this[n]=-this[n];return this.check()}},{key:"lerp",value:function(n,i,s){s===void 0&&(s=i,i=n,n=this);for(var o=0;o<this.ELEMENTS;++o){var c=n[o];this[o]=c+s*(i[o]-c)}return this.check()}},{key:"min",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(n[i],this[i]);return this.check()}},{key:"max",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.max(n[i],this[i]);return this.check()}},{key:"clamp",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n[s]),i[s]);return this.check()}},{key:"add",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]+=u[l];return this.check()}},{key:"subtract",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]-=u[l];return this.check()}},{key:"scale",value:function(n){if(Array.isArray(n))return this.multiply(n);for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"sub",value:function(n){return this.subtract(n)}},{key:"setScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=n;return this.check()}},{key:"addScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]+=n;return this.check()}},{key:"subScalar",value:function(n){return this.addScalar(-n)}},{key:"multiplyScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"divideScalar",value:function(n){return this.scale(1/n)}},{key:"clampScalar",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n),i);return this.check()}},{key:"multiplyByScalar",value:function(n){return this.scale(n)}},{key:"elements",get:function(){return this}},{key:"check",value:function(){if(xr.config.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var n=this.length===this.ELEMENTS,i=0;i<this.ELEMENTS;++i)n=n&&Number.isFinite(this[i]);return n}}]),t}(Do(Array));Wr.default=Wo});var ue=R(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.validateVector=na;tr.checkNumber=Fo;tr.checkVector=zo;tr.deprecated=Yo;var Bo=me();function na(e,r){if(e.length!==r)return!1;for(var t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function Fo(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function zo(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(Bo.config.debug&&!na(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}var aa={};function Yo(e,r){aa[e]||(aa[e]=!0,console.warn("".concat(e," has been removed in version ").concat(r,", see upgrade guide for more information")))}});var zr=R(Fr=>{"use strict";var Ve=U();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.default=void 0;var Vo=Ve($()),Go=Ve(J()),Uo=Ve(se()),jo=Ve(oe()),ia=Ve(ce()),Zo=Ve(br()),_r=ue(),Br=Ve(ze());function Xo(e){var r=Qo();return function(){var a=(0,ia.default)(e),n;if(r){var i=(0,ia.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,jo.default)(this,n)}}function Qo(){if(typeof Reflect=="undefined"||!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}}var $o=function(e){(0,Uo.default)(t,e);var r=Xo(t);function t(){return(0,Vo.default)(this,t),r.apply(this,arguments)}return(0,Go.default)(t,[{key:"ELEMENTS",get:function(){return(0,Br.default)(!1),0}},{key:"copy",value:function(n){return(0,Br.default)(!1),this}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,_r.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,_r.checkNumber)(n)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var n=0,i=0;i<this.ELEMENTS;++i)n+=this[i]*this[i];return n}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(n){return Math.sqrt(this.distanceSquared(n))}},{key:"distanceSquared",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s){var o=this[s]-n[s];i+=o*o}return(0,_r.checkNumber)(i)}},{key:"dot",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s)i+=this[s]*n[s];return(0,_r.checkNumber)(i)}},{key:"normalize",value:function(){var n=this.magnitude();if(n!==0)for(var i=0;i<this.ELEMENTS;++i)this[i]/=n;return this.check()}},{key:"multiply",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]*=u[l];return this.check()}},{key:"divide",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]/=u[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(n){return this.distance(n)}},{key:"distanceToSquared",value:function(n){return this.distanceSquared(n)}},{key:"getComponent",value:function(n){return(0,Br.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),(0,_r.checkNumber)(this[n])}},{key:"setComponent",value:function(n,i){return(0,Br.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),this[n]=i,this.check()}},{key:"addVectors",value:function(n,i){return this.copy(n).add(i)}},{key:"subVectors",value:function(n,i){return this.copy(n).subtract(i)}},{key:"multiplyVectors",value:function(n,i){return this.copy(n).multiply(i)}},{key:"addScaledVector",value:function(n,i){return this.add(new this.constructor(n).multiplyScalar(i))}}]),t}(Zo.default);Fr.default=$o});var Ge=R(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.setMatrixArrayType=Ho;ne.toRadian=ec;ne.equals=rc;ne.RANDOM=ne.ARRAY_TYPE=ne.EPSILON=void 0;var sa=1e-6;ne.EPSILON=sa;var oa=typeof Float32Array!="undefined"?Float32Array:Array;ne.ARRAY_TYPE=oa;var Jo=Math.random;ne.RANDOM=Jo;function Ho(e){ne.ARRAY_TYPE=oa=e}var Ko=Math.PI/180;function ec(e){return e*Ko}function rc(e,r){return Math.abs(e-r)<=sa*Math.max(1,Math.abs(e),Math.abs(r))}Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)})});var Vr=R(O=>{"use strict";function Yr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yr=function(t){return typeof t}:Yr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(e)}Object.defineProperty(O,"__esModule",{value:!0});O.create=ua;O.clone=nc;O.fromValues=ac;O.copy=ic;O.set=sc;O.add=oc;O.subtract=la;O.multiply=fa;O.divide=ha;O.ceil=cc;O.floor=uc;O.min=lc;O.max=fc;O.round=hc;O.scale=dc;O.scaleAndAdd=pc;O.distance=da;O.squaredDistance=pa;O.length=va;O.squaredLength=ma;O.negate=vc;O.inverse=mc;O.normalize=gc;O.dot=yc;O.cross=Mc;O.lerp=xc;O.random=bc;O.transformMat2=_c;O.transformMat2d=Tc;O.transformMat3=kc;O.transformMat4=Oc;O.rotate=Rc;O.angle=Sc;O.zero=Ac;O.str=Ec;O.exactEquals=Pc;O.equals=wc;O.forEach=O.sqrLen=O.sqrDist=O.dist=O.div=O.mul=O.sub=O.len=void 0;var Ue=tc(Ge());function ca(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ca=function(){return e},e}function tc(e){if(e&&e.__esModule)return e;if(e===null||Yr(e)!=="object"&&typeof e!="function")return{default:e};var r=ca();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function ua(){var e=new Ue.ARRAY_TYPE(2);return Ue.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function nc(e){var r=new Ue.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r}function ac(e,r){var t=new Ue.ARRAY_TYPE(2);return t[0]=e,t[1]=r,t}function ic(e,r){return e[0]=r[0],e[1]=r[1],e}function sc(e,r,t){return e[0]=r,e[1]=t,e}function oc(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function la(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e}function fa(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e}function ha(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e}function cc(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e}function uc(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e}function lc(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e}function fc(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e}function hc(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e}function dc(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function pc(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e}function da(e,r){var t=r[0]-e[0],a=r[1]-e[1];return Math.hypot(t,a)}function pa(e,r){var t=r[0]-e[0],a=r[1]-e[1];return t*t+a*a}function va(e){var r=e[0],t=e[1];return Math.hypot(r,t)}function ma(e){var r=e[0],t=e[1];return r*r+t*t}function vc(e,r){return e[0]=-r[0],e[1]=-r[1],e}function mc(e,r){return e[0]=1/r[0],e[1]=1/r[1],e}function gc(e,r){var t=r[0],a=r[1],n=t*t+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e}function yc(e,r){return e[0]*r[0]+e[1]*r[1]}function Mc(e,r,t){var a=r[0]*t[1]-r[1]*t[0];return e[0]=e[1]=0,e[2]=a,e}function xc(e,r,t,a){var n=r[0],i=r[1];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e}function bc(e,r){r=r||1;var t=Ue.RANDOM()*2*Math.PI;return e[0]=Math.cos(t)*r,e[1]=Math.sin(t)*r,e}function _c(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e}function Tc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n+t[4],e[1]=t[1]*a+t[3]*n+t[5],e}function kc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[3]*n+t[6],e[1]=t[1]*a+t[4]*n+t[7],e}function Oc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[4]*n+t[12],e[1]=t[1]*a+t[5]*n+t[13],e}function Rc(e,r,t,a){var n=r[0]-t[0],i=r[1]-t[1],s=Math.sin(a),o=Math.cos(a);return e[0]=n*o-i*s+t[0],e[1]=n*s+i*o+t[1],e}function Sc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1],s=Math.sqrt(t*t+a*a)*Math.sqrt(n*n+i*i),o=s&&(t*n+a*i)/s;return Math.acos(Math.min(Math.max(o,-1),1))}function Ac(e){return e[0]=0,e[1]=0,e}function Ec(e){return"vec2("+e[0]+", "+e[1]+")"}function Pc(e,r){return e[0]===r[0]&&e[1]===r[1]}function wc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1];return Math.abs(t-n)<=Ue.EPSILON*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(a-i)<=Ue.EPSILON*Math.max(1,Math.abs(a),Math.abs(i))}var qc=va;O.len=qc;var Lc=la;O.sub=Lc;var Ic=fa;O.mul=Ic;var Nc=ha;O.div=Nc;var Cc=da;O.dist=Cc;var Dc=pa;O.sqrDist=Dc;var Wc=ma;O.sqrLen=Wc;var Bc=function(){var e=ua();return function(r,t,a,n,i,s){var o,c;for(t||(t=2),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],i(e,e,s),r[o]=e[0],r[o+1]=e[1];return r}}();O.forEach=Bc});var nr=R(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.vec2_transformMat4AsVector=Fc;je.vec3_transformMat4AsVector=zc;je.vec3_transformMat2=Yc;je.vec4_transformMat2=Vc;je.vec4_transformMat3=Gc;function Fc(e,r,t){var a=r[0],n=r[1],i=t[3]*a+t[7]*n||1;return e[0]=(t[0]*a+t[4]*n)/i,e[1]=(t[1]*a+t[5]*n)/i,e}function zc(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i||1;return e[0]=(t[0]*a+t[4]*n+t[8]*i)/s,e[1]=(t[1]*a+t[5]*n+t[9]*i)/s,e[2]=(t[2]*a+t[6]*n+t[10]*i)/s,e}function Yc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e}function Vc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e[3]=r[3],e}function Gc(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=t[0]*a+t[3]*n+t[6]*i,e[1]=t[1]*a+t[4]*n+t[7]*i,e[2]=t[2]*a+t[5]*n+t[8]*i,e[3]=r[3],e}});var Ma=R(jr=>{"use strict";var ar=U(),Uc=te();Object.defineProperty(jr,"__esModule",{value:!0});jr.default=void 0;var jc=ar($()),Zc=ar(J()),Xc=ar(se()),Qc=ar(oe()),ga=ar(ce()),$c=ar(zr()),Nt=me(),Gr=ue(),Ur=Hc(Vr()),Jc=nr();function ya(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ya=function(n){return n?t:r})(e)}function Hc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Uc(e)!=="object"&&typeof e!="function")return{default:e};var t=ya(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Kc(e){var r=eu();return function(){var a=(0,ga.default)(e),n;if(r){var i=(0,ga.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Qc.default)(this,n)}}function eu(){if(typeof Reflect=="undefined"||!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}}var ru=function(e){(0,Xc.default)(t,e);var r=Kc(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(0,jc.default)(this,t),a=r.call(this,2),(0,Nt.isArray)(n)&&arguments.length===1?a.copy(n):(Nt.config.debug&&((0,Gr.checkNumber)(n),(0,Gr.checkNumber)(i)),a[0]=n,a[1]=i),a}return(0,Zc.default)(t,[{key:"set",value:function(n,i){return this[0]=n,this[1]=i,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this.check()}},{key:"fromObject",value:function(n){return Nt.config.debug&&((0,Gr.checkNumber)(n.x),(0,Gr.checkNumber)(n.y)),this[0]=n.x,this[1]=n.y,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return Ur.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,Jc.vec2_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return Ur.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2x3",value:function(n){return Ur.transformMat2d(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return Ur.transformMat2(this,this,n),this.check()}}]),t}($c.default);jr.default=ru});var ke=R(T=>{"use strict";function Zr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zr=function(t){return typeof t}:Zr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(e)}Object.defineProperty(T,"__esModule",{value:!0});T.create=ba;T.clone=nu;T.length=_a;T.fromValues=au;T.copy=iu;T.set=su;T.add=ou;T.subtract=Ta;T.multiply=ka;T.divide=Oa;T.ceil=cu;T.floor=uu;T.min=lu;T.max=fu;T.round=hu;T.scale=du;T.scaleAndAdd=pu;T.distance=Ra;T.squaredDistance=Sa;T.squaredLength=Aa;T.negate=vu;T.inverse=mu;T.normalize=gu;T.dot=Ea;T.cross=yu;T.lerp=Mu;T.hermite=xu;T.bezier=bu;T.random=_u;T.transformMat4=Tu;T.transformMat3=ku;T.transformQuat=Ou;T.rotateX=Ru;T.rotateY=Su;T.rotateZ=Au;T.angle=Eu;T.zero=Pu;T.str=wu;T.exactEquals=qu;T.equals=Lu;T.forEach=T.sqrLen=T.len=T.sqrDist=T.dist=T.div=T.mul=T.sub=void 0;var Te=tu(Ge());function xa(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return xa=function(){return e},e}function tu(e){if(e&&e.__esModule)return e;if(e===null||Zr(e)!=="object"&&typeof e!="function")return{default:e};var r=xa();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function ba(){var e=new Te.ARRAY_TYPE(3);return Te.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function nu(e){var r=new Te.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function _a(e){var r=e[0],t=e[1],a=e[2];return Math.hypot(r,t,a)}function au(e,r,t){var a=new Te.ARRAY_TYPE(3);return a[0]=e,a[1]=r,a[2]=t,a}function iu(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function su(e,r,t,a){return e[0]=r,e[1]=t,e[2]=a,e}function ou(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function Ta(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function ka(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Oa(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function cu(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function uu(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function lu(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function fu(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function hu(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e}function du(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function pu(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e}function Ra(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return Math.hypot(t,a,n)}function Sa(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return t*t+a*a+n*n}function Aa(e){var r=e[0],t=e[1],a=e[2];return r*r+t*t+a*a}function vu(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function mu(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function gu(e,r){var t=r[0],a=r[1],n=r[2],i=t*t+a*a+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e}function Ea(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function yu(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2];return e[0]=n*c-i*o,e[1]=i*s-a*c,e[2]=a*o-n*s,e}function Mu(e,r,t,a){var n=r[0],i=r[1],s=r[2];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e}function xu(e,r,t,a,n,i){var s=i*i,o=s*(2*i-3)+1,c=s*(i-2)+i,u=s*(i-1),l=s*(3-2*i);return e[0]=r[0]*o+t[0]*c+a[0]*u+n[0]*l,e[1]=r[1]*o+t[1]*c+a[1]*u+n[1]*l,e[2]=r[2]*o+t[2]*c+a[2]*u+n[2]*l,e}function bu(e,r,t,a,n,i){var s=1-i,o=s*s,c=i*i,u=o*s,l=3*i*o,f=3*c*s,h=c*i;return e[0]=r[0]*u+t[0]*l+a[0]*f+n[0]*h,e[1]=r[1]*u+t[1]*l+a[1]*f+n[1]*h,e[2]=r[2]*u+t[2]*l+a[2]*f+n[2]*h,e}function _u(e,r){r=r||1;var t=Te.RANDOM()*2*Math.PI,a=Te.RANDOM()*2-1,n=Math.sqrt(1-a*a)*r;return e[0]=Math.cos(t)*n,e[1]=Math.sin(t)*n,e[2]=a*r,e}function Tu(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i+t[15];return s=s||1,e[0]=(t[0]*a+t[4]*n+t[8]*i+t[12])/s,e[1]=(t[1]*a+t[5]*n+t[9]*i+t[13])/s,e[2]=(t[2]*a+t[6]*n+t[10]*i+t[14])/s,e}function ku(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=a*t[0]+n*t[3]+i*t[6],e[1]=a*t[1]+n*t[4]+i*t[7],e[2]=a*t[2]+n*t[5]+i*t[8],e}function Ou(e,r,t){var a=t[0],n=t[1],i=t[2],s=t[3],o=r[0],c=r[1],u=r[2],l=n*u-i*c,f=i*o-a*u,h=a*c-n*o,d=n*h-i*f,p=i*l-a*h,m=a*f-n*l,v=s*2;return l*=v,f*=v,h*=v,d*=2,p*=2,m*=2,e[0]=o+l+d,e[1]=c+f+p,e[2]=u+h+m,e}function Ru(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0],i[1]=n[1]*Math.cos(a)-n[2]*Math.sin(a),i[2]=n[1]*Math.sin(a)+n[2]*Math.cos(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Su(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[2]*Math.sin(a)+n[0]*Math.cos(a),i[1]=n[1],i[2]=n[2]*Math.cos(a)-n[0]*Math.sin(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Au(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0]*Math.cos(a)-n[1]*Math.sin(a),i[1]=n[0]*Math.sin(a)+n[1]*Math.cos(a),i[2]=n[2],e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function Eu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2],c=Math.sqrt(t*t+a*a+n*n),u=Math.sqrt(i*i+s*s+o*o),l=c*u,f=l&&Ea(e,r)/l;return Math.acos(Math.min(Math.max(f,-1),1))}function Pu(e){return e[0]=0,e[1]=0,e[2]=0,e}function wu(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function qu(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function Lu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2];return Math.abs(t-i)<=Te.EPSILON*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(a-s)<=Te.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(n-o)<=Te.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))}var Iu=Ta;T.sub=Iu;var Nu=ka;T.mul=Nu;var Cu=Oa;T.div=Cu;var Du=Ra;T.dist=Du;var Wu=Sa;T.sqrDist=Wu;var Bu=_a;T.len=Bu;var Fu=Aa;T.sqrLen=Fu;var zu=function(){var e=ba();return function(r,t,a,n,i,s){var o,c;for(t||(t=3),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2];return r}}();T.forEach=zu});var Qr=R(Xr=>{"use strict";var ir=U(),Yu=te();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.default=void 0;var Vu=ir($()),Gu=ir(J()),Uu=ir(se()),ju=ir(oe()),Pa=ir(ce()),Zu=ir(zr()),Ct=me(),Ze=ue(),Ee=Xu(ke()),wa=nr();function qa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(qa=function(n){return n?t:r})(e)}function Xu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Yu(e)!=="object"&&typeof e!="function")return{default:e};var t=qa(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Qu(e){var r=$u();return function(){var a=(0,Pa.default)(e),n;if(r){var i=(0,Pa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,ju.default)(this,n)}}function $u(){if(typeof Reflect=="undefined"||!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}}var Dt=[0,0,0],La={},Ju=function(e){(0,Uu.default)(t,e);var r=Qu(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return(0,Vu.default)(this,t),a=r.call(this,-0,-0,-0),arguments.length===1&&(0,Ct.isArray)(n)?a.copy(n):(Ct.config.debug&&((0,Ze.checkNumber)(n),(0,Ze.checkNumber)(i),(0,Ze.checkNumber)(s)),a[0]=n,a[1]=i,a[2]=s),a}return(0,Gu.default)(t,[{key:"set",value:function(n,i,s){return this[0]=n,this[1]=i,this[2]=s,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this.check()}},{key:"fromObject",value:function(n){return Ct.config.debug&&((0,Ze.checkNumber)(n.x),(0,Ze.checkNumber)(n.y),(0,Ze.checkNumber)(n.z)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,Ze.checkNumber)(n)}},{key:"angle",value:function(n){return Ee.angle(this,n)}},{key:"cross",value:function(n){return Ee.cross(this,this,n),this.check()}},{key:"rotateX",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Dt:s;return Ee.rotateX(this,this,o,i),this.check()}},{key:"rotateY",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Dt:s;return Ee.rotateY(this,this,o,i),this.check()}},{key:"rotateZ",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?Dt:s;return Ee.rotateZ(this,this,o,i),this.check()}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return Ee.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,wa.vec3_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return Ee.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,wa.vec3_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Ee.transformQuat(this,this,n),this.check()}}],[{key:"ZERO",get:function(){return La.ZERO=La.ZERO||Object.freeze(new t(0,0,0,0))}}]),t}(Zu.default);Xr.default=Ju});var Ba=R($r=>{"use strict";var sr=U(),Hu=te();Object.defineProperty($r,"__esModule",{value:!0});$r.default=void 0;var Ku=sr($()),el=sr(J()),rl=sr(se()),tl=sr(oe()),Ia=sr(ce()),nl=sr(zr()),Wt=me(),ge=ue(),Na=al(ke()),Ca=nr();function Da(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Da=function(n){return n?t:r})(e)}function al(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Hu(e)!=="object"&&typeof e!="function")return{default:e};var t=Da(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function il(e){var r=sl();return function(){var a=(0,Ia.default)(e),n;if(r){var i=(0,Ia.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,tl.default)(this,n)}}function sl(){if(typeof Reflect=="undefined"||!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}}var Wa={},ol=function(e){(0,rl.default)(t,e);var r=il(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return(0,Ku.default)(this,t),a=r.call(this,-0,-0,-0,-0),(0,Wt.isArray)(n)&&arguments.length===1?a.copy(n):(Wt.config.debug&&((0,ge.checkNumber)(n),(0,ge.checkNumber)(i),(0,ge.checkNumber)(s),(0,ge.checkNumber)(o)),a[0]=n,a[1]=i,a[2]=s,a[3]=o),a}return(0,el.default)(t,[{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"fromObject",value:function(n){return Wt.config.debug&&((0,ge.checkNumber)(n.x),(0,ge.checkNumber)(n.y),(0,ge.checkNumber)(n.z),(0,ge.checkNumber)(n.w)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this[3]=n.w,this}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n.w=this[3],n}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ge.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,ge.checkNumber)(n)}},{key:"transform",value:function(n){return Na.transformMat4(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return(0,Ca.vec4_transformMat3)(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,Ca.vec4_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Na.transformQuat(this,this,n),this.check()}},{key:"applyMatrix4",value:function(n){return n.transform(this,this),this}}],[{key:"ZERO",get:function(){return Wa.ZERO=Wa.ZERO||Object.freeze(new t(0,0,0,0))}}]),t}(nl.default);$r.default=ol});var Bt=R(Jr=>{"use strict";var Xe=U();Object.defineProperty(Jr,"__esModule",{value:!0});Jr.default=void 0;var cl=Xe($()),ul=Xe(J()),ll=Xe(se()),fl=Xe(oe()),Fa=Xe(ce()),hl=Xe(br()),dl=ue(),pl=me(),za=Xe(ze());function vl(e){var r=ml();return function(){var a=(0,Fa.default)(e),n;if(r){var i=(0,Fa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,fl.default)(this,n)}}function ml(){if(typeof Reflect=="undefined"||!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}}var gl=function(e){(0,ll.default)(t,e);var r=vl(t);function t(){return(0,cl.default)(this,t),r.apply(this,arguments)}return(0,ul.default)(t,[{key:"ELEMENTS",get:function(){return(0,za.default)(!1),0}},{key:"RANK",get:function(){return(0,za.default)(!1),0}},{key:"toString",value:function(){var n="[";if(pl.config.printRowMajor){n+="row-major:";for(var i=0;i<this.RANK;++i)for(var s=0;s<this.RANK;++s)n+=" ".concat(this[s*this.RANK+i])}else{n+="column-major:";for(var o=0;o<this.ELEMENTS;++o)n+=" ".concat(this[o])}return n+="]",n}},{key:"getElementIndex",value:function(n,i){return i*this.RANK+n}},{key:"getElement",value:function(n,i){return this[i*this.RANK+n]}},{key:"setElement",value:function(n,i,s){return this[i*this.RANK+n]=(0,dl.checkNumber)(s),this}},{key:"getColumn",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),s=n*this.RANK,o=0;o<this.RANK;++o)i[o]=this[s+o];return i}},{key:"setColumn",value:function(n,i){for(var s=n*this.RANK,o=0;o<this.RANK;++o)this[s+o]=i[o];return this}}]),t}(hl.default);Jr.default=gl});var Ft=R(q=>{"use strict";function Hr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hr=function(t){return typeof t}:Hr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(e)}Object.defineProperty(q,"__esModule",{value:!0});q.create=Ml;q.fromMat4=xl;q.clone=bl;q.copy=_l;q.fromValues=Tl;q.set=kl;q.identity=Ol;q.transpose=Rl;q.invert=Sl;q.adjoint=Al;q.determinant=El;q.multiply=Va;q.translate=Pl;q.rotate=wl;q.scale=ql;q.fromTranslation=Ll;q.fromRotation=Il;q.fromScaling=Nl;q.fromMat2d=Cl;q.fromQuat=Dl;q.normalFromMat4=Wl;q.projection=Bl;q.str=Fl;q.frob=zl;q.add=Yl;q.subtract=Ga;q.multiplyScalar=Vl;q.multiplyScalarAndAdd=Gl;q.exactEquals=Ul;q.equals=jl;q.sub=q.mul=void 0;var K=yl(Ge());function Ya(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Ya=function(){return e},e}function yl(e){if(e&&e.__esModule)return e;if(e===null||Hr(e)!=="object"&&typeof e!="function")return{default:e};var r=Ya();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function Ml(){var e=new K.ARRAY_TYPE(9);return K.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function xl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e}function bl(e){var r=new K.ARRAY_TYPE(9);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function _l(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Tl(e,r,t,a,n,i,s,o,c){var u=new K.ARRAY_TYPE(9);return u[0]=e,u[1]=r,u[2]=t,u[3]=a,u[4]=n,u[5]=i,u[6]=s,u[7]=o,u[8]=c,u}function kl(e,r,t,a,n,i,s,o,c,u){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e}function Ol(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Rl(e,r){if(e===r){var t=r[1],a=r[2],n=r[5];e[1]=r[3],e[2]=r[6],e[3]=t,e[5]=r[7],e[6]=a,e[7]=n}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e}function Sl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=l*s-o*u,h=-l*i+o*c,d=u*i-s*c,p=t*f+a*h+n*d;return p?(p=1/p,e[0]=f*p,e[1]=(-l*a+n*u)*p,e[2]=(o*a-n*s)*p,e[3]=h*p,e[4]=(l*t-n*c)*p,e[5]=(-o*t+n*i)*p,e[6]=d*p,e[7]=(-u*t+a*c)*p,e[8]=(s*t-a*i)*p,e):null}function Al(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8];return e[0]=s*l-o*u,e[1]=n*u-a*l,e[2]=a*o-n*s,e[3]=o*c-i*l,e[4]=t*l-n*c,e[5]=n*i-t*o,e[6]=i*u-s*c,e[7]=a*c-t*u,e[8]=t*s-a*i,e}function El(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8];return r*(u*i-s*c)+t*(-u*n+s*o)+a*(c*n-i*o)}function Va(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=t[0],d=t[1],p=t[2],m=t[3],v=t[4],g=t[5],b=t[6],y=t[7],M=t[8];return e[0]=h*a+d*s+p*u,e[1]=h*n+d*o+p*l,e[2]=h*i+d*c+p*f,e[3]=m*a+v*s+g*u,e[4]=m*n+v*o+g*l,e[5]=m*i+v*c+g*f,e[6]=b*a+y*s+M*u,e[7]=b*n+y*o+M*l,e[8]=b*i+y*c+M*f,e}function Pl(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=t[0],d=t[1];return e[0]=a,e[1]=n,e[2]=i,e[3]=s,e[4]=o,e[5]=c,e[6]=h*a+d*s+u,e[7]=h*n+d*o+l,e[8]=h*i+d*c+f,e}function wl(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=Math.sin(t),d=Math.cos(t);return e[0]=d*a+h*s,e[1]=d*n+h*o,e[2]=d*i+h*c,e[3]=d*s-h*a,e[4]=d*o-h*n,e[5]=d*c-h*i,e[6]=u,e[7]=l,e[8]=f,e}function ql(e,r,t){var a=t[0],n=t[1];return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=n*r[3],e[4]=n*r[4],e[5]=n*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Ll(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=r[0],e[7]=r[1],e[8]=1,e}function Il(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=-t,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Nl(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=r[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Cl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=0,e[3]=r[2],e[4]=r[3],e[5]=0,e[6]=r[4],e[7]=r[5],e[8]=1,e}function Dl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,f=a*o,h=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-f-p,e[3]=l-g,e[6]=h+v,e[1]=l+g,e[4]=1-u-p,e[7]=d-m,e[2]=h-v,e[5]=d+m,e[8]=1-u-f,e}function Wl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,k=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-f*p,I=l*v-h*p,w=l*g-d*p,D=f*v-h*m,N=f*g-d*m,W=h*g-d*v,E=b*W-y*N+M*D+k*w-_*I+C*L;return E?(E=1/E,e[0]=(o*W-c*N+u*D)*E,e[1]=(c*w-s*W-u*I)*E,e[2]=(s*N-o*w+u*L)*E,e[3]=(n*N-a*W-i*D)*E,e[4]=(t*W-n*w+i*I)*E,e[5]=(a*w-t*N-i*L)*E,e[6]=(m*C-v*_+g*k)*E,e[7]=(v*M-p*C-g*y)*E,e[8]=(p*_-m*M+g*b)*E,e):null}function Bl(e,r,t){return e[0]=2/r,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/t,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Fl(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function zl(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Yl(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e}function Ga(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e}function Vl(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e}function Gl(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e}function Ul(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]}function jl(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],f=r[0],h=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8];return Math.abs(t-f)<=K.EPSILON*Math.max(1,Math.abs(t),Math.abs(f))&&Math.abs(a-h)<=K.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(n-d)<=K.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=K.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=K.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-v)<=K.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(c-g)<=K.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-b)<=K.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-y)<=K.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))}var Zl=Va;q.mul=Zl;var Xl=Ga;q.sub=Xl});var Xa=R(et=>{"use strict";var or=U(),Ql=te();Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var $l=or($()),Jl=or(J()),Hl=or(se()),Kl=or(oe()),Ua=or(ce()),ef=or(Bt()),Kr=ue(),rf=nr(),ye=zt(Ft()),tf=zt(Vr()),nf=zt(ke());function ja(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ja=function(n){return n?t:r})(e)}function zt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Ql(e)!=="object"&&typeof e!="function")return{default:e};var t=ja(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function af(e){var r=sf();return function(){var a=(0,Ua.default)(e),n;if(r){var i=(0,Ua.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Kl.default)(this,n)}}function sf(){if(typeof Reflect=="undefined"||!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}}var Za=Object.freeze([1,0,0,0,1,0,0,0,1]),of=Object.freeze([0,0,0,0,0,0,0,0,0]),cf=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),cr={},uf=function(e){(0,Hl.default)(t,e);var r=af(t);function t(a){var n;return(0,$l.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):n.identity(),n}return(0,Jl.default)(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return cf}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,f,h){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=f,this[8]=h,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,f,h){return this[0]=n,this[1]=o,this[2]=l,this[3]=i,this[4]=c,this[5]=f,this[6]=s,this[7]=u,this[8]=h,this.check()}},{key:"determinant",value:function(){return ye.determinant(this)}},{key:"identity",value:function(){return this.copy(Za)}},{key:"fromQuaternion",value:function(n){return ye.fromQuat(this,n),this.check()}},{key:"transpose",value:function(){return ye.transpose(this,this),this.check()}},{key:"invert",value:function(){return ye.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return ye.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return ye.multiply(this,this,n),this.check()}},{key:"rotate",value:function(n){return ye.rotate(this,this,n),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?ye.scale(this,this,n):ye.scale(this,this,[n,n,n]),this.check()}},{key:"translate",value:function(n){return ye.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){switch(n.length){case 2:i=tf.transformMat3(i||[-0,-0],n,this);break;case 3:i=nf.transformMat3(i||[-0,-0,-0],n,this);break;case 4:i=(0,rf.vec4_transformMat3)(i||[-0,-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,Kr.checkVector)(i,n.length),i}},{key:"transformVector",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}},{key:"transformVector2",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}},{key:"transformVector3",value:function(n,i){return(0,Kr.deprecated)("Matrix3.transformVector"),this.transform(n,i)}}],[{key:"IDENTITY",get:function(){return cr.IDENTITY=cr.IDENTITY||Object.freeze(new t(Za)),cr.IDENTITY}},{key:"ZERO",get:function(){return cr.ZERO=cr.ZERO||Object.freeze(new t(of)),cr.ZERO}}]),t}(ef.default);et.default=uf});var $a=R((Op,Qa)=>{function lf(e){if(Array.isArray(e))return e}Qa.exports=lf});var Ha=R((Rp,Ja)=>{function ff(e,r){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(e)))){var t=[],a=!0,n=!1,i=void 0;try{for(var s=e[Symbol.iterator](),o;!(a=(o=s.next()).done)&&(t.push(o.value),!(r&&t.length===r));a=!0);}catch(c){n=!0,i=c}finally{try{!a&&s.return!=null&&s.return()}finally{if(n)throw i}}return t}}Ja.exports=ff});var ei=R((Sp,Ka)=>{function hf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Ka.exports=hf});var Tr=R((Ap,ri)=>{var df=$a(),pf=Ha(),vf=wt(),mf=ei();function gf(e,r){return df(e)||pf(e,r)||vf(e,r)||mf()}ri.exports=gf});var ci=R(S=>{"use strict";function rt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rt=function(t){return typeof t}:rt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(e)}Object.defineProperty(S,"__esModule",{value:!0});S.create=Mf;S.clone=xf;S.copy=bf;S.fromValues=_f;S.set=Tf;S.identity=ni;S.transpose=kf;S.invert=Of;S.adjoint=Rf;S.determinant=Sf;S.multiply=ai;S.translate=Af;S.scale=Ef;S.rotate=Pf;S.rotateX=wf;S.rotateY=qf;S.rotateZ=Lf;S.fromTranslation=If;S.fromScaling=Nf;S.fromRotation=Cf;S.fromXRotation=Df;S.fromYRotation=Wf;S.fromZRotation=Bf;S.fromRotationTranslation=ii;S.fromQuat2=Ff;S.getTranslation=zf;S.getScaling=si;S.getRotation=Yf;S.fromRotationTranslationScale=Vf;S.fromRotationTranslationScaleOrigin=Gf;S.fromQuat=Uf;S.frustum=jf;S.perspective=Zf;S.perspectiveFromFieldOfView=Xf;S.ortho=Qf;S.lookAt=$f;S.targetTo=Jf;S.str=Hf;S.frob=Kf;S.add=eh;S.subtract=oi;S.multiplyScalar=rh;S.multiplyScalarAndAdd=th;S.exactEquals=nh;S.equals=ah;S.sub=S.mul=void 0;var B=yf(Ge());function ti(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ti=function(){return e},e}function yf(e){if(e&&e.__esModule)return e;if(e===null||rt(e)!=="object"&&typeof e!="function")return{default:e};var r=ti();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function Mf(){var e=new B.ARRAY_TYPE(16);return B.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function xf(e){var r=new B.ARRAY_TYPE(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function bf(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function _f(e,r,t,a,n,i,s,o,c,u,l,f,h,d,p,m){var v=new B.ARRAY_TYPE(16);return v[0]=e,v[1]=r,v[2]=t,v[3]=a,v[4]=n,v[5]=i,v[6]=s,v[7]=o,v[8]=c,v[9]=u,v[10]=l,v[11]=f,v[12]=h,v[13]=d,v[14]=p,v[15]=m,v}function Tf(e,r,t,a,n,i,s,o,c,u,l,f,h,d,p,m,v){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e[9]=l,e[10]=f,e[11]=h,e[12]=d,e[13]=p,e[14]=m,e[15]=v,e}function ni(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 kf(e,r){if(e===r){var t=r[1],a=r[2],n=r[3],i=r[6],s=r[7],o=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=a,e[9]=i,e[11]=r[14],e[12]=n,e[13]=s,e[14]=o}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Of(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,k=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-f*p,I=l*v-h*p,w=l*g-d*p,D=f*v-h*m,N=f*g-d*m,W=h*g-d*v,E=b*W-y*N+M*D+k*w-_*I+C*L;return E?(E=1/E,e[0]=(o*W-c*N+u*D)*E,e[1]=(n*N-a*W-i*D)*E,e[2]=(m*C-v*_+g*k)*E,e[3]=(h*_-f*C-d*k)*E,e[4]=(c*w-s*W-u*I)*E,e[5]=(t*W-n*w+i*I)*E,e[6]=(v*M-p*C-g*y)*E,e[7]=(l*C-h*M+d*y)*E,e[8]=(s*N-o*w+u*L)*E,e[9]=(a*w-t*N-i*L)*E,e[10]=(p*_-m*M+g*b)*E,e[11]=(f*M-l*_-d*b)*E,e[12]=(o*I-s*D-c*L)*E,e[13]=(t*D-a*I+n*L)*E,e[14]=(m*y-p*k-v*b)*E,e[15]=(l*k-f*y+h*b)*E,e):null}function Rf(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15];return e[0]=o*(h*g-d*v)-f*(c*g-u*v)+m*(c*d-u*h),e[1]=-(a*(h*g-d*v)-f*(n*g-i*v)+m*(n*d-i*h)),e[2]=a*(c*g-u*v)-o*(n*g-i*v)+m*(n*u-i*c),e[3]=-(a*(c*d-u*h)-o*(n*d-i*h)+f*(n*u-i*c)),e[4]=-(s*(h*g-d*v)-l*(c*g-u*v)+p*(c*d-u*h)),e[5]=t*(h*g-d*v)-l*(n*g-i*v)+p*(n*d-i*h),e[6]=-(t*(c*g-u*v)-s*(n*g-i*v)+p*(n*u-i*c)),e[7]=t*(c*d-u*h)-s*(n*d-i*h)+l*(n*u-i*c),e[8]=s*(f*g-d*m)-l*(o*g-u*m)+p*(o*d-u*f),e[9]=-(t*(f*g-d*m)-l*(a*g-i*m)+p*(a*d-i*f)),e[10]=t*(o*g-u*m)-s*(a*g-i*m)+p*(a*u-i*o),e[11]=-(t*(o*d-u*f)-s*(a*d-i*f)+l*(a*u-i*o)),e[12]=-(s*(f*v-h*m)-l*(o*v-c*m)+p*(o*h-c*f)),e[13]=t*(f*v-h*m)-l*(a*v-n*m)+p*(a*h-n*f),e[14]=-(t*(o*v-c*m)-s*(a*v-n*m)+p*(a*c-n*o)),e[15]=t*(o*h-c*f)-s*(a*h-n*f)+l*(a*c-n*o),e}function Sf(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],m=e[14],v=e[15],g=r*s-t*i,b=r*o-a*i,y=r*c-n*i,M=t*o-a*s,k=t*c-n*s,_=a*c-n*o,C=u*p-l*d,L=u*m-f*d,I=u*v-h*d,w=l*m-f*p,D=l*v-h*p,N=f*v-h*m;return g*N-b*D+y*w+M*I-k*L+_*C}function ai(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=r[9],d=r[10],p=r[11],m=r[12],v=r[13],g=r[14],b=r[15],y=t[0],M=t[1],k=t[2],_=t[3];return e[0]=y*a+M*o+k*f+_*m,e[1]=y*n+M*c+k*h+_*v,e[2]=y*i+M*u+k*d+_*g,e[3]=y*s+M*l+k*p+_*b,y=t[4],M=t[5],k=t[6],_=t[7],e[4]=y*a+M*o+k*f+_*m,e[5]=y*n+M*c+k*h+_*v,e[6]=y*i+M*u+k*d+_*g,e[7]=y*s+M*l+k*p+_*b,y=t[8],M=t[9],k=t[10],_=t[11],e[8]=y*a+M*o+k*f+_*m,e[9]=y*n+M*c+k*h+_*v,e[10]=y*i+M*u+k*d+_*g,e[11]=y*s+M*l+k*p+_*b,y=t[12],M=t[13],k=t[14],_=t[15],e[12]=y*a+M*o+k*f+_*m,e[13]=y*n+M*c+k*h+_*v,e[14]=y*i+M*u+k*d+_*g,e[15]=y*s+M*l+k*p+_*b,e}function Af(e,r,t){var a=t[0],n=t[1],i=t[2],s,o,c,u,l,f,h,d,p,m,v,g;return r===e?(e[12]=r[0]*a+r[4]*n+r[8]*i+r[12],e[13]=r[1]*a+r[5]*n+r[9]*i+r[13],e[14]=r[2]*a+r[6]*n+r[10]*i+r[14],e[15]=r[3]*a+r[7]*n+r[11]*i+r[15]):(s=r[0],o=r[1],c=r[2],u=r[3],l=r[4],f=r[5],h=r[6],d=r[7],p=r[8],m=r[9],v=r[10],g=r[11],e[0]=s,e[1]=o,e[2]=c,e[3]=u,e[4]=l,e[5]=f,e[6]=h,e[7]=d,e[8]=p,e[9]=m,e[10]=v,e[11]=g,e[12]=s*a+l*n+p*i+r[12],e[13]=o*a+f*n+m*i+r[13],e[14]=c*a+h*n+v*i+r[14],e[15]=u*a+d*n+g*i+r[15]),e}function Ef(e,r,t){var a=t[0],n=t[1],i=t[2];return e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e[3]=r[3]*a,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=r[7]*n,e[8]=r[8]*i,e[9]=r[9]*i,e[10]=r[10]*i,e[11]=r[11]*i,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Pf(e,r,t,a){var n=a[0],i=a[1],s=a[2],o=Math.hypot(n,i,s),c,u,l,f,h,d,p,m,v,g,b,y,M,k,_,C,L,I,w,D,N,W,E,Z;return o<B.EPSILON?null:(o=1/o,n*=o,i*=o,s*=o,c=Math.sin(t),u=Math.cos(t),l=1-u,f=r[0],h=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8],M=r[9],k=r[10],_=r[11],C=n*n*l+u,L=i*n*l+s*c,I=s*n*l-i*c,w=n*i*l-s*c,D=i*i*l+u,N=s*i*l+n*c,W=n*s*l+i*c,E=i*s*l-n*c,Z=s*s*l+u,e[0]=f*C+m*L+y*I,e[1]=h*C+v*L+M*I,e[2]=d*C+g*L+k*I,e[3]=p*C+b*L+_*I,e[4]=f*w+m*D+y*N,e[5]=h*w+v*D+M*N,e[6]=d*w+g*D+k*N,e[7]=p*w+b*D+_*N,e[8]=f*W+m*E+y*Z,e[9]=h*W+v*E+M*Z,e[10]=d*W+g*E+k*Z,e[11]=p*W+b*E+_*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function wf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[4],s=r[5],o=r[6],c=r[7],u=r[8],l=r[9],f=r[10],h=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=i*n+u*a,e[5]=s*n+l*a,e[6]=o*n+f*a,e[7]=c*n+h*a,e[8]=u*n-i*a,e[9]=l*n-s*a,e[10]=f*n-o*a,e[11]=h*n-c*a,e}function qf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[8],l=r[9],f=r[10],h=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n-u*a,e[1]=s*n-l*a,e[2]=o*n-f*a,e[3]=c*n-h*a,e[8]=i*a+u*n,e[9]=s*a+l*n,e[10]=o*a+f*n,e[11]=c*a+h*n,e}function Lf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[4],l=r[5],f=r[6],h=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n+u*a,e[1]=s*n+l*a,e[2]=o*n+f*a,e[3]=c*n+h*a,e[4]=u*n-i*a,e[5]=l*n-s*a,e[6]=f*n-o*a,e[7]=h*n-c*a,e}function If(e,r){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]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function Nf(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Cf(e,r,t){var a=t[0],n=t[1],i=t[2],s=Math.hypot(a,n,i),o,c,u;return s<B.EPSILON?null:(s=1/s,a*=s,n*=s,i*=s,o=Math.sin(r),c=Math.cos(r),u=1-c,e[0]=a*a*u+c,e[1]=n*a*u+i*o,e[2]=i*a*u-n*o,e[3]=0,e[4]=a*n*u-i*o,e[5]=n*n*u+c,e[6]=i*n*u+a*o,e[7]=0,e[8]=a*i*u+n*o,e[9]=n*i*u-a*o,e[10]=i*i*u+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function Df(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=t,e[7]=0,e[8]=0,e[9]=-t,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Wf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=0,e[2]=-t,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=t,e[9]=0,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Bf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=0,e[4]=-t,e[5]=a,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 ii(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=a+a,c=n+n,u=i+i,l=a*o,f=a*c,h=a*u,d=n*c,p=n*u,m=i*u,v=s*o,g=s*c,b=s*u;return e[0]=1-(d+m),e[1]=f+b,e[2]=h-g,e[3]=0,e[4]=f-b,e[5]=1-(l+m),e[6]=p+v,e[7]=0,e[8]=h+g,e[9]=p-v,e[10]=1-(l+d),e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Ff(e,r){var t=new B.ARRAY_TYPE(3),a=-r[0],n=-r[1],i=-r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=a*a+n*n+i*i+s*s;return f>0?(t[0]=(o*s+l*a+c*i-u*n)*2/f,t[1]=(c*s+l*n+u*a-o*i)*2/f,t[2]=(u*s+l*i+o*n-c*a)*2/f):(t[0]=(o*s+l*a+c*i-u*n)*2,t[1]=(c*s+l*n+u*a-o*i)*2,t[2]=(u*s+l*i+o*n-c*a)*2),ii(e,r,t),e}function zf(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e}function si(e,r){var t=r[0],a=r[1],n=r[2],i=r[4],s=r[5],o=r[6],c=r[8],u=r[9],l=r[10];return e[0]=Math.hypot(t,a,n),e[1]=Math.hypot(i,s,o),e[2]=Math.hypot(c,u,l),e}function Yf(e,r){var t=new B.ARRAY_TYPE(3);si(t,r);var a=1/t[0],n=1/t[1],i=1/t[2],s=r[0]*a,o=r[1]*n,c=r[2]*i,u=r[4]*a,l=r[5]*n,f=r[6]*i,h=r[8]*a,d=r[9]*n,p=r[10]*i,m=s+l+p,v=0;return m>0?(v=Math.sqrt(m+1)*2,e[3]=.25*v,e[0]=(f-d)/v,e[1]=(h-c)/v,e[2]=(o-u)/v):s>l&&s>p?(v=Math.sqrt(1+s-l-p)*2,e[3]=(f-d)/v,e[0]=.25*v,e[1]=(o+u)/v,e[2]=(h+c)/v):l>p?(v=Math.sqrt(1+l-s-p)*2,e[3]=(h-c)/v,e[0]=(o+u)/v,e[1]=.25*v,e[2]=(f+d)/v):(v=Math.sqrt(1+p-s-l)*2,e[3]=(o-u)/v,e[0]=(h+c)/v,e[1]=(f+d)/v,e[2]=.25*v),e}function Vf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=n+n,u=i+i,l=s+s,f=n*c,h=n*u,d=n*l,p=i*u,m=i*l,v=s*l,g=o*c,b=o*u,y=o*l,M=a[0],k=a[1],_=a[2];return e[0]=(1-(p+v))*M,e[1]=(h+y)*M,e[2]=(d-b)*M,e[3]=0,e[4]=(h-y)*k,e[5]=(1-(f+v))*k,e[6]=(m+g)*k,e[7]=0,e[8]=(d+b)*_,e[9]=(m-g)*_,e[10]=(1-(f+p))*_,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Gf(e,r,t,a,n){var i=r[0],s=r[1],o=r[2],c=r[3],u=i+i,l=s+s,f=o+o,h=i*u,d=i*l,p=i*f,m=s*l,v=s*f,g=o*f,b=c*u,y=c*l,M=c*f,k=a[0],_=a[1],C=a[2],L=n[0],I=n[1],w=n[2],D=(1-(m+g))*k,N=(d+M)*k,W=(p-y)*k,E=(d-M)*_,Z=(1-(h+g))*_,de=(v+b)*_,pe=(p+y)*C,De=(v-b)*C,We=(1-(h+m))*C;return e[0]=D,e[1]=N,e[2]=W,e[3]=0,e[4]=E,e[5]=Z,e[6]=de,e[7]=0,e[8]=pe,e[9]=De,e[10]=We,e[11]=0,e[12]=t[0]+L-(D*L+E*I+pe*w),e[13]=t[1]+I-(N*L+Z*I+De*w),e[14]=t[2]+w-(W*L+de*I+We*w),e[15]=1,e}function Uf(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,f=a*o,h=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-f-p,e[1]=l+g,e[2]=h-v,e[3]=0,e[4]=l-g,e[5]=1-u-p,e[6]=d+m,e[7]=0,e[8]=h+v,e[9]=d-m,e[10]=1-u-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function jf(e,r,t,a,n,i,s){var o=1/(t-r),c=1/(n-a),u=1/(i-s);return e[0]=i*2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*o,e[9]=(n+a)*c,e[10]=(s+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*u,e[15]=0,e}function Zf(e,r,t,a,n){var i=1/Math.tan(r/2),s;return e[0]=i/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0?(s=1/(a-n),e[10]=(n+a)*s,e[14]=2*n*a*s):(e[10]=-1,e[14]=-2*a),e}function Xf(e,r,t,a){var n=Math.tan(r.upDegrees*Math.PI/180),i=Math.tan(r.downDegrees*Math.PI/180),s=Math.tan(r.leftDegrees*Math.PI/180),o=Math.tan(r.rightDegrees*Math.PI/180),c=2/(s+o),u=2/(n+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((s-o)*c*.5),e[9]=(n-i)*u*.5,e[10]=a/(t-a),e[11]=-1,e[12]=0,e[13]=0,e[14]=a*t/(t-a),e[15]=0,e}function Qf(e,r,t,a,n,i,s){var o=1/(r-t),c=1/(a-n),u=1/(i-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*o,e[13]=(n+a)*c,e[14]=(s+i)*u,e[15]=1,e}function $f(e,r,t,a){var n,i,s,o,c,u,l,f,h,d,p=r[0],m=r[1],v=r[2],g=a[0],b=a[1],y=a[2],M=t[0],k=t[1],_=t[2];return Math.abs(p-M)<B.EPSILON&&Math.abs(m-k)<B.EPSILON&&Math.abs(v-_)<B.EPSILON?ni(e):(l=p-M,f=m-k,h=v-_,d=1/Math.hypot(l,f,h),l*=d,f*=d,h*=d,n=b*h-y*f,i=y*l-g*h,s=g*f-b*l,d=Math.hypot(n,i,s),d?(d=1/d,n*=d,i*=d,s*=d):(n=0,i=0,s=0),o=f*s-h*i,c=h*n-l*s,u=l*i-f*n,d=Math.hypot(o,c,u),d?(d=1/d,o*=d,c*=d,u*=d):(o=0,c=0,u=0),e[0]=n,e[1]=o,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=h,e[11]=0,e[12]=-(n*p+i*m+s*v),e[13]=-(o*p+c*m+u*v),e[14]=-(l*p+f*m+h*v),e[15]=1,e)}function Jf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=a[0],c=a[1],u=a[2],l=n-t[0],f=i-t[1],h=s-t[2],d=l*l+f*f+h*h;d>0&&(d=1/Math.sqrt(d),l*=d,f*=d,h*=d);var p=c*h-u*f,m=u*l-o*h,v=o*f-c*l;return d=p*p+m*m+v*v,d>0&&(d=1/Math.sqrt(d),p*=d,m*=d,v*=d),e[0]=p,e[1]=m,e[2]=v,e[3]=0,e[4]=f*v-h*m,e[5]=h*p-l*v,e[6]=l*m-f*p,e[7]=0,e[8]=l,e[9]=f,e[10]=h,e[11]=0,e[12]=n,e[13]=i,e[14]=s,e[15]=1,e}function Hf(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Kf(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function eh(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e[9]=r[9]+t[9],e[10]=r[10]+t[10],e[11]=r[11]+t[11],e[12]=r[12]+t[12],e[13]=r[13]+t[13],e[14]=r[14]+t[14],e[15]=r[15]+t[15],e}function oi(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e[9]=r[9]-t[9],e[10]=r[10]-t[10],e[11]=r[11]-t[11],e[12]=r[12]-t[12],e[13]=r[13]-t[13],e[14]=r[14]-t[14],e[15]=r[15]-t[15],e}function rh(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e[9]=r[9]*t,e[10]=r[10]*t,e[11]=r[11]*t,e[12]=r[12]*t,e[13]=r[13]*t,e[14]=r[14]*t,e[15]=r[15]*t,e}function th(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e[9]=r[9]+t[9]*a,e[10]=r[10]+t[10]*a,e[11]=r[11]+t[11]*a,e[12]=r[12]+t[12]*a,e[13]=r[13]+t[13]*a,e[14]=r[14]+t[14]*a,e[15]=r[15]+t[15]*a,e}function nh(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}function ah(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],b=r[0],y=r[1],M=r[2],k=r[3],_=r[4],C=r[5],L=r[6],I=r[7],w=r[8],D=r[9],N=r[10],W=r[11],E=r[12],Z=r[13],de=r[14],pe=r[15];return Math.abs(t-b)<=B.EPSILON*Math.max(1,Math.abs(t),Math.abs(b))&&Math.abs(a-y)<=B.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(n-M)<=B.EPSILON*Math.max(1,Math.abs(n),Math.abs(M))&&Math.abs(i-k)<=B.EPSILON*Math.max(1,Math.abs(i),Math.abs(k))&&Math.abs(s-_)<=B.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-C)<=B.EPSILON*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(c-L)<=B.EPSILON*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(u-I)<=B.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(l-w)<=B.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))&&Math.abs(f-D)<=B.EPSILON*Math.max(1,Math.abs(f),Math.abs(D))&&Math.abs(h-N)<=B.EPSILON*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-W)<=B.EPSILON*Math.max(1,Math.abs(d),Math.abs(W))&&Math.abs(p-E)<=B.EPSILON*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(m-Z)<=B.EPSILON*Math.max(1,Math.abs(m),Math.abs(Z))&&Math.abs(v-de)<=B.EPSILON*Math.max(1,Math.abs(v),Math.abs(de))&&Math.abs(g-pe)<=B.EPSILON*Math.max(1,Math.abs(g),Math.abs(pe))}var ih=ai;S.mul=ih;var sh=oi;S.sub=sh});var nt=R(A=>{"use strict";function tt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tt=function(t){return typeof t}:tt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(e)}Object.defineProperty(A,"__esModule",{value:!0});A.create=li;A.clone=ch;A.fromValues=uh;A.copy=lh;A.set=fh;A.add=hh;A.subtract=fi;A.multiply=hi;A.divide=di;A.ceil=dh;A.floor=ph;A.min=vh;A.max=mh;A.round=gh;A.scale=yh;A.scaleAndAdd=Mh;A.distance=pi;A.squaredDistance=vi;A.length=mi;A.squaredLength=gi;A.negate=xh;A.inverse=bh;A.normalize=_h;A.dot=Th;A.cross=kh;A.lerp=Oh;A.random=Rh;A.transformMat4=Sh;A.transformQuat=Ah;A.zero=Eh;A.str=Ph;A.exactEquals=wh;A.equals=qh;A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var ae=oh(Ge());function ui(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return ui=function(){return e},e}function oh(e){if(e&&e.__esModule)return e;if(e===null||tt(e)!=="object"&&typeof e!="function")return{default:e};var r=ui();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function li(){var e=new ae.ARRAY_TYPE(4);return ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ch(e){var r=new ae.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function uh(e,r,t,a){var n=new ae.ARRAY_TYPE(4);return n[0]=e,n[1]=r,n[2]=t,n[3]=a,n}function lh(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function fh(e,r,t,a,n){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e}function hh(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e}function fi(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e}function hi(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e[3]=r[3]*t[3],e}function di(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e[3]=r[3]/t[3],e}function dh(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e[3]=Math.ceil(r[3]),e}function ph(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e[3]=Math.floor(r[3]),e}function vh(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e[3]=Math.min(r[3],t[3]),e}function mh(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e[3]=Math.max(r[3],t[3]),e}function gh(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e[3]=Math.round(r[3]),e}function yh(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function Mh(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e}function pi(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return Math.hypot(t,a,n,i)}function vi(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return t*t+a*a+n*n+i*i}function mi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return Math.hypot(r,t,a,n)}function gi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return r*r+t*t+a*a+n*n}function xh(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=-r[3],e}function bh(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e[3]=1/r[3],e}function _h(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),e[0]=t*s,e[1]=a*s,e[2]=n*s,e[3]=i*s,e}function Th(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function kh(e,r,t,a){var n=t[0]*a[1]-t[1]*a[0],i=t[0]*a[2]-t[2]*a[0],s=t[0]*a[3]-t[3]*a[0],o=t[1]*a[2]-t[2]*a[1],c=t[1]*a[3]-t[3]*a[1],u=t[2]*a[3]-t[3]*a[2],l=r[0],f=r[1],h=r[2],d=r[3];return e[0]=f*u-h*c+d*o,e[1]=-(l*u)+h*s-d*i,e[2]=l*c-f*s+d*n,e[3]=-(l*o)+f*i-h*n,e}function Oh(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e[3]=o+a*(t[3]-o),e}function Rh(e,r){r=r||1;var t,a,n,i,s,o;do t=ae.RANDOM()*2-1,a=ae.RANDOM()*2-1,s=t*t+a*a;while(s>=1);do n=ae.RANDOM()*2-1,i=ae.RANDOM()*2-1,o=n*n+i*i;while(o>=1);var c=Math.sqrt((1-s)/o);return e[0]=r*t,e[1]=r*a,e[2]=r*n*c,e[3]=r*i*c,e}function Sh(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3];return e[0]=t[0]*a+t[4]*n+t[8]*i+t[12]*s,e[1]=t[1]*a+t[5]*n+t[9]*i+t[13]*s,e[2]=t[2]*a+t[6]*n+t[10]*i+t[14]*s,e[3]=t[3]*a+t[7]*n+t[11]*i+t[15]*s,e}function Ah(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2],u=t[3],l=u*a+o*i-c*n,f=u*n+c*a-s*i,h=u*i+s*n-o*a,d=-s*a-o*n-c*i;return e[0]=l*u+d*-s+f*-c-h*-o,e[1]=f*u+d*-o+h*-s-l*-c,e[2]=h*u+d*-c+l*-o-f*-s,e[3]=r[3],e}function Eh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function Ph(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function wh(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function qh(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=r[0],o=r[1],c=r[2],u=r[3];return Math.abs(t-s)<=ae.EPSILON*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(a-o)<=ae.EPSILON*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(n-c)<=ae.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=ae.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var Lh=fi;A.sub=Lh;var Ih=hi;A.mul=Ih;var Nh=di;A.div=Nh;var Ch=pi;A.dist=Ch;var Dh=vi;A.sqrDist=Dh;var Wh=mi;A.len=Wh;var Bh=gi;A.sqrLen=Bh;var Fh=function(){var e=li();return function(r,t,a,n,i,s){var o,c;for(t||(t=4),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],e[3]=r[o+3],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2],r[o+3]=e[3];return r}}();A.forEach=Fh});var Yt=R(it=>{"use strict";var Qe=U(),zh=te();Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var Yh=Qe(Tr()),Vh=Qe($()),Gh=Qe(J()),Uh=Qe(se()),jh=Qe(oe()),yi=Qe(ce()),ur=ue(),Zh=Qe(Bt()),Mi=nr(),j=at(ci()),Xh=at(Vr()),Qh=at(ke()),$h=at(nt());function xi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(xi=function(n){return n?t:r})(e)}function at(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||zh(e)!=="object"&&typeof e!="function")return{default:e};var t=xi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Jh(e){var r=Hh();return function(){var a=(0,yi.default)(e),n;if(r){var i=(0,yi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,jh.default)(this,n)}}function Hh(){if(typeof Reflect=="undefined"||!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}}var bi=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kh=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e0=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),lr={},r0=function(e){(0,Uh.default)(t,e);var r=Jh(t);function t(a){var n;return(0,Vh.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):n.identity(),n}return(0,Gh.default)(t,[{key:"INDICES",get:function(){return e0}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this[9]=n[9],this[10]=n[10],this[11]=n[11],this[12]=n[12],this[13]=n[13],this[14]=n[14],this[15]=n[15],this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,f,h,d,p,m,v,g,b,y){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=f,this[8]=h,this[9]=d,this[10]=p,this[11]=m,this[12]=v,this[13]=g,this[14]=b,this[15]=y,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,f,h,d,p,m,v,g,b,y){return this[0]=n,this[1]=c,this[2]=h,this[3]=v,this[4]=i,this[5]=u,this[6]=d,this[7]=g,this[8]=s,this[9]=l,this[10]=p,this[11]=b,this[12]=o,this[13]=f,this[14]=m,this[15]=y,this.check()}},{key:"toRowMajor",value:function(n){return n[0]=this[0],n[1]=this[4],n[2]=this[8],n[3]=this[12],n[4]=this[1],n[5]=this[5],n[6]=this[9],n[7]=this[13],n[8]=this[2],n[9]=this[6],n[10]=this[10],n[11]=this[14],n[12]=this[3],n[13]=this[7],n[14]=this[11],n[15]=this[15],n}},{key:"identity",value:function(){return this.copy(bi)}},{key:"fromQuaternion",value:function(n){return j.fromQuat(this,n),this.check()}},{key:"frustum",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=n.far;return l===1/0?t._computeInfinitePerspectiveOffCenter(this,i,s,o,c,u):j.frustum(this,i,s,o,c,u,l),this.check()}},{key:"lookAt",value:function(n,i,s){if(arguments.length===1){var o=n;n=o.eye,i=o.center,s=o.up}return i=i||[0,0,0],s=s||[0,1,0],j.lookAt(this,n,i,s),this.check()}},{key:"ortho",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=u===void 0?.1:u,f=n.far,h=f===void 0?500:f;return j.ortho(this,i,s,o,c,l,h),this.check()}},{key:"orthographic",value:function(n){var i=n.fovy,s=i===void 0?45*Math.PI/180:i,o=n.aspect,c=o===void 0?1:o,u=n.focalDistance,l=u===void 0?1:u,f=n.near,h=f===void 0?.1:f,d=n.far,p=d===void 0?500:d;if(s>Math.PI*2)throw Error("radians");var m=s/2,v=l*Math.tan(m),g=v*c;return new t().ortho({left:-g,right:g,bottom:-v,top:v,near:h,far:p})}},{key:"perspective",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.fovy,s=i===void 0?void 0:i,o=n.fov,c=o===void 0?45*Math.PI/180:o,u=n.aspect,l=u===void 0?1:u,f=n.near,h=f===void 0?.1:f,d=n.far,p=d===void 0?500:d;if(s=s||c,s>Math.PI*2)throw Error("radians");return j.perspective(this,s,l,h,p),this.check()}},{key:"determinant",value:function(){return j.determinant(this)}},{key:"getScale",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),n[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),n[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),n}},{key:"getTranslation",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[12],n[1]=this[13],n[2]=this[14],n}},{key:"getRotation",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=this.getScale(i||[-0,-0,-0]),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=0,n[4]=this[4]*o,n[5]=this[5]*c,n[6]=this[6]*u,n[7]=0,n[8]=this[8]*o,n[9]=this[9]*c,n[10]=this[10]*u,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}},{key:"getRotationMatrix3",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=this.getScale(i||[-0,-0,-0]),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=this[4]*o,n[4]=this[5]*c,n[5]=this[6]*u,n[6]=this[8]*o,n[7]=this[9]*c,n[8]=this[10]*u,n}},{key:"transpose",value:function(){return j.transpose(this,this),this.check()}},{key:"invert",value:function(){return j.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return j.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return j.multiply(this,this,n),this.check()}},{key:"rotateX",value:function(n){return j.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return j.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return j.rotateZ(this,this,n),this.check()}},{key:"rotateXYZ",value:function(n){var i=(0,Yh.default)(n,3),s=i[0],o=i[1],c=i[2];return this.rotateX(s).rotateY(o).rotateZ(c)}},{key:"rotateAxis",value:function(n,i){return j.rotate(this,this,n,i),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?j.scale(this,this,n):j.scale(this,this,[n,n,n]),this.check()}},{key:"translate",value:function(n){return j.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){return n.length===4?(i=$h.transformMat4(i||[-0,-0,-0,-0],n,this),(0,ur.checkVector)(i,4),i):this.transformAsPoint(n,i)}},{key:"transformAsPoint",value:function(n,i){var s=n.length;switch(s){case 2:i=Xh.transformMat4(i||[-0,-0],n,this);break;case 3:i=Qh.transformMat4(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,ur.checkVector)(i,n.length),i}},{key:"transformAsVector",value:function(n,i){switch(n.length){case 2:i=(0,Mi.vec2_transformMat4AsVector)(i||[-0,-0],n,this);break;case 3:i=(0,Mi.vec3_transformMat4AsVector)(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,ur.checkVector)(i,n.length),i}},{key:"makeRotationX",value:function(n){return this.identity().rotateX(n)}},{key:"makeTranslation",value:function(n,i,s){return this.identity().translate([n,i,s])}},{key:"transformPoint",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformPoint","3.0"),this.transformAsPoint(n,i)}},{key:"transformVector",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformVector","3.0"),this.transformAsPoint(n,i)}},{key:"transformDirection",value:function(n,i){return(0,ur.deprecated)("Matrix4.transformDirection","3.0"),this.transformAsVector(n,i)}}],[{key:"IDENTITY",get:function(){return lr.IDENTITY=lr.IDENTITY||Object.freeze(new t(bi)),lr.IDENTITY}},{key:"ZERO",get:function(){return lr.ZERO=lr.ZERO||Object.freeze(new t(Kh)),lr.ZERO}},{key:"_computeInfinitePerspectiveOffCenter",value:function(n,i,s,o,c,u){var l=2*u/(s-i),f=2*u/(c-o),h=(s+i)/(s-i),d=(c+o)/(c-o),p=-1,m=-1,v=-2*u;return n[0]=l,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=f,n[6]=0,n[7]=0,n[8]=h,n[9]=d,n[10]=p,n[11]=m,n[12]=0,n[13]=0,n[14]=v,n[15]=0,n}}]),t}(Zh.default);it.default=r0});var qi=R(x=>{"use strict";function st(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?st=function(t){return typeof t}:st=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(e)}Object.defineProperty(x,"__esModule",{value:!0});x.create=Vt;x.identity=n0;x.setAxisAngle=Ti;x.getAxisAngle=a0;x.getAngle=i0;x.multiply=ki;x.rotateX=s0;x.rotateY=o0;x.rotateZ=c0;x.calculateW=u0;x.exp=Oi;x.ln=Ri;x.pow=l0;x.slerp=ct;x.random=f0;x.invert=h0;x.conjugate=d0;x.fromMat3=Si;x.fromEuler=p0;x.str=v0;x.setAxes=x.sqlerp=x.rotationTo=x.equals=x.exactEquals=x.normalize=x.sqrLen=x.squaredLength=x.len=x.length=x.lerp=x.dot=x.scale=x.mul=x.add=x.set=x.copy=x.fromValues=x.clone=void 0;var $e=ot(Ge()),t0=ot(Ft()),Oe=ot(ke()),ee=ot(nt());function _i(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return _i=function(){return e},e}function ot(e){if(e&&e.__esModule)return e;if(e===null||st(e)!=="object"&&typeof e!="function")return{default:e};var r=_i();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function Vt(){var e=new $e.ARRAY_TYPE(4);return $e.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function n0(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Ti(e,r,t){t=t*.5;var a=Math.sin(t);return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=Math.cos(t),e}function a0(e,r){var t=Math.acos(r[3])*2,a=Math.sin(t/2);return a>$e.EPSILON?(e[0]=r[0]/a,e[1]=r[1]/a,e[2]=r[2]/a):(e[0]=1,e[1]=0,e[2]=0),t}function i0(e,r){var t=Ei(e,r);return Math.acos(2*t*t-1)}function ki(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=t[0],c=t[1],u=t[2],l=t[3];return e[0]=a*l+s*o+n*u-i*c,e[1]=n*l+s*c+i*o-a*u,e[2]=i*l+s*u+a*c-n*o,e[3]=s*l-a*o-n*c-i*u,e}function s0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+s*o,e[1]=n*c+i*o,e[2]=i*c-n*o,e[3]=s*c-a*o,e}function o0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c-i*o,e[1]=n*c+s*o,e[2]=i*c+a*o,e[3]=s*c-n*o,e}function c0(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+n*o,e[1]=n*c-a*o,e[2]=i*c+s*o,e[3]=s*c-i*o,e}function u0(e,r){var t=r[0],a=r[1],n=r[2];return e[0]=t,e[1]=a,e[2]=n,e[3]=Math.sqrt(Math.abs(1-t*t-a*a-n*n)),e}function Oi(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=Math.exp(i),c=s>0?o*Math.sin(s)/s:0;return e[0]=t*c,e[1]=a*c,e[2]=n*c,e[3]=o*Math.cos(s),e}function Ri(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=s>0?Math.atan2(s,i)/s:0;return e[0]=t*o,e[1]=a*o,e[2]=n*o,e[3]=.5*Math.log(t*t+a*a+n*n+i*i),e}function l0(e,r,t){return Ri(e,r),Ai(e,e,t),Oi(e,e),e}function ct(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=t[0],u=t[1],l=t[2],f=t[3],h,d,p,m,v;return d=n*c+i*u+s*l+o*f,d<0&&(d=-d,c=-c,u=-u,l=-l,f=-f),1-d>$e.EPSILON?(h=Math.acos(d),p=Math.sin(h),m=Math.sin((1-a)*h)/p,v=Math.sin(a*h)/p):(m=1-a,v=a),e[0]=m*n+v*c,e[1]=m*i+v*u,e[2]=m*s+v*l,e[3]=m*o+v*f,e}function f0(e){var r=$e.RANDOM(),t=$e.RANDOM(),a=$e.RANDOM(),n=Math.sqrt(1-r),i=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*t),e[1]=n*Math.cos(2*Math.PI*t),e[2]=i*Math.sin(2*Math.PI*a),e[3]=i*Math.cos(2*Math.PI*a),e}function h0(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i,o=s?1/s:0;return e[0]=-t*o,e[1]=-a*o,e[2]=-n*o,e[3]=i*o,e}function d0(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function Si(e,r){var t=r[0]+r[4]+r[8],a;if(t>0)a=Math.sqrt(t+1),e[3]=.5*a,a=.5/a,e[0]=(r[5]-r[7])*a,e[1]=(r[6]-r[2])*a,e[2]=(r[1]-r[3])*a;else{var n=0;r[4]>r[0]&&(n=1),r[8]>r[n*3+n]&&(n=2);var i=(n+1)%3,s=(n+2)%3;a=Math.sqrt(r[n*3+n]-r[i*3+i]-r[s*3+s]+1),e[n]=.5*a,a=.5/a,e[3]=(r[i*3+s]-r[s*3+i])*a,e[i]=(r[i*3+n]+r[n*3+i])*a,e[s]=(r[s*3+n]+r[n*3+s])*a}return e}function p0(e,r,t,a){var n=.5*Math.PI/180;r*=n,t*=n,a*=n;var i=Math.sin(r),s=Math.cos(r),o=Math.sin(t),c=Math.cos(t),u=Math.sin(a),l=Math.cos(a);return e[0]=i*c*l-s*o*u,e[1]=s*o*l+i*c*u,e[2]=s*c*u-i*o*l,e[3]=s*c*l+i*o*u,e}function v0(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var m0=ee.clone;x.clone=m0;var g0=ee.fromValues;x.fromValues=g0;var y0=ee.copy;x.copy=y0;var M0=ee.set;x.set=M0;var x0=ee.add;x.add=x0;var b0=ki;x.mul=b0;var Ai=ee.scale;x.scale=Ai;var Ei=ee.dot;x.dot=Ei;var _0=ee.lerp;x.lerp=_0;var Pi=ee.length;x.length=Pi;var T0=Pi;x.len=T0;var wi=ee.squaredLength;x.squaredLength=wi;var k0=wi;x.sqrLen=k0;var Gt=ee.normalize;x.normalize=Gt;var O0=ee.exactEquals;x.exactEquals=O0;var R0=ee.equals;x.equals=R0;var S0=function(){var e=Oe.create(),r=Oe.fromValues(1,0,0),t=Oe.fromValues(0,1,0);return function(a,n,i){var s=Oe.dot(n,i);return s<-.999999?(Oe.cross(e,r,n),Oe.len(e)<1e-6&&Oe.cross(e,t,n),Oe.normalize(e,e),Ti(a,e,Math.PI),a):s>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(Oe.cross(e,n,i),a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=1+s,Gt(a,a))}}();x.rotationTo=S0;var A0=function(){var e=Vt(),r=Vt();return function(t,a,n,i,s,o){return ct(e,a,s,o),ct(r,n,i,o),ct(t,e,r,2*o*(1-o)),t}}();x.sqlerp=A0;var E0=function(){var e=t0.create();return function(r,t,a,n){return e[0]=a[0],e[3]=a[1],e[6]=a[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],Gt(r,Si(r,e))}}();x.setAxes=E0});var Ut=R(ut=>{"use strict";var Je=U(),P0=te();Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var w0=Je($()),q0=Je(J()),L0=Je(se()),I0=Je(oe()),Li=Je(ce()),N0=Je(br()),kr=ue(),Ii=Je(ze()),G=Ci(qi()),C0=Ci(nt());function Ni(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ni=function(n){return n?t:r})(e)}function Ci(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||P0(e)!=="object"&&typeof e!="function")return{default:e};var t=Ni(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function D0(e){var r=W0();return function(){var a=(0,Li.default)(e),n;if(r){var i=(0,Li.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,I0.default)(this,n)}}function W0(){if(typeof Reflect=="undefined"||!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}}var B0=[0,0,0,1],F0=function(e){(0,L0.default)(t,e);var r=D0(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return(0,w0.default)(this,t),a=r.call(this,-0,-0,-0,-0),Array.isArray(n)&&arguments.length===1?a.copy(n):a.set(n,i,s,o),a}return(0,q0.default)(t,[{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"fromMatrix3",value:function(n){return G.fromMat3(this,n),this.check()}},{key:"identity",value:function(){return G.identity(this),this.check()}},{key:"fromAxisRotation",value:function(n,i){return G.setAxisAngle(this,n,i),this.check()}},{key:"setAxisAngle",value:function(n,i){return this.fromAxisRotation(n,i)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,kr.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,kr.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,kr.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,kr.checkNumber)(n)}},{key:"len",value:function(){return G.length(this)}},{key:"lengthSquared",value:function(){return G.squaredLength(this)}},{key:"dot",value:function(n,i){if(i!==void 0)throw new Error("Quaternion.dot only takes one argument");return G.dot(this,n)}},{key:"rotationTo",value:function(n,i){return G.rotationTo(this,n,i),this.check()}},{key:"add",value:function(n,i){if(i!==void 0)throw new Error("Quaternion.add only takes one argument");return G.add(this,this,n),this.check()}},{key:"calculateW",value:function(){return G.calculateW(this,this),this.check()}},{key:"conjugate",value:function(){return G.conjugate(this,this),this.check()}},{key:"invert",value:function(){return G.invert(this,this),this.check()}},{key:"lerp",value:function(n,i,s){return G.lerp(this,n,i,s),this.check()}},{key:"multiplyRight",value:function(n,i){return(0,Ii.default)(!i),G.multiply(this,this,n),this.check()}},{key:"multiplyLeft",value:function(n,i){return(0,Ii.default)(!i),G.multiply(this,n,this),this.check()}},{key:"normalize",value:function(){var n=this.len(),i=n>0?1/n:0;return this[0]=this[0]*i,this[1]=this[1]*i,this[2]=this[2]*i,this[3]=this[3]*i,n===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(n){return G.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return G.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return G.rotateZ(this,this,n),this.check()}},{key:"scale",value:function(n){return G.scale(this,this,n),this.check()}},{key:"slerp",value:function(n,i,s){switch(arguments.length){case 1:var o=arguments[0],c=o.start;n=c===void 0?B0:c,i=o.target,s=o.ratio;break;case 2:var u=Array.prototype.slice.call(arguments);i=u[0],s=u[1],n=this;break;default:}return G.slerp(this,n,i,s),this.check()}},{key:"transformVector4",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return C0.transformQuat(i,n,this),(0,kr.checkVector)(i,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(n,i){return this.setAxisAngle(n,i)}},{key:"premultiply",value:function(n,i){return this.multiplyLeft(n,i)}},{key:"multiply",value:function(n,i){return this.multiplyRight(n,i)}}]),t}(N0.default);ut.default=F0});var Di=R(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var z0={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:Math.PI*2};lt.default=z0});var Fi=R(ht=>{"use strict";var ft=U(),Y0=te();Object.defineProperty(ht,"__esModule",{value:!0});ht.default=void 0;var V0=ft(Tr()),G0=ft($()),U0=ft(J()),X=me(),j0=ft(Qr()),Z0=X0(ke());function Wi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Wi=function(n){return n?t:r})(e)}function X0(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Y0(e)!=="object"&&typeof e!="function")return{default:e};var t=Wi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var Bi=1e-6,Q0=6371e3,$0=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.phi,a=t===void 0?0:t,n=r.theta,i=n===void 0?0:n,s=r.radius,o=s===void 0?1:s,c=r.bearing,u=c===void 0?void 0:c,l=r.pitch,f=l===void 0?void 0:l,h=r.altitude,d=h===void 0?void 0:h,p=r.radiusScale,m=p===void 0?Q0:p;(0,G0.default)(this,e),this.phi=a,this.theta=i,this.radius=o||d||1,this.radiusScale=m||1,u!==void 0&&(this.bearing=u),f!==void 0&&(this.pitch=f),this.check()}return(0,U0.default)(e,[{key:"toString",value:function(){return this.formatString(X.config)}},{key:"formatString",value:function(t){var a=t.printTypes,n=a===void 0?!1:a,i=X.formatValue;return"".concat(n?"Spherical":"","[rho:").concat(i(this.radius),",theta:").concat(i(this.theta),",phi:").concat(i(this.phi),"]")}},{key:"equals",value:function(t){return(0,X.equals)(this.radius,t.radius)&&(0,X.equals)(this.theta,t.theta)&&(0,X.equals)(this.phi,t.phi)}},{key:"exactEquals",value:function(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}},{key:"bearing",get:function(){return 180-(0,X.degrees)(this.phi)},set:function(t){this.phi=Math.PI-(0,X.radians)(t)}},{key:"pitch",get:function(){return(0,X.degrees)(this.theta)},set:function(t){this.theta=(0,X.radians)(t)}},{key:"longitude",get:function(){return(0,X.degrees)(this.phi)}},{key:"latitude",get:function(){return(0,X.degrees)(this.theta)}},{key:"lng",get:function(){return(0,X.degrees)(this.phi)}},{key:"lat",get:function(){return(0,X.degrees)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}},{key:"set",value:function(t,a,n){return this.radius=t,this.phi=a,this.theta=n,this.check()}},{key:"clone",value:function(){return new e().copy(this)}},{key:"copy",value:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}},{key:"fromLngLatZ",value:function(t){var a=(0,V0.default)(t,3),n=a[0],i=a[1],s=a[2];this.radius=1+s/this.radiusScale,this.phi=(0,X.radians)(i),this.theta=(0,X.radians)(n)}},{key:"fromVector3",value:function(t){return this.radius=Z0.length(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos((0,X.clamp)(t[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new j0.default(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(Bi,Math.min(Math.PI-Bi,this.phi)),this}},{key:"check",value:function(){if(!Number.isFinite(this.phi)||!Number.isFinite(this.theta)||!(this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}]),e}();ht.default=$0});var jt=R(pt=>{"use strict";var Pe=U();Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var J0=Pe(Tr()),H0=Pe($()),K0=Pe(J()),e1=Pe(se()),r1=Pe(oe()),zi=Pe(ce()),t1=Pe(br()),fr=me(),ie=ue(),Yi=Pe(Ut());function n1(e){var r=a1();return function(){var a=(0,zi.default)(e),n;if(r){var i=(0,zi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,r1.default)(this,n)}}function a1(){if(typeof Reflect=="undefined"||!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}}var dt="Unknown Euler angle order",hr=.99999;function i1(e){return e>=0&&e<6}function s1(e){if(e<0&&e>=6)throw new Error(dt);return e}var o1=function(e){(0,e1.default)(t,e);var r=n1(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t.DefaultOrder;if((0,H0.default)(this,t),a=r.call(this,-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])){var c;(c=a).fromVector3.apply(c,arguments)}else a.set(n,i,s,o);return a}return(0,K0.default)(t,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(n){var i=(0,J0.default)(n,4),s=i[0],o=i[1],c=i[2],u=i[3],l=o*o,f=-2*(l+c*c)+1,h=2*(s*o+u*c),d=-2*(s*c-u*o),p=2*(o*c+u*s),m=-2*(s*s+l)+1;d=d>1?1:d,d=d<-1?-1:d;var v=Math.atan2(p,m),g=Math.asin(d),b=Math.atan2(h,f);return new t(v,g,b,t.RollPitchYaw)}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=Number.isFinite(n[3])||this.order,this.check()}},{key:"set",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0;return this[0]=n,this[1]=i,this[2]=s,this[3]=Number.isFinite(o)?o:this[3],this.check()}},{key:"validate",value:function(){return i1(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}},{key:"toArray",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n}},{key:"toArray4",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n[i+3]=this[3],n}},{key:"toVector3",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[0],n[1]=this[1],n[2]=this[2],n}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"alpha",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"beta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"gamma",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"phi",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"theta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"psi",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"roll",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"pitch",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"yaw",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"order",get:function(){return this[3]},set:function(n){this[3]=s1(n)}},{key:"fromVector3",value:function(n,i){return this.set(n[0],n[1],n[2],Number.isFinite(i)?i:this[3])}},{key:"fromArray",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this[0]=n[0+i],this[1]=n[1+i],this[2]=n[2+i],n[3]!==void 0&&(this[3]=n[3]),this.check()}},{key:"fromRollPitchYaw",value:function(n,i,s){return this.set(n,i,s,t.ZYX)}},{key:"fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder;return this._fromRotationMatrix(n,i),this.check()}},{key:"getRotationMatrix",value:function(n){return this._getRotationMatrix(n)}},{key:"getQuaternion",value:function(){var n=new Yi.default;switch(this[4]){case t.XYZ:return n.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case t.YXZ:return n.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case t.ZXY:return n.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case t.ZYX:return n.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case t.YZX:return n.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case t.XZY:return n.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(dt)}}},{key:"_fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder,s=n.elements,o=s[0],c=s[4],u=s[8],l=s[1],f=s[5],h=s[9],d=s[2],p=s[6],m=s[10];switch(i=i||this[3],i){case t.XYZ:this[1]=Math.asin((0,fr.clamp)(u,-1,1)),Math.abs(u)<hr?(this[0]=Math.atan2(-h,m),this[2]=Math.atan2(-c,o)):(this[0]=Math.atan2(p,f),this[2]=0);break;case t.YXZ:this[0]=Math.asin(-(0,fr.clamp)(h,-1,1)),Math.abs(h)<hr?(this[1]=Math.atan2(u,m),this[2]=Math.atan2(l,f)):(this[1]=Math.atan2(-d,o),this[2]=0);break;case t.ZXY:this[0]=Math.asin((0,fr.clamp)(p,-1,1)),Math.abs(p)<hr?(this[1]=Math.atan2(-d,m),this[2]=Math.atan2(-c,f)):(this[1]=0,this[2]=Math.atan2(l,o));break;case t.ZYX:this[1]=Math.asin(-(0,fr.clamp)(d,-1,1)),Math.abs(d)<hr?(this[0]=Math.atan2(p,m),this[2]=Math.atan2(l,o)):(this[0]=0,this[2]=Math.atan2(-c,f));break;case t.YZX:this[2]=Math.asin((0,fr.clamp)(l,-1,1)),Math.abs(l)<hr?(this[0]=Math.atan2(-h,f),this[1]=Math.atan2(-d,o)):(this[0]=0,this[1]=Math.atan2(u,m));break;case t.XZY:this[2]=Math.asin(-(0,fr.clamp)(c,-1,1)),Math.abs(c)<hr?(this[0]=Math.atan2(p,f),this[1]=Math.atan2(u,o)):(this[0]=Math.atan2(-h,m),this[1]=0);break;default:throw new Error(dt)}return this[3]=i,this}},{key:"_getRotationMatrix",value:function(n){var i=n||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],s=this.x,o=this.y,c=this.z,u=Math.cos(s),l=Math.cos(o),f=Math.cos(c),h=Math.sin(s),d=Math.sin(o),p=Math.sin(c);switch(this[3]){case t.XYZ:{var m=u*f,v=u*p,g=h*f,b=h*p;i[0]=l*f,i[4]=-l*p,i[8]=d,i[1]=v+g*d,i[5]=m-b*d,i[9]=-h*l,i[2]=b-m*d,i[6]=g+v*d,i[10]=u*l;break}case t.YXZ:{var y=l*f,M=l*p,k=d*f,_=d*p;i[0]=y+_*h,i[4]=k*h-M,i[8]=u*d,i[1]=u*p,i[5]=u*f,i[9]=-h,i[2]=M*h-k,i[6]=_+y*h,i[10]=u*l;break}case t.ZXY:{var C=l*f,L=l*p,I=d*f,w=d*p;i[0]=C-w*h,i[4]=-u*p,i[8]=I+L*h,i[1]=L+I*h,i[5]=u*f,i[9]=w-C*h,i[2]=-u*d,i[6]=h,i[10]=u*l;break}case t.ZYX:{var D=u*f,N=u*p,W=h*f,E=h*p;i[0]=l*f,i[4]=W*d-N,i[8]=D*d+E,i[1]=l*p,i[5]=E*d+D,i[9]=N*d-W,i[2]=-d,i[6]=h*l,i[10]=u*l;break}case t.YZX:{var Z=u*l,de=u*d,pe=h*l,De=h*d;i[0]=l*f,i[4]=De-Z*p,i[8]=pe*p+de,i[1]=p,i[5]=u*f,i[9]=-h*f,i[2]=-d*f,i[6]=de*p+pe,i[10]=Z-De*p;break}case t.XZY:{var We=u*l,dn=u*d,pn=h*l,vn=h*d;i[0]=l*f,i[4]=-p,i[8]=d*f,i[1]=We*p+vn,i[5]=u*f,i[9]=dn*p-pn,i[2]=pn*p-dn,i[6]=h*f,i[10]=vn*p+We;break}default:throw new Error(dt)}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"toQuaternion",value:function(){var n=Math.cos(this.yaw*.5),i=Math.sin(this.yaw*.5),s=Math.cos(this.roll*.5),o=Math.sin(this.roll*.5),c=Math.cos(this.pitch*.5),u=Math.sin(this.pitch*.5),l=n*s*c+i*o*u,f=n*o*c-i*s*u,h=n*s*u+i*o*c,d=i*s*c-n*o*u;return new Yi.default(f,h,d,l)}}],[{key:"ZYX",get:function(){return 0}},{key:"YXZ",get:function(){return 1}},{key:"XZY",get:function(){return 2}},{key:"ZXY",get:function(){return 3}},{key:"YZX",get:function(){return 4}},{key:"XYZ",get:function(){return 5}},{key:"RollPitchYaw",get:function(){return 0}},{key:"DefaultOrder",get:function(){return t.ZYX}},{key:"RotationOrders",get:function(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}},{key:"rotationOrder",value:function(n){return t.RotationOrders[n]}}]),t}(t1.default);pt.default=o1});var Gi=R(vt=>{"use strict";var Or=U();Object.defineProperty(vt,"__esModule",{value:!0});vt.default=void 0;var c1=Or($()),u1=Or(J()),Zt=Or(Yt()),Vi=Or(Qr()),Xt=Or(jt()),l1=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.x,a=t===void 0?0:t,n=r.y,i=n===void 0?0:n,s=r.z,o=s===void 0?0:s,c=r.roll,u=c===void 0?0:c,l=r.pitch,f=l===void 0?0:l,h=r.yaw,d=h===void 0?0:h,p=r.position,m=p===void 0?void 0:p,v=r.orientation,g=v===void 0?void 0:v;(0,c1.default)(this,e),Array.isArray(m)&&m.length===3?this.position=new Vi.default(m):this.position=new Vi.default(a,i,o),Array.isArray(g)&&g.length===4?this.orientation=new Xt.default(g,g[3]):this.orientation=new Xt.default(u,f,d,Xt.default.RollPitchYaw)}return(0,u1.default)(e,[{key:"x",get:function(){return this.position.x},set:function(t){this.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.position.y=t}},{key:"z",get:function(){return this.position.z},set:function(t){this.position.z=t}},{key:"roll",get:function(){return this.orientation.roll},set:function(t){this.orientation.roll=t}},{key:"pitch",get:function(){return this.orientation.pitch},set:function(t){this.orientation.pitch=t}},{key:"yaw",get:function(){return this.orientation.yaw},set:function(t){this.orientation.yaw=t}},{key:"getPosition",value:function(){return this.position}},{key:"getOrientation",value:function(){return this.orientation}},{key:"equals",value:function(t){return t?this.position.equals(t.position)&&this.orientation.equals(t.orientation):!1}},{key:"exactEquals",value:function(t){return t?this.position.exactEquals(t.position)&&this.orientation.exactEquals(t.orientation):!1}},{key:"getTransformationMatrix",value:function(){var t=Math.sin(this.roll),a=Math.sin(this.pitch),n=Math.sin(this.yaw),i=Math.cos(this.roll),s=Math.cos(this.pitch),o=Math.cos(this.yaw),c=new Zt.default().setRowMajor(o*s,-n*i+o*a*t,n*t+o*a*i,this.x,n*s,o*i+n*a*t,-o*t+n*a*i,this.y,-a,s*t,s*i,this.z,0,0,0,1);return c}},{key:"getTransformationMatrixFromPose",value:function(t){return new Zt.default().multiplyRight(this.getTransformationMatrix()).multiplyRight(t.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(t){return new Zt.default().multiplyRight(t.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}}]),e}();vt.default=l1});var dr=R(P=>{"use strict";var le=U();Object.defineProperty(P,"__esModule",{value:!0});Object.defineProperty(P,"config",{enumerable:!0,get:function(){return z.config}});Object.defineProperty(P,"configure",{enumerable:!0,get:function(){return z.configure}});Object.defineProperty(P,"formatValue",{enumerable:!0,get:function(){return z.formatValue}});Object.defineProperty(P,"isArray",{enumerable:!0,get:function(){return z.isArray}});Object.defineProperty(P,"clone",{enumerable:!0,get:function(){return z.clone}});Object.defineProperty(P,"equals",{enumerable:!0,get:function(){return z.equals}});Object.defineProperty(P,"exactEquals",{enumerable:!0,get:function(){return z.exactEquals}});Object.defineProperty(P,"toRadians",{enumerable:!0,get:function(){return z.toRadians}});Object.defineProperty(P,"toDegrees",{enumerable:!0,get:function(){return z.toDegrees}});Object.defineProperty(P,"radians",{enumerable:!0,get:function(){return z.radians}});Object.defineProperty(P,"degrees",{enumerable:!0,get:function(){return z.degrees}});Object.defineProperty(P,"sin",{enumerable:!0,get:function(){return z.sin}});Object.defineProperty(P,"cos",{enumerable:!0,get:function(){return z.cos}});Object.defineProperty(P,"tan",{enumerable:!0,get:function(){return z.tan}});Object.defineProperty(P,"asin",{enumerable:!0,get:function(){return z.asin}});Object.defineProperty(P,"acos",{enumerable:!0,get:function(){return z.acos}});Object.defineProperty(P,"atan",{enumerable:!0,get:function(){return z.atan}});Object.defineProperty(P,"clamp",{enumerable:!0,get:function(){return z.clamp}});Object.defineProperty(P,"lerp",{enumerable:!0,get:function(){return z.lerp}});Object.defineProperty(P,"withEpsilon",{enumerable:!0,get:function(){return z.withEpsilon}});Object.defineProperty(P,"Vector2",{enumerable:!0,get:function(){return f1.default}});Object.defineProperty(P,"Vector3",{enumerable:!0,get:function(){return h1.default}});Object.defineProperty(P,"Vector4",{enumerable:!0,get:function(){return d1.default}});Object.defineProperty(P,"Matrix3",{enumerable:!0,get:function(){return p1.default}});Object.defineProperty(P,"Matrix4",{enumerable:!0,get:function(){return v1.default}});Object.defineProperty(P,"Quaternion",{enumerable:!0,get:function(){return m1.default}});Object.defineProperty(P,"checkNumber",{enumerable:!0,get:function(){return g1.checkNumber}});Object.defineProperty(P,"_MathUtils",{enumerable:!0,get:function(){return y1.default}});Object.defineProperty(P,"SphericalCoordinates",{enumerable:!0,get:function(){return Ui.default}});Object.defineProperty(P,"_SphericalCoordinates",{enumerable:!0,get:function(){return Ui.default}});Object.defineProperty(P,"Pose",{enumerable:!0,get:function(){return ji.default}});Object.defineProperty(P,"_Pose",{enumerable:!0,get:function(){return ji.default}});Object.defineProperty(P,"Euler",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(P,"_Euler",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(P,"assert",{enumerable:!0,get:function(){return M1.default}});var z=me(),f1=le(Ma()),h1=le(Qr()),d1=le(Ba()),p1=le(Xa()),v1=le(Yt()),m1=le(Ut()),g1=ue(),y1=le(Di()),Ui=le(Fi()),ji=le(Gi()),Zi=le(jt()),M1=le(ze()),Qt={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global},x1=Qt.global||Qt.self||Qt.window;x1.mathgl={config:z.config}});var Kt=R(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.WGS84_CONSTANTS=xe.WGS84_RADIUS_Z=xe.WGS84_RADIUS_Y=xe.WGS84_RADIUS_X=void 0;var we=6378137;xe.WGS84_RADIUS_X=we;var qe=6378137;xe.WGS84_RADIUS_Y=qe;var Le=6356752314245179e-9;xe.WGS84_RADIUS_Z=Le;var R1={radii:[we,qe,Le],radiiSquared:[we*we,qe*qe,Le*Le],oneOverRadii:[1/we,1/qe,1/Le],oneOverRadiiSquared:[1/(we*we),1/(qe*qe),1/(Le*Le)],maximumRadius:Math.max(we,qe,Le),centerToleranceSquared:.1};xe.WGS84_CONSTANTS=R1});var nn=R(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.fromCartographic=rn;Re.fromCartographicToRadians=S1;Re.fromCartographicToDegrees=A1;Re.toCartographic=tn;Re.toCartographicFromRadians=E1;Re.toCartographicFromDegrees=P1;Re.isWGS84=w1;var fe=dr(),Xi=Kt(),pr=function(r){return r},en=new fe.Vector3;function rn(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pr;return(0,fe.isArray)(e)?(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]):"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z),r}function S1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en;return rn(e,r,fe.config._cartographicRadians?pr:fe.toRadians)}function A1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en;return rn(e,r,fe.config._cartographicRadians?fe.toDegrees:pr)}function tn(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pr;return(0,fe.isArray)(r)?(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]):"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]),r}function E1(e,r){return tn(e,r,fe.config._cartographicRadians?pr:fe.toDegrees)}function P1(e,r){return tn(e,r,fe.config._cartographicRadians?fe.toRadians:pr)}function w1(e){if(!e)return!1;en.from(e);var r=Xi.WGS84_CONSTANTS.oneOverRadiiSquared,t=Xi.WGS84_CONSTANTS.centerToleranceSquared,a=e[0]*e[0]*r[0],n=e[1]*e[1]*r[1],i=e[2]*e[2]*r[2];return Math.abs(a+n+i-1)<t}});var Ji=R(an=>{"use strict";var q1=te();Object.defineProperty(an,"__esModule",{value:!0});an.default=C1;var Rr=dr(),Jp=L1(ke());function Qi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Qi=function(n){return n?t:r})(e)}function L1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||q1(e)!=="object"&&typeof e!="function")return{default:e};var t=Qi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var $i=new Rr.Vector3,I1=new Rr.Vector3,N1=new Rr.Vector3;function C1(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Rr.Vector3,a=r.oneOverRadii,n=r.oneOverRadiiSquared,i=r.centerToleranceSquared;$i.from(e);var s=e.x,o=e.y,c=e.z,u=a.x,l=a.y,f=a.z,h=s*s*u*u,d=o*o*l*l,p=c*c*f*f,m=h+d+p,v=Math.sqrt(1/m);if(!!Number.isFinite(v)){var g=I1;if(g.copy(e).scale(v),m<i)return g.to(t);var b=n.x,y=n.y,M=n.z,k=N1;k.set(g.x*b*2,g.y*y*2,g.z*M*2);var _=(1-v)*e.len()/(.5*k.len()),C=0,L,I,w,D;do{_-=C,L=1/(1+_*b),I=1/(1+_*y),w=1/(1+_*M);var N=L*L,W=I*I,E=w*w,Z=N*L,de=W*I,pe=E*w;D=h*N+d*W+p*E-1;var De=h*Z*b+d*de*y+p*pe*M,We=-2*De;C=D/We}while(Math.abs(D)>Rr._MathUtils.EPSILON12);return $i.scale([L,I,w]).to(t)}}});var es=R(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.default=z1;var re=dr(),Hi=1e-14,D1=new re.Vector3,Ki={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},sn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Se={east:new re.Vector3,north:new re.Vector3,up:new re.Vector3,west:new re.Vector3,south:new re.Vector3,down:new re.Vector3},W1=new re.Vector3,B1=new re.Vector3,F1=new re.Vector3;function z1(e,r,t,a,n,i){var s=Ki[r]&&Ki[r][t];(0,re.assert)(s&&(!a||a===s));var o,c,u,l=D1.copy(n),f=(0,re.equals)(l.x,0,Hi)&&(0,re.equals)(l.y,0,Hi);if(f){var h=Math.sign(l.z);o=W1.fromArray(sn[r]),r!=="east"&&r!=="west"&&o.scale(h),c=B1.fromArray(sn[t]),t!=="east"&&t!=="west"&&c.scale(h),u=F1.fromArray(sn[a]),a!=="east"&&a!=="west"&&u.scale(h)}else{var d=Se.up,p=Se.east,m=Se.north;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),m.copy(d).cross(p);var v=Se.down,g=Se.west,b=Se.south;v.copy(d).scale(-1),g.copy(p).scale(-1),b.copy(m).scale(-1),o=Se[r],c=Se[t],u=Se[a]}return i[0]=o.x,i[1]=o.y,i[2]=o.z,i[3]=0,i[4]=c.x,i[5]=c.y,i[6]=c.z,i[7]=0,i[8]=u.x,i[9]=u.y,i[10]=u.z,i[11]=0,i[12]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}});var ss=R(yt=>{"use strict";var Sr=U(),Y1=te();Object.defineProperty(yt,"__esModule",{value:!0});yt.default=void 0;var V1=Sr(Tr()),G1=Sr($()),U1=Sr(J()),Y=dr(),rs=Z1(ke()),cn=Kt(),ts=nn(),j1=Sr(Ji()),ns=Sr(es());function as(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(as=function(n){return n?t:r})(e)}function Z1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Y1(e)!=="object"&&typeof e!="function")return{default:e};var t=as(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var mt=new Y.Vector3,is=new Y.Vector3,X1=new Y.Vector3,he=new Y.Vector3,Q1=new Y.Vector3,gt=new Y.Vector3,un,$1=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;(0,G1.default)(this,e),(0,Y.assert)(r>=0),(0,Y.assert)(t>=0),(0,Y.assert)(a>=0),this.radii=new Y.Vector3(r,t,a),this.radiiSquared=new Y.Vector3(r*r,t*t,a*a),this.radiiToTheFourth=new Y.Vector3(r*r*r*r,t*t*t*t,a*a*a*a),this.oneOverRadii=new Y.Vector3(r===0?0:1/r,t===0?0:1/t,a===0?0:1/a),this.oneOverRadiiSquared=new Y.Vector3(r===0?0:1/(r*r),t===0?0:1/(t*t),a===0?0:1/(a*a)),this.minimumRadius=Math.min(r,t,a),this.maximumRadius=Math.max(r,t,a),this.centerToleranceSquared=Y._MathUtils.EPSILON1,this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return(0,U1.default)(e,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=is,i=X1,s=(0,V1.default)(t,3),o=s[2];this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);var c=Math.sqrt(n.dot(i));return i.scale(1/c),n.scale(o),i.add(n),i.to(a)}},{key:"cartesianToCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];gt.from(t);var n=this.scaleToGeodeticSurface(gt,he);if(!!n){var i=this.geodeticSurfaceNormal(n,is),s=Q1;s.copy(gt).subtract(n);var o=Math.atan2(i.y,i.x),c=Math.asin(i.z),u=Math.sign(rs.dot(s,gt))*rs.length(s);return(0,ts.toCartographicFromRadians)([o,c,u],a)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Y.Matrix4;return(0,ns.default)(this,"east","north","up",t,a)}},{key:"localFrameToFixedFrame",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new Y.Matrix4;return(0,ns.default)(this,t,a,n,i,s)}},{key:"geocentricSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return mt.from(t).normalize().to(a)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=(0,ts.fromCartographicToRadians)(t),i=n[0],s=n[1],o=Math.cos(s);return mt.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),mt.to(a)}},{key:"geodeticSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return mt.from(t).scale(this.oneOverRadiiSquared).normalize().to(a)}},{key:"scaleToGeodeticSurface",value:function(t,a){return(0,j1.default)(t,this,a)}},{key:"scaleToGeocentricSurface",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];he.from(t);var n=he.x,i=he.y,s=he.z,o=this.oneOverRadiiSquared,c=1/Math.sqrt(n*n*o.x+i*i*o.y+s*s*o.z);return he.multiplyScalar(c).to(a)}},{key:"transformPositionToScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return he.from(t).scale(this.oneOverRadii).to(a)}},{key:"transformPositionFromScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return he.from(t).scale(this.radii).to(a)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];(0,Y.assert)((0,Y.equals)(this.radii.x,this.radii.y,Y._MathUtils.EPSILON15)),(0,Y.assert)(this.radii.z>0),he.from(t);var i=he.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-a))return he.set(0,0,i).to(n)}}],[{key:"WGS84",get:function(){return un=un||new e(cn.WGS84_RADIUS_X,cn.WGS84_RADIUS_Y,cn.WGS84_RADIUS_Z),un}}]),e}();yt.default=$1});var os=R(Mt=>{"use strict";var J1=U();Object.defineProperty(Mt,"__esModule",{value:!0});Object.defineProperty(Mt,"Ellipsoid",{enumerable:!0,get:function(){return H1.default}});Object.defineProperty(Mt,"isWGS84",{enumerable:!0,get:function(){return K1.isWGS84}});var H1=J1(ss()),K1=nn()});function bt(e,r=!0,t){let a=t||new Set;if(e){if(bn(e))a.add(e);else if(bn(e.buffer))a.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)bt(e[n],r,a)}}return t===void 0?Array.from(a):[]}function bn(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}function Be(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var _t=new Map,H=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(Be())}static set onmessage(r){function t(n){let i=Be(),{type:s,payload:o}=i?n:n.data;r(s,o)}let a=Be();a?(a.on("message",t),a.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t}static addEventListener(r){let t=_t.get(r);t||(t=n=>{if(!Os(n))return;let i=Be(),{type:s,payload:o}=i?n:n.data;r(s,o)}),Be()?console.error("not implemented"):globalThis.addEventListener("message",t)}static removeEventListener(r){let t=_t.get(r);_t.delete(r),Be()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static postMessage(r,t){let a={source:"loaders.gl",type:r,payload:t},n=bt(t),i=Be();i?i.postMessage(a,n):globalThis.postMessage(a,n)}};function Os(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}var Er=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(r){return this.enqueue(r)}enqueue(r){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let t=this._settlers.shift();r instanceof Error?t.reject(r):t.resolve({value:r})}else this._values.push(r)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let r=this._values.shift();return r instanceof Error?Promise.reject(r):Promise.resolve({done:!1,value:r})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((r,t)=>{this._settlers.push({resolve:r,reject:t})})}};var Rs=0,Pr,_n;function Tt(e,r){if(!H.inWorkerThread())return;let t={process:Ss};H.onmessage=async(a,n)=>{try{switch(a){case"process":if(!e)throw new Error("Worker does not support atomic processing");let i=await e(n.input,n.options||{},t);H.postMessage("done",{result:i});break;case"process-in-batches":if(!r)throw new Error("Worker does not support batched processing");Pr=new Er,_n=n.options||{};let s=r(Pr,_n,t);for await(let o of s)H.postMessage("output-batch",{result:o});H.postMessage("done",{});break;case"input-batch":Pr.push(n.input);break;case"input-done":Pr.close();break;default:}}catch(i){let s=i instanceof Error?i.message:"";H.postMessage("error",{error:s})}}}function Ss(e,r={}){return new Promise((t,a)=>{let n=Rs++,i=(o,c)=>{if(c.id===n)switch(o){case"done":H.removeEventListener(i),t(c.result);break;case"error":H.removeEventListener(i),a(c.error);break;default:}};H.addEventListener(i);let s={id:n,input:e,options:r};H.postMessage("process",s)})}function Ae(e,r){if(!e)throw new Error(r||"loader assertion failed.")}function be(e,r){return Ae(e>=0),Ae(r>0),e+(r-1)&~(r-1)}function kt(e,r,t){let a;if(e instanceof ArrayBuffer)a=new Uint8Array(e);else{let n=e.byteOffset,i=e.byteLength;a=new Uint8Array(e.buffer||e.arrayBuffer,n,i)}return r.set(a,t),t+be(a.byteLength,4)}function wr(e,r,t,a){let n=be(t.byteLength,a),i=n-t.byteLength;if(e){let s=new Uint8Array(e.buffer,e.byteOffset+r,t.byteLength),o=new Uint8Array(t);s.set(o);for(let c=0;c<i;++c)e.setUint8(r+t.byteLength+c,32)}return r+=n,r}function Ke(e,r,t,a){let i=new TextEncoder().encode(t);return r=wr(e,r,i,a),r}function Ot(e,r){let t=e.length,n=Math.ceil(t/r)*r-t,i="";for(let s=0;s<n;++s)i+=" ";return e+i}function er(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t.charCodeAt(n));return r+a}function mr(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t[n]);return r+a}function qr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}var Tn="3.3.0-alpha.5";var ve=!1,gr=!0;function Rt(e){let r=yr(e);return As(r)||ws(r)||Es(r)||Ps(r)}function As(e){let r=yr(e);return r.byteLength>=24&&r.getUint32(0,ve)===2303741511?{mimeType:"image/png",width:r.getUint32(16,ve),height:r.getUint32(20,ve)}:null}function Es(e){let r=yr(e);return r.byteLength>=10&&r.getUint32(0,ve)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,gr),height:r.getUint16(8,gr)}:null}function Ps(e){let r=yr(e);return r.byteLength>=14&&r.getUint16(0,ve)===16973&&r.getUint32(2,gr)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,gr),height:r.getUint32(22,gr)}:null}function ws(e){let r=yr(e);if(!(r.byteLength>=3&&r.getUint16(0,ve)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:a,sofMarkers:n}=qs(),i=2;for(;i+9<r.byteLength;){let s=r.getUint16(i,ve);if(n.has(s))return{mimeType:"image/jpeg",height:r.getUint16(i+5,ve),width:r.getUint16(i+7,ve)};if(!a.has(s))return null;i+=2,i+=r.getUint16(i,ve)}return null}function qs(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);let r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}function yr(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function Fe(e,r){if(!e)throw new Error(r||"assert failed: gltf")}var kn=["SCALAR","VEC2","VEC3","VEC4"],Ls=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Is=new Map(Ls),Ns={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ds={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function On(e){return kn[e-1]||kn[0]}function Rn(e){let r=Is.get(e.constructor);if(!r)throw new Error("Illegal typed array");return r}function Sn(e,r){let t=Ds[e.componentType],a=Ns[e.type],n=Cs[e.componentType],i=e.count*a,s=e.count*a*n;return Fe(s>=0&&s<=r.byteLength),{ArrayType:t,length:i,byteLength:s}}var Ws={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Mr=class{constructor(r){this.gltf=r||{json:Q({},Ws),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(r){return this.json[r]}getExtraData(r){return(this.json.extras||{})[r]}getExtension(r){let t=this.getUsedExtensions().find(n=>n===r),a=this.json.extensions||{};return t?a[r]||!0:null}getRequiredExtension(r){return this.getRequiredExtensions().find(a=>a===r)?this.getExtension(r):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(r,t){return(r.extensions||{})[t]}getScene(r){return this.getObject("scenes",r)}getNode(r){return this.getObject("nodes",r)}getSkin(r){return this.getObject("skins",r)}getMesh(r){return this.getObject("meshes",r)}getMaterial(r){return this.getObject("materials",r)}getAccessor(r){return this.getObject("accessors",r)}getTexture(r){return this.getObject("textures",r)}getSampler(r){return this.getObject("samplers",r)}getImage(r){return this.getObject("images",r)}getBufferView(r){return this.getObject("bufferViews",r)}getBuffer(r){return this.getObject("buffers",r)}getObject(r,t){if(typeof t=="object")return t;let a=this.json[r]&&this.json[r][t];if(!a)throw new Error(`glTF file error: Could not find ${r}[${t}]`);return a}getTypedArrayForBufferView(r){r=this.getBufferView(r);let t=r.buffer,a=this.gltf.buffers[t];Fe(a);let n=(r.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,n,r.byteLength)}getTypedArrayForAccessor(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,{ArrayType:i,length:s}=Sn(r,t),o=t.byteOffset+r.byteOffset;return new i(n,o,s)}getTypedArrayForImageData(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(n,i,t.byteLength)}addApplicationData(r,t){return this.json[r]=t,this}addExtraData(r,t){return this.json.extras=this.json.extras||{},this.json.extras[r]=t,this}addObjectExtension(r,t,a){return r.extensions=r.extensions||{},r.extensions[t]=a,this.registerUsedExtension(t),this}setObjectExtension(r,t,a){let n=r.extensions||{};n[t]=a}removeObjectExtension(r,t){let a=r.extensions||{},n=a[t];return delete a[t],n}addExtension(r,t={}){return Fe(t),this.json.extensions=this.json.extensions||{},this.json.extensions[r]=t,this.registerUsedExtension(r),t}addRequiredExtension(r,t={}){return Fe(t),this.addExtension(r,t),this.registerRequiredExtension(r),t}registerUsedExtension(r){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===r)||this.json.extensionsUsed.push(r)}registerRequiredExtension(r){this.registerUsedExtension(r),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===r)||this.json.extensionsRequired.push(r)}removeExtension(r){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,r),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,r),this.json.extensions&&delete this.json.extensions[r]}setDefaultScene(r){this.json.scene=r}addScene(r){let{nodeIndices:t}=r;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(r){let{meshIndex:t,matrix:a}=r;this.json.nodes=this.json.nodes||[];let n={mesh:t};return a&&(n.matrix=a),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(r){let{attributes:t,indices:a,material:n,mode:i=4}=r,o={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(a){let c=this._addIndices(a);o.primitives[0].indices=c}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(r){let a={primitives:[{attributes:this._addAttributes(r),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addImage(r,t){let a=Rt(r),n=t||(a==null?void 0:a.mimeType),s={bufferView:this.addBufferView(r),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(r){let t=r.byteLength;Fe(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(r);let a={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=be(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(r,t){let a={bufferView:r,type:On(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(a),this.json.accessors.length-1}addBinaryBuffer(r,t={size:3}){let a=this.addBufferView(r),n={min:t.min,max:t.max};(!n.min||!n.max)&&(n=this._getAccessorMinMax(r,t.size));let i={size:t.size,componentType:Rn(r),count:Math.round(r.length/t.size),min:n.min,max:n.max};return this.addAccessor(a,Object.assign(i,t))}addTexture(r){let{imageIndex:t}=r,a={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(a),this.json.textures.length-1}addMaterial(r){return this.json.materials=this.json.materials||[],this.json.materials.push(r),this.json.materials.length-1}createBinaryChunk(){var i,s;this.gltf.buffers=[];let r=this.byteLength,t=new ArrayBuffer(r),a=new Uint8Array(t),n=0;for(let o of this.sourceBuffers||[])n=kt(o,a,n);((s=(i=this.json)==null?void 0:i.buffers)==null?void 0:s[0])?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=t,this.sourceBuffers=[t]}_removeStringFromArray(r,t){let a=!0;for(;a;){let n=r.indexOf(t);n>-1?r.splice(n,1):a=!1}}_addAttributes(r={}){let t={};for(let a in r){let n=r[a],i=this._getGltfAttributeName(a),s=this.addBinaryBuffer(n.value,n);t[i]=s}return t}_addIndices(r){return this.addBinaryBuffer(r,{size:1})}_getGltfAttributeName(r){switch(r.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return r}}_getAccessorMinMax(r,t){let a={min:null,max:null};if(r.length<t)return a;a.min=[],a.max=[];let n=r.subarray(0,t);for(let i of n)a.min.push(i),a.max.push(i);for(let i=t;i<r.length;i+=t)for(let s=0;s<t;s++)a.min[0+s]=Math.min(a.min[0+s],r[i+s]),a.max[0+s]=Math.max(a.max[0+s],r[i+s]);return a}};var b1=1179937895,_1=1313821514,T1=5130562,Me=!0;function $t(e,r,t=0,a={}){let{magic:n=b1,version:i=2,json:s={},binary:o}=e,c=t;r&&(r.setUint32(t+0,n,Me),r.setUint32(t+4,i,Me),r.setUint32(t+8,0,Me));let u=t+8;t+=12;let l=t;r&&(r.setUint32(t+0,0,Me),r.setUint32(t+4,_1,Me)),t+=8;let f=JSON.stringify(s);if(t=Ke(r,t,f,4),r){let h=t-l-8;r.setUint32(l+0,h,Me)}if(o){let h=t;if(r&&(r.setUint32(t+0,0,Me),r.setUint32(t+4,T1,Me)),t+=8,t=wr(r,t,o,4),r){let d=t-h-8;r.setUint32(h+0,d,Me)}}if(r){let h=t-c;r.setUint32(u,h,Me)}return t}function Jt(e,r,t,a){return k1(e),$t(e,r,t,a)}function k1(e,{firstBuffer:r=0}={}){if(e.buffers&&e.buffers.length>r)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Ht={name:"glTF",id:"gltf",module:"gltf",version:Tn,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:O1,options:{gltf:{}}};function O1(e,r={}){let{byteOffset:t=0}=r,a=Jt(e,null,t,r),n=new ArrayBuffer(a),i=new DataView(n);return Jt(e,i,t,r),n}var cs="3.3.0-alpha.5";var vr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},nv=Object.keys(vr),Ie={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Ne(e,r,t){let a=12;if(!r)return t+a;let{magic:n,version:i=1,byteLength:s=12}=e;return Ae(Array.isArray(n)&&Number.isFinite(i)&&Number.isFinite(s)),r.setUint8(t+0,n[0]),r.setUint8(t+1,n[1]),r.setUint8(t+2,n[2]),r.setUint8(t+3,n[3]),r.setUint32(t+4,i,!0),r.setUint32(t+8,s,!0),t+=a,t}function Ce(e,r,t){!e||e.setUint32(r+8,t,!0)}function us(e,r,t,a,n){e=Q({magic:Ie.COMPOSITE,tiles:[]},e);let i=t;t+=Ne(e,r,t),r&&r.setUint32(t,e.tiles.length,!0),t+=4;for(let s=0;s<e.tiles.length;++s)t+=n(e.tiles[s],r,t,a);return Ce(r,i,t-i),t}function ls(e,r,t,a){let{featuresLength:n=0,batchTable:i}=e,s={BATCH_LENGTH:n},o=JSON.stringify(s),c=i?JSON.stringify(i):"",u=be(o.length,8),l=c?be(c.length,8):0;e=Q({magic:Ie.BATCHED_MODEL},e);let f=t;t=Ne(e,r,t),r&&(r.setUint32(12,u,!0),r.setUint32(16,0,!0),r.setUint32(20,l,!0),r.setUint32(24,0,!0)),t+=16,t=Ke(r,t,o,8),i&&(t=Ke(r,t,c,8));let h=e.gltfEncoded;return h&&(t=mr(r,t,h,h.byteLength)),Ce(r,f,t-f),t}function fs(e,r,t,a){let{featuresLength:n=1,gltfFormat:i=1,gltfUri:s=""}=e,o=s.length,c={INSTANCES_LENGTH:n,POSITION:new Array(n*3).fill(0)},u=JSON.stringify(c),l=u.length;e=Q({magic:Ie.INSTANCED_MODEL},e);let f=t;return t=Ne(e,r,0),r&&(r.setUint32(12,l,!0),r.setUint32(16,0,!0),r.setUint32(20,0,!0),r.setUint32(24,0,!0),r.setUint32(28,i,!0)),t+=20,t+=er(r,t,u,l),t+=er(r,t,s,o),Ce(r,f,t-f),t}var ed={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function hs(e,r,t,a){let{featureTableJson:n=ed}=e,i=JSON.stringify(n);i=Ot(i,4);let{featureTableJsonByteLength:s=i.length}=e,o=new ArrayBuffer(12),c=o.byteLength;e=Q({magic:Ie.POINT_CLOUD},e);let u=t;return t+=Ne(e,r,0),r&&(r.setUint32(t+0,s,!0),r.setUint32(t+4,c,!0),r.setUint32(t+8,0,!0),r.setUint32(t+12,0,!0)),t+=16,t+=er(r,t,i,s),t+=mr(r,t,o,c),Ce(r,u,t-u),t}function ln(e,r){let t=fn(e,null,0,r),a=new ArrayBuffer(t),n=new DataView(a);return fn(e,n,0,r),a}function fn(e,r,t,a){switch(Ae(typeof e.type=="string"),e.type){case vr.COMPOSITE:return us(e,r,t,a,fn);case vr.POINT_CLOUD:return hs(e,r,t,a);case vr.BATCHED_3D_MODEL:return ls(e,r,t,a);case vr.INSTANCED_3D_MODEL:return fs(e,r,t,a);default:throw new Error("3D Tiles: unknown tile type")}}var hn={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:cs,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:rd,binary:!0,options:{["3d-tiles"]:{}}};function rd(e,r){return ln(e,r)}var He=xn(dr()),ps=xn(os());function ds(e,r){let t=new Float32Array(e.length),a=nd(r);for(let n=0;n<e.length;n+=2){let i=e.subarray(n,n+2),s=a.slice(n*2,n*2+4),o=td([i[0],i[1]]),c=[s[2]-s[0],s[3]-s[1]],u=[o[0]*c[0],o[1]*c[1]],l=[u[0]+s[0],u[1]+s[1]];t[n]=l[0],t[n+1]=l[1]}return t}function td(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function nd(e){let r=65535,t=[];for(let a=0;a<e.length;a++)t[a]=e[a]/r;return t}var ad=new He.Matrix4([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),vs=new He.Vector3,xt=class{async convert(r,t=null){let a=await this.buildGltf(r,t);return qr({gltfEncoded:new Uint8Array(a),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},hn)}async buildGltf(r,t){let{tileContent:a,textureFormat:n}=r,{material:i,attributes:s,indices:o,cartesianOrigin:c,cartographicOrigin:u,modelMatrix:l}=a,f=new Mr,h=await this._addI3sTextureToGltf(a,n,f),d=this._convertI3sMaterialToGltfMaterial(i,h),p=f.addMaterial(d),m=s.positions,v=m.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=ds(s.texCoords.value,s.uvRegions.value)),s.positions.value=this._normalizePositions(v,c,u,l),this._createBatchIds(a,t),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let g=o||this._generateSynteticIndices(v.length/m.size),b=f.addMesh({attributes:s,indices:g,material:p,mode:4}),y=this._generateTransformMatrix(c),M=f.addNode({meshIndex:b,matrix:y}),k=f.addScene({nodeIndices:[M]});return f.setDefaultScene(k),f.createBinaryChunk(),qr(f.gltf,Ht)}async _addI3sTextureToGltf(r,t,a){let{texture:n,material:i,attributes:s}=r,o=null,c=n;if(!n&&i&&(c=i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorTexture&&i.pbrMetallicRoughness.baseColorTexture.texture.source.image),c){let u=this._deduceMimeTypeFromFormat(t),l=a.addImage(c,u);o=a.addTexture({imageIndex:l}),delete s.colors}return o}_normalizePositions(r,t,a,n){let i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3){let o=r.subarray(s,s+3),c=new He.Vector3(t),u=new He.Vector3(Array.from(o)).transform(n).add(a);ps.Ellipsoid.WGS84.cartographicToCartesian(u,vs),u=vs.subtract(c),i.set(u,s)}return i}_generateTransformMatrix(r){return new He.Matrix4().translate(r).multiplyLeft(ad)}_createBatchIds(r,t){let{featureIds:a}=r,{OBJECTID:n}=t||{};if(!(!a||!n)){for(let i=0;i<a.length;i++){let s=a[i],o=n.indexOf(s);a[i]=o}r.attributes._BATCHID={size:1,byteOffset:0,value:a}}}_generateSynteticIndices(r){let t=new Uint32Array(r);for(let a=0;a<r;a++)t.set([a],a);return t}_deduceMimeTypeFromFormat(r){switch(r){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${r}`),"image/jpeg"}}_convertI3sMaterialToGltfMaterial(r,t){let a=t!==null;return r?(t!==null&&(r=this._setGltfTexture(r,t)),r):(r={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},a?r.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],r)}_setGltfTexture(r,t){let a=Mn(Q({},r),{pbrMetallicRoughness:Q({},r.pbrMetallicRoughness)});return r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorTexture?a.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.emissiveTexture?a.emissiveTexture={index:t,texCoord:0}:r.pbrMetallicRoughness&&r.pbrMetallicRoughness.metallicRoughnessTexture?a.pbrMetallicRoughness.metallicRoughnessTexture={index:t,texCoord:0}:r.normalTexture?a.normalTexture={index:t,texCoord:0}:r.occlusionTexture&&(a.occlusionTexture={index:t,texCoord:0}),a}_getFeaturesLength(r){if(!r)return 0;let t=Object.keys(r)[0];return t?r[t].length:0}_checkNormals(r){return r.find(t=>t)}};var id=new xt;Tt(async(e,r={})=>id.convert(e,r.featureAttributes));
1
+ var hs=Object.create;var Yr=Object.defineProperty,ds=Object.defineProperties,ps=Object.getOwnPropertyDescriptor,vs=Object.getOwnPropertyDescriptors,ms=Object.getOwnPropertyNames,Cn=Object.getOwnPropertySymbols,gs=Object.getPrototypeOf,In=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable;var Wn=(e,r,t)=>r in e?Yr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Q=(e,r)=>{for(var t in r||(r={}))In.call(r,t)&&Wn(e,t,r[t]);if(Cn)for(var t of Cn(r))ys.call(r,t)&&Wn(e,t,r[t]);return e},Bn=(e,r)=>ds(e,vs(r)),Ms=e=>Yr(e,"__esModule",{value:!0});var S=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var xs=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of ms(r))!In.call(e,a)&&a!=="default"&&Yr(e,a,{get:()=>r[a],enumerable:!(t=ps(r,a))||t.enumerable});return e},Fn=e=>xs(Ms(Yr(e!=null?hs(gs(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var V=S((qd,Or)=>{function Cs(e){return e&&e.__esModule?e:{default:e}}Or.exports=Cs,Or.exports.__esModule=!0,Or.exports.default=Or.exports});var se=S((Ed,Oe)=>{function Ut(e){return Oe.exports=Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Oe.exports.__esModule=!0,Oe.exports.default=Oe.exports,Ut(e)}Oe.exports=Ut,Oe.exports.__esModule=!0,Oe.exports.default=Oe.exports});var $=S((Ld,Tr)=>{function Is(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Tr.exports=Is,Tr.exports.__esModule=!0,Tr.exports.default=Tr.exports});var J=S((Nd,kr)=>{function Zn(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ws(e,r,t){return r&&Zn(e.prototype,r),t&&Zn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}kr.exports=Ws,kr.exports.__esModule=!0,kr.exports.default=kr.exports});var Xn=S((Cd,Te)=>{function Vt(e,r){return Te.exports=Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},Te.exports.__esModule=!0,Te.exports.default=Te.exports,Vt(e,r)}Te.exports=Vt,Te.exports.__esModule=!0,Te.exports.default=Te.exports});var oe=S((Id,Rr)=>{var Bs=Xn();function Fs(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Bs(e,r)}Rr.exports=Fs,Rr.exports.__esModule=!0,Rr.exports.default=Rr.exports});var Qn=S((Wd,Ar)=>{function Ds(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Ar.exports=Ds,Ar.exports.__esModule=!0,Ar.exports.default=Ar.exports});var ce=S((Bd,Pr)=>{var zs=se().default,Ys=Qn();function Gs(e,r){if(r&&(zs(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ys(e)}Pr.exports=Gs,Pr.exports.__esModule=!0,Pr.exports.default=Pr.exports});var ue=S((Fd,ke)=>{function jt(e){return ke.exports=jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ke.exports.__esModule=!0,ke.exports.default=ke.exports,jt(e)}ke.exports=jt,ke.exports.__esModule=!0,ke.exports.default=ke.exports});var Zr=S(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.default=Us;function Us(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}});var ve=S(D=>{"use strict";var $n=V();Object.defineProperty(D,"__esModule",{value:!0});D.configure=Xs;D.formatValue=Qs;D.isArray=je;D.clone=$s;D.toRadians=Js;D.toDegrees=Hs;D.radians=Hn;D.degrees=Kn;D.sin=Ks;D.cos=eo;D.tan=ro;D.asin=to;D.acos=no;D.atan=ao;D.clamp=io;D.lerp=ea;D.equals=ra;D.exactEquals=ta;D.withEpsilon=so;D.config=void 0;var Jn=$n(se()),Vs=$n(Zr()),js=1/Math.PI*180,Zs=1/180*Math.PI,H={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};D.config=H;function Xs(e){for(var r in e)(0,Vs.default)(r in H),H[r]=e[r];return H}function Qs(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.precision,a=t===void 0?H.precision:t;return e=oo(e),"".concat(parseFloat(e.toPrecision(a)))}function je(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $s(e){return"clone"in e?e.clone():e.slice()}function Js(e){return Hn(e)}function Hs(e){return Kn(e)}function Hn(e,r){return Re(e,function(t){return t*Zs},r)}function Kn(e,r){return Re(e,function(t){return t*js},r)}function Ks(e,r){return Re(e,function(t){return Math.sin(t)},r)}function eo(e,r){return Re(e,function(t){return Math.cos(t)},r)}function ro(e,r){return Re(e,function(t){return Math.tan(t)},r)}function to(e,r){return Re(e,function(t){return Math.asin(t)},r)}function no(e,r){return Re(e,function(t){return Math.acos(t)},r)}function ao(e,r){return Re(e,function(t){return Math.atan(t)},r)}function io(e,r,t){return Re(e,function(a){return Math.max(r,Math.min(t,a))})}function ea(e,r,t){return je(e)?e.map(function(a,n){return ea(a,r[n],t)}):t*r+(1-t)*e}function ra(e,r,t){var a=H.EPSILON;t&&(H.EPSILON=t);try{if(e===r)return!0;if(je(e)&&je(r)){if(e.length!==r.length)return!1;for(var n=0;n<e.length;++n)if(!ra(e[n],r[n]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=H.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{H.EPSILON=a}}function ta(e,r){if(e===r)return!0;if(e&&(0,Jn.default)(e)==="object"&&r&&(0,Jn.default)(r)==="object"){if(e.constructor!==r.constructor)return!1;if(e.exactEquals)return e.exactEquals(r)}if(je(e)&&je(r)){if(e.length!==r.length)return!1;for(var t=0;t<e.length;++t)if(!ta(e[t],r[t]))return!1;return!0}return!1}function so(e,r){var t=H.EPSILON;H.EPSILON=e;var a;try{a=r()}finally{H.EPSILON=t}return a}function oo(e){return Math.round(e/H.EPSILON)*H.EPSILON}function co(e){return e.clone?e.clone():new Array(e.length)}function Re(e,r,t){if(je(e)){var a=e;t=t||co(a);for(var n=0;n<t.length&&n<a.length;++n)t[n]=r(e[n],n,t);return t}return r(e)}});var qr=S(Xr=>{"use strict";var Sr=V();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.default=void 0;var uo=Sr($()),lo=Sr(J()),fo=Sr(oe()),ho=Sr(ce()),na=Sr(ue()),wr=ve();function po(e){var r=vo();return function(){var a=(0,na.default)(e),n;if(r){var i=(0,na.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,ho.default)(this,n)}}function vo(){if(typeof Reflect=="undefined"||!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 mo(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var go=function(e){(0,fo.default)(t,e);var r=po(t);function t(){return(0,uo.default)(this,t),r.apply(this,arguments)}return(0,lo.default)(t,[{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"fromArray",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)this[s]=n[s+i];return this.check()}},{key:"toArray",value:function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)n[i+s]=this[s];return n}},{key:"from",value:function(n){return Array.isArray(n)?this.copy(n):this.fromObject(n)}},{key:"to",value:function(n){return n===this?this:(0,wr.isArray)(n)?this.toArray(n):this.toObject(n)}},{key:"toTarget",value:function(n){return n?this.to(n):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(wr.config)}},{key:"formatString",value:function(n){for(var i="",s=0;s<this.ELEMENTS;++s)i+=(s>0?", ":"")+(0,wr.formatValue)(this[s],n);return"".concat(n.printTypes?this.constructor.name:"","[").concat(i,"]")}},{key:"equals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(!(0,wr.equals)(this[i],n[i]))return!1;return!0}},{key:"exactEquals",value:function(n){if(!n||this.length!==n.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(this[i]!==n[i])return!1;return!0}},{key:"negate",value:function(){for(var n=0;n<this.ELEMENTS;++n)this[n]=-this[n];return this.check()}},{key:"lerp",value:function(n,i,s){if(s===void 0)return this.lerp(this,n,i);for(var o=0;o<this.ELEMENTS;++o){var c=n[o];this[o]=c+s*(i[o]-c)}return this.check()}},{key:"min",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(n[i],this[i]);return this.check()}},{key:"max",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.max(n[i],this[i]);return this.check()}},{key:"clamp",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n[s]),i[s]);return this.check()}},{key:"add",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]+=u[l];return this.check()}},{key:"subtract",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]-=u[l];return this.check()}},{key:"scale",value:function(n){if(typeof n=="number")for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;else for(var s=0;s<this.ELEMENTS&&s<n.length;++s)this[s]*=n[s];return this.check()}},{key:"multiplyByScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"check",value:function(){if(wr.config.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var n=this.length===this.ELEMENTS,i=0;i<this.ELEMENTS;++i)n=n&&Number.isFinite(this[i]);return n}},{key:"sub",value:function(n){return this.subtract(n)}},{key:"setScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]=n;return this.check()}},{key:"addScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]+=n;return this.check()}},{key:"subScalar",value:function(n){return this.addScalar(-n)}},{key:"multiplyScalar",value:function(n){for(var i=0;i<this.ELEMENTS;++i)this[i]*=n;return this.check()}},{key:"divideScalar",value:function(n){return this.multiplyByScalar(1/n)}},{key:"clampScalar",value:function(n,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],n),i);return this.check()}},{key:"elements",get:function(){return this}}]),t}(mo(Array));Xr.default=go});var me=S(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.validateVector=aa;nr.checkNumber=Mo;nr.checkVector=xo;nr.deprecated=bo;var yo=ve();function aa(e,r){if(e.length!==r)return!1;for(var t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function Mo(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function xo(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(yo.config.debug&&!aa(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}var ia={};function bo(e,r){ia[e]||(ia[e]=!0,console.warn("".concat(e," has been removed in version ").concat(r,", see upgrade guide for more information")))}});var $r=S(Qr=>{"use strict";var Ze=V();Object.defineProperty(Qr,"__esModule",{value:!0});Qr.default=void 0;var _o=Ze($()),Oo=Ze(J()),To=Ze(oe()),ko=Ze(ce()),sa=Ze(ue()),Ro=Ze(qr()),Er=me(),oa=Ze(Zr());function Ao(e){var r=Po();return function(){var a=(0,sa.default)(e),n;if(r){var i=(0,sa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,ko.default)(this,n)}}function Po(){if(typeof Reflect=="undefined"||!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}}var So=function(e){(0,To.default)(t,e);var r=Ao(t);function t(){return(0,_o.default)(this,t),r.apply(this,arguments)}return(0,Oo.default)(t,[{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,Er.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,Er.checkNumber)(n)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var n=0,i=0;i<this.ELEMENTS;++i)n+=this[i]*this[i];return n}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(n){return Math.sqrt(this.distanceSquared(n))}},{key:"distanceSquared",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s){var o=this[s]-n[s];i+=o*o}return(0,Er.checkNumber)(i)}},{key:"dot",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s)i+=this[s]*n[s];return(0,Er.checkNumber)(i)}},{key:"normalize",value:function(){var n=this.magnitude();if(n!==0)for(var i=0;i<this.ELEMENTS;++i)this[i]/=n;return this.check()}},{key:"multiply",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]*=u[l];return this.check()}},{key:"divide",value:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]/=u[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(n){return this.distance(n)}},{key:"distanceToSquared",value:function(n){return this.distanceSquared(n)}},{key:"getComponent",value:function(n){return(0,oa.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),(0,Er.checkNumber)(this[n])}},{key:"setComponent",value:function(n,i){return(0,oa.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),this[n]=i,this.check()}},{key:"addVectors",value:function(n,i){return this.copy(n).add(i)}},{key:"subVectors",value:function(n,i){return this.copy(n).subtract(i)}},{key:"multiplyVectors",value:function(n,i){return this.copy(n).multiply(i)}},{key:"addScaledVector",value:function(n,i){return this.add(new this.constructor(n).multiplyScalar(i))}}]),t}(Ro.default);Qr.default=So});var Xe=S(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.setMatrixArrayType=qo;ne.toRadian=Lo;ne.equals=No;ne.RANDOM=ne.ARRAY_TYPE=ne.EPSILON=void 0;var ca=1e-6;ne.EPSILON=ca;var ua=typeof Float32Array!="undefined"?Float32Array:Array;ne.ARRAY_TYPE=ua;var wo=Math.random;ne.RANDOM=wo;function qo(e){ne.ARRAY_TYPE=ua=e}var Eo=Math.PI/180;function Lo(e){return e*Eo}function No(e,r){return Math.abs(e-r)<=ca*Math.max(1,Math.abs(e),Math.abs(r))}Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)})});var Hr=S(R=>{"use strict";function Jr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jr=function(t){return typeof t}:Jr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(e)}Object.defineProperty(R,"__esModule",{value:!0});R.create=fa;R.clone=Io;R.fromValues=Wo;R.copy=Bo;R.set=Fo;R.add=Do;R.subtract=ha;R.multiply=da;R.divide=pa;R.ceil=zo;R.floor=Yo;R.min=Go;R.max=Uo;R.round=Vo;R.scale=jo;R.scaleAndAdd=Zo;R.distance=va;R.squaredDistance=ma;R.length=ga;R.squaredLength=ya;R.negate=Xo;R.inverse=Qo;R.normalize=$o;R.dot=Jo;R.cross=Ho;R.lerp=Ko;R.random=ec;R.transformMat2=rc;R.transformMat2d=tc;R.transformMat3=nc;R.transformMat4=ac;R.rotate=ic;R.angle=sc;R.zero=oc;R.str=cc;R.exactEquals=uc;R.equals=lc;R.forEach=R.sqrLen=R.sqrDist=R.dist=R.div=R.mul=R.sub=R.len=void 0;var Qe=Co(Xe());function la(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(la=function(n){return n?t:r})(e)}function Co(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Jr(e)!=="object"&&typeof e!="function")return{default:e};var t=la(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function fa(){var e=new Qe.ARRAY_TYPE(2);return Qe.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function Io(e){var r=new Qe.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r}function Wo(e,r){var t=new Qe.ARRAY_TYPE(2);return t[0]=e,t[1]=r,t}function Bo(e,r){return e[0]=r[0],e[1]=r[1],e}function Fo(e,r,t){return e[0]=r,e[1]=t,e}function Do(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function ha(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e}function da(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e}function pa(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e}function zo(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e}function Yo(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e}function Go(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e}function Uo(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e}function Vo(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e}function jo(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function Zo(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e}function va(e,r){var t=r[0]-e[0],a=r[1]-e[1];return Math.hypot(t,a)}function ma(e,r){var t=r[0]-e[0],a=r[1]-e[1];return t*t+a*a}function ga(e){var r=e[0],t=e[1];return Math.hypot(r,t)}function ya(e){var r=e[0],t=e[1];return r*r+t*t}function Xo(e,r){return e[0]=-r[0],e[1]=-r[1],e}function Qo(e,r){return e[0]=1/r[0],e[1]=1/r[1],e}function $o(e,r){var t=r[0],a=r[1],n=t*t+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e}function Jo(e,r){return e[0]*r[0]+e[1]*r[1]}function Ho(e,r,t){var a=r[0]*t[1]-r[1]*t[0];return e[0]=e[1]=0,e[2]=a,e}function Ko(e,r,t,a){var n=r[0],i=r[1];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e}function ec(e,r){r=r||1;var t=Qe.RANDOM()*2*Math.PI;return e[0]=Math.cos(t)*r,e[1]=Math.sin(t)*r,e}function rc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e}function tc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n+t[4],e[1]=t[1]*a+t[3]*n+t[5],e}function nc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[3]*n+t[6],e[1]=t[1]*a+t[4]*n+t[7],e}function ac(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[4]*n+t[12],e[1]=t[1]*a+t[5]*n+t[13],e}function ic(e,r,t,a){var n=r[0]-t[0],i=r[1]-t[1],s=Math.sin(a),o=Math.cos(a);return e[0]=n*o-i*s+t[0],e[1]=n*s+i*o+t[1],e}function sc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1],s=Math.sqrt(t*t+a*a)*Math.sqrt(n*n+i*i),o=s&&(t*n+a*i)/s;return Math.acos(Math.min(Math.max(o,-1),1))}function oc(e){return e[0]=0,e[1]=0,e}function cc(e){return"vec2("+e[0]+", "+e[1]+")"}function uc(e,r){return e[0]===r[0]&&e[1]===r[1]}function lc(e,r){var t=e[0],a=e[1],n=r[0],i=r[1];return Math.abs(t-n)<=Qe.EPSILON*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(a-i)<=Qe.EPSILON*Math.max(1,Math.abs(a),Math.abs(i))}var fc=ga;R.len=fc;var hc=ha;R.sub=hc;var dc=da;R.mul=dc;var pc=pa;R.div=pc;var vc=va;R.dist=vc;var mc=ma;R.sqrDist=mc;var gc=ya;R.sqrLen=gc;var yc=function(){var e=fa();return function(r,t,a,n,i,s){var o,c;for(t||(t=2),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],i(e,e,s),r[o]=e[0],r[o+1]=e[1];return r}}();R.forEach=yc});var ar=S($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.vec2_transformMat4AsVector=Mc;$e.vec3_transformMat4AsVector=xc;$e.vec3_transformMat2=bc;$e.vec4_transformMat2=_c;$e.vec4_transformMat3=Oc;function Mc(e,r,t){var a=r[0],n=r[1],i=t[3]*a+t[7]*n||1;return e[0]=(t[0]*a+t[4]*n)/i,e[1]=(t[1]*a+t[5]*n)/i,e}function xc(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i||1;return e[0]=(t[0]*a+t[4]*n+t[8]*i)/s,e[1]=(t[1]*a+t[5]*n+t[9]*i)/s,e[2]=(t[2]*a+t[6]*n+t[10]*i)/s,e}function bc(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e}function _c(e,r,t){var a=r[0],n=r[1];return e[0]=t[0]*a+t[2]*n,e[1]=t[1]*a+t[3]*n,e[2]=r[2],e[3]=r[3],e}function Oc(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=t[0]*a+t[3]*n+t[6]*i,e[1]=t[1]*a+t[4]*n+t[7]*i,e[2]=t[2]*a+t[5]*n+t[8]*i,e[3]=r[3],e}});var ba=S(rt=>{"use strict";var ir=V(),Tc=se();Object.defineProperty(rt,"__esModule",{value:!0});rt.default=void 0;var kc=ir($()),Rc=ir(J()),Ac=ir(oe()),Pc=ir(ce()),Ma=ir(ue()),Sc=ir($r()),Xt=ve(),Kr=me(),et=qc(Hr()),wc=ar();function xa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(xa=function(n){return n?t:r})(e)}function qc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Tc(e)!=="object"&&typeof e!="function")return{default:e};var t=xa(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Ec(e){var r=Lc();return function(){var a=(0,Ma.default)(e),n;if(r){var i=(0,Ma.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Pc.default)(this,n)}}function Lc(){if(typeof Reflect=="undefined"||!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}}var Nc=function(e){(0,Ac.default)(t,e);var r=Ec(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(0,kc.default)(this,t),a=r.call(this,2),(0,Xt.isArray)(n)&&arguments.length===1?a.copy(n):(Xt.config.debug&&((0,Kr.checkNumber)(n),(0,Kr.checkNumber)(i)),a[0]=n,a[1]=i),a}return(0,Rc.default)(t,[{key:"set",value:function(n,i){return this[0]=n,this[1]=i,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this.check()}},{key:"fromObject",value:function(n){return Xt.config.debug&&((0,Kr.checkNumber)(n.x),(0,Kr.checkNumber)(n.y)),this[0]=n.x,this[1]=n.y,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return et.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,wc.vec2_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return et.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2x3",value:function(n){return et.transformMat2d(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return et.transformMat2(this,this,n),this.check()}}]),t}(Sc.default);rt.default=Nc});var Le=S(O=>{"use strict";function tt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tt=function(t){return typeof t}:tt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(e)}Object.defineProperty(O,"__esModule",{value:!0});O.create=Oa;O.clone=Ic;O.length=Ta;O.fromValues=Wc;O.copy=Bc;O.set=Fc;O.add=Dc;O.subtract=ka;O.multiply=Ra;O.divide=Aa;O.ceil=zc;O.floor=Yc;O.min=Gc;O.max=Uc;O.round=Vc;O.scale=jc;O.scaleAndAdd=Zc;O.distance=Pa;O.squaredDistance=Sa;O.squaredLength=wa;O.negate=Xc;O.inverse=Qc;O.normalize=$c;O.dot=qa;O.cross=Jc;O.lerp=Hc;O.hermite=Kc;O.bezier=eu;O.random=ru;O.transformMat4=tu;O.transformMat3=nu;O.transformQuat=au;O.rotateX=iu;O.rotateY=su;O.rotateZ=ou;O.angle=cu;O.zero=uu;O.str=lu;O.exactEquals=fu;O.equals=hu;O.forEach=O.sqrLen=O.len=O.sqrDist=O.dist=O.div=O.mul=O.sub=void 0;var Ae=Cc(Xe());function _a(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(_a=function(n){return n?t:r})(e)}function Cc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||tt(e)!=="object"&&typeof e!="function")return{default:e};var t=_a(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Oa(){var e=new Ae.ARRAY_TYPE(3);return Ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Ic(e){var r=new Ae.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function Ta(e){var r=e[0],t=e[1],a=e[2];return Math.hypot(r,t,a)}function Wc(e,r,t){var a=new Ae.ARRAY_TYPE(3);return a[0]=e,a[1]=r,a[2]=t,a}function Bc(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function Fc(e,r,t,a){return e[0]=r,e[1]=t,e[2]=a,e}function Dc(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function ka(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Ra(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Aa(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function zc(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function Yc(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function Gc(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function Uc(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function Vc(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e}function jc(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function Zc(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e}function Pa(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return Math.hypot(t,a,n)}function Sa(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2];return t*t+a*a+n*n}function wa(e){var r=e[0],t=e[1],a=e[2];return r*r+t*t+a*a}function Xc(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function Qc(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function $c(e,r){var t=r[0],a=r[1],n=r[2],i=t*t+a*a+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e}function qa(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function Jc(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2];return e[0]=n*c-i*o,e[1]=i*s-a*c,e[2]=a*o-n*s,e}function Hc(e,r,t,a){var n=r[0],i=r[1],s=r[2];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e}function Kc(e,r,t,a,n,i){var s=i*i,o=s*(2*i-3)+1,c=s*(i-2)+i,u=s*(i-1),l=s*(3-2*i);return e[0]=r[0]*o+t[0]*c+a[0]*u+n[0]*l,e[1]=r[1]*o+t[1]*c+a[1]*u+n[1]*l,e[2]=r[2]*o+t[2]*c+a[2]*u+n[2]*l,e}function eu(e,r,t,a,n,i){var s=1-i,o=s*s,c=i*i,u=o*s,l=3*i*o,f=3*c*s,h=c*i;return e[0]=r[0]*u+t[0]*l+a[0]*f+n[0]*h,e[1]=r[1]*u+t[1]*l+a[1]*f+n[1]*h,e[2]=r[2]*u+t[2]*l+a[2]*f+n[2]*h,e}function ru(e,r){r=r||1;var t=Ae.RANDOM()*2*Math.PI,a=Ae.RANDOM()*2-1,n=Math.sqrt(1-a*a)*r;return e[0]=Math.cos(t)*n,e[1]=Math.sin(t)*n,e[2]=a*r,e}function tu(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[3]*a+t[7]*n+t[11]*i+t[15];return s=s||1,e[0]=(t[0]*a+t[4]*n+t[8]*i+t[12])/s,e[1]=(t[1]*a+t[5]*n+t[9]*i+t[13])/s,e[2]=(t[2]*a+t[6]*n+t[10]*i+t[14])/s,e}function nu(e,r,t){var a=r[0],n=r[1],i=r[2];return e[0]=a*t[0]+n*t[3]+i*t[6],e[1]=a*t[1]+n*t[4]+i*t[7],e[2]=a*t[2]+n*t[5]+i*t[8],e}function au(e,r,t){var a=t[0],n=t[1],i=t[2],s=t[3],o=r[0],c=r[1],u=r[2],l=n*u-i*c,f=i*o-a*u,h=a*c-n*o,d=n*h-i*f,p=i*l-a*h,m=a*f-n*l,v=s*2;return l*=v,f*=v,h*=v,d*=2,p*=2,m*=2,e[0]=o+l+d,e[1]=c+f+p,e[2]=u+h+m,e}function iu(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0],i[1]=n[1]*Math.cos(a)-n[2]*Math.sin(a),i[2]=n[1]*Math.sin(a)+n[2]*Math.cos(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function su(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[2]*Math.sin(a)+n[0]*Math.cos(a),i[1]=n[1],i[2]=n[2]*Math.cos(a)-n[0]*Math.sin(a),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function ou(e,r,t,a){var n=[],i=[];return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],i[0]=n[0]*Math.cos(a)-n[1]*Math.sin(a),i[1]=n[0]*Math.sin(a)+n[1]*Math.cos(a),i[2]=n[2],e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e}function cu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2],c=Math.sqrt(t*t+a*a+n*n),u=Math.sqrt(i*i+s*s+o*o),l=c*u,f=l&&qa(e,r)/l;return Math.acos(Math.min(Math.max(f,-1),1))}function uu(e){return e[0]=0,e[1]=0,e[2]=0,e}function lu(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function fu(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function hu(e,r){var t=e[0],a=e[1],n=e[2],i=r[0],s=r[1],o=r[2];return Math.abs(t-i)<=Ae.EPSILON*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(a-s)<=Ae.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(n-o)<=Ae.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))}var du=ka;O.sub=du;var pu=Ra;O.mul=pu;var vu=Aa;O.div=vu;var mu=Pa;O.dist=mu;var gu=Sa;O.sqrDist=gu;var yu=Ta;O.len=yu;var Mu=wa;O.sqrLen=Mu;var xu=function(){var e=Oa();return function(r,t,a,n,i,s){var o,c;for(t||(t=3),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2];return r}}();O.forEach=xu});var it=S(at=>{"use strict";var sr=V(),bu=se();Object.defineProperty(at,"__esModule",{value:!0});at.default=void 0;var _u=sr($()),Ou=sr(J()),Tu=sr(oe()),ku=sr(ce()),Ea=sr(ue()),Ru=sr($r()),Qt=ve(),Je=me(),Ne=Au(Le()),La=ar();function Na(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Na=function(n){return n?t:r})(e)}function Au(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||bu(e)!=="object"&&typeof e!="function")return{default:e};var t=Na(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Pu(e){var r=Su();return function(){var a=(0,Ea.default)(e),n;if(r){var i=(0,Ea.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,ku.default)(this,n)}}function Su(){if(typeof Reflect=="undefined"||!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}}var $t=[0,0,0],nt,wu=function(e){(0,Tu.default)(t,e);var r=Pu(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return(0,_u.default)(this,t),a=r.call(this,-0,-0,-0),arguments.length===1&&(0,Qt.isArray)(n)?a.copy(n):(Qt.config.debug&&((0,Je.checkNumber)(n),(0,Je.checkNumber)(i),(0,Je.checkNumber)(s)),a[0]=n,a[1]=i,a[2]=s),a}return(0,Ou.default)(t,[{key:"set",value:function(n,i,s){return this[0]=n,this[1]=i,this[2]=s,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this.check()}},{key:"fromObject",value:function(n){return Qt.config.debug&&((0,Je.checkNumber)(n.x),(0,Je.checkNumber)(n.y),(0,Je.checkNumber)(n.z)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this.check()}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,Je.checkNumber)(n)}},{key:"angle",value:function(n){return Ne.angle(this,n)}},{key:"cross",value:function(n){return Ne.cross(this,this,n),this.check()}},{key:"rotateX",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?$t:s;return Ne.rotateX(this,this,o,i),this.check()}},{key:"rotateY",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?$t:s;return Ne.rotateY(this,this,o,i),this.check()}},{key:"rotateZ",value:function(n){var i=n.radians,s=n.origin,o=s===void 0?$t:s;return Ne.rotateZ(this,this,o,i),this.check()}},{key:"transform",value:function(n){return this.transformAsPoint(n)}},{key:"transformAsPoint",value:function(n){return Ne.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,La.vec3_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return Ne.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,La.vec3_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Ne.transformQuat(this,this,n),this.check()}}],[{key:"ZERO",get:function(){return nt||(nt=new t(0,0,0),Object.freeze(nt)),nt}}]),t}(Ru.default);at.default=wu});var Ht=S(ot=>{"use strict";var or=V(),qu=se();Object.defineProperty(ot,"__esModule",{value:!0});ot.default=void 0;var Eu=or($()),Lu=or(J()),Nu=or(oe()),Cu=or(ce()),Ca=or(ue()),Iu=or($r()),Jt=ve(),ge=me(),Ia=Wu(Le()),Wa=ar();function Ba(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ba=function(n){return n?t:r})(e)}function Wu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||qu(e)!=="object"&&typeof e!="function")return{default:e};var t=Ba(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Bu(e){var r=Fu();return function(){var a=(0,Ca.default)(e),n;if(r){var i=(0,Ca.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Cu.default)(this,n)}}function Fu(){if(typeof Reflect=="undefined"||!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}}var st,Du=function(e){(0,Nu.default)(t,e);var r=Bu(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return(0,Eu.default)(this,t),a=r.call(this,-0,-0,-0,-0),(0,Jt.isArray)(n)&&arguments.length===1?a.copy(n):(Jt.config.debug&&((0,ge.checkNumber)(n),(0,ge.checkNumber)(i),(0,ge.checkNumber)(s),(0,ge.checkNumber)(o)),a[0]=n,a[1]=i,a[2]=s,a[3]=o),a}return(0,Lu.default)(t,[{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"fromObject",value:function(n){return Jt.config.debug&&((0,ge.checkNumber)(n.x),(0,ge.checkNumber)(n.y),(0,ge.checkNumber)(n.z),(0,ge.checkNumber)(n.w)),this[0]=n.x,this[1]=n.y,this[2]=n.z,this[3]=n.w,this}},{key:"toObject",value:function(n){return n.x=this[0],n.y=this[1],n.z=this[2],n.w=this[3],n}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ge.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,ge.checkNumber)(n)}},{key:"transform",value:function(n){return Ia.transformMat4(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return(0,Wa.vec4_transformMat3)(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,Wa.vec4_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Ia.transformQuat(this,this,n),this.check()}},{key:"applyMatrix4",value:function(n){return n.transform(this,this),this}}],[{key:"ZERO",get:function(){return st||(st=new t(0,0,0,0),Object.freeze(st)),st}}]),t}(Iu.default);ot.default=Du});var Kt=S(ct=>{"use strict";var cr=V();Object.defineProperty(ct,"__esModule",{value:!0});ct.default=void 0;var zu=cr($()),Yu=cr(J()),Gu=cr(oe()),Uu=cr(ce()),Fa=cr(ue()),Vu=cr(qr()),ju=me(),Zu=ve();function Xu(e){var r=Qu();return function(){var a=(0,Fa.default)(e),n;if(r){var i=(0,Fa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Uu.default)(this,n)}}function Qu(){if(typeof Reflect=="undefined"||!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}}var $u=function(e){(0,Gu.default)(t,e);var r=Xu(t);function t(){return(0,zu.default)(this,t),r.apply(this,arguments)}return(0,Yu.default)(t,[{key:"toString",value:function(){var n="[";if(Zu.config.printRowMajor){n+="row-major:";for(var i=0;i<this.RANK;++i)for(var s=0;s<this.RANK;++s)n+=" ".concat(this[s*this.RANK+i])}else{n+="column-major:";for(var o=0;o<this.ELEMENTS;++o)n+=" ".concat(this[o])}return n+="]",n}},{key:"getElementIndex",value:function(n,i){return i*this.RANK+n}},{key:"getElement",value:function(n,i){return this[i*this.RANK+n]}},{key:"setElement",value:function(n,i,s){return this[i*this.RANK+n]=(0,ju.checkNumber)(s),this}},{key:"getColumn",value:function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),s=n*this.RANK,o=0;o<this.RANK;++o)i[o]=this[s+o];return i}},{key:"setColumn",value:function(n,i){for(var s=n*this.RANK,o=0;o<this.RANK;++o)this[s+o]=i[o];return this}}]),t}(Vu.default);ct.default=$u});var en=S(q=>{"use strict";function ut(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ut=function(t){return typeof t}:ut=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(e)}Object.defineProperty(q,"__esModule",{value:!0});q.create=Hu;q.fromMat4=Ku;q.clone=el;q.copy=rl;q.fromValues=tl;q.set=nl;q.identity=al;q.transpose=il;q.invert=sl;q.adjoint=ol;q.determinant=cl;q.multiply=za;q.translate=ul;q.rotate=ll;q.scale=fl;q.fromTranslation=hl;q.fromRotation=dl;q.fromScaling=pl;q.fromMat2d=vl;q.fromQuat=ml;q.normalFromMat4=gl;q.projection=yl;q.str=Ml;q.frob=xl;q.add=bl;q.subtract=Ya;q.multiplyScalar=_l;q.multiplyScalarAndAdd=Ol;q.exactEquals=Tl;q.equals=kl;q.sub=q.mul=void 0;var ee=Ju(Xe());function Da(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Da=function(n){return n?t:r})(e)}function Ju(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||ut(e)!=="object"&&typeof e!="function")return{default:e};var t=Da(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Hu(){var e=new ee.ARRAY_TYPE(9);return ee.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Ku(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e}function el(e){var r=new ee.ARRAY_TYPE(9);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function rl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function tl(e,r,t,a,n,i,s,o,c){var u=new ee.ARRAY_TYPE(9);return u[0]=e,u[1]=r,u[2]=t,u[3]=a,u[4]=n,u[5]=i,u[6]=s,u[7]=o,u[8]=c,u}function nl(e,r,t,a,n,i,s,o,c,u){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e}function al(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function il(e,r){if(e===r){var t=r[1],a=r[2],n=r[5];e[1]=r[3],e[2]=r[6],e[3]=t,e[5]=r[7],e[6]=a,e[7]=n}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e}function sl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=l*s-o*u,h=-l*i+o*c,d=u*i-s*c,p=t*f+a*h+n*d;return p?(p=1/p,e[0]=f*p,e[1]=(-l*a+n*u)*p,e[2]=(o*a-n*s)*p,e[3]=h*p,e[4]=(l*t-n*c)*p,e[5]=(-o*t+n*i)*p,e[6]=d*p,e[7]=(-u*t+a*c)*p,e[8]=(s*t-a*i)*p,e):null}function ol(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8];return e[0]=s*l-o*u,e[1]=n*u-a*l,e[2]=a*o-n*s,e[3]=o*c-i*l,e[4]=t*l-n*c,e[5]=n*i-t*o,e[6]=i*u-s*c,e[7]=a*c-t*u,e[8]=t*s-a*i,e}function cl(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8];return r*(u*i-s*c)+t*(-u*n+s*o)+a*(c*n-i*o)}function za(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=t[0],d=t[1],p=t[2],m=t[3],v=t[4],g=t[5],b=t[6],y=t[7],M=t[8];return e[0]=h*a+d*s+p*u,e[1]=h*n+d*o+p*l,e[2]=h*i+d*c+p*f,e[3]=m*a+v*s+g*u,e[4]=m*n+v*o+g*l,e[5]=m*i+v*c+g*f,e[6]=b*a+y*s+M*u,e[7]=b*n+y*o+M*l,e[8]=b*i+y*c+M*f,e}function ul(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=t[0],d=t[1];return e[0]=a,e[1]=n,e[2]=i,e[3]=s,e[4]=o,e[5]=c,e[6]=h*a+d*s+u,e[7]=h*n+d*o+l,e[8]=h*i+d*c+f,e}function ll(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=Math.sin(t),d=Math.cos(t);return e[0]=d*a+h*s,e[1]=d*n+h*o,e[2]=d*i+h*c,e[3]=d*s-h*a,e[4]=d*o-h*n,e[5]=d*c-h*i,e[6]=u,e[7]=l,e[8]=f,e}function fl(e,r,t){var a=t[0],n=t[1];return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=n*r[3],e[4]=n*r[4],e[5]=n*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function hl(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=r[0],e[7]=r[1],e[8]=1,e}function dl(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=-t,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function pl(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=r[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function vl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=0,e[3]=r[2],e[4]=r[3],e[5]=0,e[6]=r[4],e[7]=r[5],e[8]=1,e}function ml(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,f=a*o,h=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-f-p,e[3]=l-g,e[6]=h+v,e[1]=l+g,e[4]=1-u-p,e[7]=d-m,e[2]=h-v,e[5]=d+m,e[8]=1-u-f,e}function gl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,T=a*c-n*o,_=a*u-i*o,I=n*u-i*c,L=l*m-f*p,N=l*v-h*p,w=l*g-d*p,W=f*v-h*m,C=f*g-d*m,B=h*g-d*v,P=b*B-y*C+M*W+T*w-_*N+I*L;return P?(P=1/P,e[0]=(o*B-c*C+u*W)*P,e[1]=(c*w-s*B-u*N)*P,e[2]=(s*C-o*w+u*L)*P,e[3]=(n*C-a*B-i*W)*P,e[4]=(t*B-n*w+i*N)*P,e[5]=(a*w-t*C-i*L)*P,e[6]=(m*I-v*_+g*T)*P,e[7]=(v*M-p*I-g*y)*P,e[8]=(p*_-m*M+g*b)*P,e):null}function yl(e,r,t){return e[0]=2/r,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/t,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Ml(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function xl(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function bl(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e}function Ya(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e}function _l(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e}function Ol(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e}function Tl(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]}function kl(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],f=r[0],h=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8];return Math.abs(t-f)<=ee.EPSILON*Math.max(1,Math.abs(t),Math.abs(f))&&Math.abs(a-h)<=ee.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(n-d)<=ee.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=ee.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=ee.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-v)<=ee.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(c-g)<=ee.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-b)<=ee.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-y)<=ee.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))}var Rl=za;q.mul=Rl;var Al=Ya;q.sub=Al});var Va=S(ht=>{"use strict";var ur=V(),Pl=se();Object.defineProperty(ht,"__esModule",{value:!0});ht.default=void 0;var Sl=ur($()),wl=ur(J()),ql=ur(oe()),El=ur(ce()),Ga=ur(ue()),Ll=ur(Kt()),Nl=me(),Cl=ar(),ye=rn(en()),Il=rn(Hr()),Wl=rn(Le());function Ua(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ua=function(n){return n?t:r})(e)}function rn(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Pl(e)!=="object"&&typeof e!="function")return{default:e};var t=Ua(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Bl(e){var r=Fl();return function(){var a=(0,Ga.default)(e),n;if(r){var i=(0,Ga.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,El.default)(this,n)}}function Fl(){if(typeof Reflect=="undefined"||!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}}var tn;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(tn||(tn={}));var Dl=Object.freeze([1,0,0,0,1,0,0,0,1]),nn=function(e){(0,ql.default)(t,e);var r=Bl(t);function t(a){for(var n,i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return(0,Sl.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):s.length>0?n.copy([a].concat(s)):n.identity(),n}return(0,wl.default)(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return tn}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this.check()}},{key:"identity",value:function(){return this.copy(Dl)}},{key:"fromObject",value:function(n){return this.check()}},{key:"fromQuaternion",value:function(n){return ye.fromQuat(this,n),this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,f,h){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=f,this[8]=h,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,f,h){return this[0]=n,this[1]=o,this[2]=l,this[3]=i,this[4]=c,this[5]=f,this[6]=s,this[7]=u,this[8]=h,this.check()}},{key:"determinant",value:function(){return ye.determinant(this)}},{key:"transpose",value:function(){return ye.transpose(this,this),this.check()}},{key:"invert",value:function(){return ye.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return ye.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return ye.multiply(this,this,n),this.check()}},{key:"rotate",value:function(n){return ye.rotate(this,this,n),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?ye.scale(this,this,n):ye.scale(this,this,[n,n]),this.check()}},{key:"translate",value:function(n){return ye.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){var s;switch(n.length){case 2:s=Il.transformMat3(i||[-0,-0],n,this);break;case 3:s=Wl.transformMat3(i||[-0,-0,-0],n,this);break;case 4:s=(0,Cl.vec4_transformMat3)(i||[-0,-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,Nl.checkVector)(s,n.length),s}},{key:"transformVector",value:function(n,i){return this.transform(n,i)}},{key:"transformVector2",value:function(n,i){return this.transform(n,i)}},{key:"transformVector3",value:function(n,i){return this.transform(n,i)}}],[{key:"IDENTITY",get:function(){return Yl()}},{key:"ZERO",get:function(){return zl()}}]),t}(Ll.default);ht.default=nn;var lt,ft;function zl(){return lt||(lt=new nn([0,0,0,0,0,0,0,0,0]),Object.freeze(lt)),lt}function Yl(){return ft||(ft=new nn,Object.freeze(ft)),ft}});var ei=S(k=>{"use strict";function dt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dt=function(t){return typeof t}:dt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(e)}Object.defineProperty(k,"__esModule",{value:!0});k.create=Ul;k.clone=Vl;k.copy=jl;k.fromValues=Zl;k.set=Xl;k.identity=Za;k.transpose=Ql;k.invert=$l;k.adjoint=Jl;k.determinant=Hl;k.multiply=Xa;k.translate=Kl;k.scale=ef;k.rotate=rf;k.rotateX=tf;k.rotateY=nf;k.rotateZ=af;k.fromTranslation=sf;k.fromScaling=of;k.fromRotation=cf;k.fromXRotation=uf;k.fromYRotation=lf;k.fromZRotation=ff;k.fromRotationTranslation=Qa;k.fromQuat2=hf;k.getTranslation=df;k.getScaling=$a;k.getRotation=pf;k.fromRotationTranslationScale=vf;k.fromRotationTranslationScaleOrigin=mf;k.fromQuat=gf;k.frustum=yf;k.perspectiveNO=Ja;k.perspectiveZO=xf;k.perspectiveFromFieldOfView=bf;k.orthoNO=Ha;k.orthoZO=Of;k.lookAt=Tf;k.targetTo=kf;k.str=Rf;k.frob=Af;k.add=Pf;k.subtract=Ka;k.multiplyScalar=Sf;k.multiplyScalarAndAdd=wf;k.exactEquals=qf;k.equals=Ef;k.sub=k.mul=k.ortho=k.perspective=void 0;var F=Gl(Xe());function ja(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ja=function(n){return n?t:r})(e)}function Gl(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||dt(e)!=="object"&&typeof e!="function")return{default:e};var t=ja(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Ul(){var e=new F.ARRAY_TYPE(16);return F.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Vl(e){var r=new F.ARRAY_TYPE(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function jl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Zl(e,r,t,a,n,i,s,o,c,u,l,f,h,d,p,m){var v=new F.ARRAY_TYPE(16);return v[0]=e,v[1]=r,v[2]=t,v[3]=a,v[4]=n,v[5]=i,v[6]=s,v[7]=o,v[8]=c,v[9]=u,v[10]=l,v[11]=f,v[12]=h,v[13]=d,v[14]=p,v[15]=m,v}function Xl(e,r,t,a,n,i,s,o,c,u,l,f,h,d,p,m,v){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e[9]=l,e[10]=f,e[11]=h,e[12]=d,e[13]=p,e[14]=m,e[15]=v,e}function Za(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 Ql(e,r){if(e===r){var t=r[1],a=r[2],n=r[3],i=r[6],s=r[7],o=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=a,e[9]=i,e[11]=r[14],e[12]=n,e[13]=s,e[14]=o}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function $l(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15],b=t*o-a*s,y=t*c-n*s,M=t*u-i*s,T=a*c-n*o,_=a*u-i*o,I=n*u-i*c,L=l*m-f*p,N=l*v-h*p,w=l*g-d*p,W=f*v-h*m,C=f*g-d*m,B=h*g-d*v,P=b*B-y*C+M*W+T*w-_*N+I*L;return P?(P=1/P,e[0]=(o*B-c*C+u*W)*P,e[1]=(n*C-a*B-i*W)*P,e[2]=(m*I-v*_+g*T)*P,e[3]=(h*_-f*I-d*T)*P,e[4]=(c*w-s*B-u*N)*P,e[5]=(t*B-n*w+i*N)*P,e[6]=(v*M-p*I-g*y)*P,e[7]=(l*I-h*M+d*y)*P,e[8]=(s*C-o*w+u*L)*P,e[9]=(a*w-t*C-i*L)*P,e[10]=(p*_-m*M+g*b)*P,e[11]=(f*M-l*_-d*b)*P,e[12]=(o*N-s*W-c*L)*P,e[13]=(t*W-a*N+n*L)*P,e[14]=(m*y-p*T-v*b)*P,e[15]=(l*T-f*y+h*b)*P,e):null}function Jl(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11],p=r[12],m=r[13],v=r[14],g=r[15];return e[0]=o*(h*g-d*v)-f*(c*g-u*v)+m*(c*d-u*h),e[1]=-(a*(h*g-d*v)-f*(n*g-i*v)+m*(n*d-i*h)),e[2]=a*(c*g-u*v)-o*(n*g-i*v)+m*(n*u-i*c),e[3]=-(a*(c*d-u*h)-o*(n*d-i*h)+f*(n*u-i*c)),e[4]=-(s*(h*g-d*v)-l*(c*g-u*v)+p*(c*d-u*h)),e[5]=t*(h*g-d*v)-l*(n*g-i*v)+p*(n*d-i*h),e[6]=-(t*(c*g-u*v)-s*(n*g-i*v)+p*(n*u-i*c)),e[7]=t*(c*d-u*h)-s*(n*d-i*h)+l*(n*u-i*c),e[8]=s*(f*g-d*m)-l*(o*g-u*m)+p*(o*d-u*f),e[9]=-(t*(f*g-d*m)-l*(a*g-i*m)+p*(a*d-i*f)),e[10]=t*(o*g-u*m)-s*(a*g-i*m)+p*(a*u-i*o),e[11]=-(t*(o*d-u*f)-s*(a*d-i*f)+l*(a*u-i*o)),e[12]=-(s*(f*v-h*m)-l*(o*v-c*m)+p*(o*h-c*f)),e[13]=t*(f*v-h*m)-l*(a*v-n*m)+p*(a*h-n*f),e[14]=-(t*(o*v-c*m)-s*(a*v-n*m)+p*(a*c-n*o)),e[15]=t*(o*h-c*f)-s*(a*h-n*f)+l*(a*c-n*o),e}function Hl(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],m=e[14],v=e[15],g=r*s-t*i,b=r*o-a*i,y=r*c-n*i,M=t*o-a*s,T=t*c-n*s,_=a*c-n*o,I=u*p-l*d,L=u*m-f*d,N=u*v-h*d,w=l*m-f*p,W=l*v-h*p,C=f*v-h*m;return g*C-b*W+y*w+M*N-T*L+_*I}function Xa(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=r[8],h=r[9],d=r[10],p=r[11],m=r[12],v=r[13],g=r[14],b=r[15],y=t[0],M=t[1],T=t[2],_=t[3];return e[0]=y*a+M*o+T*f+_*m,e[1]=y*n+M*c+T*h+_*v,e[2]=y*i+M*u+T*d+_*g,e[3]=y*s+M*l+T*p+_*b,y=t[4],M=t[5],T=t[6],_=t[7],e[4]=y*a+M*o+T*f+_*m,e[5]=y*n+M*c+T*h+_*v,e[6]=y*i+M*u+T*d+_*g,e[7]=y*s+M*l+T*p+_*b,y=t[8],M=t[9],T=t[10],_=t[11],e[8]=y*a+M*o+T*f+_*m,e[9]=y*n+M*c+T*h+_*v,e[10]=y*i+M*u+T*d+_*g,e[11]=y*s+M*l+T*p+_*b,y=t[12],M=t[13],T=t[14],_=t[15],e[12]=y*a+M*o+T*f+_*m,e[13]=y*n+M*c+T*h+_*v,e[14]=y*i+M*u+T*d+_*g,e[15]=y*s+M*l+T*p+_*b,e}function Kl(e,r,t){var a=t[0],n=t[1],i=t[2],s,o,c,u,l,f,h,d,p,m,v,g;return r===e?(e[12]=r[0]*a+r[4]*n+r[8]*i+r[12],e[13]=r[1]*a+r[5]*n+r[9]*i+r[13],e[14]=r[2]*a+r[6]*n+r[10]*i+r[14],e[15]=r[3]*a+r[7]*n+r[11]*i+r[15]):(s=r[0],o=r[1],c=r[2],u=r[3],l=r[4],f=r[5],h=r[6],d=r[7],p=r[8],m=r[9],v=r[10],g=r[11],e[0]=s,e[1]=o,e[2]=c,e[3]=u,e[4]=l,e[5]=f,e[6]=h,e[7]=d,e[8]=p,e[9]=m,e[10]=v,e[11]=g,e[12]=s*a+l*n+p*i+r[12],e[13]=o*a+f*n+m*i+r[13],e[14]=c*a+h*n+v*i+r[14],e[15]=u*a+d*n+g*i+r[15]),e}function ef(e,r,t){var a=t[0],n=t[1],i=t[2];return e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e[3]=r[3]*a,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=r[7]*n,e[8]=r[8]*i,e[9]=r[9]*i,e[10]=r[10]*i,e[11]=r[11]*i,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function rf(e,r,t,a){var n=a[0],i=a[1],s=a[2],o=Math.hypot(n,i,s),c,u,l,f,h,d,p,m,v,g,b,y,M,T,_,I,L,N,w,W,C,B,P,j;return o<F.EPSILON?null:(o=1/o,n*=o,i*=o,s*=o,c=Math.sin(t),u=Math.cos(t),l=1-u,f=r[0],h=r[1],d=r[2],p=r[3],m=r[4],v=r[5],g=r[6],b=r[7],y=r[8],M=r[9],T=r[10],_=r[11],I=n*n*l+u,L=i*n*l+s*c,N=s*n*l-i*c,w=n*i*l-s*c,W=i*i*l+u,C=s*i*l+n*c,B=n*s*l+i*c,P=i*s*l-n*c,j=s*s*l+u,e[0]=f*I+m*L+y*N,e[1]=h*I+v*L+M*N,e[2]=d*I+g*L+T*N,e[3]=p*I+b*L+_*N,e[4]=f*w+m*W+y*C,e[5]=h*w+v*W+M*C,e[6]=d*w+g*W+T*C,e[7]=p*w+b*W+_*C,e[8]=f*B+m*P+y*j,e[9]=h*B+v*P+M*j,e[10]=d*B+g*P+T*j,e[11]=p*B+b*P+_*j,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function tf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[4],s=r[5],o=r[6],c=r[7],u=r[8],l=r[9],f=r[10],h=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=i*n+u*a,e[5]=s*n+l*a,e[6]=o*n+f*a,e[7]=c*n+h*a,e[8]=u*n-i*a,e[9]=l*n-s*a,e[10]=f*n-o*a,e[11]=h*n-c*a,e}function nf(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[8],l=r[9],f=r[10],h=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n-u*a,e[1]=s*n-l*a,e[2]=o*n-f*a,e[3]=c*n-h*a,e[8]=i*a+u*n,e[9]=s*a+l*n,e[10]=o*a+f*n,e[11]=c*a+h*n,e}function af(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],s=r[1],o=r[2],c=r[3],u=r[4],l=r[5],f=r[6],h=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n+u*a,e[1]=s*n+l*a,e[2]=o*n+f*a,e[3]=c*n+h*a,e[4]=u*n-i*a,e[5]=l*n-s*a,e[6]=f*n-o*a,e[7]=h*n-c*a,e}function sf(e,r){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]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function of(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function cf(e,r,t){var a=t[0],n=t[1],i=t[2],s=Math.hypot(a,n,i),o,c,u;return s<F.EPSILON?null:(s=1/s,a*=s,n*=s,i*=s,o=Math.sin(r),c=Math.cos(r),u=1-c,e[0]=a*a*u+c,e[1]=n*a*u+i*o,e[2]=i*a*u-n*o,e[3]=0,e[4]=a*n*u-i*o,e[5]=n*n*u+c,e[6]=i*n*u+a*o,e[7]=0,e[8]=a*i*u+n*o,e[9]=n*i*u-a*o,e[10]=i*i*u+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function uf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=t,e[7]=0,e[8]=0,e[9]=-t,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function lf(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=0,e[2]=-t,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=t,e[9]=0,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ff(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=0,e[4]=-t,e[5]=a,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 Qa(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=a+a,c=n+n,u=i+i,l=a*o,f=a*c,h=a*u,d=n*c,p=n*u,m=i*u,v=s*o,g=s*c,b=s*u;return e[0]=1-(d+m),e[1]=f+b,e[2]=h-g,e[3]=0,e[4]=f-b,e[5]=1-(l+m),e[6]=p+v,e[7]=0,e[8]=h+g,e[9]=p-v,e[10]=1-(l+d),e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function hf(e,r){var t=new F.ARRAY_TYPE(3),a=-r[0],n=-r[1],i=-r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],f=a*a+n*n+i*i+s*s;return f>0?(t[0]=(o*s+l*a+c*i-u*n)*2/f,t[1]=(c*s+l*n+u*a-o*i)*2/f,t[2]=(u*s+l*i+o*n-c*a)*2/f):(t[0]=(o*s+l*a+c*i-u*n)*2,t[1]=(c*s+l*n+u*a-o*i)*2,t[2]=(u*s+l*i+o*n-c*a)*2),Qa(e,r,t),e}function df(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e}function $a(e,r){var t=r[0],a=r[1],n=r[2],i=r[4],s=r[5],o=r[6],c=r[8],u=r[9],l=r[10];return e[0]=Math.hypot(t,a,n),e[1]=Math.hypot(i,s,o),e[2]=Math.hypot(c,u,l),e}function pf(e,r){var t=new F.ARRAY_TYPE(3);$a(t,r);var a=1/t[0],n=1/t[1],i=1/t[2],s=r[0]*a,o=r[1]*n,c=r[2]*i,u=r[4]*a,l=r[5]*n,f=r[6]*i,h=r[8]*a,d=r[9]*n,p=r[10]*i,m=s+l+p,v=0;return m>0?(v=Math.sqrt(m+1)*2,e[3]=.25*v,e[0]=(f-d)/v,e[1]=(h-c)/v,e[2]=(o-u)/v):s>l&&s>p?(v=Math.sqrt(1+s-l-p)*2,e[3]=(f-d)/v,e[0]=.25*v,e[1]=(o+u)/v,e[2]=(h+c)/v):l>p?(v=Math.sqrt(1+l-s-p)*2,e[3]=(h-c)/v,e[0]=(o+u)/v,e[1]=.25*v,e[2]=(f+d)/v):(v=Math.sqrt(1+p-s-l)*2,e[3]=(o-u)/v,e[0]=(h+c)/v,e[1]=(f+d)/v,e[2]=.25*v),e}function vf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=n+n,u=i+i,l=s+s,f=n*c,h=n*u,d=n*l,p=i*u,m=i*l,v=s*l,g=o*c,b=o*u,y=o*l,M=a[0],T=a[1],_=a[2];return e[0]=(1-(p+v))*M,e[1]=(h+y)*M,e[2]=(d-b)*M,e[3]=0,e[4]=(h-y)*T,e[5]=(1-(f+v))*T,e[6]=(m+g)*T,e[7]=0,e[8]=(d+b)*_,e[9]=(m-g)*_,e[10]=(1-(f+p))*_,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function mf(e,r,t,a,n){var i=r[0],s=r[1],o=r[2],c=r[3],u=i+i,l=s+s,f=o+o,h=i*u,d=i*l,p=i*f,m=s*l,v=s*f,g=o*f,b=c*u,y=c*l,M=c*f,T=a[0],_=a[1],I=a[2],L=n[0],N=n[1],w=n[2],W=(1-(m+g))*T,C=(d+M)*T,B=(p-y)*T,P=(d-M)*_,j=(1-(h+g))*_,he=(v+b)*_,de=(p+y)*I,Ye=(v-b)*I,Ge=(1-(h+m))*I;return e[0]=W,e[1]=C,e[2]=B,e[3]=0,e[4]=P,e[5]=j,e[6]=he,e[7]=0,e[8]=de,e[9]=Ye,e[10]=Ge,e[11]=0,e[12]=t[0]+L-(W*L+P*N+de*w),e[13]=t[1]+N-(C*L+j*N+Ye*w),e[14]=t[2]+w-(B*L+he*N+Ge*w),e[15]=1,e}function gf(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t+t,o=a+a,c=n+n,u=t*s,l=a*s,f=a*o,h=n*s,d=n*o,p=n*c,m=i*s,v=i*o,g=i*c;return e[0]=1-f-p,e[1]=l+g,e[2]=h-v,e[3]=0,e[4]=l-g,e[5]=1-u-p,e[6]=d+m,e[7]=0,e[8]=h+v,e[9]=d-m,e[10]=1-u-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function yf(e,r,t,a,n,i,s){var o=1/(t-r),c=1/(n-a),u=1/(i-s);return e[0]=i*2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*o,e[9]=(n+a)*c,e[10]=(s+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*u,e[15]=0,e}function Ja(e,r,t,a,n){var i=1/Math.tan(r/2),s;return e[0]=i/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0?(s=1/(a-n),e[10]=(n+a)*s,e[14]=2*n*a*s):(e[10]=-1,e[14]=-2*a),e}var Mf=Ja;k.perspective=Mf;function xf(e,r,t,a,n){var i=1/Math.tan(r/2),s;return e[0]=i/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0?(s=1/(a-n),e[10]=n*s,e[14]=n*a*s):(e[10]=-1,e[14]=-a),e}function bf(e,r,t,a){var n=Math.tan(r.upDegrees*Math.PI/180),i=Math.tan(r.downDegrees*Math.PI/180),s=Math.tan(r.leftDegrees*Math.PI/180),o=Math.tan(r.rightDegrees*Math.PI/180),c=2/(s+o),u=2/(n+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((s-o)*c*.5),e[9]=(n-i)*u*.5,e[10]=a/(t-a),e[11]=-1,e[12]=0,e[13]=0,e[14]=a*t/(t-a),e[15]=0,e}function Ha(e,r,t,a,n,i,s){var o=1/(r-t),c=1/(a-n),u=1/(i-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*o,e[13]=(n+a)*c,e[14]=(s+i)*u,e[15]=1,e}var _f=Ha;k.ortho=_f;function Of(e,r,t,a,n,i,s){var o=1/(r-t),c=1/(a-n),u=1/(i-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(r+t)*o,e[13]=(n+a)*c,e[14]=i*u,e[15]=1,e}function Tf(e,r,t,a){var n,i,s,o,c,u,l,f,h,d,p=r[0],m=r[1],v=r[2],g=a[0],b=a[1],y=a[2],M=t[0],T=t[1],_=t[2];return Math.abs(p-M)<F.EPSILON&&Math.abs(m-T)<F.EPSILON&&Math.abs(v-_)<F.EPSILON?Za(e):(l=p-M,f=m-T,h=v-_,d=1/Math.hypot(l,f,h),l*=d,f*=d,h*=d,n=b*h-y*f,i=y*l-g*h,s=g*f-b*l,d=Math.hypot(n,i,s),d?(d=1/d,n*=d,i*=d,s*=d):(n=0,i=0,s=0),o=f*s-h*i,c=h*n-l*s,u=l*i-f*n,d=Math.hypot(o,c,u),d?(d=1/d,o*=d,c*=d,u*=d):(o=0,c=0,u=0),e[0]=n,e[1]=o,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=h,e[11]=0,e[12]=-(n*p+i*m+s*v),e[13]=-(o*p+c*m+u*v),e[14]=-(l*p+f*m+h*v),e[15]=1,e)}function kf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=a[0],c=a[1],u=a[2],l=n-t[0],f=i-t[1],h=s-t[2],d=l*l+f*f+h*h;d>0&&(d=1/Math.sqrt(d),l*=d,f*=d,h*=d);var p=c*h-u*f,m=u*l-o*h,v=o*f-c*l;return d=p*p+m*m+v*v,d>0&&(d=1/Math.sqrt(d),p*=d,m*=d,v*=d),e[0]=p,e[1]=m,e[2]=v,e[3]=0,e[4]=f*v-h*m,e[5]=h*p-l*v,e[6]=l*m-f*p,e[7]=0,e[8]=l,e[9]=f,e[10]=h,e[11]=0,e[12]=n,e[13]=i,e[14]=s,e[15]=1,e}function Rf(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Af(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Pf(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e[4]=r[4]+t[4],e[5]=r[5]+t[5],e[6]=r[6]+t[6],e[7]=r[7]+t[7],e[8]=r[8]+t[8],e[9]=r[9]+t[9],e[10]=r[10]+t[10],e[11]=r[11]+t[11],e[12]=r[12]+t[12],e[13]=r[13]+t[13],e[14]=r[14]+t[14],e[15]=r[15]+t[15],e}function Ka(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e[4]=r[4]-t[4],e[5]=r[5]-t[5],e[6]=r[6]-t[6],e[7]=r[7]-t[7],e[8]=r[8]-t[8],e[9]=r[9]-t[9],e[10]=r[10]-t[10],e[11]=r[11]-t[11],e[12]=r[12]-t[12],e[13]=r[13]-t[13],e[14]=r[14]-t[14],e[15]=r[15]-t[15],e}function Sf(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*t,e[9]=r[9]*t,e[10]=r[10]*t,e[11]=r[11]*t,e[12]=r[12]*t,e[13]=r[13]*t,e[14]=r[14]*t,e[15]=r[15]*t,e}function wf(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e[4]=r[4]+t[4]*a,e[5]=r[5]+t[5]*a,e[6]=r[6]+t[6]*a,e[7]=r[7]+t[7]*a,e[8]=r[8]+t[8]*a,e[9]=r[9]+t[9]*a,e[10]=r[10]+t[10]*a,e[11]=r[11]+t[11]*a,e[12]=r[12]+t[12]*a,e[13]=r[13]+t[13]*a,e[14]=r[14]+t[14]*a,e[15]=r[15]+t[15]*a,e}function qf(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}function Ef(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],b=r[0],y=r[1],M=r[2],T=r[3],_=r[4],I=r[5],L=r[6],N=r[7],w=r[8],W=r[9],C=r[10],B=r[11],P=r[12],j=r[13],he=r[14],de=r[15];return Math.abs(t-b)<=F.EPSILON*Math.max(1,Math.abs(t),Math.abs(b))&&Math.abs(a-y)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(n-M)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(M))&&Math.abs(i-T)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(s-_)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-I)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(c-L)<=F.EPSILON*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(u-N)<=F.EPSILON*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(l-w)<=F.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))&&Math.abs(f-W)<=F.EPSILON*Math.max(1,Math.abs(f),Math.abs(W))&&Math.abs(h-C)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(d-B)<=F.EPSILON*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(p-P)<=F.EPSILON*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(m-j)<=F.EPSILON*Math.max(1,Math.abs(m),Math.abs(j))&&Math.abs(v-he)<=F.EPSILON*Math.max(1,Math.abs(v),Math.abs(he))&&Math.abs(g-de)<=F.EPSILON*Math.max(1,Math.abs(g),Math.abs(de))}var Lf=Xa;k.mul=Lf;var Nf=Ka;k.sub=Nf});var vt=S(A=>{"use strict";function pt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pt=function(t){return typeof t}:pt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(e)}Object.defineProperty(A,"__esModule",{value:!0});A.create=ti;A.clone=If;A.fromValues=Wf;A.copy=Bf;A.set=Ff;A.add=Df;A.subtract=ni;A.multiply=ai;A.divide=ii;A.ceil=zf;A.floor=Yf;A.min=Gf;A.max=Uf;A.round=Vf;A.scale=jf;A.scaleAndAdd=Zf;A.distance=si;A.squaredDistance=oi;A.length=ci;A.squaredLength=ui;A.negate=Xf;A.inverse=Qf;A.normalize=$f;A.dot=Jf;A.cross=Hf;A.lerp=Kf;A.random=eh;A.transformMat4=rh;A.transformQuat=th;A.zero=nh;A.str=ah;A.exactEquals=ih;A.equals=sh;A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var ae=Cf(Xe());function ri(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ri=function(n){return n?t:r})(e)}function Cf(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||pt(e)!=="object"&&typeof e!="function")return{default:e};var t=ri(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function ti(){var e=new ae.ARRAY_TYPE(4);return ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function If(e){var r=new ae.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function Wf(e,r,t,a){var n=new ae.ARRAY_TYPE(4);return n[0]=e,n[1]=r,n[2]=t,n[3]=a,n}function Bf(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function Ff(e,r,t,a,n){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e}function Df(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e}function ni(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e[3]=r[3]-t[3],e}function ai(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e[3]=r[3]*t[3],e}function ii(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e[3]=r[3]/t[3],e}function zf(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e[3]=Math.ceil(r[3]),e}function Yf(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e[3]=Math.floor(r[3]),e}function Gf(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e[3]=Math.min(r[3],t[3]),e}function Uf(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e[3]=Math.max(r[3],t[3]),e}function Vf(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e[3]=Math.round(r[3]),e}function jf(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function Zf(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e[2]=r[2]+t[2]*a,e[3]=r[3]+t[3]*a,e}function si(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return Math.hypot(t,a,n,i)}function oi(e,r){var t=r[0]-e[0],a=r[1]-e[1],n=r[2]-e[2],i=r[3]-e[3];return t*t+a*a+n*n+i*i}function ci(e){var r=e[0],t=e[1],a=e[2],n=e[3];return Math.hypot(r,t,a,n)}function ui(e){var r=e[0],t=e[1],a=e[2],n=e[3];return r*r+t*t+a*a+n*n}function Xf(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=-r[3],e}function Qf(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e[3]=1/r[3],e}function $f(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),e[0]=t*s,e[1]=a*s,e[2]=n*s,e[3]=i*s,e}function Jf(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function Hf(e,r,t,a){var n=t[0]*a[1]-t[1]*a[0],i=t[0]*a[2]-t[2]*a[0],s=t[0]*a[3]-t[3]*a[0],o=t[1]*a[2]-t[2]*a[1],c=t[1]*a[3]-t[3]*a[1],u=t[2]*a[3]-t[3]*a[2],l=r[0],f=r[1],h=r[2],d=r[3];return e[0]=f*u-h*c+d*o,e[1]=-(l*u)+h*s-d*i,e[2]=l*c-f*s+d*n,e[3]=-(l*o)+f*i-h*n,e}function Kf(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3];return e[0]=n+a*(t[0]-n),e[1]=i+a*(t[1]-i),e[2]=s+a*(t[2]-s),e[3]=o+a*(t[3]-o),e}function eh(e,r){r=r||1;var t,a,n,i,s,o;do t=ae.RANDOM()*2-1,a=ae.RANDOM()*2-1,s=t*t+a*a;while(s>=1);do n=ae.RANDOM()*2-1,i=ae.RANDOM()*2-1,o=n*n+i*i;while(o>=1);var c=Math.sqrt((1-s)/o);return e[0]=r*t,e[1]=r*a,e[2]=r*n*c,e[3]=r*i*c,e}function rh(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3];return e[0]=t[0]*a+t[4]*n+t[8]*i+t[12]*s,e[1]=t[1]*a+t[5]*n+t[9]*i+t[13]*s,e[2]=t[2]*a+t[6]*n+t[10]*i+t[14]*s,e[3]=t[3]*a+t[7]*n+t[11]*i+t[15]*s,e}function th(e,r,t){var a=r[0],n=r[1],i=r[2],s=t[0],o=t[1],c=t[2],u=t[3],l=u*a+o*i-c*n,f=u*n+c*a-s*i,h=u*i+s*n-o*a,d=-s*a-o*n-c*i;return e[0]=l*u+d*-s+f*-c-h*-o,e[1]=f*u+d*-o+h*-s-l*-c,e[2]=h*u+d*-c+l*-o-f*-s,e[3]=r[3],e}function nh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function ah(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function ih(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function sh(e,r){var t=e[0],a=e[1],n=e[2],i=e[3],s=r[0],o=r[1],c=r[2],u=r[3];return Math.abs(t-s)<=ae.EPSILON*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(a-o)<=ae.EPSILON*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(n-c)<=ae.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=ae.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var oh=ni;A.sub=oh;var ch=ai;A.mul=ch;var uh=ii;A.div=uh;var lh=si;A.dist=lh;var fh=oi;A.sqrDist=fh;var hh=ci;A.len=hh;var dh=ui;A.sqrLen=dh;var ph=function(){var e=ti();return function(r,t,a,n,i,s){var o,c;for(t||(t=4),a||(a=0),n?c=Math.min(n*t+a,r.length):c=r.length,o=a;o<c;o+=t)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],e[3]=r[o+3],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2],r[o+3]=e[3];return r}}();A.forEach=ph});var ln=S(Mt=>{"use strict";var lr=V(),vh=se();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.default=void 0;var mh=lr($()),gh=lr(J()),yh=lr(oe()),Mh=lr(ce()),li=lr(ue()),xh=lr(Kt()),an=me(),fi=ar(),Z=mt(ei()),bh=mt(Hr()),_h=mt(Le()),Oh=mt(vt());function hi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(hi=function(n){return n?t:r})(e)}function mt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||vh(e)!=="object"&&typeof e!="function")return{default:e};var t=hi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function Th(e){var r=kh();return function(){var a=(0,li.default)(e),n;if(r){var i=(0,li.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Mh.default)(this,n)}}function kh(){if(typeof Reflect=="undefined"||!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}}var sn;(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"})(sn||(sn={}));var Rh=45*Math.PI/180,Ah=1,on=.1,cn=500,Ph=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),un=function(e){(0,yh.default)(t,e);var r=Th(t);function t(a){var n;return(0,mh.default)(this,t),n=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?n.copy(a):n.identity(),n}return(0,gh.default)(t,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return sn}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this[4]=n[4],this[5]=n[5],this[6]=n[6],this[7]=n[7],this[8]=n[8],this[9]=n[9],this[10]=n[10],this[11]=n[11],this[12]=n[12],this[13]=n[13],this[14]=n[14],this[15]=n[15],this.check()}},{key:"set",value:function(n,i,s,o,c,u,l,f,h,d,p,m,v,g,b,y){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=f,this[8]=h,this[9]=d,this[10]=p,this[11]=m,this[12]=v,this[13]=g,this[14]=b,this[15]=y,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,f,h,d,p,m,v,g,b,y){return this[0]=n,this[1]=c,this[2]=h,this[3]=v,this[4]=i,this[5]=u,this[6]=d,this[7]=g,this[8]=s,this[9]=l,this[10]=p,this[11]=b,this[12]=o,this[13]=f,this[14]=m,this[15]=y,this.check()}},{key:"toRowMajor",value:function(n){return n[0]=this[0],n[1]=this[4],n[2]=this[8],n[3]=this[12],n[4]=this[1],n[5]=this[5],n[6]=this[9],n[7]=this[13],n[8]=this[2],n[9]=this[6],n[10]=this[10],n[11]=this[14],n[12]=this[3],n[13]=this[7],n[14]=this[11],n[15]=this[15],n}},{key:"identity",value:function(){return this.copy(Ph)}},{key:"fromObject",value:function(n){return this.check()}},{key:"fromQuaternion",value:function(n){return Z.fromQuat(this,n),this.check()}},{key:"frustum",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=u===void 0?on:u,f=n.far,h=f===void 0?cn:f;return h===1/0?qh(this,i,s,o,c,l):Z.frustum(this,i,s,o,c,l,h),this.check()}},{key:"lookAt",value:function(n){var i=n.eye,s=n.center,o=s===void 0?[0,0,0]:s,c=n.up,u=c===void 0?[0,1,0]:c;return Z.lookAt(this,i,o,u),this.check()}},{key:"ortho",value:function(n){var i=n.left,s=n.right,o=n.bottom,c=n.top,u=n.near,l=u===void 0?on:u,f=n.far,h=f===void 0?cn:f;return Z.ortho(this,i,s,o,c,l,h),this.check()}},{key:"orthographic",value:function(n){var i=n.fovy,s=i===void 0?Rh:i,o=n.aspect,c=o===void 0?Ah:o,u=n.focalDistance,l=u===void 0?1:u,f=n.near,h=f===void 0?on:f,d=n.far,p=d===void 0?cn:d;di(s);var m=s/2,v=l*Math.tan(m),g=v*c;return this.ortho({left:-g,right:g,bottom:-v,top:v,near:h,far:p})}},{key:"perspective",value:function(n){var i=n.fovy,s=i===void 0?45*Math.PI/180:i,o=n.aspect,c=o===void 0?1:o,u=n.near,l=u===void 0?.1:u,f=n.far,h=f===void 0?500:f;return di(s),Z.perspective(this,s,c,l,h),this.check()}},{key:"determinant",value:function(){return Z.determinant(this)}},{key:"getScale",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),n[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),n[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),n}},{key:"getTranslation",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[12],n[1]=this[13],n[2]=this[14],n}},{key:"getRotation",value:function(n,i){n=n||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=i||[-0,-0,-0];var s=this.getScale(i),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=0,n[4]=this[4]*o,n[5]=this[5]*c,n[6]=this[6]*u,n[7]=0,n[8]=this[8]*o,n[9]=this[9]*c,n[10]=this[10]*u,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}},{key:"getRotationMatrix3",value:function(n,i){n=n||[-0,-0,-0,-0,-0,-0,-0,-0,-0],i=i||[-0,-0,-0];var s=this.getScale(i),o=1/s[0],c=1/s[1],u=1/s[2];return n[0]=this[0]*o,n[1]=this[1]*c,n[2]=this[2]*u,n[3]=this[4]*o,n[4]=this[5]*c,n[5]=this[6]*u,n[6]=this[8]*o,n[7]=this[9]*c,n[8]=this[10]*u,n}},{key:"transpose",value:function(){return Z.transpose(this,this),this.check()}},{key:"invert",value:function(){return Z.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return Z.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return Z.multiply(this,this,n),this.check()}},{key:"rotateX",value:function(n){return Z.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return Z.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return Z.rotateZ(this,this,n),this.check()}},{key:"rotateXYZ",value:function(n){return this.rotateX(n[0]).rotateY(n[1]).rotateZ(n[2])}},{key:"rotateAxis",value:function(n,i){return Z.rotate(this,this,n,i),this.check()}},{key:"scale",value:function(n){return Z.scale(this,this,Array.isArray(n)?n:[n,n,n]),this.check()}},{key:"translate",value:function(n){return Z.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){return n.length===4?(i=Oh.transformMat4(i||[-0,-0,-0,-0],n,this),(0,an.checkVector)(i,4),i):this.transformAsPoint(n,i)}},{key:"transformAsPoint",value:function(n,i){var s=n.length,o;switch(s){case 2:o=bh.transformMat4(i||[-0,-0],n,this);break;case 3:o=_h.transformMat4(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,an.checkVector)(o,n.length),o}},{key:"transformAsVector",value:function(n,i){var s;switch(n.length){case 2:s=(0,fi.vec2_transformMat4AsVector)(i||[-0,-0],n,this);break;case 3:s=(0,fi.vec3_transformMat4AsVector)(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,an.checkVector)(s,n.length),s}},{key:"transformPoint",value:function(n,i){return this.transformAsPoint(n,i)}},{key:"transformVector",value:function(n,i){return this.transformAsPoint(n,i)}},{key:"transformDirection",value:function(n,i){return this.transformAsVector(n,i)}},{key:"makeRotationX",value:function(n){return this.identity().rotateX(n)}},{key:"makeTranslation",value:function(n,i,s){return this.identity().translate([n,i,s])}}],[{key:"IDENTITY",get:function(){return wh()}},{key:"ZERO",get:function(){return Sh()}}]),t}(xh.default);Mt.default=un;var gt,yt;function Sh(){return gt||(gt=new un([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(gt)),gt}function wh(){return yt||(yt=new un,Object.freeze(yt)),yt}function di(e){if(e>Math.PI*2)throw Error("expected radians")}function qh(e,r,t,a,n,i){var s=2*i/(t-r),o=2*i/(n-a),c=(t+r)/(t-r),u=(n+a)/(n-a),l=-1,f=-1,h=-2*i;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=c,e[9]=u,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}});var Ti=S(x=>{"use strict";function xt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xt=function(t){return typeof t}:xt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(e)}Object.defineProperty(x,"__esModule",{value:!0});x.create=fn;x.identity=Lh;x.setAxisAngle=vi;x.getAxisAngle=Nh;x.getAngle=Ch;x.multiply=mi;x.rotateX=Ih;x.rotateY=Wh;x.rotateZ=Bh;x.calculateW=Fh;x.exp=gi;x.ln=yi;x.pow=Dh;x.slerp=_t;x.random=zh;x.invert=Yh;x.conjugate=Gh;x.fromMat3=Mi;x.fromEuler=Uh;x.str=Vh;x.setAxes=x.sqlerp=x.rotationTo=x.equals=x.exactEquals=x.normalize=x.sqrLen=x.squaredLength=x.len=x.length=x.lerp=x.dot=x.scale=x.mul=x.add=x.set=x.copy=x.fromValues=x.clone=void 0;var He=bt(Xe()),Eh=bt(en()),Pe=bt(Le()),re=bt(vt());function pi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(pi=function(n){return n?t:r})(e)}function bt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||xt(e)!=="object"&&typeof e!="function")return{default:e};var t=pi(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function fn(){var e=new He.ARRAY_TYPE(4);return He.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Lh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function vi(e,r,t){t=t*.5;var a=Math.sin(t);return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=Math.cos(t),e}function Nh(e,r){var t=Math.acos(r[3])*2,a=Math.sin(t/2);return a>He.EPSILON?(e[0]=r[0]/a,e[1]=r[1]/a,e[2]=r[2]/a):(e[0]=1,e[1]=0,e[2]=0),t}function Ch(e,r){var t=bi(e,r);return Math.acos(2*t*t-1)}function mi(e,r,t){var a=r[0],n=r[1],i=r[2],s=r[3],o=t[0],c=t[1],u=t[2],l=t[3];return e[0]=a*l+s*o+n*u-i*c,e[1]=n*l+s*c+i*o-a*u,e[2]=i*l+s*u+a*c-n*o,e[3]=s*l-a*o-n*c-i*u,e}function Ih(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+s*o,e[1]=n*c+i*o,e[2]=i*c-n*o,e[3]=s*c-a*o,e}function Wh(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c-i*o,e[1]=n*c+s*o,e[2]=i*c+a*o,e[3]=s*c-n*o,e}function Bh(e,r,t){t*=.5;var a=r[0],n=r[1],i=r[2],s=r[3],o=Math.sin(t),c=Math.cos(t);return e[0]=a*c+n*o,e[1]=n*c-a*o,e[2]=i*c+s*o,e[3]=s*c-i*o,e}function Fh(e,r){var t=r[0],a=r[1],n=r[2];return e[0]=t,e[1]=a,e[2]=n,e[3]=Math.sqrt(Math.abs(1-t*t-a*a-n*n)),e}function gi(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=Math.exp(i),c=s>0?o*Math.sin(s)/s:0;return e[0]=t*c,e[1]=a*c,e[2]=n*c,e[3]=o*Math.cos(s),e}function yi(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=Math.sqrt(t*t+a*a+n*n),o=s>0?Math.atan2(s,i)/s:0;return e[0]=t*o,e[1]=a*o,e[2]=n*o,e[3]=.5*Math.log(t*t+a*a+n*n+i*i),e}function Dh(e,r,t){return yi(e,r),xi(e,e,t),gi(e,e),e}function _t(e,r,t,a){var n=r[0],i=r[1],s=r[2],o=r[3],c=t[0],u=t[1],l=t[2],f=t[3],h,d,p,m,v;return d=n*c+i*u+s*l+o*f,d<0&&(d=-d,c=-c,u=-u,l=-l,f=-f),1-d>He.EPSILON?(h=Math.acos(d),p=Math.sin(h),m=Math.sin((1-a)*h)/p,v=Math.sin(a*h)/p):(m=1-a,v=a),e[0]=m*n+v*c,e[1]=m*i+v*u,e[2]=m*s+v*l,e[3]=m*o+v*f,e}function zh(e){var r=He.RANDOM(),t=He.RANDOM(),a=He.RANDOM(),n=Math.sqrt(1-r),i=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*t),e[1]=n*Math.cos(2*Math.PI*t),e[2]=i*Math.sin(2*Math.PI*a),e[3]=i*Math.cos(2*Math.PI*a),e}function Yh(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],s=t*t+a*a+n*n+i*i,o=s?1/s:0;return e[0]=-t*o,e[1]=-a*o,e[2]=-n*o,e[3]=i*o,e}function Gh(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function Mi(e,r){var t=r[0]+r[4]+r[8],a;if(t>0)a=Math.sqrt(t+1),e[3]=.5*a,a=.5/a,e[0]=(r[5]-r[7])*a,e[1]=(r[6]-r[2])*a,e[2]=(r[1]-r[3])*a;else{var n=0;r[4]>r[0]&&(n=1),r[8]>r[n*3+n]&&(n=2);var i=(n+1)%3,s=(n+2)%3;a=Math.sqrt(r[n*3+n]-r[i*3+i]-r[s*3+s]+1),e[n]=.5*a,a=.5/a,e[3]=(r[i*3+s]-r[s*3+i])*a,e[i]=(r[i*3+n]+r[n*3+i])*a,e[s]=(r[s*3+n]+r[n*3+s])*a}return e}function Uh(e,r,t,a){var n=.5*Math.PI/180;r*=n,t*=n,a*=n;var i=Math.sin(r),s=Math.cos(r),o=Math.sin(t),c=Math.cos(t),u=Math.sin(a),l=Math.cos(a);return e[0]=i*c*l-s*o*u,e[1]=s*o*l+i*c*u,e[2]=s*c*u-i*o*l,e[3]=s*c*l+i*o*u,e}function Vh(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var jh=re.clone;x.clone=jh;var Zh=re.fromValues;x.fromValues=Zh;var Xh=re.copy;x.copy=Xh;var Qh=re.set;x.set=Qh;var $h=re.add;x.add=$h;var Jh=mi;x.mul=Jh;var xi=re.scale;x.scale=xi;var bi=re.dot;x.dot=bi;var Hh=re.lerp;x.lerp=Hh;var _i=re.length;x.length=_i;var Kh=_i;x.len=Kh;var Oi=re.squaredLength;x.squaredLength=Oi;var e0=Oi;x.sqrLen=e0;var hn=re.normalize;x.normalize=hn;var r0=re.exactEquals;x.exactEquals=r0;var t0=re.equals;x.equals=t0;var n0=function(){var e=Pe.create(),r=Pe.fromValues(1,0,0),t=Pe.fromValues(0,1,0);return function(a,n,i){var s=Pe.dot(n,i);return s<-.999999?(Pe.cross(e,r,n),Pe.len(e)<1e-6&&Pe.cross(e,t,n),Pe.normalize(e,e),vi(a,e,Math.PI),a):s>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(Pe.cross(e,n,i),a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=1+s,hn(a,a))}}();x.rotationTo=n0;var a0=function(){var e=fn(),r=fn();return function(t,a,n,i,s,o){return _t(e,a,s,o),_t(r,n,i,o),_t(t,e,r,2*o*(1-o)),t}}();x.sqlerp=a0;var i0=function(){var e=Eh.create();return function(r,t,a,n){return e[0]=a[0],e[3]=a[1],e[6]=a[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],hn(r,Mi(r,e))}}();x.setAxes=i0});var dn=S(Ot=>{"use strict";var Ke=V(),s0=se();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.default=void 0;var o0=Ke($()),c0=Ke(J()),u0=Ke(oe()),l0=Ke(ce()),ki=Ke(ue()),f0=Ke(qr()),Lr=me(),h0=Ke(Ht()),G=Ai(Ti()),d0=Ai(vt());function Ri(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ri=function(n){return n?t:r})(e)}function Ai(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||s0(e)!=="object"&&typeof e!="function")return{default:e};var t=Ri(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}function p0(e){var r=v0();return function(){var a=(0,ki.default)(e),n;if(r){var i=(0,ki.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,l0.default)(this,n)}}function v0(){if(typeof Reflect=="undefined"||!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}}var m0=[0,0,0,1],g0=function(e){(0,u0.default)(t,e);var r=p0(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return(0,o0.default)(this,t),a=r.call(this,-0,-0,-0,-0),Array.isArray(n)&&arguments.length===1?a.copy(n):a.set(n,i,s,o),a}return(0,c0.default)(t,[{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=n[3],this.check()}},{key:"set",value:function(n,i,s,o){return this[0]=n,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"fromObject",value:function(n){return this[0]=n.x,this[1]=n.y,this[2]=n.z,this[3]=n.w,this.check()}},{key:"fromMatrix3",value:function(n){return G.fromMat3(this,n),this.check()}},{key:"fromAxisRotation",value:function(n,i){return G.setAxisAngle(this,n,i),this.check()}},{key:"identity",value:function(){return G.identity(this),this.check()}},{key:"setAxisAngle",value:function(n,i){return this.fromAxisRotation(n,i)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,Lr.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,Lr.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,Lr.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,Lr.checkNumber)(n)}},{key:"len",value:function(){return G.length(this)}},{key:"lengthSquared",value:function(){return G.squaredLength(this)}},{key:"dot",value:function(n){return G.dot(this,n)}},{key:"rotationTo",value:function(n,i){return G.rotationTo(this,n,i),this.check()}},{key:"add",value:function(n){return G.add(this,this,n),this.check()}},{key:"calculateW",value:function(){return G.calculateW(this,this),this.check()}},{key:"conjugate",value:function(){return G.conjugate(this,this),this.check()}},{key:"invert",value:function(){return G.invert(this,this),this.check()}},{key:"lerp",value:function(n,i,s){return s===void 0?this.lerp(this,n,i):(G.lerp(this,n,i,s),this.check())}},{key:"multiplyRight",value:function(n){return G.multiply(this,this,n),this.check()}},{key:"multiplyLeft",value:function(n){return G.multiply(this,n,this),this.check()}},{key:"normalize",value:function(){var n=this.len(),i=n>0?1/n:0;return this[0]=this[0]*i,this[1]=this[1]*i,this[2]=this[2]*i,this[3]=this[3]*i,n===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(n){return G.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return G.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return G.rotateZ(this,this,n),this.check()}},{key:"scale",value:function(n){return G.scale(this,this,n),this.check()}},{key:"slerp",value:function(n,i,s){var o,c,u;switch(arguments.length){case 1:var l=n,f=l.start;o=f===void 0?m0:f,c=l.target,u=l.ratio;break;case 2:o=this,c=n,u=i;break;default:o=n,c=i,u=s}return G.slerp(this,o,c,u),this.check()}},{key:"transformVector4",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new h0.default;return d0.transformQuat(i,n,this),(0,Lr.checkVector)(i,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(n,i){return this.setAxisAngle(n,i)}},{key:"premultiply",value:function(n){return this.multiplyLeft(n)}},{key:"multiply",value:function(n){return this.multiplyRight(n)}}]),t}(f0.default);Ot.default=g0});var Pi=S((sp,Nr)=>{function y0(e){if(Array.isArray(e))return e}Nr.exports=y0,Nr.exports.__esModule=!0,Nr.exports.default=Nr.exports});var Si=S((op,Cr)=>{function M0(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a=[],n=!0,i=!1,s,o;try{for(t=t.call(e);!(n=(s=t.next()).done)&&(a.push(s.value),!(r&&a.length===r));n=!0);}catch(c){i=!0,o=c}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw o}}return a}}Cr.exports=M0,Cr.exports.__esModule=!0,Cr.exports.default=Cr.exports});var wi=S((cp,Ir)=>{function x0(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}Ir.exports=x0,Ir.exports.__esModule=!0,Ir.exports.default=Ir.exports});var Ei=S((up,Wr)=>{var qi=wi();function b0(e,r){if(!!e){if(typeof e=="string")return qi(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qi(e,r)}}Wr.exports=b0,Wr.exports.__esModule=!0,Wr.exports.default=Wr.exports});var Li=S((lp,Br)=>{function _0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Br.exports=_0,Br.exports.__esModule=!0,Br.exports.default=Br.exports});var Tt=S((fp,Fr)=>{var O0=Pi(),T0=Si(),k0=Ei(),R0=Li();function A0(e,r){return O0(e)||T0(e,r)||k0(e,r)||R0()}Fr.exports=A0,Fr.exports.__esModule=!0,Fr.exports.default=Fr.exports});var kt=S((hp,Dr)=>{function P0(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}Dr.exports=P0,Dr.exports.__esModule=!0,Dr.exports.default=Dr.exports});var Ii=S(At=>{"use strict";var zr=V(),S0=se();Object.defineProperty(At,"__esModule",{value:!0});At.default=void 0;var w0=zr(Tt()),q0=zr($()),E0=zr(J()),Rt=zr(kt()),L0=zr(it()),X=ve(),N0=C0(Le());function Ni(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ni=function(n){return n?t:r})(e)}function C0(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||S0(e)!=="object"&&typeof e!="function")return{default:e};var t=Ni(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var Ci=1e-6,I0=6371e3,W0=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.phi,a=t===void 0?0:t,n=r.theta,i=n===void 0?0:n,s=r.radius,o=s===void 0?1:s,c=r.bearing,u=r.pitch,l=r.altitude,f=r.radiusScale,h=f===void 0?I0:f;(0,q0.default)(this,e),(0,Rt.default)(this,"phi",void 0),(0,Rt.default)(this,"theta",void 0),(0,Rt.default)(this,"radius",void 0),(0,Rt.default)(this,"radiusScale",void 0),this.phi=a,this.theta=i,this.radius=o||l||1,this.radiusScale=h||1,c!==void 0&&(this.bearing=c),u!==void 0&&(this.pitch=u),this.check()}return(0,E0.default)(e,[{key:"toString",value:function(){return this.formatString(X.config)}},{key:"formatString",value:function(t){var a=t.printTypes,n=a===void 0?!1:a,i=X.formatValue;return"".concat(n?"Spherical":"","[rho:").concat(i(this.radius),",theta:").concat(i(this.theta),",phi:").concat(i(this.phi),"]")}},{key:"equals",value:function(t){return(0,X.equals)(this.radius,t.radius)&&(0,X.equals)(this.theta,t.theta)&&(0,X.equals)(this.phi,t.phi)}},{key:"exactEquals",value:function(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}},{key:"bearing",get:function(){return 180-(0,X.degrees)(this.phi)},set:function(t){this.phi=Math.PI-(0,X.radians)(t)}},{key:"pitch",get:function(){return(0,X.degrees)(this.theta)},set:function(t){this.theta=(0,X.radians)(t)}},{key:"longitude",get:function(){return(0,X.degrees)(this.phi)}},{key:"latitude",get:function(){return(0,X.degrees)(this.theta)}},{key:"lng",get:function(){return(0,X.degrees)(this.phi)}},{key:"lat",get:function(){return(0,X.degrees)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}},{key:"set",value:function(t,a,n){return this.radius=t,this.phi=a,this.theta=n,this.check()}},{key:"clone",value:function(){return new e().copy(this)}},{key:"copy",value:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}},{key:"fromLngLatZ",value:function(t){var a=(0,w0.default)(t,3),n=a[0],i=a[1],s=a[2];return this.radius=1+s/this.radiusScale,this.phi=(0,X.radians)(i),this.theta=(0,X.radians)(n),this.check()}},{key:"fromVector3",value:function(t){return this.radius=N0.length(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos((0,X.clamp)(t[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new L0.default(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(Ci,Math.min(Math.PI-Ci,this.phi)),this}},{key:"check",value:function(){if(!Number.isFinite(this.phi)||!Number.isFinite(this.theta)||!(this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}]),e}();At.default=W0});var pn=S(St=>{"use strict";var Ce=V();Object.defineProperty(St,"__esModule",{value:!0});St.default=void 0;var B0=Ce(Tt()),F0=Ce($()),D0=Ce(J()),z0=Ce(oe()),Y0=Ce(ce()),Wi=Ce(ue()),G0=Ce(qr()),Bi=Ce(dn()),fr=ve(),ie=me();function U0(e){var r=V0();return function(){var a=(0,Wi.default)(e),n;if(r){var i=(0,Wi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Y0.default)(this,n)}}function V0(){if(typeof Reflect=="undefined"||!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}}var Pt="Unknown Euler angle order",hr=.99999,U;(function(e){e[e.ZYX=0]="ZYX",e[e.YXZ=1]="YXZ",e[e.XZY=2]="XZY",e[e.ZXY=3]="ZXY",e[e.YZX=4]="YZX",e[e.XYZ=5]="XYZ"})(U||(U={}));var j0=function(e){(0,z0.default)(t,e);var r=U0(t);function t(){var a,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t.DefaultOrder;if((0,F0.default)(this,t),a=r.call(this,-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])){var c;(c=a).fromVector3.apply(c,arguments)}else a.set(n,i,s,o);return a}return(0,D0.default)(t,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(n){var i=(0,B0.default)(n,4),s=i[0],o=i[1],c=i[2],u=i[3],l=o*o,f=-2*(l+c*c)+1,h=2*(s*o+u*c),d=-2*(s*c-u*o),p=2*(o*c+u*s),m=-2*(s*s+l)+1;d=d>1?1:d,d=d<-1?-1:d;var v=Math.atan2(p,m),g=Math.asin(d),b=Math.atan2(h,f);return this.set(v,g,b,t.RollPitchYaw)}},{key:"fromObject",value:function(n){throw new Error("not implemented")}},{key:"copy",value:function(n){return this[0]=n[0],this[1]=n[1],this[2]=n[2],this[3]=Number.isFinite(n[3])||this.order,this.check()}},{key:"set",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0;return this[0]=n,this[1]=i,this[2]=s,this[3]=Number.isFinite(o)?o:this[3],this.check()}},{key:"validate",value:function(){return Z0(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}},{key:"toArray",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n}},{key:"toArray4",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n[i]=this[0],n[i+1]=this[1],n[i+2]=this[2],n[i+3]=this[3],n}},{key:"toVector3",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return n[0]=this[0],n[1]=this[1],n[2]=this[2],n}},{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"alpha",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"beta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"gamma",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"phi",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"theta",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"psi",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"roll",get:function(){return this[0]},set:function(n){this[0]=(0,ie.checkNumber)(n)}},{key:"pitch",get:function(){return this[1]},set:function(n){this[1]=(0,ie.checkNumber)(n)}},{key:"yaw",get:function(){return this[2]},set:function(n){this[2]=(0,ie.checkNumber)(n)}},{key:"order",get:function(){return this[3]},set:function(n){this[3]=X0(n)}},{key:"fromVector3",value:function(n,i){return this.set(n[0],n[1],n[2],Number.isFinite(i)?i:this[3])}},{key:"fromArray",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this[0]=n[0+i],this[1]=n[1+i],this[2]=n[2+i],n[3]!==void 0&&(this[3]=n[3]),this.check()}},{key:"fromRollPitchYaw",value:function(n,i,s){return this.set(n,i,s,U.ZYX)}},{key:"fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder;return this._fromRotationMatrix(n,i),this.check()}},{key:"getRotationMatrix",value:function(n){return this._getRotationMatrix(n)}},{key:"getQuaternion",value:function(){var n=new Bi.default;switch(this[4]){case U.XYZ:return n.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case U.YXZ:return n.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case U.ZXY:return n.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case U.ZYX:return n.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case U.YZX:return n.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case U.XZY:return n.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(Pt)}}},{key:"_fromRotationMatrix",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.DefaultOrder,s=n[0],o=n[4],c=n[8],u=n[1],l=n[5],f=n[9],h=n[2],d=n[6],p=n[10];switch(i=i||this[3],i){case t.XYZ:this[1]=Math.asin((0,fr.clamp)(c,-1,1)),Math.abs(c)<hr?(this[0]=Math.atan2(-f,p),this[2]=Math.atan2(-o,s)):(this[0]=Math.atan2(d,l),this[2]=0);break;case t.YXZ:this[0]=Math.asin(-(0,fr.clamp)(f,-1,1)),Math.abs(f)<hr?(this[1]=Math.atan2(c,p),this[2]=Math.atan2(u,l)):(this[1]=Math.atan2(-h,s),this[2]=0);break;case t.ZXY:this[0]=Math.asin((0,fr.clamp)(d,-1,1)),Math.abs(d)<hr?(this[1]=Math.atan2(-h,p),this[2]=Math.atan2(-o,l)):(this[1]=0,this[2]=Math.atan2(u,s));break;case t.ZYX:this[1]=Math.asin(-(0,fr.clamp)(h,-1,1)),Math.abs(h)<hr?(this[0]=Math.atan2(d,p),this[2]=Math.atan2(u,s)):(this[0]=0,this[2]=Math.atan2(-o,l));break;case t.YZX:this[2]=Math.asin((0,fr.clamp)(u,-1,1)),Math.abs(u)<hr?(this[0]=Math.atan2(-f,l),this[1]=Math.atan2(-h,s)):(this[0]=0,this[1]=Math.atan2(c,p));break;case t.XZY:this[2]=Math.asin(-(0,fr.clamp)(o,-1,1)),Math.abs(o)<hr?(this[0]=Math.atan2(d,l),this[1]=Math.atan2(c,s)):(this[0]=Math.atan2(-f,p),this[1]=0);break;default:throw new Error(Pt)}return this[3]=i,this}},{key:"_getRotationMatrix",value:function(n){var i=n||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],s=this.x,o=this.y,c=this.z,u=Math.cos(s),l=Math.cos(o),f=Math.cos(c),h=Math.sin(s),d=Math.sin(o),p=Math.sin(c);switch(this[3]){case t.XYZ:{var m=u*f,v=u*p,g=h*f,b=h*p;i[0]=l*f,i[4]=-l*p,i[8]=d,i[1]=v+g*d,i[5]=m-b*d,i[9]=-h*l,i[2]=b-m*d,i[6]=g+v*d,i[10]=u*l;break}case t.YXZ:{var y=l*f,M=l*p,T=d*f,_=d*p;i[0]=y+_*h,i[4]=T*h-M,i[8]=u*d,i[1]=u*p,i[5]=u*f,i[9]=-h,i[2]=M*h-T,i[6]=_+y*h,i[10]=u*l;break}case t.ZXY:{var I=l*f,L=l*p,N=d*f,w=d*p;i[0]=I-w*h,i[4]=-u*p,i[8]=N+L*h,i[1]=L+N*h,i[5]=u*f,i[9]=w-I*h,i[2]=-u*d,i[6]=h,i[10]=u*l;break}case t.ZYX:{var W=u*f,C=u*p,B=h*f,P=h*p;i[0]=l*f,i[4]=B*d-C,i[8]=W*d+P,i[1]=l*p,i[5]=P*d+W,i[9]=C*d-B,i[2]=-d,i[6]=h*l,i[10]=u*l;break}case t.YZX:{var j=u*l,he=u*d,de=h*l,Ye=h*d;i[0]=l*f,i[4]=Ye-j*p,i[8]=de*p+he,i[1]=p,i[5]=u*f,i[9]=-h*f,i[2]=-d*f,i[6]=he*p+de,i[10]=j-Ye*p;break}case t.XZY:{var Ge=u*l,En=u*d,Ln=h*l,Nn=h*d;i[0]=l*f,i[4]=-p,i[8]=d*f,i[1]=Ge*p+Nn,i[5]=u*f,i[9]=En*p-Ln,i[2]=Ln*p-En,i[6]=h*f,i[10]=Nn*p+Ge;break}default:throw new Error(Pt)}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"toQuaternion",value:function(){var n=Math.cos(this.yaw*.5),i=Math.sin(this.yaw*.5),s=Math.cos(this.roll*.5),o=Math.sin(this.roll*.5),c=Math.cos(this.pitch*.5),u=Math.sin(this.pitch*.5),l=n*s*c+i*o*u,f=n*o*c-i*s*u,h=n*s*u+i*o*c,d=i*s*c-n*o*u;return new Bi.default(f,h,d,l)}}],[{key:"ZYX",get:function(){return U.ZYX}},{key:"YXZ",get:function(){return U.YXZ}},{key:"XZY",get:function(){return U.XZY}},{key:"ZXY",get:function(){return U.ZXY}},{key:"YZX",get:function(){return U.YZX}},{key:"XYZ",get:function(){return U.XYZ}},{key:"RollPitchYaw",get:function(){return U.ZYX}},{key:"DefaultOrder",get:function(){return U.ZYX}},{key:"RotationOrders",get:function(){return U}},{key:"rotationOrder",value:function(n){return U[n]}}]),t}(G0.default);St.default=j0;function Z0(e){return e>=0&&e<6}function X0(e){if(e<0&&e>=6)throw new Error(Pt);return e}});var zi=S(wt=>{"use strict";var dr=V();Object.defineProperty(wt,"__esModule",{value:!0});wt.default=void 0;var Q0=dr($()),$0=dr(J()),Fi=dr(kt()),vn=dr(ln()),Di=dr(it()),mn=dr(pn()),J0=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.x,a=t===void 0?0:t,n=r.y,i=n===void 0?0:n,s=r.z,o=s===void 0?0:s,c=r.roll,u=c===void 0?0:c,l=r.pitch,f=l===void 0?0:l,h=r.yaw,d=h===void 0?0:h,p=r.position,m=r.orientation;(0,Q0.default)(this,e),(0,Fi.default)(this,"position",void 0),(0,Fi.default)(this,"orientation",void 0),Array.isArray(p)&&p.length===3?this.position=new Di.default(p):this.position=new Di.default(a,i,o),Array.isArray(m)&&m.length===4?this.orientation=new mn.default(m,m[3]):this.orientation=new mn.default(u,f,d,mn.default.RollPitchYaw)}return(0,$0.default)(e,[{key:"x",get:function(){return this.position.x},set:function(t){this.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.position.y=t}},{key:"z",get:function(){return this.position.z},set:function(t){this.position.z=t}},{key:"roll",get:function(){return this.orientation.roll},set:function(t){this.orientation.roll=t}},{key:"pitch",get:function(){return this.orientation.pitch},set:function(t){this.orientation.pitch=t}},{key:"yaw",get:function(){return this.orientation.yaw},set:function(t){this.orientation.yaw=t}},{key:"getPosition",value:function(){return this.position}},{key:"getOrientation",value:function(){return this.orientation}},{key:"equals",value:function(t){return t?this.position.equals(t.position)&&this.orientation.equals(t.orientation):!1}},{key:"exactEquals",value:function(t){return t?this.position.exactEquals(t.position)&&this.orientation.exactEquals(t.orientation):!1}},{key:"getTransformationMatrix",value:function(){var t=Math.sin(this.roll),a=Math.sin(this.pitch),n=Math.sin(this.yaw),i=Math.cos(this.roll),s=Math.cos(this.pitch),o=Math.cos(this.yaw);return new vn.default().setRowMajor(o*s,-n*i+o*a*t,n*t+o*a*i,this.x,n*s,o*i+n*a*t,-o*t+n*a*i,this.y,-a,s*t,s*i,this.z,0,0,0,1)}},{key:"getTransformationMatrixFromPose",value:function(t){return new vn.default().multiplyRight(this.getTransformationMatrix()).multiplyRight(t.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(t){return new vn.default().multiplyRight(t.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}}]),e}();wt.default=J0});var Yi=S(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var H0={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:Math.PI*2};qt.default=H0});var pr=S(E=>{"use strict";var le=V();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"Vector2",{enumerable:!0,get:function(){return K0.default}});Object.defineProperty(E,"Vector3",{enumerable:!0,get:function(){return e1.default}});Object.defineProperty(E,"Vector4",{enumerable:!0,get:function(){return r1.default}});Object.defineProperty(E,"Matrix3",{enumerable:!0,get:function(){return t1.default}});Object.defineProperty(E,"Matrix4",{enumerable:!0,get:function(){return n1.default}});Object.defineProperty(E,"Quaternion",{enumerable:!0,get:function(){return a1.default}});Object.defineProperty(E,"SphericalCoordinates",{enumerable:!0,get:function(){return Gi.default}});Object.defineProperty(E,"_SphericalCoordinates",{enumerable:!0,get:function(){return Gi.default}});Object.defineProperty(E,"Pose",{enumerable:!0,get:function(){return Ui.default}});Object.defineProperty(E,"_Pose",{enumerable:!0,get:function(){return Ui.default}});Object.defineProperty(E,"Euler",{enumerable:!0,get:function(){return Vi.default}});Object.defineProperty(E,"_Euler",{enumerable:!0,get:function(){return Vi.default}});Object.defineProperty(E,"_MathUtils",{enumerable:!0,get:function(){return i1.default}});Object.defineProperty(E,"assert",{enumerable:!0,get:function(){return s1.default}});Object.defineProperty(E,"config",{enumerable:!0,get:function(){return Y.config}});Object.defineProperty(E,"configure",{enumerable:!0,get:function(){return Y.configure}});Object.defineProperty(E,"formatValue",{enumerable:!0,get:function(){return Y.formatValue}});Object.defineProperty(E,"isArray",{enumerable:!0,get:function(){return Y.isArray}});Object.defineProperty(E,"clone",{enumerable:!0,get:function(){return Y.clone}});Object.defineProperty(E,"equals",{enumerable:!0,get:function(){return Y.equals}});Object.defineProperty(E,"exactEquals",{enumerable:!0,get:function(){return Y.exactEquals}});Object.defineProperty(E,"toRadians",{enumerable:!0,get:function(){return Y.toRadians}});Object.defineProperty(E,"toDegrees",{enumerable:!0,get:function(){return Y.toDegrees}});Object.defineProperty(E,"radians",{enumerable:!0,get:function(){return Y.radians}});Object.defineProperty(E,"degrees",{enumerable:!0,get:function(){return Y.degrees}});Object.defineProperty(E,"sin",{enumerable:!0,get:function(){return Y.sin}});Object.defineProperty(E,"cos",{enumerable:!0,get:function(){return Y.cos}});Object.defineProperty(E,"tan",{enumerable:!0,get:function(){return Y.tan}});Object.defineProperty(E,"asin",{enumerable:!0,get:function(){return Y.asin}});Object.defineProperty(E,"acos",{enumerable:!0,get:function(){return Y.acos}});Object.defineProperty(E,"atan",{enumerable:!0,get:function(){return Y.atan}});Object.defineProperty(E,"clamp",{enumerable:!0,get:function(){return Y.clamp}});Object.defineProperty(E,"lerp",{enumerable:!0,get:function(){return Y.lerp}});Object.defineProperty(E,"withEpsilon",{enumerable:!0,get:function(){return Y.withEpsilon}});var K0=le(ba()),e1=le(it()),r1=le(Ht()),t1=le(Va()),n1=le(ln()),a1=le(dn()),Gi=le(Ii()),Ui=le(zi()),Vi=le(pn()),i1=le(Yi()),s1=le(Zr()),Y=ve()});var xn=S(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.WGS84_CONSTANTS=xe.WGS84_RADIUS_Z=xe.WGS84_RADIUS_Y=xe.WGS84_RADIUS_X=void 0;var Ie=6378137;xe.WGS84_RADIUS_X=Ie;var We=6378137;xe.WGS84_RADIUS_Y=We;var Be=6356752314245179e-9;xe.WGS84_RADIUS_Z=Be;var h1={radii:[Ie,We,Be],radiiSquared:[Ie*Ie,We*We,Be*Be],oneOverRadii:[1/Ie,1/We,1/Be],oneOverRadiiSquared:[1/(Ie*Ie),1/(We*We),1/(Be*Be)],maximumRadius:Math.max(Ie,We,Be),centerToleranceSquared:.1};xe.WGS84_CONSTANTS=h1});var On=S(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.fromCartographic=bn;we.fromCartographicToRadians=p1;we.fromCartographicToDegrees=v1;we.toCartographic=_n;we.toCartographicFromRadians=m1;we.toCartographicFromDegrees=g1;we.isWGS84=y1;var Se=pr(),ji=xn();function vr(e){return e}var d1=new Se.Vector3;function bn(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vr;return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function p1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return bn(e,r,Se.config._cartographicRadians?vr:Se.toRadians)}function v1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return bn(e,r,Se.config._cartographicRadians?Se.toDegrees:vr)}function _n(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vr;return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function m1(e,r){return _n(e,r,Se.config._cartographicRadians?vr:Se.toDegrees)}function g1(e,r){return _n(e,r,Se.config._cartographicRadians?Se.toRadians:vr)}function y1(e){if(!e)return!1;d1.from(e);var r=ji.WGS84_CONSTANTS.oneOverRadiiSquared,t=ji.WGS84_CONSTANTS.centerToleranceSquared,a=e[0]*e[0]*r[0],n=e[1]*e[1]*r[1],i=e[2]*e[2]*r[2];return Math.abs(a+n+i-1)<t}});var Zi=S(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.default=b1;var Et=pr(),mr=new Et.Vector3,M1=new Et.Vector3,x1=new Et.Vector3;function b1(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=r.oneOverRadii,n=r.oneOverRadiiSquared,i=r.centerToleranceSquared;mr.from(e);var s=mr.x,o=mr.y,c=mr.z,u=a.x,l=a.y,f=a.z,h=s*s*u*u,d=o*o*l*l,p=c*c*f*f,m=h+d+p,v=Math.sqrt(1/m);if(!!Number.isFinite(v)){var g=M1;if(g.copy(e).scale(v),m<i)return g.to(t);var b=n.x,y=n.y,M=n.z,T=x1;T.set(g.x*b*2,g.y*y*2,g.z*M*2);var _=(1-v)*mr.len()/(.5*T.len()),I=0,L,N,w,W;do{_-=I,L=1/(1+_*b),N=1/(1+_*y),w=1/(1+_*M);var C=L*L,B=N*N,P=w*w,j=C*L,he=B*N,de=P*w;W=h*C+d*B+p*P-1;var Ye=h*j*b+d*he*y+p*de*M,Ge=-2*Ye;I=W/Ge}while(Math.abs(W)>Et._MathUtils.EPSILON12);return mr.scale([L,N,w]).to(t)}}});var $i=S(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.default=R1;var te=pr(),Xi=1e-14,_1=new te.Vector3,Qi={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},kn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},qe={east:new te.Vector3,north:new te.Vector3,up:new te.Vector3,west:new te.Vector3,south:new te.Vector3,down:new te.Vector3},O1=new te.Vector3,T1=new te.Vector3,k1=new te.Vector3;function R1(e,r,t,a,n,i){var s=Qi[r]&&Qi[r][t];(0,te.assert)(s&&(!a||a===s));var o,c,u,l=_1.copy(n),f=(0,te.equals)(l.x,0,Xi)&&(0,te.equals)(l.y,0,Xi);if(f){var h=Math.sign(l.z);o=O1.fromArray(kn[r]),r!=="east"&&r!=="west"&&o.scale(h),c=T1.fromArray(kn[t]),t!=="east"&&t!=="west"&&c.scale(h),u=k1.fromArray(kn[a]),a!=="east"&&a!=="west"&&u.scale(h)}else{var d=qe.up,p=qe.east,m=qe.north;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),m.copy(d).cross(p);var v=qe.down,g=qe.west,b=qe.south;v.copy(d).scale(-1),g.copy(p).scale(-1),b.copy(m).scale(-1),o=qe[r],c=qe[t],u=qe[a]}return i[0]=o.x,i[1]=o.y,i[2]=o.z,i[3]=0,i[4]=c.x,i[5]=c.y,i[6]=c.z,i[7]=0,i[8]=u.x,i[9]=u.y,i[10]=u.z,i[11]=0,i[12]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}});var ts=S(Ct=>{"use strict";var gr=V(),A1=se();Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=void 0;var P1=gr(Tt()),S1=gr($()),w1=gr(J()),be=gr(kt()),z=pr(),Ji=E1(Le()),An=xn(),Hi=On(),q1=gr(Zi()),Ki=gr($i());function es(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(es=function(n){return n?t:r})(e)}function E1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||A1(e)!=="object"&&typeof e!="function")return{default:e};var t=es(r);if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,t&&t.set(e,a),a}var Lt=new z.Vector3,rs=new z.Vector3,L1=new z.Vector3,fe=new z.Vector3,N1=new z.Vector3,Nt=new z.Vector3,Pn=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;(0,S1.default)(this,e),(0,be.default)(this,"radii",void 0),(0,be.default)(this,"radiiSquared",void 0),(0,be.default)(this,"radiiToTheFourth",void 0),(0,be.default)(this,"oneOverRadii",void 0),(0,be.default)(this,"oneOverRadiiSquared",void 0),(0,be.default)(this,"minimumRadius",void 0),(0,be.default)(this,"maximumRadius",void 0),(0,be.default)(this,"centerToleranceSquared",z._MathUtils.EPSILON1),(0,be.default)(this,"squaredXOverSquaredZ",void 0),(0,z.assert)(r>=0),(0,z.assert)(t>=0),(0,z.assert)(a>=0),this.radii=new z.Vector3(r,t,a),this.radiiSquared=new z.Vector3(r*r,t*t,a*a),this.radiiToTheFourth=new z.Vector3(r*r*r*r,t*t*t*t,a*a*a*a),this.oneOverRadii=new z.Vector3(r===0?0:1/r,t===0?0:1/t,a===0?0:1/a),this.oneOverRadiiSquared=new z.Vector3(r===0?0:1/(r*r),t===0?0:1/(t*t),a===0?0:1/(a*a)),this.minimumRadius=Math.min(r,t,a),this.maximumRadius=Math.max(r,t,a),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return(0,w1.default)(e,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=rs,i=L1,s=(0,P1.default)(t,3),o=s[2];this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);var c=Math.sqrt(n.dot(i));return i.scale(1/c),n.scale(o),i.add(n),i.to(a)}},{key:"cartesianToCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];Nt.from(t);var n=this.scaleToGeodeticSurface(Nt,fe);if(!!n){var i=this.geodeticSurfaceNormal(n,rs),s=N1;s.copy(Nt).subtract(n);var o=Math.atan2(i.y,i.x),c=Math.asin(i.z),u=Math.sign(Ji.dot(s,Nt))*Ji.length(s);return(0,Hi.toCartographicFromRadians)([o,c,u],a)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new z.Matrix4;return(0,Ki.default)(this,"east","north","up",t,a)}},{key:"localFrameToFixedFrame",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new z.Matrix4;return(0,Ki.default)(this,t,a,n,i,s)}},{key:"geocentricSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Lt.from(t).normalize().to(a)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=(0,Hi.fromCartographicToRadians)(t),i=n[0],s=n[1],o=Math.cos(s);return Lt.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),Lt.to(a)}},{key:"geodeticSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Lt.from(t).scale(this.oneOverRadiiSquared).normalize().to(a)}},{key:"scaleToGeodeticSurface",value:function(t,a){return(0,q1.default)(t,this,a)}},{key:"scaleToGeocentricSurface",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];fe.from(t);var n=fe.x,i=fe.y,s=fe.z,o=this.oneOverRadiiSquared,c=1/Math.sqrt(n*n*o.x+i*i*o.y+s*s*o.z);return fe.multiplyScalar(c).to(a)}},{key:"transformPositionToScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return fe.from(t).scale(this.oneOverRadii).to(a)}},{key:"transformPositionFromScaledSpace",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return fe.from(t).scale(this.radii).to(a)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];(0,z.assert)((0,z.equals)(this.radii.x,this.radii.y,z._MathUtils.EPSILON15)),(0,z.assert)(this.radii.z>0),fe.from(t);var i=fe.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-a))return fe.set(0,0,i).to(n)}}]),e}();Ct.default=Pn;(0,be.default)(Pn,"WGS84",new Pn(An.WGS84_RADIUS_X,An.WGS84_RADIUS_Y,An.WGS84_RADIUS_Z))});var ns=S(It=>{"use strict";var C1=V();Object.defineProperty(It,"__esModule",{value:!0});Object.defineProperty(It,"Ellipsoid",{enumerable:!0,get:function(){return I1.default}});Object.defineProperty(It,"isWGS84",{enumerable:!0,get:function(){return W1.isWGS84}});var I1=C1(ts()),W1=On()});function Bt(e,r=!0,t){let a=t||new Set;if(e){if(Dn(e))a.add(e);else if(Dn(e.buffer))a.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)Bt(e[n],r,a)}}return t===void 0?Array.from(a):[]}function Dn(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}function Ue(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var Ft=new Map,K=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(Ue())}static set onmessage(r){function t(n){let i=Ue(),{type:s,payload:o}=i?n:n.data;r(s,o)}let a=Ue();a?(a.on("message",t),a.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t}static addEventListener(r){let t=Ft.get(r);t||(t=n=>{if(!bs(n))return;let i=Ue(),{type:s,payload:o}=i?n:n.data;r(s,o)}),Ue()?console.error("not implemented"):globalThis.addEventListener("message",t)}static removeEventListener(r){let t=Ft.get(r);Ft.delete(r),Ue()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static postMessage(r,t){let a={source:"loaders.gl",type:r,payload:t},n=Bt(t),i=Ue();i?i.postMessage(a,n):globalThis.postMessage(a,n)}};function bs(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}var Gr=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(r){return this.enqueue(r)}enqueue(r){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let t=this._settlers.shift();r instanceof Error?t.reject(r):t.resolve({value:r})}else this._values.push(r)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let r=this._values.shift();return r instanceof Error?Promise.reject(r):Promise.resolve({done:!1,value:r})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((r,t)=>{this._settlers.push({resolve:r,reject:t})})}};var _s=0,Ur,zn;function Dt(e,r){if(!K.inWorkerThread())return;let t={process:Os};K.onmessage=async(a,n)=>{try{switch(a){case"process":if(!e)throw new Error("Worker does not support atomic processing");let i=await e(n.input,n.options||{},t);K.postMessage("done",{result:i});break;case"process-in-batches":if(!r)throw new Error("Worker does not support batched processing");Ur=new Gr,zn=n.options||{};let s=r(Ur,zn,t);for await(let o of s)K.postMessage("output-batch",{result:o});K.postMessage("done",{});break;case"input-batch":Ur.push(n.input);break;case"input-done":Ur.close();break;default:}}catch(i){let s=i instanceof Error?i.message:"";K.postMessage("error",{error:s})}}}function Os(e,r={}){return new Promise((t,a)=>{let n=_s++,i=(o,c)=>{if(c.id===n)switch(o){case"done":K.removeEventListener(i),t(c.result);break;case"error":K.removeEventListener(i),a(c.error);break;default:}};K.addEventListener(i);let s={id:n,input:e,options:r};K.postMessage("process",s)})}function Ee(e,r){if(!e)throw new Error(r||"loader assertion failed.")}function _e(e,r){return Ee(e>=0),Ee(r>0),e+(r-1)&~(r-1)}function zt(e,r,t){let a;if(e instanceof ArrayBuffer)a=new Uint8Array(e);else{let n=e.byteOffset,i=e.byteLength;a=new Uint8Array(e.buffer||e.arrayBuffer,n,i)}return r.set(a,t),t+_e(a.byteLength,4)}function Vr(e,r,t,a){let n=_e(t.byteLength,a),i=n-t.byteLength;if(e){let s=new Uint8Array(e.buffer,e.byteOffset+r,t.byteLength),o=new Uint8Array(t);s.set(o);for(let c=0;c<i;++c)e.setUint8(r+t.byteLength+c,32)}return r+=n,r}function rr(e,r,t,a){let i=new TextEncoder().encode(t);return r=Vr(e,r,i,a),r}function Yt(e,r){let t=e.length,n=Math.ceil(t/r)*r-t,i="";for(let s=0;s<n;++s)i+=" ";return e+i}function tr(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t.charCodeAt(n));return r+a}function Mr(e,r,t,a){if(e)for(let n=0;n<a;n++)e.setUint8(r+n,t[n]);return r+a}function jr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}var Yn="3.3.0-alpha.7";var pe=!1,xr=!0;function Gt(e){let r=br(e);return Ts(r)||As(r)||ks(r)||Rs(r)}function Ts(e){let r=br(e);return r.byteLength>=24&&r.getUint32(0,pe)===2303741511?{mimeType:"image/png",width:r.getUint32(16,pe),height:r.getUint32(20,pe)}:null}function ks(e){let r=br(e);return r.byteLength>=10&&r.getUint32(0,pe)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,xr),height:r.getUint16(8,xr)}:null}function Rs(e){let r=br(e);return r.byteLength>=14&&r.getUint16(0,pe)===16973&&r.getUint32(2,xr)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,xr),height:r.getUint32(22,xr)}:null}function As(e){let r=br(e);if(!(r.byteLength>=3&&r.getUint16(0,pe)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:a,sofMarkers:n}=Ps(),i=2;for(;i+9<r.byteLength;){let s=r.getUint16(i,pe);if(n.has(s))return{mimeType:"image/jpeg",height:r.getUint16(i+5,pe),width:r.getUint16(i+7,pe)};if(!a.has(s))return null;i+=2,i+=r.getUint16(i,pe)}return null}function Ps(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);let r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}function br(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function Ve(e,r){if(!e)throw new Error(r||"assert failed: gltf")}var Gn=["SCALAR","VEC2","VEC3","VEC4"],Ss=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],ws=new Map(Ss),qs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Es={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ls={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Un(e){return Gn[e-1]||Gn[0]}function Vn(e){let r=ws.get(e.constructor);if(!r)throw new Error("Illegal typed array");return r}function jn(e,r){let t=Ls[e.componentType],a=qs[e.type],n=Es[e.componentType],i=e.count*a,s=e.count*a*n;return Ve(s>=0&&s<=r.byteLength),{ArrayType:t,length:i,byteLength:s}}var Ns={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},_r=class{constructor(r){this.gltf=r||{json:Q({},Ns),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(r){return this.json[r]}getExtraData(r){return(this.json.extras||{})[r]}getExtension(r){let t=this.getUsedExtensions().find(n=>n===r),a=this.json.extensions||{};return t?a[r]||!0:null}getRequiredExtension(r){return this.getRequiredExtensions().find(a=>a===r)?this.getExtension(r):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(r,t){return(r.extensions||{})[t]}getScene(r){return this.getObject("scenes",r)}getNode(r){return this.getObject("nodes",r)}getSkin(r){return this.getObject("skins",r)}getMesh(r){return this.getObject("meshes",r)}getMaterial(r){return this.getObject("materials",r)}getAccessor(r){return this.getObject("accessors",r)}getTexture(r){return this.getObject("textures",r)}getSampler(r){return this.getObject("samplers",r)}getImage(r){return this.getObject("images",r)}getBufferView(r){return this.getObject("bufferViews",r)}getBuffer(r){return this.getObject("buffers",r)}getObject(r,t){if(typeof t=="object")return t;let a=this.json[r]&&this.json[r][t];if(!a)throw new Error(`glTF file error: Could not find ${r}[${t}]`);return a}getTypedArrayForBufferView(r){r=this.getBufferView(r);let t=r.buffer,a=this.gltf.buffers[t];Ve(a);let n=(r.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,n,r.byteLength)}getTypedArrayForAccessor(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,{ArrayType:i,length:s}=jn(r,t),o=t.byteOffset+r.byteOffset;return new i(n,o,s)}getTypedArrayForImageData(r){r=this.getAccessor(r);let t=this.getBufferView(r.bufferView),n=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(n,i,t.byteLength)}addApplicationData(r,t){return this.json[r]=t,this}addExtraData(r,t){return this.json.extras=this.json.extras||{},this.json.extras[r]=t,this}addObjectExtension(r,t,a){return r.extensions=r.extensions||{},r.extensions[t]=a,this.registerUsedExtension(t),this}setObjectExtension(r,t,a){let n=r.extensions||{};n[t]=a}removeObjectExtension(r,t){let a=r.extensions||{},n=a[t];return delete a[t],n}addExtension(r,t={}){return Ve(t),this.json.extensions=this.json.extensions||{},this.json.extensions[r]=t,this.registerUsedExtension(r),t}addRequiredExtension(r,t={}){return Ve(t),this.addExtension(r,t),this.registerRequiredExtension(r),t}registerUsedExtension(r){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===r)||this.json.extensionsUsed.push(r)}registerRequiredExtension(r){this.registerUsedExtension(r),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===r)||this.json.extensionsRequired.push(r)}removeExtension(r){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,r),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,r),this.json.extensions&&delete this.json.extensions[r]}setDefaultScene(r){this.json.scene=r}addScene(r){let{nodeIndices:t}=r;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(r){let{meshIndex:t,matrix:a}=r;this.json.nodes=this.json.nodes||[];let n={mesh:t};return a&&(n.matrix=a),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(r){let{attributes:t,indices:a,material:n,mode:i=4}=r,o={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(a){let c=this._addIndices(a);o.primitives[0].indices=c}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(r){let a={primitives:[{attributes:this._addAttributes(r),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addImage(r,t){let a=Gt(r),n=t||(a==null?void 0:a.mimeType),s={bufferView:this.addBufferView(r),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(r){let t=r.byteLength;Ve(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(r);let a={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=_e(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(r,t){let a={bufferView:r,type:Un(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(a),this.json.accessors.length-1}addBinaryBuffer(r,t={size:3}){let a=this.addBufferView(r),n={min:t.min,max:t.max};(!n.min||!n.max)&&(n=this._getAccessorMinMax(r,t.size));let i={size:t.size,componentType:Vn(r),count:Math.round(r.length/t.size),min:n.min,max:n.max};return this.addAccessor(a,Object.assign(i,t))}addTexture(r){let{imageIndex:t}=r,a={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(a),this.json.textures.length-1}addMaterial(r){return this.json.materials=this.json.materials||[],this.json.materials.push(r),this.json.materials.length-1}createBinaryChunk(){var i,s;this.gltf.buffers=[];let r=this.byteLength,t=new ArrayBuffer(r),a=new Uint8Array(t),n=0;for(let o of this.sourceBuffers||[])n=zt(o,a,n);((s=(i=this.json)==null?void 0:i.buffers)==null?void 0:s[0])?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=t,this.sourceBuffers=[t]}_removeStringFromArray(r,t){let a=!0;for(;a;){let n=r.indexOf(t);n>-1?r.splice(n,1):a=!1}}_addAttributes(r={}){let t={};for(let a in r){let n=r[a],i=this._getGltfAttributeName(a),s=this.addBinaryBuffer(n.value,n);t[i]=s}return t}_addIndices(r){return this.addBinaryBuffer(r,{size:1})}_getGltfAttributeName(r){switch(r.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return r}}_getAccessorMinMax(r,t){let a={min:null,max:null};if(r.length<t)return a;a.min=[],a.max=[];let n=r.subarray(0,t);for(let i of n)a.min.push(i),a.max.push(i);for(let i=t;i<r.length;i+=t)for(let s=0;s<t;s++)a.min[0+s]=Math.min(a.min[0+s],r[i+s]),a.max[0+s]=Math.max(a.max[0+s],r[i+s]);return a}};var o1=1179937895,c1=1313821514,u1=5130562,Me=!0;function gn(e,r,t=0,a={}){let{magic:n=o1,version:i=2,json:s={},binary:o}=e,c=t;r&&(r.setUint32(t+0,n,Me),r.setUint32(t+4,i,Me),r.setUint32(t+8,0,Me));let u=t+8;t+=12;let l=t;r&&(r.setUint32(t+0,0,Me),r.setUint32(t+4,c1,Me)),t+=8;let f=JSON.stringify(s);if(t=rr(r,t,f,4),r){let h=t-l-8;r.setUint32(l+0,h,Me)}if(o){let h=t;if(r&&(r.setUint32(t+0,0,Me),r.setUint32(t+4,u1,Me)),t+=8,t=Vr(r,t,o,4),r){let d=t-h-8;r.setUint32(h+0,d,Me)}}if(r){let h=t-c;r.setUint32(u,h,Me)}return t}function yn(e,r,t,a){return l1(e),gn(e,r,t,a)}function l1(e,{firstBuffer:r=0}={}){if(e.buffers&&e.buffers.length>r)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Mn={name:"glTF",id:"gltf",module:"gltf",version:Yn,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:f1,options:{gltf:{}}};function f1(e,r={}){let{byteOffset:t=0}=r,a=yn(e,null,t,r),n=new ArrayBuffer(a),i=new DataView(n);return yn(e,i,t,r),n}var as="3.3.0-alpha.7";var yr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Cp=Object.keys(yr),Fe={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function De(e,r,t){let a=12;if(!r)return t+a;let{magic:n,version:i=1,byteLength:s=12}=e;return Ee(Array.isArray(n)&&Number.isFinite(i)&&Number.isFinite(s)),r.setUint8(t+0,n[0]),r.setUint8(t+1,n[1]),r.setUint8(t+2,n[2]),r.setUint8(t+3,n[3]),r.setUint32(t+4,i,!0),r.setUint32(t+8,s,!0),t+=a,t}function ze(e,r,t){!e||e.setUint32(r+8,t,!0)}function is(e,r,t,a,n){e=Q({magic:Fe.COMPOSITE,tiles:[]},e);let i=t;t+=De(e,r,t),r&&r.setUint32(t,e.tiles.length,!0),t+=4;for(let s=0;s<e.tiles.length;++s)t+=n(e.tiles[s],r,t,a);return ze(r,i,t-i),t}function ss(e,r,t,a){let{featuresLength:n=0,batchTable:i}=e,s={BATCH_LENGTH:n},o=JSON.stringify(s),c=i?JSON.stringify(i):"",u=_e(o.length,8),l=c?_e(c.length,8):0;e=Q({magic:Fe.BATCHED_MODEL},e);let f=t;t=De(e,r,t),r&&(r.setUint32(12,u,!0),r.setUint32(16,0,!0),r.setUint32(20,l,!0),r.setUint32(24,0,!0)),t+=16,t=rr(r,t,o,8),i&&(t=rr(r,t,c,8));let h=e.gltfEncoded;return h&&(t=Mr(r,t,h,h.byteLength)),ze(r,f,t-f),t}function os(e,r,t,a){let{featuresLength:n=1,gltfFormat:i=1,gltfUri:s=""}=e,o=s.length,c={INSTANCES_LENGTH:n,POSITION:new Array(n*3).fill(0)},u=JSON.stringify(c),l=u.length;e=Q({magic:Fe.INSTANCED_MODEL},e);let f=t;return t=De(e,r,0),r&&(r.setUint32(12,l,!0),r.setUint32(16,0,!0),r.setUint32(20,0,!0),r.setUint32(24,0,!0),r.setUint32(28,i,!0)),t+=20,t+=tr(r,t,u,l),t+=tr(r,t,s,o),ze(r,f,t-f),t}var B1={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function cs(e,r,t,a){let{featureTableJson:n=B1}=e,i=JSON.stringify(n);i=Yt(i,4);let{featureTableJsonByteLength:s=i.length}=e,o=new ArrayBuffer(12),c=o.byteLength;e=Q({magic:Fe.POINT_CLOUD},e);let u=t;return t+=De(e,r,0),r&&(r.setUint32(t+0,s,!0),r.setUint32(t+4,c,!0),r.setUint32(t+8,0,!0),r.setUint32(t+12,0,!0)),t+=16,t+=tr(r,t,i,s),t+=Mr(r,t,o,c),ze(r,u,t-u),t}function Sn(e,r){let t=wn(e,null,0,r),a=new ArrayBuffer(t),n=new DataView(a);return wn(e,n,0,r),a}function wn(e,r,t,a){switch(Ee(typeof e.type=="string"),e.type){case yr.COMPOSITE:return is(e,r,t,a,wn);case yr.POINT_CLOUD:return cs(e,r,t,a);case yr.BATCHED_3D_MODEL:return ss(e,r,t,a);case yr.INSTANCED_3D_MODEL:return os(e,r,t,a);default:throw new Error("3D Tiles: unknown tile type")}}var qn={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:as,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:F1,binary:!0,options:{["3d-tiles"]:{}}};function F1(e,r){return Sn(e,r)}var er=Fn(pr()),ls=Fn(ns());function us(e,r){let t=new Float32Array(e.length),a=z1(r);for(let n=0;n<e.length;n+=2){let i=e.subarray(n,n+2),s=a.slice(n*2,n*2+4),o=D1([i[0],i[1]]),c=[s[2]-s[0],s[3]-s[1]],u=[o[0]*c[0],o[1]*c[1]],l=[u[0]+s[0],u[1]+s[1]];t[n]=l[0],t[n+1]=l[1]}return t}function D1(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function z1(e){let r=65535,t=[];for(let a=0;a<e.length;a++)t[a]=e[a]/r;return t}var Y1=new er.Matrix4([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),fs=new er.Vector3,Wt=class{async convert(r,t=null){let a=await this.buildGltf(r,t);return jr({gltfEncoded:new Uint8Array(a),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},qn)}async buildGltf(r,t){let{tileContent:a,textureFormat:n}=r,{material:i,attributes:s,indices:o,cartesianOrigin:c,cartographicOrigin:u,modelMatrix:l}=a,f=new _r,h=await this._addI3sTextureToGltf(a,n,f),d=this._convertI3sMaterialToGltfMaterial(i,h),p=f.addMaterial(d),m=s.positions,v=m.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=us(s.texCoords.value,s.uvRegions.value)),s.positions.value=this._normalizePositions(v,c,u,l),this._createBatchIds(a,t),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let g=o||this._generateSynteticIndices(v.length/m.size),b=f.addMesh({attributes:s,indices:g,material:p,mode:4}),y=this._generateTransformMatrix(c),M=f.addNode({meshIndex:b,matrix:y}),T=f.addScene({nodeIndices:[M]});return f.setDefaultScene(T),f.createBinaryChunk(),jr(f.gltf,Mn)}async _addI3sTextureToGltf(r,t,a){let{texture:n,material:i,attributes:s}=r,o=null,c=n;if(!n&&i&&(c=i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorTexture&&i.pbrMetallicRoughness.baseColorTexture.texture.source.image),c){let u=this._deduceMimeTypeFromFormat(t),l=a.addImage(c,u);o=a.addTexture({imageIndex:l}),delete s.colors}return o}_normalizePositions(r,t,a,n){let i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3){let o=r.subarray(s,s+3),c=new er.Vector3(t),u=new er.Vector3(Array.from(o)).transform(n).add(a);ls.Ellipsoid.WGS84.cartographicToCartesian(u,fs),u=fs.subtract(c),i.set(u,s)}return i}_generateTransformMatrix(r){return new er.Matrix4().translate(r).multiplyLeft(Y1)}_createBatchIds(r,t){let{featureIds:a}=r,{OBJECTID:n}=t||{};if(!(!a||!n)){for(let i=0;i<a.length;i++){let s=a[i],o=n.indexOf(s);a[i]=o}r.attributes._BATCHID={size:1,byteOffset:0,value:a}}}_generateSynteticIndices(r){let t=new Uint32Array(r);for(let a=0;a<r;a++)t.set([a],a);return t}_deduceMimeTypeFromFormat(r){switch(r){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${r}`),"image/jpeg"}}_convertI3sMaterialToGltfMaterial(r,t){let a=t!==null;return r?(t!==null&&(r=this._setGltfTexture(r,t)),r):(r={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},a?r.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],r)}_setGltfTexture(r,t){let a=Bn(Q({},r),{pbrMetallicRoughness:Q({},r.pbrMetallicRoughness)});return r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorTexture?a.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:r.emissiveTexture?a.emissiveTexture={index:t,texCoord:0}:r.pbrMetallicRoughness&&r.pbrMetallicRoughness.metallicRoughnessTexture?a.pbrMetallicRoughness.metallicRoughnessTexture={index:t,texCoord:0}:r.normalTexture?a.normalTexture={index:t,texCoord:0}:r.occlusionTexture&&(a.occlusionTexture={index:t,texCoord:0}),a}_getFeaturesLength(r){if(!r)return 0;let t=Object.keys(r)[0];return t?r[t].length:0}_checkNormals(r){return r.find(t=>t)}};var G1=new Wt;Dt(async(e,r={})=>G1.convert(e,r.featureAttributes));
4
3
  //# sourceMappingURL=3d-tiles-attributes-worker.js.map