@loaders.gl/tile-converter 4.0.0-alpha.6 → 4.0.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.
- package/bin/converter.js +1 -1
- package/dist/3d-tiles-attributes-worker.js +2 -2
- package/dist/3d-tiles-attributes-worker.js.map +3 -3
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/3d-tiles-converter.js +4 -3
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +0 -8
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +2 -15
- package/dist/converter.min.js +75 -76
- package/dist/deps-installer/deps-installer.js +3 -3
- package/dist/dist.min.js +1870 -1581
- package/dist/es5/3d-tiles-attributes-worker.js +1 -1
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +0 -3
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +2 -10
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +4 -4
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +1 -1
- package/dist/es5/i3s-attributes-worker.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +2 -2
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +25 -17
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js +1 -4
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +0 -7
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/lib/utils/geometry-utils.js +15 -0
- package/dist/es5/lib/utils/geometry-utils.js.map +1 -0
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +1 -1
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +0 -3
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +2 -8
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +4 -4
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/i3s-attributes-worker.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +2 -2
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +19 -11
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js +1 -4
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +0 -7
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/lib/utils/geometry-utils.js +8 -0
- package/dist/esm/lib/utils/geometry-utils.js.map +1 -0
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/i3s-attributes-worker.d.ts +10 -2
- package/dist/i3s-attributes-worker.d.ts.map +1 -1
- package/dist/i3s-attributes-worker.js +2 -2
- package/dist/i3s-attributes-worker.js.map +3 -3
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +4 -2
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +2 -2
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +51 -43
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/gltf-attributes.js +1 -4
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +7 -6
- package/dist/lib/utils/geometry-utils.d.ts +9 -0
- package/dist/lib/utils/geometry-utils.d.ts.map +1 -0
- package/dist/lib/utils/geometry-utils.js +18 -0
- package/package.json +15 -16
- package/src/3d-tiles-converter/3d-tiles-converter.ts +4 -3
- package/src/3d-tiles-converter/helpers/b3dm-converter.ts +2 -16
- package/src/deps-installer/deps-installer.ts +3 -3
- package/src/i3s-attributes-worker.ts +11 -2
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +13 -14
- package/src/i3s-converter/helpers/geometry-converter.ts +105 -78
- package/src/i3s-converter/helpers/gltf-attributes.ts +1 -4
- package/src/i3s-converter/i3s-converter.ts +8 -7
- package/src/lib/utils/geometry-utils.ts +14 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var gs=Object.create;var Ur=Object.defineProperty,Ms=Object.defineProperties,xs=Object.getOwnPropertyDescriptor,bs=Object.getOwnPropertyDescriptors,_s=Object.getOwnPropertyNames,Bn=Object.getOwnPropertySymbols,Ts=Object.getPrototypeOf,Fn=Object.prototype.hasOwnProperty,Os=Object.prototype.propertyIsEnumerable;var Dn=(e,r,t)=>r in e?Ur(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Q=(e,r)=>{for(var t in r||(r={}))Fn.call(r,t)&&Dn(e,t,r[t]);if(Bn)for(var t of Bn(r))Os.call(r,t)&&Dn(e,t,r[t]);return e},zn=(e,r)=>Ms(e,bs(r)),ks=e=>Ur(e,"__esModule",{value:!0});var S=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Rs=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of _s(r))!Fn.call(e,a)&&a!=="default"&&Ur(e,a,{get:()=>r[a],enumerable:!(t=xs(r,a))||t.enumerable});return e},Yn=e=>Rs(ks(Ur(e!=null?gs(Ts(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var G=S((Xd,Tr)=>{function js(e){return e&&e.__esModule?e:{default:e}}Tr.exports=js,Tr.exports.__esModule=!0,Tr.exports.default=Tr.exports});var ee=S((Qd,Te)=>{function jt(e){return Te.exports=jt=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},Te.exports.__esModule=!0,Te.exports.default=Te.exports,jt(e)}Te.exports=jt,Te.exports.__esModule=!0,Te.exports.default=Te.exports});var $=S(($d,Or)=>{function Zs(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Or.exports=Zs,Or.exports.__esModule=!0,Or.exports.default=Or.exports});var Hn=S((Jd,kr)=>{var Jn=ee().default;function Xs(e,r){if(Jn(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var a=t.call(e,r||"default");if(Jn(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}kr.exports=Xs,kr.exports.__esModule=!0,kr.exports.default=kr.exports});var Zt=S((Hd,Rr)=>{var Qs=ee().default,$s=Hn();function Js(e){var r=$s(e,"string");return Qs(r)==="symbol"?r:String(r)}Rr.exports=Js,Rr.exports.__esModule=!0,Rr.exports.default=Rr.exports});var J=S((Kd,Ar)=>{var Hs=Zt();function Kn(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,Hs(a.key),a)}}function Ks(e,r,t){return r&&Kn(e.prototype,r),t&&Kn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Ar.exports=Ks,Ar.exports.__esModule=!0,Ar.exports.default=Ar.exports});var ea=S((ep,Oe)=>{function Xt(e,r){return Oe.exports=Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},Oe.exports.__esModule=!0,Oe.exports.default=Oe.exports,Xt(e,r)}Oe.exports=Xt,Oe.exports.__esModule=!0,Oe.exports.default=Oe.exports});var oe=S((rp,Pr)=>{var eo=ea();function ro(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&&eo(e,r)}Pr.exports=ro,Pr.exports.__esModule=!0,Pr.exports.default=Pr.exports});var ra=S((tp,Sr)=>{function to(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Sr.exports=to,Sr.exports.__esModule=!0,Sr.exports.default=Sr.exports});var ce=S((np,wr)=>{var no=ee().default,ao=ra();function io(e,r){if(r&&(no(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ao(e)}wr.exports=io,wr.exports.__esModule=!0,wr.exports.default=wr.exports});var ue=S((ap,ke)=>{function Qt(e){return ke.exports=Qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ke.exports.__esModule=!0,ke.exports.default=ke.exports,Qt(e)}ke.exports=Qt,ke.exports.__esModule=!0,ke.exports.default=ke.exports});var Qr=S($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.default=so;function so(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}});var ve=S(D=>{"use strict";var ta=G();Object.defineProperty(D,"__esModule",{value:!0});D.configure=lo;D.formatValue=fo;D.isArray=je;D.clone=ho;D.toRadians=po;D.toDegrees=vo;D.radians=aa;D.degrees=ia;D.sin=mo;D.cos=yo;D.tan=go;D.asin=Mo;D.acos=xo;D.atan=bo;D.clamp=_o;D.lerp=sa;D.equals=oa;D.exactEquals=ca;D.withEpsilon=To;D.config=void 0;var na=ta(ee()),oo=ta(Qr()),co=1/Math.PI*180,uo=1/180*Math.PI,H={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};D.config=H;function lo(e){for(var r in e)(0,oo.default)(r in H),H[r]=e[r];return H}function fo(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 ho(e){return"clone"in e?e.clone():e.slice()}function po(e){return aa(e)}function vo(e){return ia(e)}function aa(e,r){return Re(e,function(t){return t*uo},r)}function ia(e,r){return Re(e,function(t){return t*co},r)}function mo(e,r){return Re(e,function(t){return Math.sin(t)},r)}function yo(e,r){return Re(e,function(t){return Math.cos(t)},r)}function go(e,r){return Re(e,function(t){return Math.tan(t)},r)}function Mo(e,r){return Re(e,function(t){return Math.asin(t)},r)}function xo(e,r){return Re(e,function(t){return Math.acos(t)},r)}function bo(e,r){return Re(e,function(t){return Math.atan(t)},r)}function _o(e,r,t){return Re(e,function(a){return Math.max(r,Math.min(t,a))})}function sa(e,r,t){return je(e)?e.map(function(a,n){return sa(a,r[n],t)}):t*r+(1-t)*e}function oa(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(!oa(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 ca(e,r){if(e===r)return!0;if(e&&(0,na.default)(e)==="object"&&r&&(0,na.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(!ca(e[t],r[t]))return!1;return!0}return!1}function To(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 ko(e){return e.clone?e.clone():new Array(e.length)}function Re(e,r,t){if(je(e)){var a=e;t=t||ko(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 Lr=S($r=>{"use strict";var qr=G();Object.defineProperty($r,"__esModule",{value:!0});$r.default=void 0;var Ro=qr($()),Ao=qr(J()),Po=qr(oe()),So=qr(ce()),ua=qr(ue()),Er=ve();function wo(e){var r=qo();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,So.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}}function Eo(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 Lo=function(e){(0,Po.default)(t,e);var r=wo(t);function t(){return(0,Ro.default)(this,t),r.apply(this,arguments)}return(0,Ao.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,Er.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(Er.config)}},{key:"formatString",value:function(n){for(var i="",s=0;s<this.ELEMENTS;++s)i+=(s>0?", ":"")+(0,Er.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,Er.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(Er.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}(Eo(Array));$r.default=Lo});var me=S(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.validateVector=la;nr.checkNumber=Io;nr.checkVector=Co;nr.deprecated=Wo;var No=ve();function la(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 Io(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Co(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(No.config.debug&&!la(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}var fa={};function Wo(e,r){fa[e]||(fa[e]=!0,console.warn("".concat(e," has been removed in version ").concat(r,", see upgrade guide for more information")))}});var Hr=S(Jr=>{"use strict";var Ze=G();Object.defineProperty(Jr,"__esModule",{value:!0});Jr.default=void 0;var Bo=Ze($()),Fo=Ze(J()),Do=Ze(oe()),zo=Ze(ce()),ha=Ze(ue()),Yo=Ze(Lr()),Nr=me(),da=Ze(Qr());function Vo(e){var r=Uo();return function(){var a=(0,ha.default)(e),n;if(r){var i=(0,ha.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,zo.default)(this,n)}}function Uo(){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 Go=function(e){(0,Do.default)(t,e);var r=Vo(t);function t(){return(0,Bo.default)(this,t),r.apply(this,arguments)}return(0,Fo.default)(t,[{key:"x",get:function(){return this[0]},set:function(n){this[0]=(0,Nr.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,Nr.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,Nr.checkNumber)(i)}},{key:"dot",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s)i+=this[s]*n[s];return(0,Nr.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,da.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),(0,Nr.checkNumber)(this[n])}},{key:"setComponent",value:function(n,i){return(0,da.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}(Yo.default);Jr.default=Go});var Xe=S(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.setMatrixArrayType=Zo;ae.toRadian=Qo;ae.equals=$o;ae.RANDOM=ae.ARRAY_TYPE=ae.EPSILON=void 0;var pa=1e-6;ae.EPSILON=pa;var va=typeof Float32Array!="undefined"?Float32Array:Array;ae.ARRAY_TYPE=va;var jo=Math.random;ae.RANDOM=jo;function Zo(e){ae.ARRAY_TYPE=va=e}var Xo=Math.PI/180;function Qo(e){return e*Xo}function $o(e,r){return Math.abs(e-r)<=pa*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 et=S(R=>{"use strict";function Kr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kr=function(t){return typeof t}:Kr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kr(e)}Object.defineProperty(R,"__esModule",{value:!0});R.create=ya;R.clone=Ho;R.fromValues=Ko;R.copy=ec;R.set=rc;R.add=tc;R.subtract=ga;R.multiply=Ma;R.divide=xa;R.ceil=nc;R.floor=ac;R.min=ic;R.max=sc;R.round=oc;R.scale=cc;R.scaleAndAdd=uc;R.distance=ba;R.squaredDistance=_a;R.length=Ta;R.squaredLength=Oa;R.negate=lc;R.inverse=fc;R.normalize=hc;R.dot=dc;R.cross=pc;R.lerp=vc;R.random=mc;R.transformMat2=yc;R.transformMat2d=gc;R.transformMat3=Mc;R.transformMat4=xc;R.rotate=bc;R.angle=_c;R.zero=Tc;R.str=Oc;R.exactEquals=kc;R.equals=Rc;R.forEach=R.sqrLen=R.sqrDist=R.dist=R.div=R.mul=R.sub=R.len=void 0;var Qe=Jo(Xe());function ma(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ma=function(n){return n?t:r})(e)}function Jo(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Kr(e)!=="object"&&typeof e!="function")return{default:e};var t=ma(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 ya(){var e=new Qe.ARRAY_TYPE(2);return Qe.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function Ho(e){var r=new Qe.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r}function Ko(e,r){var t=new Qe.ARRAY_TYPE(2);return t[0]=e,t[1]=r,t}function ec(e,r){return e[0]=r[0],e[1]=r[1],e}function rc(e,r,t){return e[0]=r,e[1]=t,e}function tc(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function ga(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e}function Ma(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e}function xa(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e}function nc(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e}function ac(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e}function ic(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e}function sc(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e}function oc(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e}function cc(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function uc(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e}function ba(e,r){var t=r[0]-e[0],a=r[1]-e[1];return Math.hypot(t,a)}function _a(e,r){var t=r[0]-e[0],a=r[1]-e[1];return t*t+a*a}function Ta(e){var r=e[0],t=e[1];return Math.hypot(r,t)}function Oa(e){var r=e[0],t=e[1];return r*r+t*t}function lc(e,r){return e[0]=-r[0],e[1]=-r[1],e}function fc(e,r){return e[0]=1/r[0],e[1]=1/r[1],e}function hc(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 dc(e,r){return e[0]*r[0]+e[1]*r[1]}function pc(e,r,t){var a=r[0]*t[1]-r[1]*t[0];return e[0]=e[1]=0,e[2]=a,e}function vc(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 mc(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 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}function gc(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 Mc(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 xc(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 bc(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 _c(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 Tc(e){return e[0]=0,e[1]=0,e}function Oc(e){return"vec2("+e[0]+", "+e[1]+")"}function kc(e,r){return e[0]===r[0]&&e[1]===r[1]}function Rc(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 Ac=Ta;R.len=Ac;var Pc=ga;R.sub=Pc;var Sc=Ma;R.mul=Sc;var wc=xa;R.div=wc;var qc=ba;R.dist=qc;var Ec=_a;R.sqrDist=Ec;var Lc=Oa;R.sqrLen=Lc;var Nc=function(){var e=ya();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=Nc});var ar=S($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.vec2_transformMat4AsVector=Ic;$e.vec3_transformMat4AsVector=Cc;$e.vec3_transformMat2=Wc;$e.vec4_transformMat2=Bc;$e.vec4_transformMat3=Fc;function Ic(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 Cc(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 Wc(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 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[3]=r[3],e}function Fc(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 Aa=S(nt=>{"use strict";var ir=G(),Dc=ee();Object.defineProperty(nt,"__esModule",{value:!0});nt.default=void 0;var zc=ir($()),Yc=ir(J()),Vc=ir(oe()),Uc=ir(ce()),ka=ir(ue()),Gc=ir(Hr()),Jt=ve(),rt=me(),tt=Zc(et()),jc=ar();function Ra(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ra=function(n){return n?t:r})(e)}function Zc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Dc(e)!=="object"&&typeof e!="function")return{default:e};var t=Ra(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 Xc(e){var r=Qc();return function(){var a=(0,ka.default)(e),n;if(r){var i=(0,ka.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Uc.default)(this,n)}}function Qc(){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 $c=function(e){(0,Vc.default)(t,e);var r=Xc(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,zc.default)(this,t),a=r.call(this,2),(0,Jt.isArray)(n)&&arguments.length===1?a.copy(n):(Jt.config.debug&&((0,rt.checkNumber)(n),(0,rt.checkNumber)(i)),a[0]=n,a[1]=i),a}return(0,Yc.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 Jt.config.debug&&((0,rt.checkNumber)(n.x),(0,rt.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 tt.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 tt.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2x3",value:function(n){return tt.transformMat2d(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return tt.transformMat2(this,this,n),this.check()}}]),t}(Gc.default);nt.default=$c});var Le=S(T=>{"use strict";function at(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?at=function(t){return typeof t}:at=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(e)}Object.defineProperty(T,"__esModule",{value:!0});T.create=Sa;T.clone=Hc;T.length=wa;T.fromValues=Kc;T.copy=eu;T.set=ru;T.add=tu;T.subtract=qa;T.multiply=Ea;T.divide=La;T.ceil=nu;T.floor=au;T.min=iu;T.max=su;T.round=ou;T.scale=cu;T.scaleAndAdd=uu;T.distance=Na;T.squaredDistance=Ia;T.squaredLength=Ca;T.negate=lu;T.inverse=fu;T.normalize=hu;T.dot=Wa;T.cross=du;T.lerp=pu;T.hermite=vu;T.bezier=mu;T.random=yu;T.transformMat4=gu;T.transformMat3=Mu;T.transformQuat=xu;T.rotateX=bu;T.rotateY=_u;T.rotateZ=Tu;T.angle=Ou;T.zero=ku;T.str=Ru;T.exactEquals=Au;T.equals=Pu;T.forEach=T.sqrLen=T.len=T.sqrDist=T.dist=T.div=T.mul=T.sub=void 0;var Ae=Jc(Xe());function Pa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Pa=function(n){return n?t:r})(e)}function Jc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||at(e)!=="object"&&typeof e!="function")return{default:e};var t=Pa(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 Sa(){var e=new Ae.ARRAY_TYPE(3);return Ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Hc(e){var r=new Ae.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function wa(e){var r=e[0],t=e[1],a=e[2];return Math.hypot(r,t,a)}function Kc(e,r,t){var a=new Ae.ARRAY_TYPE(3);return a[0]=e,a[1]=r,a[2]=t,a}function eu(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function ru(e,r,t,a){return e[0]=r,e[1]=t,e[2]=a,e}function tu(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function qa(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Ea(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function La(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function nu(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function au(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function iu(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 su(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 ou(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e}function cu(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function uu(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 Na(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 Ia(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 Ca(e){var r=e[0],t=e[1],a=e[2];return r*r+t*t+a*a}function lu(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function fu(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function hu(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 Wa(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function du(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 pu(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 vu(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 mu(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 yu(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 gu(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 Mu(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 xu(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 bu(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 _u(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 Tu(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 Ou(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&&Wa(e,r)/l;return Math.acos(Math.min(Math.max(f,-1),1))}function ku(e){return e[0]=0,e[1]=0,e[2]=0,e}function Ru(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Au(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function Pu(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 Su=qa;T.sub=Su;var wu=Ea;T.mul=wu;var qu=La;T.div=qu;var Eu=Na;T.dist=Eu;var Lu=Ia;T.sqrDist=Lu;var Nu=wa;T.len=Nu;var Iu=Ca;T.sqrLen=Iu;var Cu=function(){var e=Sa();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=Cu});var ot=S(st=>{"use strict";var sr=G(),Wu=ee();Object.defineProperty(st,"__esModule",{value:!0});st.default=void 0;var Bu=sr($()),Fu=sr(J()),Du=sr(oe()),zu=sr(ce()),Ba=sr(ue()),Yu=sr(Hr()),Ht=ve(),Je=me(),Ne=Vu(Le()),Fa=ar();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 Vu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Wu(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 Uu(e){var r=Gu();return function(){var a=(0,Ba.default)(e),n;if(r){var i=(0,Ba.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,zu.default)(this,n)}}function Gu(){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 Kt=[0,0,0],it,ju=function(e){(0,Du.default)(t,e);var r=Uu(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,Bu.default)(this,t),a=r.call(this,-0,-0,-0),arguments.length===1&&(0,Ht.isArray)(n)?a.copy(n):(Ht.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,Fu.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 Ht.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?Kt: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?Kt: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?Kt: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,Fa.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,Fa.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 it||(it=new t(0,0,0),Object.freeze(it)),it}}]),t}(Yu.default);st.default=ju});var rn=S(ut=>{"use strict";var or=G(),Zu=ee();Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var Xu=or($()),Qu=or(J()),$u=or(oe()),Ju=or(ce()),za=or(ue()),Hu=or(Hr()),en=ve(),ye=me(),Ya=Ku(Le()),Va=ar();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 Ku(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Zu(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 el(e){var r=rl();return function(){var a=(0,za.default)(e),n;if(r){var i=(0,za.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Ju.default)(this,n)}}function rl(){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 ct,tl=function(e){(0,$u.default)(t,e);var r=el(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,Xu.default)(this,t),a=r.call(this,-0,-0,-0,-0),(0,en.isArray)(n)&&arguments.length===1?a.copy(n):(en.config.debug&&((0,ye.checkNumber)(n),(0,ye.checkNumber)(i),(0,ye.checkNumber)(s),(0,ye.checkNumber)(o)),a[0]=n,a[1]=i,a[2]=s,a[3]=o),a}return(0,Qu.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 en.config.debug&&((0,ye.checkNumber)(n.x),(0,ye.checkNumber)(n.y),(0,ye.checkNumber)(n.z),(0,ye.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,ye.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,ye.checkNumber)(n)}},{key:"transform",value:function(n){return Ya.transformMat4(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return(0,Va.vec4_transformMat3)(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,Va.vec4_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return Ya.transformQuat(this,this,n),this.check()}},{key:"applyMatrix4",value:function(n){return n.transform(this,this),this}}],[{key:"ZERO",get:function(){return ct||(ct=new t(0,0,0,0),Object.freeze(ct)),ct}}]),t}(Hu.default);ut.default=tl});var tn=S(lt=>{"use strict";var cr=G();Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var nl=cr($()),al=cr(J()),il=cr(oe()),sl=cr(ce()),Ga=cr(ue()),ol=cr(Lr()),cl=me(),ul=ve();function ll(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,sl.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 hl=function(e){(0,il.default)(t,e);var r=ll(t);function t(){return(0,nl.default)(this,t),r.apply(this,arguments)}return(0,al.default)(t,[{key:"toString",value:function(){var n="[";if(ul.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,cl.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}(ol.default);lt.default=hl});var nn=S(q=>{"use strict";function ft(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ft=function(t){return typeof t}:ft=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(e)}Object.defineProperty(q,"__esModule",{value:!0});q.create=pl;q.fromMat4=vl;q.clone=ml;q.copy=yl;q.fromValues=gl;q.set=Ml;q.identity=xl;q.transpose=bl;q.invert=_l;q.adjoint=Tl;q.determinant=Ol;q.multiply=Za;q.translate=kl;q.rotate=Rl;q.scale=Al;q.fromTranslation=Pl;q.fromRotation=Sl;q.fromScaling=wl;q.fromMat2d=ql;q.fromQuat=El;q.normalFromMat4=Ll;q.projection=Nl;q.str=Il;q.frob=Cl;q.add=Wl;q.subtract=Xa;q.multiplyScalar=Bl;q.multiplyScalarAndAdd=Fl;q.exactEquals=Dl;q.equals=zl;q.sub=q.mul=void 0;var re=dl(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 dl(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||ft(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 pl(){var e=new re.ARRAY_TYPE(9);return re.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 vl(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 ml(e){var r=new re.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 yl(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 gl(e,r,t,a,n,i,s,o,c){var u=new re.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 Ml(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 xl(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 bl(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 _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=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 Tl(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 Ol(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],y=t[5],b=t[6],g=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+y*u,e[4]=m*n+v*o+y*l,e[5]=m*i+v*c+y*f,e[6]=b*a+g*s+M*u,e[7]=b*n+g*o+M*l,e[8]=b*i+g*c+M*f,e}function kl(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 Rl(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 Al(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 Pl(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 Sl(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 wl(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 ql(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 El(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,y=i*c;return e[0]=1-f-p,e[3]=l-y,e[6]=h+v,e[1]=l+y,e[4]=1-u-p,e[7]=d-m,e[2]=h-v,e[5]=d+m,e[8]=1-u-f,e}function Ll(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],y=r[15],b=t*o-a*s,g=t*c-n*s,M=t*u-i*s,O=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-f*p,N=l*v-h*p,w=l*y-d*p,W=f*v-h*m,I=f*y-d*m,B=h*y-d*v,P=b*B-g*I+M*W+O*w-_*N+C*L;return P?(P=1/P,e[0]=(o*B-c*I+u*W)*P,e[1]=(c*w-s*B-u*N)*P,e[2]=(s*I-o*w+u*L)*P,e[3]=(n*I-a*B-i*W)*P,e[4]=(t*B-n*w+i*N)*P,e[5]=(a*w-t*I-i*L)*P,e[6]=(m*C-v*_+y*O)*P,e[7]=(v*M-p*C-y*g)*P,e[8]=(p*_-m*M+y*b)*P,e):null}function Nl(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 Il(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Cl(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Wl(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 Xa(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 Bl(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 Fl(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 Dl(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 zl(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],y=r[6],b=r[7],g=r[8];return Math.abs(t-f)<=re.EPSILON*Math.max(1,Math.abs(t),Math.abs(f))&&Math.abs(a-h)<=re.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(n-d)<=re.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=re.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=re.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-v)<=re.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(c-y)<=re.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=re.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-g)<=re.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))}var Yl=Za;q.mul=Yl;var Vl=Xa;q.sub=Vl});var Ja=S(pt=>{"use strict";var ur=G(),Ul=ee();Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var Gl=ur($()),jl=ur(J()),Zl=ur(oe()),Xl=ur(ce()),Qa=ur(ue()),Ql=ur(tn()),$l=me(),Jl=ar(),ge=an(nn()),Hl=an(et()),Kl=an(Le());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 an(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Ul(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 ef(e){var r=rf();return function(){var a=(0,Qa.default)(e),n;if(r){var i=(0,Qa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Xl.default)(this,n)}}function rf(){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.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"})(sn||(sn={}));var tf=Object.freeze([1,0,0,0,1,0,0,0,1]),on=function(e){(0,Zl.default)(t,e);var r=ef(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,Gl.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,jl.default)(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{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.check()}},{key:"identity",value:function(){return this.copy(tf)}},{key:"fromObject",value:function(n){return this.check()}},{key:"fromQuaternion",value:function(n){return ge.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 ge.determinant(this)}},{key:"transpose",value:function(){return ge.transpose(this,this),this.check()}},{key:"invert",value:function(){return ge.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return ge.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return ge.multiply(this,this,n),this.check()}},{key:"rotate",value:function(n){return ge.rotate(this,this,n),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?ge.scale(this,this,n):ge.scale(this,this,[n,n]),this.check()}},{key:"translate",value:function(n){return ge.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){var s;switch(n.length){case 2:s=Hl.transformMat3(i||[-0,-0],n,this);break;case 3:s=Kl.transformMat3(i||[-0,-0,-0],n,this);break;case 4:s=(0,Jl.vec4_transformMat3)(i||[-0,-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,$l.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 af()}},{key:"ZERO",get:function(){return nf()}}]),t}(Ql.default);pt.default=on;var ht,dt;function nf(){return ht||(ht=new on([0,0,0,0,0,0,0,0,0]),Object.freeze(ht)),ht}function af(){return dt||(dt=new on,Object.freeze(dt)),dt}});var si=S(k=>{"use strict";function vt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vt=function(t){return typeof t}:vt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(e)}Object.defineProperty(k,"__esModule",{value:!0});k.create=of;k.clone=cf;k.copy=uf;k.fromValues=lf;k.set=ff;k.identity=Ka;k.transpose=hf;k.invert=df;k.adjoint=pf;k.determinant=vf;k.multiply=ei;k.translate=mf;k.scale=yf;k.rotate=gf;k.rotateX=Mf;k.rotateY=xf;k.rotateZ=bf;k.fromTranslation=_f;k.fromScaling=Tf;k.fromRotation=Of;k.fromXRotation=kf;k.fromYRotation=Rf;k.fromZRotation=Af;k.fromRotationTranslation=ri;k.fromQuat2=Pf;k.getTranslation=Sf;k.getScaling=ti;k.getRotation=wf;k.fromRotationTranslationScale=qf;k.fromRotationTranslationScaleOrigin=Ef;k.fromQuat=Lf;k.frustum=Nf;k.perspectiveNO=ni;k.perspectiveZO=Cf;k.perspectiveFromFieldOfView=Wf;k.orthoNO=ai;k.orthoZO=Ff;k.lookAt=Df;k.targetTo=zf;k.str=Yf;k.frob=Vf;k.add=Uf;k.subtract=ii;k.multiplyScalar=Gf;k.multiplyScalarAndAdd=jf;k.exactEquals=Zf;k.equals=Xf;k.sub=k.mul=k.ortho=k.perspective=void 0;var F=sf(Xe());function Ha(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ha=function(n){return n?t:r})(e)}function sf(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||vt(e)!=="object"&&typeof e!="function")return{default:e};var t=Ha(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 of(){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 cf(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 uf(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 lf(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 ff(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 Ka(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 hf(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 df(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],y=r[15],b=t*o-a*s,g=t*c-n*s,M=t*u-i*s,O=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-f*p,N=l*v-h*p,w=l*y-d*p,W=f*v-h*m,I=f*y-d*m,B=h*y-d*v,P=b*B-g*I+M*W+O*w-_*N+C*L;return P?(P=1/P,e[0]=(o*B-c*I+u*W)*P,e[1]=(n*I-a*B-i*W)*P,e[2]=(m*C-v*_+y*O)*P,e[3]=(h*_-f*C-d*O)*P,e[4]=(c*w-s*B-u*N)*P,e[5]=(t*B-n*w+i*N)*P,e[6]=(v*M-p*C-y*g)*P,e[7]=(l*C-h*M+d*g)*P,e[8]=(s*I-o*w+u*L)*P,e[9]=(a*w-t*I-i*L)*P,e[10]=(p*_-m*M+y*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*g-p*O-v*b)*P,e[15]=(l*O-f*g+h*b)*P,e):null}function pf(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],y=r[15];return e[0]=o*(h*y-d*v)-f*(c*y-u*v)+m*(c*d-u*h),e[1]=-(a*(h*y-d*v)-f*(n*y-i*v)+m*(n*d-i*h)),e[2]=a*(c*y-u*v)-o*(n*y-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*y-d*v)-l*(c*y-u*v)+p*(c*d-u*h)),e[5]=t*(h*y-d*v)-l*(n*y-i*v)+p*(n*d-i*h),e[6]=-(t*(c*y-u*v)-s*(n*y-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*y-d*m)-l*(o*y-u*m)+p*(o*d-u*f),e[9]=-(t*(f*y-d*m)-l*(a*y-i*m)+p*(a*d-i*f)),e[10]=t*(o*y-u*m)-s*(a*y-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 vf(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],y=r*s-t*i,b=r*o-a*i,g=r*c-n*i,M=t*o-a*s,O=t*c-n*s,_=a*c-n*o,C=u*p-l*d,L=u*m-f*d,N=u*v-h*d,w=l*m-f*p,W=l*v-h*p,I=f*v-h*m;return y*I-b*W+g*w+M*N-O*L+_*C}function ei(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],y=r[14],b=r[15],g=t[0],M=t[1],O=t[2],_=t[3];return e[0]=g*a+M*o+O*f+_*m,e[1]=g*n+M*c+O*h+_*v,e[2]=g*i+M*u+O*d+_*y,e[3]=g*s+M*l+O*p+_*b,g=t[4],M=t[5],O=t[6],_=t[7],e[4]=g*a+M*o+O*f+_*m,e[5]=g*n+M*c+O*h+_*v,e[6]=g*i+M*u+O*d+_*y,e[7]=g*s+M*l+O*p+_*b,g=t[8],M=t[9],O=t[10],_=t[11],e[8]=g*a+M*o+O*f+_*m,e[9]=g*n+M*c+O*h+_*v,e[10]=g*i+M*u+O*d+_*y,e[11]=g*s+M*l+O*p+_*b,g=t[12],M=t[13],O=t[14],_=t[15],e[12]=g*a+M*o+O*f+_*m,e[13]=g*n+M*c+O*h+_*v,e[14]=g*i+M*u+O*d+_*y,e[15]=g*s+M*l+O*p+_*b,e}function mf(e,r,t){var a=t[0],n=t[1],i=t[2],s,o,c,u,l,f,h,d,p,m,v,y;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],y=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]=y,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+y*i+r[15]),e}function yf(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 gf(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,y,b,g,M,O,_,C,L,N,w,W,I,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],y=r[6],b=r[7],g=r[8],M=r[9],O=r[10],_=r[11],C=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,I=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*C+m*L+g*N,e[1]=h*C+v*L+M*N,e[2]=d*C+y*L+O*N,e[3]=p*C+b*L+_*N,e[4]=f*w+m*W+g*I,e[5]=h*w+v*W+M*I,e[6]=d*w+y*W+O*I,e[7]=p*w+b*W+_*I,e[8]=f*B+m*P+g*j,e[9]=h*B+v*P+M*j,e[10]=d*B+y*P+O*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 Mf(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 xf(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 bf(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 _f(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 Tf(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 Of(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 kf(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 Rf(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 Af(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 ri(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,y=s*c,b=s*u;return e[0]=1-(d+m),e[1]=f+b,e[2]=h-y,e[3]=0,e[4]=f-b,e[5]=1-(l+m),e[6]=p+v,e[7]=0,e[8]=h+y,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 Pf(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),ri(e,r,t),e}function Sf(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e}function ti(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 wf(e,r){var t=new F.ARRAY_TYPE(3);ti(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 qf(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,y=o*c,b=o*u,g=o*l,M=a[0],O=a[1],_=a[2];return e[0]=(1-(p+v))*M,e[1]=(h+g)*M,e[2]=(d-b)*M,e[3]=0,e[4]=(h-g)*O,e[5]=(1-(f+v))*O,e[6]=(m+y)*O,e[7]=0,e[8]=(d+b)*_,e[9]=(m-y)*_,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 Ef(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,y=o*f,b=c*u,g=c*l,M=c*f,O=a[0],_=a[1],C=a[2],L=n[0],N=n[1],w=n[2],W=(1-(m+y))*O,I=(d+M)*O,B=(p-g)*O,P=(d-M)*_,j=(1-(h+y))*_,he=(v+b)*_,de=(p+g)*C,Ye=(v-b)*C,Ve=(1-(h+m))*C;return e[0]=W,e[1]=I,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]=Ve,e[11]=0,e[12]=t[0]+L-(W*L+P*N+de*w),e[13]=t[1]+N-(I*L+j*N+Ye*w),e[14]=t[2]+w-(B*L+he*N+Ve*w),e[15]=1,e}function Lf(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,y=i*c;return e[0]=1-f-p,e[1]=l+y,e[2]=h-v,e[3]=0,e[4]=l-y,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 Nf(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 ni(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 If=ni;k.perspective=If;function Cf(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 Wf(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 ai(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 Bf=ai;k.ortho=Bf;function Ff(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 Df(e,r,t,a){var n,i,s,o,c,u,l,f,h,d,p=r[0],m=r[1],v=r[2],y=a[0],b=a[1],g=a[2],M=t[0],O=t[1],_=t[2];return Math.abs(p-M)<F.EPSILON&&Math.abs(m-O)<F.EPSILON&&Math.abs(v-_)<F.EPSILON?Ka(e):(l=p-M,f=m-O,h=v-_,d=1/Math.hypot(l,f,h),l*=d,f*=d,h*=d,n=b*h-g*f,i=g*l-y*h,s=y*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 zf(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 Yf(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 Vf(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 Uf(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 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[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 Gf(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 jf(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 Zf(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 Xf(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],y=e[15],b=r[0],g=r[1],M=r[2],O=r[3],_=r[4],C=r[5],L=r[6],N=r[7],w=r[8],W=r[9],I=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-g)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(n-M)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(M))&&Math.abs(i-O)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(s-_)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-C)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(C))&&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-I)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(I))&&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(y-de)<=F.EPSILON*Math.max(1,Math.abs(y),Math.abs(de))}var Qf=ei;k.mul=Qf;var $f=ii;k.sub=$f});var yt=S(A=>{"use strict";function mt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mt=function(t){return typeof t}:mt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(e)}Object.defineProperty(A,"__esModule",{value:!0});A.create=ci;A.clone=Hf;A.fromValues=Kf;A.copy=eh;A.set=rh;A.add=th;A.subtract=ui;A.multiply=li;A.divide=fi;A.ceil=nh;A.floor=ah;A.min=ih;A.max=sh;A.round=oh;A.scale=ch;A.scaleAndAdd=uh;A.distance=hi;A.squaredDistance=di;A.length=pi;A.squaredLength=vi;A.negate=lh;A.inverse=fh;A.normalize=hh;A.dot=dh;A.cross=ph;A.lerp=vh;A.random=mh;A.transformMat4=yh;A.transformQuat=gh;A.zero=Mh;A.str=xh;A.exactEquals=bh;A.equals=_h;A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var ie=Jf(Xe());function oi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(oi=function(n){return n?t:r})(e)}function Jf(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||mt(e)!=="object"&&typeof e!="function")return{default:e};var t=oi(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 ci(){var e=new ie.ARRAY_TYPE(4);return ie.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Hf(e){var r=new ie.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function Kf(e,r,t,a){var n=new ie.ARRAY_TYPE(4);return n[0]=e,n[1]=r,n[2]=t,n[3]=a,n}function eh(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function rh(e,r,t,a,n){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e}function th(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 ui(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 li(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 nh(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 ah(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 ih(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 sh(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 oh(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 ch(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 uh(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 hi(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 di(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 pi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return Math.hypot(r,t,a,n)}function vi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return r*r+t*t+a*a+n*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){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e[3]=1/r[3],e}function hh(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 dh(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function ph(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 vh(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 mh(e,r){r=r||1;var t,a,n,i,s,o;do t=ie.RANDOM()*2-1,a=ie.RANDOM()*2-1,s=t*t+a*a;while(s>=1);do n=ie.RANDOM()*2-1,i=ie.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 yh(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 gh(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 Mh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function xh(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function bh(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function _h(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)<=ie.EPSILON*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(a-o)<=ie.EPSILON*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(n-c)<=ie.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=ie.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var Th=ui;A.sub=Th;var Oh=li;A.mul=Oh;var kh=fi;A.div=kh;var Rh=hi;A.dist=Rh;var Ah=di;A.sqrDist=Ah;var Ph=pi;A.len=Ph;var Sh=vi;A.sqrLen=Sh;var wh=function(){var e=ci();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=wh});var dn=S(bt=>{"use strict";var lr=G(),qh=ee();Object.defineProperty(bt,"__esModule",{value:!0});bt.default=void 0;var Eh=lr($()),Lh=lr(J()),Nh=lr(oe()),Ih=lr(ce()),mi=lr(ue()),Ch=lr(tn()),cn=me(),yi=ar(),Z=gt(si()),Wh=gt(et()),Bh=gt(Le()),Fh=gt(yt());function gi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(gi=function(n){return n?t:r})(e)}function gt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||qh(e)!=="object"&&typeof e!="function")return{default:e};var t=gi(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 Dh(e){var r=zh();return function(){var a=(0,mi.default)(e),n;if(r){var i=(0,mi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Ih.default)(this,n)}}function zh(){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 un;(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"})(un||(un={}));var Yh=45*Math.PI/180,Vh=1,ln=.1,fn=500,Uh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),hn=function(e){(0,Nh.default)(t,e);var r=Dh(t);function t(a){var n;return(0,Eh.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,Lh.default)(t,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return un}},{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,y,b,g){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]=y,this[14]=b,this[15]=g,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,f,h,d,p,m,v,y,b,g){return this[0]=n,this[1]=c,this[2]=h,this[3]=v,this[4]=i,this[5]=u,this[6]=d,this[7]=y,this[8]=s,this[9]=l,this[10]=p,this[11]=b,this[12]=o,this[13]=f,this[14]=m,this[15]=g,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(Uh)}},{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?ln:u,f=n.far,h=f===void 0?fn:f;return h===1/0?Zh(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?ln:u,f=n.far,h=f===void 0?fn: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?Yh:i,o=n.aspect,c=o===void 0?Vh:o,u=n.focalDistance,l=u===void 0?1:u,f=n.near,h=f===void 0?ln:f,d=n.far,p=d===void 0?fn:d;Mi(s);var m=s/2,v=l*Math.tan(m),y=v*c;return this.ortho({left:-y,right:y,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 Mi(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=Fh.transformMat4(i||[-0,-0,-0,-0],n,this),(0,cn.checkVector)(i,4),i):this.transformAsPoint(n,i)}},{key:"transformAsPoint",value:function(n,i){var s=n.length,o;switch(s){case 2:o=Wh.transformMat4(i||[-0,-0],n,this);break;case 3:o=Bh.transformMat4(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,cn.checkVector)(o,n.length),o}},{key:"transformAsVector",value:function(n,i){var s;switch(n.length){case 2:s=(0,yi.vec2_transformMat4AsVector)(i||[-0,-0],n,this);break;case 3:s=(0,yi.vec3_transformMat4AsVector)(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,cn.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 jh()}},{key:"ZERO",get:function(){return Gh()}}]),t}(Ch.default);bt.default=hn;var Mt,xt;function Gh(){return Mt||(Mt=new hn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Mt)),Mt}function jh(){return xt||(xt=new hn,Object.freeze(xt)),xt}function Mi(e){if(e>Math.PI*2)throw Error("expected radians")}function Zh(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 wi=S(x=>{"use strict";function _t(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_t=function(t){return typeof t}:_t=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(e)}Object.defineProperty(x,"__esModule",{value:!0});x.create=pn;x.identity=Qh;x.setAxisAngle=bi;x.getAxisAngle=$h;x.getAngle=Jh;x.multiply=_i;x.rotateX=Hh;x.rotateY=Kh;x.rotateZ=e0;x.calculateW=r0;x.exp=Ti;x.ln=Oi;x.pow=t0;x.slerp=Ot;x.random=n0;x.invert=a0;x.conjugate=i0;x.fromMat3=ki;x.fromEuler=s0;x.str=o0;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=Tt(Xe()),Xh=Tt(nn()),Pe=Tt(Le()),te=Tt(yt());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 Tt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||_t(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 pn(){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 Qh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function bi(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 $h(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 Jh(e,r){var t=Ai(e,r);return Math.acos(2*t*t-1)}function _i(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 Hh(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 Kh(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 e0(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 r0(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 Ti(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 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=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 t0(e,r,t){return Oi(e,r),Ri(e,e,t),Ti(e,e),e}function Ot(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 n0(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 a0(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 i0(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function ki(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 s0(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 o0(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var c0=te.clone;x.clone=c0;var u0=te.fromValues;x.fromValues=u0;var l0=te.copy;x.copy=l0;var f0=te.set;x.set=f0;var h0=te.add;x.add=h0;var d0=_i;x.mul=d0;var Ri=te.scale;x.scale=Ri;var Ai=te.dot;x.dot=Ai;var p0=te.lerp;x.lerp=p0;var Pi=te.length;x.length=Pi;var v0=Pi;x.len=v0;var Si=te.squaredLength;x.squaredLength=Si;var m0=Si;x.sqrLen=m0;var vn=te.normalize;x.normalize=vn;var y0=te.exactEquals;x.exactEquals=y0;var g0=te.equals;x.equals=g0;var M0=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),bi(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,vn(a,a))}}();x.rotationTo=M0;var x0=function(){var e=pn(),r=pn();return function(t,a,n,i,s,o){return Ot(e,a,s,o),Ot(r,n,i,o),Ot(t,e,r,2*o*(1-o)),t}}();x.sqlerp=x0;var b0=function(){var e=Xh.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],vn(r,ki(r,e))}}();x.setAxes=b0});var mn=S(kt=>{"use strict";var Ke=G(),_0=ee();Object.defineProperty(kt,"__esModule",{value:!0});kt.default=void 0;var T0=Ke($()),O0=Ke(J()),k0=Ke(oe()),R0=Ke(ce()),qi=Ke(ue()),A0=Ke(Lr()),Ir=me(),P0=Ke(rn()),V=Li(wi()),S0=Li(yt());function Ei(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ei=function(n){return n?t:r})(e)}function Li(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||_0(e)!=="object"&&typeof e!="function")return{default:e};var t=Ei(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 w0(e){var r=q0();return function(){var a=(0,qi.default)(e),n;if(r){var i=(0,qi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,R0.default)(this,n)}}function q0(){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 E0=[0,0,0,1],L0=function(e){(0,k0.default)(t,e);var r=w0(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,T0.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,O0.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 V.fromMat3(this,n),this.check()}},{key:"fromAxisRotation",value:function(n,i){return V.setAxisAngle(this,n,i),this.check()}},{key:"identity",value:function(){return V.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,Ir.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,Ir.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,Ir.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,Ir.checkNumber)(n)}},{key:"len",value:function(){return V.length(this)}},{key:"lengthSquared",value:function(){return V.squaredLength(this)}},{key:"dot",value:function(n){return V.dot(this,n)}},{key:"rotationTo",value:function(n,i){return V.rotationTo(this,n,i),this.check()}},{key:"add",value:function(n){return V.add(this,this,n),this.check()}},{key:"calculateW",value:function(){return V.calculateW(this,this),this.check()}},{key:"conjugate",value:function(){return V.conjugate(this,this),this.check()}},{key:"invert",value:function(){return V.invert(this,this),this.check()}},{key:"lerp",value:function(n,i,s){return s===void 0?this.lerp(this,n,i):(V.lerp(this,n,i,s),this.check())}},{key:"multiplyRight",value:function(n){return V.multiply(this,this,n),this.check()}},{key:"multiplyLeft",value:function(n){return V.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 V.rotateX(this,this,n),this.check()}},{key:"rotateY",value:function(n){return V.rotateY(this,this,n),this.check()}},{key:"rotateZ",value:function(n){return V.rotateZ(this,this,n),this.check()}},{key:"scale",value:function(n){return V.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?E0: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 V.slerp(this,o,c,u),this.check()}},{key:"transformVector4",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new P0.default;return S0.transformQuat(i,n,this),(0,Ir.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}(A0.default);kt.default=L0});var Ni=S((kp,Cr)=>{function N0(e){if(Array.isArray(e))return e}Cr.exports=N0,Cr.exports.__esModule=!0,Cr.exports.default=Cr.exports});var Ii=S((Rp,Wr)=>{function I0(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a,n,i,s,o=[],c=!0,u=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(a=i.call(t)).done)&&(o.push(a.value),o.length!==r);c=!0);}catch(l){u=!0,n=l}finally{try{if(!c&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}Wr.exports=I0,Wr.exports.__esModule=!0,Wr.exports.default=Wr.exports});var Ci=S((Ap,Br)=>{function C0(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}Br.exports=C0,Br.exports.__esModule=!0,Br.exports.default=Br.exports});var Bi=S((Pp,Fr)=>{var Wi=Ci();function W0(e,r){if(!!e){if(typeof e=="string")return Wi(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 Wi(e,r)}}Fr.exports=W0,Fr.exports.__esModule=!0,Fr.exports.default=Fr.exports});var Fi=S((Sp,Dr)=>{function B0(){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.`)}Dr.exports=B0,Dr.exports.__esModule=!0,Dr.exports.default=Dr.exports});var Rt=S((wp,zr)=>{var F0=Ni(),D0=Ii(),z0=Bi(),Y0=Fi();function V0(e,r){return F0(e)||D0(e,r)||z0(e,r)||Y0()}zr.exports=V0,zr.exports.__esModule=!0,zr.exports.default=zr.exports});var At=S((qp,Yr)=>{var U0=Zt();function G0(e,r,t){return r=U0(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}Yr.exports=G0,Yr.exports.__esModule=!0,Yr.exports.default=Yr.exports});var Yi=S(St=>{"use strict";var Vr=G(),j0=ee();Object.defineProperty(St,"__esModule",{value:!0});St.default=void 0;var Z0=Vr(Rt()),X0=Vr($()),Q0=Vr(J()),Pt=Vr(At()),$0=Vr(ot()),X=ve(),J0=H0(Le());function Di(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Di=function(n){return n?t:r})(e)}function H0(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||j0(e)!=="object"&&typeof e!="function")return{default:e};var t=Di(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 zi=1e-6,K0=6371e3,e1=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?K0:f;(0,X0.default)(this,e),(0,Pt.default)(this,"phi",void 0),(0,Pt.default)(this,"theta",void 0),(0,Pt.default)(this,"radius",void 0),(0,Pt.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,Q0.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,Z0.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=J0.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 $0.default(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(zi,Math.min(Math.PI-zi,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}();St.default=e1});var yn=S(qt=>{"use strict";var Ie=G();Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var r1=Ie(Rt()),t1=Ie($()),n1=Ie(J()),a1=Ie(oe()),i1=Ie(ce()),Vi=Ie(ue()),s1=Ie(Lr()),Ui=Ie(mn()),fr=ve(),se=me();function o1(e){var r=c1();return function(){var a=(0,Vi.default)(e),n;if(r){var i=(0,Vi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,i1.default)(this,n)}}function c1(){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 wt="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 u1=function(e){(0,a1.default)(t,e);var r=o1(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,t1.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,n1.default)(t,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(n){var i=(0,r1.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),y=Math.asin(d),b=Math.atan2(h,f);return this.set(v,y,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 l1(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,se.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"alpha",get:function(){return this[0]},set:function(n){this[0]=(0,se.checkNumber)(n)}},{key:"beta",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"gamma",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"phi",get:function(){return this[0]},set:function(n){this[0]=(0,se.checkNumber)(n)}},{key:"theta",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"psi",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"roll",get:function(){return this[0]},set:function(n){this[0]=(0,se.checkNumber)(n)}},{key:"pitch",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"yaw",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"order",get:function(){return this[3]},set:function(n){this[3]=f1(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 Ui.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(wt)}}},{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(wt)}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,y=h*f,b=h*p;i[0]=l*f,i[4]=-l*p,i[8]=d,i[1]=v+y*d,i[5]=m-b*d,i[9]=-h*l,i[2]=b-m*d,i[6]=y+v*d,i[10]=u*l;break}case t.YXZ:{var g=l*f,M=l*p,O=d*f,_=d*p;i[0]=g+_*h,i[4]=O*h-M,i[8]=u*d,i[1]=u*p,i[5]=u*f,i[9]=-h,i[2]=M*h-O,i[6]=_+g*h,i[10]=u*l;break}case t.ZXY:{var C=l*f,L=l*p,N=d*f,w=d*p;i[0]=C-w*h,i[4]=-u*p,i[8]=N+L*h,i[1]=L+N*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 W=u*f,I=u*p,B=h*f,P=h*p;i[0]=l*f,i[4]=B*d-I,i[8]=W*d+P,i[1]=l*p,i[5]=P*d+W,i[9]=I*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 Ve=u*l,In=u*d,Cn=h*l,Wn=h*d;i[0]=l*f,i[4]=-p,i[8]=d*f,i[1]=Ve*p+Wn,i[5]=u*f,i[9]=In*p-Cn,i[2]=Cn*p-In,i[6]=h*f,i[10]=Wn*p+Ve;break}default:throw new Error(wt)}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 Ui.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}(s1.default);qt.default=u1;function l1(e){return e>=0&&e<6}function f1(e){if(e<0&&e>=6)throw new Error(wt);return e}});var Zi=S(Et=>{"use strict";var dr=G();Object.defineProperty(Et,"__esModule",{value:!0});Et.default=void 0;var h1=dr($()),d1=dr(J()),Gi=dr(At()),gn=dr(dn()),ji=dr(ot()),Mn=dr(yn()),p1=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,h1.default)(this,e),(0,Gi.default)(this,"position",void 0),(0,Gi.default)(this,"orientation",void 0),Array.isArray(p)&&p.length===3?this.position=new ji.default(p):this.position=new ji.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,d1.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 gn.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 gn.default().multiplyRight(this.getTransformationMatrix()).multiplyRight(t.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(t){return new gn.default().multiplyRight(t.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}}]),e}();Et.default=p1});var Xi=S(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.default=void 0;var v1={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=v1});var pr=S(E=>{"use strict";var le=G();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"Vector2",{enumerable:!0,get:function(){return m1.default}});Object.defineProperty(E,"Vector3",{enumerable:!0,get:function(){return y1.default}});Object.defineProperty(E,"Vector4",{enumerable:!0,get:function(){return g1.default}});Object.defineProperty(E,"Matrix3",{enumerable:!0,get:function(){return M1.default}});Object.defineProperty(E,"Matrix4",{enumerable:!0,get:function(){return x1.default}});Object.defineProperty(E,"Quaternion",{enumerable:!0,get:function(){return b1.default}});Object.defineProperty(E,"SphericalCoordinates",{enumerable:!0,get:function(){return Qi.default}});Object.defineProperty(E,"_SphericalCoordinates",{enumerable:!0,get:function(){return Qi.default}});Object.defineProperty(E,"Pose",{enumerable:!0,get:function(){return $i.default}});Object.defineProperty(E,"_Pose",{enumerable:!0,get:function(){return $i.default}});Object.defineProperty(E,"Euler",{enumerable:!0,get:function(){return Ji.default}});Object.defineProperty(E,"_Euler",{enumerable:!0,get:function(){return Ji.default}});Object.defineProperty(E,"_MathUtils",{enumerable:!0,get:function(){return _1.default}});Object.defineProperty(E,"assert",{enumerable:!0,get:function(){return T1.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 m1=le(Aa()),y1=le(ot()),g1=le(rn()),M1=le(Ja()),x1=le(dn()),b1=le(mn()),Qi=le(Yi()),$i=le(Zi()),Ji=le(yn()),_1=le(Xi()),T1=le(Qr()),Y=ve()});var Tn=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 Ce=6378137;xe.WGS84_RADIUS_X=Ce;var We=6378137;xe.WGS84_RADIUS_Y=We;var Be=6356752314245179e-9;xe.WGS84_RADIUS_Z=Be;var S1={radii:[Ce,We,Be],radiiSquared:[Ce*Ce,We*We,Be*Be],oneOverRadii:[1/Ce,1/We,1/Be],oneOverRadiiSquared:[1/(Ce*Ce),1/(We*We),1/(Be*Be)],maximumRadius:Math.max(Ce,We,Be),centerToleranceSquared:.1};xe.WGS84_CONSTANTS=S1});var Rn=S(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.fromCartographic=On;we.fromCartographicToRadians=q1;we.fromCartographicToDegrees=E1;we.toCartographic=kn;we.toCartographicFromRadians=L1;we.toCartographicFromDegrees=N1;we.isWGS84=I1;var Se=pr(),Hi=Tn();function vr(e){return e}var w1=new Se.Vector3;function On(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 q1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return On(e,r,Se.config._cartographicRadians?vr:Se.toRadians)}function E1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return On(e,r,Se.config._cartographicRadians?Se.toDegrees:vr)}function kn(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 L1(e,r){return kn(e,r,Se.config._cartographicRadians?vr:Se.toDegrees)}function N1(e,r){return kn(e,r,Se.config._cartographicRadians?Se.toRadians:vr)}function I1(e){if(!e)return!1;w1.from(e);var r=Hi.WGS84_CONSTANTS.oneOverRadiiSquared,t=Hi.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 Ki=S(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.default=B1;var Nt=pr(),mr=new Nt.Vector3,C1=new Nt.Vector3,W1=new Nt.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 y=C1;if(y.copy(e).scale(v),m<i)return y.to(t);var b=n.x,g=n.y,M=n.z,O=W1;O.set(y.x*b*2,y.y*g*2,y.z*M*2);var _=(1-v)*mr.len()/(.5*O.len()),C=0,L,N,w,W;do{_-=C,L=1/(1+_*b),N=1/(1+_*g),w=1/(1+_*M);var I=L*L,B=N*N,P=w*w,j=I*L,he=B*N,de=P*w;W=h*I+d*B+p*P-1;var Ye=h*j*b+d*he*g+p*de*M,Ve=-2*Ye;C=W/Ve}while(Math.abs(W)>Nt._MathUtils.EPSILON12);return mr.scale([L,N,w]).to(t)}}});var ts=S(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.default=V1;var ne=pr(),es=1e-14,F1=new ne.Vector3,rs={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"}},Pn={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 ne.Vector3,north:new ne.Vector3,up:new ne.Vector3,west:new ne.Vector3,south:new ne.Vector3,down:new ne.Vector3},D1=new ne.Vector3,z1=new ne.Vector3,Y1=new ne.Vector3;function V1(e,r,t,a,n,i){var s=rs[r]&&rs[r][t];(0,ne.assert)(s&&(!a||a===s));var o,c,u,l=F1.copy(n),f=(0,ne.equals)(l.x,0,es)&&(0,ne.equals)(l.y,0,es);if(f){var h=Math.sign(l.z);o=D1.fromArray(Pn[r]),r!=="east"&&r!=="west"&&o.scale(h),c=z1.fromArray(Pn[t]),t!=="east"&&t!=="west"&&c.scale(h),u=Y1.fromArray(Pn[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,y=qe.west,b=qe.south;v.copy(d).scale(-1),y.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 cs=S(Wt=>{"use strict";var yr=G(),U1=ee();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.default=void 0;var G1=yr(Rt()),j1=yr($()),Z1=yr(J()),be=yr(At()),z=pr(),ns=Q1(Le()),wn=Tn(),as=Rn(),X1=yr(Ki()),is=yr(ts());function ss(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ss=function(n){return n?t:r})(e)}function Q1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||U1(e)!=="object"&&typeof e!="function")return{default:e};var t=ss(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 It=new z.Vector3,os=new z.Vector3,$1=new z.Vector3,fe=new z.Vector3,J1=new z.Vector3,Ct=new z.Vector3,qn=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,j1.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,Z1.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=os,i=$1,s=(0,G1.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];Ct.from(t);var n=this.scaleToGeodeticSurface(Ct,fe);if(!!n){var i=this.geodeticSurfaceNormal(n,os),s=J1;s.copy(Ct).subtract(n);var o=Math.atan2(i.y,i.x),c=Math.asin(i.z),u=Math.sign(ns.dot(s,Ct))*ns.length(s);return(0,as.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,is.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,is.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 It.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,as.fromCartographicToRadians)(t),i=n[0],s=n[1],o=Math.cos(s);return It.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),It.to(a)}},{key:"geodeticSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return It.from(t).scale(this.oneOverRadiiSquared).normalize().to(a)}},{key:"scaleToGeodeticSurface",value:function(t,a){return(0,X1.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}();Wt.default=qn;(0,be.default)(qn,"WGS84",new qn(wn.WGS84_RADIUS_X,wn.WGS84_RADIUS_Y,wn.WGS84_RADIUS_Z))});var us=S(Bt=>{"use strict";var H1=G();Object.defineProperty(Bt,"__esModule",{value:!0});Object.defineProperty(Bt,"Ellipsoid",{enumerable:!0,get:function(){return K1.default}});Object.defineProperty(Bt,"isWGS84",{enumerable:!0,get:function(){return ed.isWGS84}});var K1=H1(cs()),ed=Rn()});function Dt(e,r=!0,t){let a=t||new Set;if(e){if(Vn(e))a.add(e);else if(Vn(e.buffer))a.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)Dt(e[n],r,a)}}return t===void 0?Array.from(a):[]}function Vn(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 zt=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=zt.get(r);t||(t=n=>{if(!As(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=zt.get(r);zt.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=Dt(t),i=Ue();i?i.postMessage(a,n):globalThis.postMessage(a,n)}};function As(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 Ps=0,jr,Un;function Yt(e,r){if(!K.inWorkerThread())return;let t={process:Ss};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");jr=new Gr,Un=n.options||{};let s=r(jr,Un,t);for await(let o of s)K.postMessage("output-batch",{result:o});K.postMessage("done",{});break;case"input-batch":jr.push(n.input);break;case"input-done":jr.close();break;default:}}catch(i){let s=i instanceof Error?i.message:"";K.postMessage("error",{error:s})}}}function Ss(e,r={}){return new Promise((t,a)=>{let n=Ps++,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 Vt(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 Ut(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 rr(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 Zr(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 tr(e,r,t,a){let i=new TextEncoder().encode(t);return r=Zr(e,r,i,a),r}function Xr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}var Gn="4.0.0-alpha.6";function jn(e){return!Ls(e,"ftyp",4)||(e[8]&96)==0?null:ws(e)}function ws(e){switch(qs(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function qs(e,r,t){return String.fromCharCode(...e.slice(r,t))}function Es(e){return[...e].map(r=>r.charCodeAt(0))}function Ls(e,r,t=0){let a=Es(r);for(let n=0;n<a.length;++n)if(a[n]!==e[n+t])return!1;return!0}var pe=!1,xr=!0;function Gt(e){let r=br(e);return Is(r)||Bs(r)||Cs(r)||Ws(r)||Ns(r)}function Ns(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=jn(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function Is(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 Cs(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 Ws(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 Bs(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}=Fs(),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 Fs(){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 Ge(e,r){if(!e)throw new Error(r||"assert failed: gltf")}var Zn=["SCALAR","VEC2","VEC3","VEC4"],Ds=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],zs=new Map(Ds),Ys={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Vs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Us={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Xn(e){return Zn[e-1]||Zn[0]}function Qn(e){let r=zs.get(e.constructor);if(!r)throw new Error("Illegal typed array");return r}function $n(e,r){let t=Us[e.componentType],a=Ys[e.type],n=Vs[e.componentType],i=e.count*a,s=e.count*a*n;return Ge(s>=0&&s<=r.byteLength),{ArrayType:t,length:i,byteLength:s}}var Gs={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},_r=class{constructor(r){this.gltf=r||{json:Q({},Gs),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||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}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];Ge(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}=$n(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 Ge(t),this.json.extensions=this.json.extensions||{},this.json.extensions[r]=t,this.registerUsedExtension(r),t}addRequiredExtension(r,t={}){return Ge(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){if(!this.getExtension(r))return;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],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);let t=this.json.extensionsRemoved;t.includes(r)||t.push(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;Ge(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:Xn(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:Qn(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=Vt(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,k1=1313821514,R1=5130562,Me=!0;function xn(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,k1,Me)),t+=8;let f=JSON.stringify(s);if(t=tr(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,R1,Me)),t+=8,t=Zr(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 bn(e,r,t,a){return A1(e),xn(e,r,t,a)}function A1(e,{firstBuffer:r=0}={}){if(e.buffers&&e.buffers.length>r)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var _n={name:"glTF",id:"gltf",module:"gltf",version:Gn,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:P1,options:{gltf:{}}};function P1(e,r={}){let{byteOffset:t=0}=r,a=bn(e,null,t,r),n=new ArrayBuffer(a),i=new DataView(n);return bn(e,i,t,r),n}var ls="4.0.0-alpha.6";var gr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},ev=Object.keys(gr),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 fs(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 hs(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=tr(r,t,o,8),i&&(t=tr(r,t,c,8));let h=e.gltfEncoded;return h&&(t=Mr(r,t,h,h.byteLength)),ze(r,f,t-f),t}function ds(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+=rr(r,t,u,l),t+=rr(r,t,s,o),ze(r,f,t-f),t}var rd={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function ps(e,r,t,a){let{featureTableJson:n=rd}=e,i=JSON.stringify(n);i=Ut(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+=rr(r,t,i,s),t+=Mr(r,t,o,c),ze(r,u,t-u),t}function En(e,r){let t=Ln(e,null,0,r),a=new ArrayBuffer(t),n=new DataView(a);return Ln(e,n,0,r),a}function Ln(e,r,t,a){switch(Ee(typeof e.type=="string"),e.type){case gr.COMPOSITE:return fs(e,r,t,a,Ln);case gr.POINT_CLOUD:return ps(e,r,t,a);case gr.BATCHED_3D_MODEL:return hs(e,r,t,a);case gr.INSTANCED_3D_MODEL:return ds(e,r,t,a);default:throw new Error("3D Tiles: unknown tile type")}}var Nn={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:ls,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:td,binary:!0,options:{["3d-tiles"]:{}}};function td(e,r){return En(e,r)}var er=Yn(pr()),ms=Yn(us());function vs(e,r){let t=new Float32Array(e.length),a=ad(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=nd([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 nd(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function ad(e){let r=65535,t=[];for(let a=0;a<e.length;a++)t[a]=e[a]/r;return t}var id=new er.Matrix4([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ys=new er.Vector3,Ft=class{async convert(r,t=null){let a=await this.buildGltf(r,t);return Xr({gltfEncoded:new Uint8Array(a),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},Nn)}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=vs(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 y=o||this._generateSynteticIndices(v.length/m.size),b=f.addMesh({attributes:s,indices:y,material:p,mode:4}),g=this._generateTransformMatrix(c),M=f.addNode({meshIndex:b,matrix:g}),O=f.addScene({nodeIndices:[M]});return f.setDefaultScene(O),f.createBinaryChunk(),Xr(f.gltf,_n)}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);ms.Ellipsoid.WGS84.cartographicToCartesian(u,ys),u=ys.subtract(c),i.set(u,s)}return i}_generateTransformMatrix(r){return new er.Matrix4().translate(r).multiplyLeft(id)}_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=zn(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 sd=new Ft;Yt(async(e,r={})=>sd.convert(e,r.featureAttributes));
|
|
1
|
+
var Ms=Object.create;var Gr=Object.defineProperty,xs=Object.defineProperties,bs=Object.getOwnPropertyDescriptor,_s=Object.getOwnPropertyDescriptors,Ts=Object.getOwnPropertyNames,Wn=Object.getOwnPropertySymbols,Os=Object.getPrototypeOf,Bn=Object.prototype.hasOwnProperty,ks=Object.prototype.propertyIsEnumerable;var Fn=(e,r,t)=>r in e?Gr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ne=(e,r)=>{for(var t in r||(r={}))Bn.call(r,t)&&Fn(e,t,r[t]);if(Wn)for(var t of Wn(r))ks.call(r,t)&&Fn(e,t,r[t]);return e},Dn=(e,r)=>xs(e,_s(r)),Rs=e=>Gr(e,"__esModule",{value:!0});var S=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var As=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ts(r))!Bn.call(e,a)&&a!=="default"&&Gr(e,a,{get:()=>r[a],enumerable:!(t=bs(r,a))||t.enumerable});return e},zn=e=>As(Rs(Gr(e!=null?Ms(Os(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var V=S((Qd,_r)=>{function Zs(e){return e&&e.__esModule?e:{default:e}}_r.exports=Zs,_r.exports.__esModule=!0,_r.exports.default=_r.exports});var K=S(($d,Te)=>{function jt(e){return Te.exports=jt=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},Te.exports.__esModule=!0,Te.exports.default=Te.exports,jt(e)}Te.exports=jt,Te.exports.__esModule=!0,Te.exports.default=Te.exports});var Q=S((Jd,Tr)=>{function Xs(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Tr.exports=Xs,Tr.exports.__esModule=!0,Tr.exports.default=Tr.exports});var Jn=S((Hd,Or)=>{var $n=K().default;function Qs(e,r){if($n(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var a=t.call(e,r||"default");if($n(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}Or.exports=Qs,Or.exports.__esModule=!0,Or.exports.default=Or.exports});var Zt=S((Kd,kr)=>{var $s=K().default,Js=Jn();function Hs(e){var r=Js(e,"string");return $s(r)==="symbol"?r:String(r)}kr.exports=Hs,kr.exports.__esModule=!0,kr.exports.default=kr.exports});var $=S((ep,Rr)=>{var Ks=Zt();function Hn(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,Ks(a.key),a)}}function eo(e,r,t){return r&&Hn(e.prototype,r),t&&Hn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Rr.exports=eo,Rr.exports.__esModule=!0,Rr.exports.default=Rr.exports});var Kn=S((rp,Oe)=>{function Xt(e,r){return Oe.exports=Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},Oe.exports.__esModule=!0,Oe.exports.default=Oe.exports,Xt(e,r)}Oe.exports=Xt,Oe.exports.__esModule=!0,Oe.exports.default=Oe.exports});var oe=S((tp,Ar)=>{var ro=Kn();function to(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&&ro(e,r)}Ar.exports=to,Ar.exports.__esModule=!0,Ar.exports.default=Ar.exports});var ea=S((np,Pr)=>{function no(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Pr.exports=no,Pr.exports.__esModule=!0,Pr.exports.default=Pr.exports});var ce=S((ap,Sr)=>{var ao=K().default,io=ea();function so(e,r){if(r&&(ao(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return io(e)}Sr.exports=so,Sr.exports.__esModule=!0,Sr.exports.default=Sr.exports});var ue=S((ip,ke)=>{function Qt(e){return ke.exports=Qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ke.exports.__esModule=!0,ke.exports.default=ke.exports,Qt(e)}ke.exports=Qt,ke.exports.__esModule=!0,ke.exports.default=ke.exports});var Qr=S($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.default=oo;function oo(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}});var ve=S(D=>{"use strict";var ra=V();Object.defineProperty(D,"__esModule",{value:!0});D.configure=fo;D.formatValue=ho;D.isArray=je;D.clone=po;D.toRadians=vo;D.toDegrees=mo;D.radians=na;D.degrees=aa;D.sin=yo;D.cos=go;D.tan=Mo;D.asin=xo;D.acos=bo;D.atan=_o;D.clamp=To;D.lerp=ia;D.equals=sa;D.exactEquals=oa;D.withEpsilon=Oo;D.config=void 0;var ta=ra(K()),co=ra(Qr()),uo=1/Math.PI*180,lo=1/180*Math.PI,J={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};D.config=J;function fo(e){for(var r in e)(0,co.default)(r in J),J[r]=e[r];return J}function ho(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.precision,a=t===void 0?J.precision:t;return e=ko(e),"".concat(parseFloat(e.toPrecision(a)))}function je(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function po(e){return"clone"in e?e.clone():e.slice()}function vo(e){return na(e)}function mo(e){return aa(e)}function na(e,r){return Re(e,function(t){return t*lo},r)}function aa(e,r){return Re(e,function(t){return t*uo},r)}function yo(e,r){return Re(e,function(t){return Math.sin(t)},r)}function go(e,r){return Re(e,function(t){return Math.cos(t)},r)}function Mo(e,r){return Re(e,function(t){return Math.tan(t)},r)}function xo(e,r){return Re(e,function(t){return Math.asin(t)},r)}function bo(e,r){return Re(e,function(t){return Math.acos(t)},r)}function _o(e,r){return Re(e,function(t){return Math.atan(t)},r)}function To(e,r,t){return Re(e,function(a){return Math.max(r,Math.min(t,a))})}function ia(e,r,t){return je(e)?e.map(function(a,n){return ia(a,r[n],t)}):t*r+(1-t)*e}function sa(e,r,t){var a=J.EPSILON;t&&(J.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(!sa(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)<=J.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{J.EPSILON=a}}function oa(e,r){if(e===r)return!0;if(e&&(0,ta.default)(e)==="object"&&r&&(0,ta.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(!oa(e[t],r[t]))return!1;return!0}return!1}function Oo(e,r){var t=J.EPSILON;J.EPSILON=e;var a;try{a=r()}finally{J.EPSILON=t}return a}function ko(e){return Math.round(e/J.EPSILON)*J.EPSILON}function Ro(e){return e.clone?e.clone():new Array(e.length)}function Re(e,r,t){if(je(e)){var a=e;t=t||Ro(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 Er=S($r=>{"use strict";var wr=V();Object.defineProperty($r,"__esModule",{value:!0});$r.default=void 0;var Ao=wr(Q()),Po=wr($()),So=wr(oe()),wo=wr(ce()),ca=wr(ue()),qr=ve();function qo(e){var r=Eo();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,wo.default)(this,n)}}function Eo(){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 Lo(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 No=function(e){(0,So.default)(t,e);var r=qo(t);function t(){return(0,Ao.default)(this,t),r.apply(this,arguments)}return(0,Po.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,qr.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(qr.config)}},{key:"formatString",value:function(n){for(var i="",s=0;s<this.ELEMENTS;++s)i+=(s>0?", ":"")+(0,qr.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,qr.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(qr.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}(Lo(Array));$r.default=No});var me=S(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.validateVector=ua;nr.checkNumber=Co;nr.checkVector=Wo;nr.deprecated=Bo;var Io=ve();function ua(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 Co(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Wo(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(Io.config.debug&&!ua(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}var la={};function Bo(e,r){la[e]||(la[e]=!0,console.warn("".concat(e," has been removed in version ").concat(r,", see upgrade guide for more information")))}});var Hr=S(Jr=>{"use strict";var Ze=V();Object.defineProperty(Jr,"__esModule",{value:!0});Jr.default=void 0;var Fo=Ze(Q()),Do=Ze($()),zo=Ze(oe()),Yo=Ze(ce()),fa=Ze(ue()),Go=Ze(Er()),Lr=me(),ha=Ze(Qr());function Uo(e){var r=Vo();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,Yo.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}}var jo=function(e){(0,zo.default)(t,e);var r=Uo(t);function t(){return(0,Fo.default)(this,t),r.apply(this,arguments)}return(0,Do.default)(t,[{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:"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,Lr.checkNumber)(i)}},{key:"dot",value:function(n){for(var i=0,s=0;s<this.ELEMENTS;++s)i+=this[s]*n[s];return(0,Lr.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,ha.default)(n>=0&&n<this.ELEMENTS,"index is out of range"),(0,Lr.checkNumber)(this[n])}},{key:"setComponent",value:function(n,i){return(0,ha.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}(Go.default);Jr.default=jo});var Xe=S(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.setMatrixArrayType=Xo;ae.toRadian=$o;ae.equals=Jo;ae.RANDOM=ae.ARRAY_TYPE=ae.EPSILON=void 0;var da=1e-6;ae.EPSILON=da;var pa=typeof Float32Array!="undefined"?Float32Array:Array;ae.ARRAY_TYPE=pa;var Zo=Math.random;ae.RANDOM=Zo;function Xo(e){ae.ARRAY_TYPE=pa=e}var Qo=Math.PI/180;function $o(e){return e*Qo}function Jo(e,r){return Math.abs(e-r)<=da*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 et=S(R=>{"use strict";function Kr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kr=function(t){return typeof t}:Kr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kr(e)}Object.defineProperty(R,"__esModule",{value:!0});R.create=ma;R.clone=Ko;R.fromValues=ec;R.copy=rc;R.set=tc;R.add=nc;R.subtract=ya;R.multiply=ga;R.divide=Ma;R.ceil=ac;R.floor=ic;R.min=sc;R.max=oc;R.round=cc;R.scale=uc;R.scaleAndAdd=lc;R.distance=xa;R.squaredDistance=ba;R.length=_a;R.squaredLength=Ta;R.negate=fc;R.inverse=hc;R.normalize=dc;R.dot=pc;R.cross=vc;R.lerp=mc;R.random=yc;R.transformMat2=gc;R.transformMat2d=Mc;R.transformMat3=xc;R.transformMat4=bc;R.rotate=_c;R.angle=Tc;R.zero=Oc;R.str=kc;R.exactEquals=Rc;R.equals=Ac;R.forEach=R.sqrLen=R.sqrDist=R.dist=R.div=R.mul=R.sub=R.len=void 0;var Qe=Ho(Xe());function va(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(va=function(n){return n?t:r})(e)}function Ho(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Kr(e)!=="object"&&typeof e!="function")return{default:e};var t=va(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 ma(){var e=new Qe.ARRAY_TYPE(2);return Qe.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function Ko(e){var r=new Qe.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r}function ec(e,r){var t=new Qe.ARRAY_TYPE(2);return t[0]=e,t[1]=r,t}function rc(e,r){return e[0]=r[0],e[1]=r[1],e}function tc(e,r,t){return e[0]=r,e[1]=t,e}function nc(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function ya(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e}function ga(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e}function Ma(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e}function ac(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e}function ic(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e}function sc(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e}function oc(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e}function cc(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e}function uc(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function lc(e,r,t,a){return e[0]=r[0]+t[0]*a,e[1]=r[1]+t[1]*a,e}function xa(e,r){var t=r[0]-e[0],a=r[1]-e[1];return Math.hypot(t,a)}function ba(e,r){var t=r[0]-e[0],a=r[1]-e[1];return t*t+a*a}function _a(e){var r=e[0],t=e[1];return Math.hypot(r,t)}function Ta(e){var r=e[0],t=e[1];return r*r+t*t}function fc(e,r){return e[0]=-r[0],e[1]=-r[1],e}function hc(e,r){return e[0]=1/r[0],e[1]=1/r[1],e}function dc(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 pc(e,r){return e[0]*r[0]+e[1]*r[1]}function vc(e,r,t){var a=r[0]*t[1]-r[1]*t[0];return e[0]=e[1]=0,e[2]=a,e}function mc(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 yc(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 gc(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 Mc(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 xc(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 bc(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 _c(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 Tc(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 kc(e){return"vec2("+e[0]+", "+e[1]+")"}function Rc(e,r){return e[0]===r[0]&&e[1]===r[1]}function Ac(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 Pc=_a;R.len=Pc;var Sc=ya;R.sub=Sc;var wc=ga;R.mul=wc;var qc=Ma;R.div=qc;var Ec=xa;R.dist=Ec;var Lc=ba;R.sqrDist=Lc;var Nc=Ta;R.sqrLen=Nc;var Ic=function(){var e=ma();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=Ic});var ar=S($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.vec2_transformMat4AsVector=Cc;$e.vec3_transformMat4AsVector=Wc;$e.vec3_transformMat2=Bc;$e.vec4_transformMat2=Fc;$e.vec4_transformMat3=Dc;function Cc(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 Wc(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 Fc(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 Dc(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 Ra=S(nt=>{"use strict";var ir=V(),zc=K();Object.defineProperty(nt,"__esModule",{value:!0});nt.default=void 0;var Yc=ir(Q()),Gc=ir($()),Uc=ir(oe()),Vc=ir(ce()),Oa=ir(ue()),jc=ir(Hr()),Jt=ve(),rt=me(),tt=Xc(et()),Zc=ar();function ka(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ka=function(n){return n?t:r})(e)}function Xc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||zc(e)!=="object"&&typeof e!="function")return{default:e};var t=ka(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 Qc(e){var r=$c();return function(){var a=(0,Oa.default)(e),n;if(r){var i=(0,Oa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Vc.default)(this,n)}}function $c(){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 Jc=function(e){(0,Uc.default)(t,e);var r=Qc(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,Yc.default)(this,t),a=r.call(this,2),(0,Jt.isArray)(n)&&arguments.length===1?a.copy(n):(Jt.config.debug&&((0,rt.checkNumber)(n),(0,rt.checkNumber)(i)),a[0]=n,a[1]=i),a}return(0,Gc.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 Jt.config.debug&&((0,rt.checkNumber)(n.x),(0,rt.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 tt.transformMat4(this,this,n),this.check()}},{key:"transformAsVector",value:function(n){return(0,Zc.vec2_transformMat4AsVector)(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return tt.transformMat3(this,this,n),this.check()}},{key:"transformByMatrix2x3",value:function(n){return tt.transformMat2d(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return tt.transformMat2(this,this,n),this.check()}}]),t}(jc.default);nt.default=Jc});var Le=S(T=>{"use strict";function at(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?at=function(t){return typeof t}:at=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(e)}Object.defineProperty(T,"__esModule",{value:!0});T.create=Pa;T.clone=Kc;T.length=Sa;T.fromValues=eu;T.copy=ru;T.set=tu;T.add=nu;T.subtract=wa;T.multiply=qa;T.divide=Ea;T.ceil=au;T.floor=iu;T.min=su;T.max=ou;T.round=cu;T.scale=uu;T.scaleAndAdd=lu;T.distance=La;T.squaredDistance=Na;T.squaredLength=Ia;T.negate=fu;T.inverse=hu;T.normalize=du;T.dot=Ca;T.cross=pu;T.lerp=vu;T.hermite=mu;T.bezier=yu;T.random=gu;T.transformMat4=Mu;T.transformMat3=xu;T.transformQuat=bu;T.rotateX=_u;T.rotateY=Tu;T.rotateZ=Ou;T.angle=ku;T.zero=Ru;T.str=Au;T.exactEquals=Pu;T.equals=Su;T.forEach=T.sqrLen=T.len=T.sqrDist=T.dist=T.div=T.mul=T.sub=void 0;var Ae=Hc(Xe());function Aa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Aa=function(n){return n?t:r})(e)}function Hc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||at(e)!=="object"&&typeof e!="function")return{default:e};var t=Aa(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 Pa(){var e=new Ae.ARRAY_TYPE(3);return Ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Kc(e){var r=new Ae.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function Sa(e){var r=e[0],t=e[1],a=e[2];return Math.hypot(r,t,a)}function eu(e,r,t){var a=new Ae.ARRAY_TYPE(3);return a[0]=e,a[1]=r,a[2]=t,a}function ru(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function tu(e,r,t,a){return e[0]=r,e[1]=t,e[2]=a,e}function nu(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function wa(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function qa(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Ea(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function au(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function iu(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function su(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 ou(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 cu(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e}function uu(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function lu(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 La(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 Na(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 Ia(e){var r=e[0],t=e[1],a=e[2];return r*r+t*t+a*a}function fu(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function hu(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function du(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 Ca(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function pu(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 vu(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 mu(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 yu(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 gu(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 Mu(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 xu(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 bu(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 _u(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 Tu(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 ku(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&&Ca(e,r)/l;return Math.acos(Math.min(Math.max(f,-1),1))}function Ru(e){return e[0]=0,e[1]=0,e[2]=0,e}function Au(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Pu(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function Su(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 wu=wa;T.sub=wu;var qu=qa;T.mul=qu;var Eu=Ea;T.div=Eu;var Lu=La;T.dist=Lu;var Nu=Na;T.sqrDist=Nu;var Iu=Sa;T.len=Iu;var Cu=Ia;T.sqrLen=Cu;var Wu=function(){var e=Pa();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=Wu});var ot=S(st=>{"use strict";var sr=V(),Bu=K();Object.defineProperty(st,"__esModule",{value:!0});st.default=void 0;var Fu=sr(Q()),Du=sr($()),zu=sr(oe()),Yu=sr(ce()),Wa=sr(ue()),Gu=sr(Hr()),Ht=ve(),Je=me(),Ne=Uu(Le()),Ba=ar();function Fa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Fa=function(n){return n?t:r})(e)}function Uu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Bu(e)!=="object"&&typeof e!="function")return{default:e};var t=Fa(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 Vu(e){var r=ju();return function(){var a=(0,Wa.default)(e),n;if(r){var i=(0,Wa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Yu.default)(this,n)}}function ju(){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 Kt=[0,0,0],it,Zu=function(e){(0,zu.default)(t,e);var r=Vu(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,Fu.default)(this,t),a=r.call(this,-0,-0,-0),arguments.length===1&&(0,Ht.isArray)(n)?a.copy(n):(Ht.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,Du.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 Ht.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?Kt: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?Kt: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?Kt: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,Ba.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,Ba.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 it||(it=new t(0,0,0),Object.freeze(it)),it}}]),t}(Gu.default);st.default=Zu});var rn=S(ut=>{"use strict";var or=V(),Xu=K();Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var Qu=or(Q()),$u=or($()),Ju=or(oe()),Hu=or(ce()),Da=or(ue()),Ku=or(Hr()),en=ve(),ye=me(),za=el(Le()),Ya=ar();function Ga(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Ga=function(n){return n?t:r})(e)}function el(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Xu(e)!=="object"&&typeof e!="function")return{default:e};var t=Ga(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 rl(e){var r=tl();return function(){var a=(0,Da.default)(e),n;if(r){var i=(0,Da.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Hu.default)(this,n)}}function tl(){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 ct,nl=function(e){(0,Ju.default)(t,e);var r=rl(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,Qu.default)(this,t),a=r.call(this,-0,-0,-0,-0),(0,en.isArray)(n)&&arguments.length===1?a.copy(n):(en.config.debug&&((0,ye.checkNumber)(n),(0,ye.checkNumber)(i),(0,ye.checkNumber)(s),(0,ye.checkNumber)(o)),a[0]=n,a[1]=i,a[2]=s,a[3]=o),a}return(0,$u.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 en.config.debug&&((0,ye.checkNumber)(n.x),(0,ye.checkNumber)(n.y),(0,ye.checkNumber)(n.z),(0,ye.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,ye.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,ye.checkNumber)(n)}},{key:"transform",value:function(n){return za.transformMat4(this,this,n),this.check()}},{key:"transformByMatrix3",value:function(n){return(0,Ya.vec4_transformMat3)(this,this,n),this.check()}},{key:"transformByMatrix2",value:function(n){return(0,Ya.vec4_transformMat2)(this,this,n),this.check()}},{key:"transformByQuaternion",value:function(n){return za.transformQuat(this,this,n),this.check()}},{key:"applyMatrix4",value:function(n){return n.transform(this,this),this}}],[{key:"ZERO",get:function(){return ct||(ct=new t(0,0,0,0),Object.freeze(ct)),ct}}]),t}(Ku.default);ut.default=nl});var tn=S(lt=>{"use strict";var cr=V();Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var al=cr(Q()),il=cr($()),sl=cr(oe()),ol=cr(ce()),Ua=cr(ue()),cl=cr(Er()),ul=me(),ll=ve();function fl(e){var r=hl();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,ol.default)(this,n)}}function hl(){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 dl=function(e){(0,sl.default)(t,e);var r=fl(t);function t(){return(0,al.default)(this,t),r.apply(this,arguments)}return(0,il.default)(t,[{key:"toString",value:function(){var n="[";if(ll.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,ul.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}(cl.default);lt.default=dl});var nn=S(q=>{"use strict";function ft(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ft=function(t){return typeof t}:ft=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(e)}Object.defineProperty(q,"__esModule",{value:!0});q.create=vl;q.fromMat4=ml;q.clone=yl;q.copy=gl;q.fromValues=Ml;q.set=xl;q.identity=bl;q.transpose=_l;q.invert=Tl;q.adjoint=Ol;q.determinant=kl;q.multiply=ja;q.translate=Rl;q.rotate=Al;q.scale=Pl;q.fromTranslation=Sl;q.fromRotation=wl;q.fromScaling=ql;q.fromMat2d=El;q.fromQuat=Ll;q.normalFromMat4=Nl;q.projection=Il;q.str=Cl;q.frob=Wl;q.add=Bl;q.subtract=Za;q.multiplyScalar=Fl;q.multiplyScalarAndAdd=Dl;q.exactEquals=zl;q.equals=Yl;q.sub=q.mul=void 0;var ee=pl(Xe());function Va(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Va=function(n){return n?t:r})(e)}function pl(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||ft(e)!=="object"&&typeof e!="function")return{default:e};var t=Va(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 vl(){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 ml(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 yl(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 gl(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 Ml(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 xl(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 bl(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 _l(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 Tl(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 kl(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 ja(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],y=t[5],b=t[6],g=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+y*u,e[4]=m*n+v*o+y*l,e[5]=m*i+v*c+y*f,e[6]=b*a+g*s+M*u,e[7]=b*n+g*o+M*l,e[8]=b*i+g*c+M*f,e}function Rl(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 Al(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 Pl(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 Sl(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 wl(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 ql(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 El(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 Ll(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,y=i*c;return e[0]=1-f-p,e[3]=l-y,e[6]=h+v,e[1]=l+y,e[4]=1-u-p,e[7]=d-m,e[2]=h-v,e[5]=d+m,e[8]=1-u-f,e}function Nl(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],y=r[15],b=t*o-a*s,g=t*c-n*s,M=t*u-i*s,O=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-f*p,N=l*v-h*p,w=l*y-d*p,W=f*v-h*m,I=f*y-d*m,B=h*y-d*v,P=b*B-g*I+M*W+O*w-_*N+C*L;return P?(P=1/P,e[0]=(o*B-c*I+u*W)*P,e[1]=(c*w-s*B-u*N)*P,e[2]=(s*I-o*w+u*L)*P,e[3]=(n*I-a*B-i*W)*P,e[4]=(t*B-n*w+i*N)*P,e[5]=(a*w-t*I-i*L)*P,e[6]=(m*C-v*_+y*O)*P,e[7]=(v*M-p*C-y*g)*P,e[8]=(p*_-m*M+y*b)*P,e):null}function Il(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 Cl(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Wl(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 Za(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 Fl(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 Dl(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 zl(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 Yl(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],y=r[6],b=r[7],g=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-y)<=ee.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=ee.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-g)<=ee.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))}var Gl=ja;q.mul=Gl;var Ul=Za;q.sub=Ul});var $a=S(pt=>{"use strict";var ur=V(),Vl=K();Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var jl=ur(Q()),Zl=ur($()),Xl=ur(oe()),Ql=ur(ce()),Xa=ur(ue()),$l=ur(tn()),Jl=me(),Hl=ar(),ge=an(nn()),Kl=an(et()),ef=an(Le());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 an(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Vl(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 rf(e){var r=tf();return function(){var a=(0,Xa.default)(e),n;if(r){var i=(0,Xa.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Ql.default)(this,n)}}function tf(){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.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"})(sn||(sn={}));var nf=Object.freeze([1,0,0,0,1,0,0,0,1]),on=function(e){(0,Xl.default)(t,e);var r=rf(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,jl.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,Zl.default)(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{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.check()}},{key:"identity",value:function(){return this.copy(nf)}},{key:"fromObject",value:function(n){return this.check()}},{key:"fromQuaternion",value:function(n){return ge.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 ge.determinant(this)}},{key:"transpose",value:function(){return ge.transpose(this,this),this.check()}},{key:"invert",value:function(){return ge.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(n){return ge.multiply(this,n,this),this.check()}},{key:"multiplyRight",value:function(n){return ge.multiply(this,this,n),this.check()}},{key:"rotate",value:function(n){return ge.rotate(this,this,n),this.check()}},{key:"scale",value:function(n){return Array.isArray(n)?ge.scale(this,this,n):ge.scale(this,this,[n,n]),this.check()}},{key:"translate",value:function(n){return ge.translate(this,this,n),this.check()}},{key:"transform",value:function(n,i){var s;switch(n.length){case 2:s=Kl.transformMat3(i||[-0,-0],n,this);break;case 3:s=ef.transformMat3(i||[-0,-0,-0],n,this);break;case 4:s=(0,Hl.vec4_transformMat3)(i||[-0,-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,Jl.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 sf()}},{key:"ZERO",get:function(){return af()}}]),t}($l.default);pt.default=on;var ht,dt;function af(){return ht||(ht=new on([0,0,0,0,0,0,0,0,0]),Object.freeze(ht)),ht}function sf(){return dt||(dt=new on,Object.freeze(dt)),dt}});var ii=S(k=>{"use strict";function vt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vt=function(t){return typeof t}:vt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(e)}Object.defineProperty(k,"__esModule",{value:!0});k.create=cf;k.clone=uf;k.copy=lf;k.fromValues=ff;k.set=hf;k.identity=Ha;k.transpose=df;k.invert=pf;k.adjoint=vf;k.determinant=mf;k.multiply=Ka;k.translate=yf;k.scale=gf;k.rotate=Mf;k.rotateX=xf;k.rotateY=bf;k.rotateZ=_f;k.fromTranslation=Tf;k.fromScaling=Of;k.fromRotation=kf;k.fromXRotation=Rf;k.fromYRotation=Af;k.fromZRotation=Pf;k.fromRotationTranslation=ei;k.fromQuat2=Sf;k.getTranslation=wf;k.getScaling=ri;k.getRotation=qf;k.fromRotationTranslationScale=Ef;k.fromRotationTranslationScaleOrigin=Lf;k.fromQuat=Nf;k.frustum=If;k.perspectiveNO=ti;k.perspectiveZO=Wf;k.perspectiveFromFieldOfView=Bf;k.orthoNO=ni;k.orthoZO=Df;k.lookAt=zf;k.targetTo=Yf;k.str=Gf;k.frob=Uf;k.add=Vf;k.subtract=ai;k.multiplyScalar=jf;k.multiplyScalarAndAdd=Zf;k.exactEquals=Xf;k.equals=Qf;k.sub=k.mul=k.ortho=k.perspective=void 0;var F=of(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 of(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||vt(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 cf(){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 uf(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 lf(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 ff(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 hf(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 Ha(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 df(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 pf(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],y=r[15],b=t*o-a*s,g=t*c-n*s,M=t*u-i*s,O=a*c-n*o,_=a*u-i*o,C=n*u-i*c,L=l*m-f*p,N=l*v-h*p,w=l*y-d*p,W=f*v-h*m,I=f*y-d*m,B=h*y-d*v,P=b*B-g*I+M*W+O*w-_*N+C*L;return P?(P=1/P,e[0]=(o*B-c*I+u*W)*P,e[1]=(n*I-a*B-i*W)*P,e[2]=(m*C-v*_+y*O)*P,e[3]=(h*_-f*C-d*O)*P,e[4]=(c*w-s*B-u*N)*P,e[5]=(t*B-n*w+i*N)*P,e[6]=(v*M-p*C-y*g)*P,e[7]=(l*C-h*M+d*g)*P,e[8]=(s*I-o*w+u*L)*P,e[9]=(a*w-t*I-i*L)*P,e[10]=(p*_-m*M+y*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*g-p*O-v*b)*P,e[15]=(l*O-f*g+h*b)*P,e):null}function vf(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],y=r[15];return e[0]=o*(h*y-d*v)-f*(c*y-u*v)+m*(c*d-u*h),e[1]=-(a*(h*y-d*v)-f*(n*y-i*v)+m*(n*d-i*h)),e[2]=a*(c*y-u*v)-o*(n*y-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*y-d*v)-l*(c*y-u*v)+p*(c*d-u*h)),e[5]=t*(h*y-d*v)-l*(n*y-i*v)+p*(n*d-i*h),e[6]=-(t*(c*y-u*v)-s*(n*y-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*y-d*m)-l*(o*y-u*m)+p*(o*d-u*f),e[9]=-(t*(f*y-d*m)-l*(a*y-i*m)+p*(a*d-i*f)),e[10]=t*(o*y-u*m)-s*(a*y-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 mf(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],y=r*s-t*i,b=r*o-a*i,g=r*c-n*i,M=t*o-a*s,O=t*c-n*s,_=a*c-n*o,C=u*p-l*d,L=u*m-f*d,N=u*v-h*d,w=l*m-f*p,W=l*v-h*p,I=f*v-h*m;return y*I-b*W+g*w+M*N-O*L+_*C}function Ka(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],y=r[14],b=r[15],g=t[0],M=t[1],O=t[2],_=t[3];return e[0]=g*a+M*o+O*f+_*m,e[1]=g*n+M*c+O*h+_*v,e[2]=g*i+M*u+O*d+_*y,e[3]=g*s+M*l+O*p+_*b,g=t[4],M=t[5],O=t[6],_=t[7],e[4]=g*a+M*o+O*f+_*m,e[5]=g*n+M*c+O*h+_*v,e[6]=g*i+M*u+O*d+_*y,e[7]=g*s+M*l+O*p+_*b,g=t[8],M=t[9],O=t[10],_=t[11],e[8]=g*a+M*o+O*f+_*m,e[9]=g*n+M*c+O*h+_*v,e[10]=g*i+M*u+O*d+_*y,e[11]=g*s+M*l+O*p+_*b,g=t[12],M=t[13],O=t[14],_=t[15],e[12]=g*a+M*o+O*f+_*m,e[13]=g*n+M*c+O*h+_*v,e[14]=g*i+M*u+O*d+_*y,e[15]=g*s+M*l+O*p+_*b,e}function yf(e,r,t){var a=t[0],n=t[1],i=t[2],s,o,c,u,l,f,h,d,p,m,v,y;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],y=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]=y,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+y*i+r[15]),e}function gf(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 Mf(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,y,b,g,M,O,_,C,L,N,w,W,I,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],y=r[6],b=r[7],g=r[8],M=r[9],O=r[10],_=r[11],C=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,I=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*C+m*L+g*N,e[1]=h*C+v*L+M*N,e[2]=d*C+y*L+O*N,e[3]=p*C+b*L+_*N,e[4]=f*w+m*W+g*I,e[5]=h*w+v*W+M*I,e[6]=d*w+y*W+O*I,e[7]=p*w+b*W+_*I,e[8]=f*B+m*P+g*j,e[9]=h*B+v*P+M*j,e[10]=d*B+y*P+O*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 xf(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 bf(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 _f(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 Tf(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 kf(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 Rf(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 Af(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 Pf(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 ei(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,y=s*c,b=s*u;return e[0]=1-(d+m),e[1]=f+b,e[2]=h-y,e[3]=0,e[4]=f-b,e[5]=1-(l+m),e[6]=p+v,e[7]=0,e[8]=h+y,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 Sf(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),ei(e,r,t),e}function wf(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e}function ri(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 qf(e,r){var t=new F.ARRAY_TYPE(3);ri(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 Ef(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,y=o*c,b=o*u,g=o*l,M=a[0],O=a[1],_=a[2];return e[0]=(1-(p+v))*M,e[1]=(h+g)*M,e[2]=(d-b)*M,e[3]=0,e[4]=(h-g)*O,e[5]=(1-(f+v))*O,e[6]=(m+y)*O,e[7]=0,e[8]=(d+b)*_,e[9]=(m-y)*_,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 Lf(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,y=o*f,b=c*u,g=c*l,M=c*f,O=a[0],_=a[1],C=a[2],L=n[0],N=n[1],w=n[2],W=(1-(m+y))*O,I=(d+M)*O,B=(p-g)*O,P=(d-M)*_,j=(1-(h+y))*_,he=(v+b)*_,de=(p+g)*C,Ye=(v-b)*C,Ge=(1-(h+m))*C;return e[0]=W,e[1]=I,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-(I*L+j*N+Ye*w),e[14]=t[2]+w-(B*L+he*N+Ge*w),e[15]=1,e}function Nf(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,y=i*c;return e[0]=1-f-p,e[1]=l+y,e[2]=h-v,e[3]=0,e[4]=l-y,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 If(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 ti(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 Cf=ti;k.perspective=Cf;function Wf(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 ni(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 Ff=ni;k.ortho=Ff;function Df(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 zf(e,r,t,a){var n,i,s,o,c,u,l,f,h,d,p=r[0],m=r[1],v=r[2],y=a[0],b=a[1],g=a[2],M=t[0],O=t[1],_=t[2];return Math.abs(p-M)<F.EPSILON&&Math.abs(m-O)<F.EPSILON&&Math.abs(v-_)<F.EPSILON?Ha(e):(l=p-M,f=m-O,h=v-_,d=1/Math.hypot(l,f,h),l*=d,f*=d,h*=d,n=b*h-g*f,i=g*l-y*h,s=y*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 Yf(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 Gf(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 Uf(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 Vf(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 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[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 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[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 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[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 Xf(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 Qf(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],y=e[15],b=r[0],g=r[1],M=r[2],O=r[3],_=r[4],C=r[5],L=r[6],N=r[7],w=r[8],W=r[9],I=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-g)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(n-M)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(M))&&Math.abs(i-O)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(s-_)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-C)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(C))&&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-I)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(I))&&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(y-de)<=F.EPSILON*Math.max(1,Math.abs(y),Math.abs(de))}var $f=Ka;k.mul=$f;var Jf=ai;k.sub=Jf});var yt=S(A=>{"use strict";function mt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mt=function(t){return typeof t}:mt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(e)}Object.defineProperty(A,"__esModule",{value:!0});A.create=oi;A.clone=Kf;A.fromValues=eh;A.copy=rh;A.set=th;A.add=nh;A.subtract=ci;A.multiply=ui;A.divide=li;A.ceil=ah;A.floor=ih;A.min=sh;A.max=oh;A.round=ch;A.scale=uh;A.scaleAndAdd=lh;A.distance=fi;A.squaredDistance=hi;A.length=di;A.squaredLength=pi;A.negate=fh;A.inverse=hh;A.normalize=dh;A.dot=ph;A.cross=vh;A.lerp=mh;A.random=yh;A.transformMat4=gh;A.transformQuat=Mh;A.zero=xh;A.str=bh;A.exactEquals=_h;A.equals=Th;A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var ie=Hf(Xe());function si(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(si=function(n){return n?t:r})(e)}function Hf(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||mt(e)!=="object"&&typeof e!="function")return{default:e};var t=si(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 oi(){var e=new ie.ARRAY_TYPE(4);return ie.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Kf(e){var r=new ie.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function eh(e,r,t,a){var n=new ie.ARRAY_TYPE(4);return n[0]=e,n[1]=r,n[2]=t,n[3]=a,n}function rh(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function th(e,r,t,a,n){return e[0]=r,e[1]=t,e[2]=a,e[3]=n,e}function nh(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 ci(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 ui(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 li(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 ah(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 ih(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 sh(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 oh(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 ch(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 uh(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 lh(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 fi(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 hi(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 di(e){var r=e[0],t=e[1],a=e[2],n=e[3];return Math.hypot(r,t,a,n)}function pi(e){var r=e[0],t=e[1],a=e[2],n=e[3];return r*r+t*t+a*a+n*n}function fh(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=-r[3],e}function hh(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 dh(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 ph(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function vh(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 mh(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 yh(e,r){r=r||1;var t,a,n,i,s,o;do t=ie.RANDOM()*2-1,a=ie.RANDOM()*2-1,s=t*t+a*a;while(s>=1);do n=ie.RANDOM()*2-1,i=ie.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 gh(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 Mh(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 xh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function bh(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function _h(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function Th(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)<=ie.EPSILON*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(a-o)<=ie.EPSILON*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(n-c)<=ie.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=ie.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var Oh=ci;A.sub=Oh;var kh=ui;A.mul=kh;var Rh=li;A.div=Rh;var Ah=fi;A.dist=Ah;var Ph=hi;A.sqrDist=Ph;var Sh=di;A.len=Sh;var wh=pi;A.sqrLen=wh;var qh=function(){var e=oi();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=qh});var dn=S(bt=>{"use strict";var lr=V(),Eh=K();Object.defineProperty(bt,"__esModule",{value:!0});bt.default=void 0;var Lh=lr(Q()),Nh=lr($()),Ih=lr(oe()),Ch=lr(ce()),vi=lr(ue()),Wh=lr(tn()),cn=me(),mi=ar(),Z=gt(ii()),Bh=gt(et()),Fh=gt(Le()),Dh=gt(yt());function yi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(yi=function(n){return n?t:r})(e)}function gt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Eh(e)!=="object"&&typeof e!="function")return{default:e};var t=yi(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 zh(e){var r=Yh();return function(){var a=(0,vi.default)(e),n;if(r){var i=(0,vi.default)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,Ch.default)(this,n)}}function Yh(){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 un;(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"})(un||(un={}));var Gh=45*Math.PI/180,Uh=1,ln=.1,fn=500,Vh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),hn=function(e){(0,Ih.default)(t,e);var r=zh(t);function t(a){var n;return(0,Lh.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,Nh.default)(t,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return un}},{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,y,b,g){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]=y,this[14]=b,this[15]=g,this.check()}},{key:"setRowMajor",value:function(n,i,s,o,c,u,l,f,h,d,p,m,v,y,b,g){return this[0]=n,this[1]=c,this[2]=h,this[3]=v,this[4]=i,this[5]=u,this[6]=d,this[7]=y,this[8]=s,this[9]=l,this[10]=p,this[11]=b,this[12]=o,this[13]=f,this[14]=m,this[15]=g,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(Vh)}},{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?ln:u,f=n.far,h=f===void 0?fn:f;return h===1/0?Xh(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?ln:u,f=n.far,h=f===void 0?fn: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?Gh:i,o=n.aspect,c=o===void 0?Uh:o,u=n.focalDistance,l=u===void 0?1:u,f=n.near,h=f===void 0?ln:f,d=n.far,p=d===void 0?fn:d;gi(s);var m=s/2,v=l*Math.tan(m),y=v*c;return this.ortho({left:-y,right:y,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 gi(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=Dh.transformMat4(i||[-0,-0,-0,-0],n,this),(0,cn.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=Fh.transformMat4(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,cn.checkVector)(o,n.length),o}},{key:"transformAsVector",value:function(n,i){var s;switch(n.length){case 2:s=(0,mi.vec2_transformMat4AsVector)(i||[-0,-0],n,this);break;case 3:s=(0,mi.vec3_transformMat4AsVector)(i||[-0,-0,-0],n,this);break;default:throw new Error("Illegal vector")}return(0,cn.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 Zh()}},{key:"ZERO",get:function(){return jh()}}]),t}(Wh.default);bt.default=hn;var Mt,xt;function jh(){return Mt||(Mt=new hn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Mt)),Mt}function Zh(){return xt||(xt=new hn,Object.freeze(xt)),xt}function gi(e){if(e>Math.PI*2)throw Error("expected radians")}function Xh(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 Si=S(x=>{"use strict";function _t(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_t=function(t){return typeof t}:_t=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(e)}Object.defineProperty(x,"__esModule",{value:!0});x.create=pn;x.identity=$h;x.setAxisAngle=xi;x.getAxisAngle=Jh;x.getAngle=Hh;x.multiply=bi;x.rotateX=Kh;x.rotateY=e0;x.rotateZ=r0;x.calculateW=t0;x.exp=_i;x.ln=Ti;x.pow=n0;x.slerp=Ot;x.random=a0;x.invert=i0;x.conjugate=s0;x.fromMat3=Oi;x.fromEuler=o0;x.str=c0;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=Tt(Xe()),Qh=Tt(nn()),Pe=Tt(Le()),re=Tt(yt());function Mi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Mi=function(n){return n?t:r})(e)}function Tt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||_t(e)!=="object"&&typeof e!="function")return{default:e};var t=Mi(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 pn(){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 $h(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function xi(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 Jh(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 Hh(e,r){var t=Ri(e,r);return Math.acos(2*t*t-1)}function bi(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 Kh(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 e0(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 r0(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 t0(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 _i(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 Ti(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 n0(e,r,t){return Ti(e,r),ki(e,e,t),_i(e,e),e}function Ot(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 a0(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 i0(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 s0(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function Oi(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 o0(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 c0(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var u0=re.clone;x.clone=u0;var l0=re.fromValues;x.fromValues=l0;var f0=re.copy;x.copy=f0;var h0=re.set;x.set=h0;var d0=re.add;x.add=d0;var p0=bi;x.mul=p0;var ki=re.scale;x.scale=ki;var Ri=re.dot;x.dot=Ri;var v0=re.lerp;x.lerp=v0;var Ai=re.length;x.length=Ai;var m0=Ai;x.len=m0;var Pi=re.squaredLength;x.squaredLength=Pi;var y0=Pi;x.sqrLen=y0;var vn=re.normalize;x.normalize=vn;var g0=re.exactEquals;x.exactEquals=g0;var M0=re.equals;x.equals=M0;var x0=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),xi(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,vn(a,a))}}();x.rotationTo=x0;var b0=function(){var e=pn(),r=pn();return function(t,a,n,i,s,o){return Ot(e,a,s,o),Ot(r,n,i,o),Ot(t,e,r,2*o*(1-o)),t}}();x.sqlerp=b0;var _0=function(){var e=Qh.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],vn(r,Oi(r,e))}}();x.setAxes=_0});var mn=S(kt=>{"use strict";var Ke=V(),T0=K();Object.defineProperty(kt,"__esModule",{value:!0});kt.default=void 0;var O0=Ke(Q()),k0=Ke($()),R0=Ke(oe()),A0=Ke(ce()),wi=Ke(ue()),P0=Ke(Er()),Nr=me(),S0=Ke(rn()),G=Ei(Si()),w0=Ei(yt());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 Ei(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||T0(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}function q0(e){var r=E0();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,A0.default)(this,n)}}function E0(){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 L0=[0,0,0,1],N0=function(e){(0,R0.default)(t,e);var r=q0(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,k0.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,Nr.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,Nr.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,Nr.checkNumber)(n)}},{key:"w",get:function(){return this[3]},set:function(n){this[3]=(0,Nr.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?L0: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 S0.default;return w0.transformQuat(i,n,this),(0,Nr.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}(P0.default);kt.default=N0});var Li=S((Rp,Ir)=>{function I0(e){if(Array.isArray(e))return e}Ir.exports=I0,Ir.exports.__esModule=!0,Ir.exports.default=Ir.exports});var Ni=S((Ap,Cr)=>{function C0(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a,n,i,s,o=[],c=!0,u=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(a=i.call(t)).done)&&(o.push(a.value),o.length!==r);c=!0);}catch(l){u=!0,n=l}finally{try{if(!c&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}Cr.exports=C0,Cr.exports.__esModule=!0,Cr.exports.default=Cr.exports});var Ii=S((Pp,Wr)=>{function W0(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}Wr.exports=W0,Wr.exports.__esModule=!0,Wr.exports.default=Wr.exports});var Wi=S((Sp,Br)=>{var Ci=Ii();function B0(e,r){if(!!e){if(typeof e=="string")return Ci(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 Ci(e,r)}}Br.exports=B0,Br.exports.__esModule=!0,Br.exports.default=Br.exports});var Bi=S((wp,Fr)=>{function F0(){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.`)}Fr.exports=F0,Fr.exports.__esModule=!0,Fr.exports.default=Fr.exports});var Rt=S((qp,Dr)=>{var D0=Li(),z0=Ni(),Y0=Wi(),G0=Bi();function U0(e,r){return D0(e)||z0(e,r)||Y0(e,r)||G0()}Dr.exports=U0,Dr.exports.__esModule=!0,Dr.exports.default=Dr.exports});var At=S((Ep,zr)=>{var V0=Zt();function j0(e,r,t){return r=V0(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}zr.exports=j0,zr.exports.__esModule=!0,zr.exports.default=zr.exports});var zi=S(St=>{"use strict";var Yr=V(),Z0=K();Object.defineProperty(St,"__esModule",{value:!0});St.default=void 0;var X0=Yr(Rt()),Q0=Yr(Q()),$0=Yr($()),Pt=Yr(At()),J0=Yr(ot()),X=ve(),H0=K0(Le());function Fi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(Fi=function(n){return n?t:r})(e)}function K0(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Z0(e)!=="object"&&typeof e!="function")return{default:e};var t=Fi(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 Di=1e-6,e1=6371e3,r1=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?e1:f;(0,Q0.default)(this,e),(0,Pt.default)(this,"phi",void 0),(0,Pt.default)(this,"theta",void 0),(0,Pt.default)(this,"radius",void 0),(0,Pt.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,$0.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,X0.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=H0.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(Di,Math.min(Math.PI-Di,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}();St.default=r1});var yn=S(qt=>{"use strict";var Ie=V();Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var t1=Ie(Rt()),n1=Ie(Q()),a1=Ie($()),i1=Ie(oe()),s1=Ie(ce()),Yi=Ie(ue()),o1=Ie(Er()),Gi=Ie(mn()),fr=ve(),se=me();function c1(e){var r=u1();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,s1.default)(this,n)}}function u1(){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 wt="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 l1=function(e){(0,i1.default)(t,e);var r=c1(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,n1.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,a1.default)(t,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(n){var i=(0,t1.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),y=Math.asin(d),b=Math.atan2(h,f);return this.set(v,y,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 f1(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,se.checkNumber)(n)}},{key:"y",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"z",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"alpha",get:function(){return this[0]},set:function(n){this[0]=(0,se.checkNumber)(n)}},{key:"beta",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"gamma",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"phi",get:function(){return this[0]},set:function(n){this[0]=(0,se.checkNumber)(n)}},{key:"theta",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"psi",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"roll",get:function(){return this[0]},set:function(n){this[0]=(0,se.checkNumber)(n)}},{key:"pitch",get:function(){return this[1]},set:function(n){this[1]=(0,se.checkNumber)(n)}},{key:"yaw",get:function(){return this[2]},set:function(n){this[2]=(0,se.checkNumber)(n)}},{key:"order",get:function(){return this[3]},set:function(n){this[3]=h1(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 Gi.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(wt)}}},{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(wt)}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,y=h*f,b=h*p;i[0]=l*f,i[4]=-l*p,i[8]=d,i[1]=v+y*d,i[5]=m-b*d,i[9]=-h*l,i[2]=b-m*d,i[6]=y+v*d,i[10]=u*l;break}case t.YXZ:{var g=l*f,M=l*p,O=d*f,_=d*p;i[0]=g+_*h,i[4]=O*h-M,i[8]=u*d,i[1]=u*p,i[5]=u*f,i[9]=-h,i[2]=M*h-O,i[6]=_+g*h,i[10]=u*l;break}case t.ZXY:{var C=l*f,L=l*p,N=d*f,w=d*p;i[0]=C-w*h,i[4]=-u*p,i[8]=N+L*h,i[1]=L+N*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 W=u*f,I=u*p,B=h*f,P=h*p;i[0]=l*f,i[4]=B*d-I,i[8]=W*d+P,i[1]=l*p,i[5]=P*d+W,i[9]=I*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,Nn=u*d,In=h*l,Cn=h*d;i[0]=l*f,i[4]=-p,i[8]=d*f,i[1]=Ge*p+Cn,i[5]=u*f,i[9]=Nn*p-In,i[2]=In*p-Nn,i[6]=h*f,i[10]=Cn*p+Ge;break}default:throw new Error(wt)}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 Gi.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}(o1.default);qt.default=l1;function f1(e){return e>=0&&e<6}function h1(e){if(e<0&&e>=6)throw new Error(wt);return e}});var ji=S(Et=>{"use strict";var dr=V();Object.defineProperty(Et,"__esModule",{value:!0});Et.default=void 0;var d1=dr(Q()),p1=dr($()),Ui=dr(At()),gn=dr(dn()),Vi=dr(ot()),Mn=dr(yn()),v1=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,d1.default)(this,e),(0,Ui.default)(this,"position",void 0),(0,Ui.default)(this,"orientation",void 0),Array.isArray(p)&&p.length===3?this.position=new Vi.default(p):this.position=new Vi.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,p1.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 gn.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 gn.default().multiplyRight(this.getTransformationMatrix()).multiplyRight(t.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(t){return new gn.default().multiplyRight(t.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}}]),e}();Et.default=v1});var Zi=S(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.default=void 0;var m1={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=m1});var pr=S(E=>{"use strict";var le=V();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"Vector2",{enumerable:!0,get:function(){return y1.default}});Object.defineProperty(E,"Vector3",{enumerable:!0,get:function(){return g1.default}});Object.defineProperty(E,"Vector4",{enumerable:!0,get:function(){return M1.default}});Object.defineProperty(E,"Matrix3",{enumerable:!0,get:function(){return x1.default}});Object.defineProperty(E,"Matrix4",{enumerable:!0,get:function(){return b1.default}});Object.defineProperty(E,"Quaternion",{enumerable:!0,get:function(){return _1.default}});Object.defineProperty(E,"SphericalCoordinates",{enumerable:!0,get:function(){return Xi.default}});Object.defineProperty(E,"_SphericalCoordinates",{enumerable:!0,get:function(){return Xi.default}});Object.defineProperty(E,"Pose",{enumerable:!0,get:function(){return Qi.default}});Object.defineProperty(E,"_Pose",{enumerable:!0,get:function(){return Qi.default}});Object.defineProperty(E,"Euler",{enumerable:!0,get:function(){return $i.default}});Object.defineProperty(E,"_Euler",{enumerable:!0,get:function(){return $i.default}});Object.defineProperty(E,"_MathUtils",{enumerable:!0,get:function(){return T1.default}});Object.defineProperty(E,"assert",{enumerable:!0,get:function(){return O1.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 y1=le(Ra()),g1=le(ot()),M1=le(rn()),x1=le($a()),b1=le(dn()),_1=le(mn()),Xi=le(zi()),Qi=le(ji()),$i=le(yn()),T1=le(Zi()),O1=le(Qr()),Y=ve()});var _n=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 Ce=6378137;xe.WGS84_RADIUS_X=Ce;var We=6378137;xe.WGS84_RADIUS_Y=We;var Be=6356752314245179e-9;xe.WGS84_RADIUS_Z=Be;var w1={radii:[Ce,We,Be],radiiSquared:[Ce*Ce,We*We,Be*Be],oneOverRadii:[1/Ce,1/We,1/Be],oneOverRadiiSquared:[1/(Ce*Ce),1/(We*We),1/(Be*Be)],maximumRadius:Math.max(Ce,We,Be),centerToleranceSquared:.1};xe.WGS84_CONSTANTS=w1});var kn=S(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.fromCartographic=Tn;we.fromCartographicToRadians=E1;we.fromCartographicToDegrees=L1;we.toCartographic=On;we.toCartographicFromRadians=N1;we.toCartographicFromDegrees=I1;we.isWGS84=C1;var Se=pr(),Hi=_n();function vr(e){return e}var q1=new Se.Vector3;function Tn(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 E1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Tn(e,r,Se.config._cartographicRadians?vr:Se.toRadians)}function L1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Tn(e,r,Se.config._cartographicRadians?Se.toDegrees:vr)}function On(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 N1(e,r){return On(e,r,Se.config._cartographicRadians?vr:Se.toDegrees)}function I1(e,r){return On(e,r,Se.config._cartographicRadians?Se.toRadians:vr)}function C1(e){if(!e)return!1;q1.from(e);var r=Hi.WGS84_CONSTANTS.oneOverRadiiSquared,t=Hi.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 Ki=S(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.default=F1;var Nt=pr(),mr=new Nt.Vector3,W1=new Nt.Vector3,B1=new Nt.Vector3;function F1(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 y=W1;if(y.copy(e).scale(v),m<i)return y.to(t);var b=n.x,g=n.y,M=n.z,O=B1;O.set(y.x*b*2,y.y*g*2,y.z*M*2);var _=(1-v)*mr.len()/(.5*O.len()),C=0,L,N,w,W;do{_-=C,L=1/(1+_*b),N=1/(1+_*g),w=1/(1+_*M);var I=L*L,B=N*N,P=w*w,j=I*L,he=B*N,de=P*w;W=h*I+d*B+p*P-1;var Ye=h*j*b+d*he*g+p*de*M,Ge=-2*Ye;C=W/Ge}while(Math.abs(W)>Nt._MathUtils.EPSILON12);return mr.scale([L,N,w]).to(t)}}});var ts=S(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.default=U1;var te=pr(),es=1e-14,D1=new te.Vector3,rs={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"}},An={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},z1=new te.Vector3,Y1=new te.Vector3,G1=new te.Vector3;function U1(e,r,t,a,n,i){var s=rs[r]&&rs[r][t];(0,te.assert)(s&&(!a||a===s));var o,c,u,l=D1.copy(n),f=(0,te.equals)(l.x,0,es)&&(0,te.equals)(l.y,0,es);if(f){var h=Math.sign(l.z);o=z1.fromArray(An[r]),r!=="east"&&r!=="west"&&o.scale(h),c=Y1.fromArray(An[t]),t!=="east"&&t!=="west"&&c.scale(h),u=G1.fromArray(An[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,y=qe.west,b=qe.south;v.copy(d).scale(-1),y.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 cs=S(Wt=>{"use strict";var yr=V(),V1=K();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.default=void 0;var j1=yr(Rt()),Z1=yr(Q()),X1=yr($()),be=yr(At()),z=pr(),ns=$1(Le()),Sn=_n(),as=kn(),Q1=yr(Ki()),is=yr(ts());function ss(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(ss=function(n){return n?t:r})(e)}function $1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||V1(e)!=="object"&&typeof e!="function")return{default:e};var t=ss(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 It=new z.Vector3,os=new z.Vector3,J1=new z.Vector3,fe=new z.Vector3,H1=new z.Vector3,Ct=new z.Vector3,wn=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,Z1.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,X1.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=os,i=J1,s=(0,j1.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];Ct.from(t);var n=this.scaleToGeodeticSurface(Ct,fe);if(!!n){var i=this.geodeticSurfaceNormal(n,os),s=H1;s.copy(Ct).subtract(n);var o=Math.atan2(i.y,i.x),c=Math.asin(i.z),u=Math.sign(ns.dot(s,Ct))*ns.length(s);return(0,as.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,is.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,is.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 It.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,as.fromCartographicToRadians)(t),i=n[0],s=n[1],o=Math.cos(s);return It.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),It.to(a)}},{key:"geodeticSurfaceNormal",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return It.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}();Wt.default=wn;(0,be.default)(wn,"WGS84",new wn(Sn.WGS84_RADIUS_X,Sn.WGS84_RADIUS_Y,Sn.WGS84_RADIUS_Z))});var us=S(Bt=>{"use strict";var K1=V();Object.defineProperty(Bt,"__esModule",{value:!0});Object.defineProperty(Bt,"Ellipsoid",{enumerable:!0,get:function(){return ed.default}});Object.defineProperty(Bt,"isWGS84",{enumerable:!0,get:function(){return rd.isWGS84}});var ed=K1(cs()),rd=kn()});function Dt(e,r=!0,t){let a=t||new Set;if(e){if(Yn(e))a.add(e);else if(Yn(e.buffer))a.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let n in e)Dt(e[n],r,a)}}return t===void 0?Array.from(a):[]}function Yn(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 zt=new Map,H=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=zt.get(r);t||(t=n=>{if(!Ps(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=zt.get(r);zt.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=Dt(t),i=Ue();i?i.postMessage(a,n):globalThis.postMessage(a,n)}};function Ps(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}var Ur=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 Ss=0,Vr,Gn;function Yt(e,r){if(!H.inWorkerThread())return;let t={process:ws};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");Vr=new Ur,Gn=n.options||{};let s=r(Vr,Gn,t);for await(let o of s)H.postMessage("output-batch",{result:o});H.postMessage("done",{});break;case"input-batch":Vr.push(n.input);break;case"input-done":Vr.close();break;default:}}catch(i){let s=i instanceof Error?i.message:"";H.postMessage("error",{error:s})}}}function ws(e,r={}){return new Promise((t,a)=>{let n=Ss++,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 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 Gt(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 Ut(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 rr(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,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 tr(e,r,t,a){let i=new TextEncoder().encode(t);return r=jr(e,r,i,a),r}function Zr(e,r,t){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}var Un="4.0.0-alpha.7";function Vn(e){return!Ns(e,"ftyp",4)||(e[8]&96)==0?null:qs(e)}function qs(e){switch(Es(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Es(e,r,t){return String.fromCharCode(...e.slice(r,t))}function Ls(e){return[...e].map(r=>r.charCodeAt(0))}function Ns(e,r,t=0){let a=Ls(r);for(let n=0;n<a.length;++n)if(a[n]!==e[n+t])return!1;return!0}var pe=!1,xr=!0;function Vt(e){let r=br(e);return Cs(r)||Fs(r)||Ws(r)||Bs(r)||Is(r)}function Is(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=Vn(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function Cs(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 Ws(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 Bs(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 Fs(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}=Ds(),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 Ds(){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 jn=["SCALAR","VEC2","VEC3","VEC4"],zs=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ys=new Map(zs),Gs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Us={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Vs={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Zn(e){return jn[e-1]||jn[0]}function Xn(e){let r=Ys.get(e.constructor);if(!r)throw new Error("Illegal typed array");return r}function Qn(e,r){let t=Vs[e.componentType],a=Gs[e.type],n=Us[e.componentType],i=e.count*a,s=e.count*a*n;return Ve(s>=0&&s<=r.byteLength),{ArrayType:t,length:i,byteLength:s}}function js(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Xr=class{constructor(r){this.gltf={json:(r==null?void 0:r.json)||js(),buffers:(r==null?void 0:r.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]}hasExtension(r){let t=this.getUsedExtensions().find(n=>n===r),a=this.getRequiredExtensions().find(n=>n===r);return typeof t=="string"||typeof a=="string"}getExtension(r){let t=this.getUsedExtensions().find(n=>n===r),a=this.json.extensions||{};return t?a[r]:null}getRequiredExtension(r){return this.getRequiredExtensions().find(a=>a===r)?this.getExtension(r):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}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}=Qn(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==null?void 0:r.extensions)||{};if(a[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(t)||n.push(t)}delete a[t]}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){var t;if((t=this.json.extensions)==null?void 0:t[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let a=this.json.extensionsRemoved;a.includes(r)||a.push(r)}this.json.extensions&&delete this.json.extensions[r],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,r),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,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=Vt(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:Zn(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:Xn(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=Gt(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 k1=1179937895,R1=1313821514,A1=5130562,Me=!0;function Ji(e,r,t=0,a={}){let{magic:n=k1,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,R1,Me)),t+=8;let f=JSON.stringify(s);if(t=tr(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,A1,Me)),t+=8,t=jr(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 xn(e,r,t,a){return P1(e),Ji(e,r,t,a)}function P1(e,{firstBuffer:r=0}={}){if(e.buffers&&e.buffers.length>r)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var bn={name:"glTF",id:"gltf",module:"gltf",version:Un,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:S1,options:{gltf:{}}};function S1(e,r={}){let{byteOffset:t=0}=r,a=xn(e,null,t,r),n=new ArrayBuffer(a),i=new DataView(n);return xn(e,i,t,r),n}var ls="4.0.0-alpha.7";var gr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},rv=Object.keys(gr),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 fs(e,r,t,a,n){e=ne({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 hs(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=ne({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=tr(r,t,o,8),i&&(t=tr(r,t,c,8));let h=e.gltfEncoded;return h&&(t=Mr(r,t,h,h.byteLength)),ze(r,f,t-f),t}function ds(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=ne({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+=rr(r,t,u,l),t+=rr(r,t,s,o),ze(r,f,t-f),t}var td={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function ps(e,r,t,a){let{featureTableJson:n=td}=e,i=JSON.stringify(n);i=Ut(i,4);let{featureTableJsonByteLength:s=i.length}=e,o=new ArrayBuffer(12),c=o.byteLength;e=ne({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+=rr(r,t,i,s),t+=Mr(r,t,o,c),ze(r,u,t-u),t}function qn(e,r){let t=En(e,null,0,r),a=new ArrayBuffer(t),n=new DataView(a);return En(e,n,0,r),a}function En(e,r,t,a){switch(Ee(typeof e.type=="string"),e.type){case gr.COMPOSITE:return fs(e,r,t,a,En);case gr.POINT_CLOUD:return ps(e,r,t,a);case gr.BATCHED_3D_MODEL:return hs(e,r,t,a);case gr.INSTANCED_3D_MODEL:return ds(e,r,t,a);default:throw new Error("3D Tiles: unknown tile type")}}var Ln={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:ls,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:nd,binary:!0,options:{["3d-tiles"]:{}}};function nd(e,r){return qn(e,r)}var er=zn(pr()),ys=zn(us());function vs(e,r){let t=new Float32Array(e.length),a=id(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=ad([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 ad(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function id(e){let r=65535,t=[];for(let a=0;a<e.length;a++)t[a]=e[a]/r;return t}var ms=e=>{let r=new Uint32Array(e);for(let t=0;t<e;t++)r[t]=t;return r};var sd=new er.Matrix4([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),gs=new er.Vector3,Ft=class{async convert(r,t=null){let a=await this.buildGltf(r,t);return Zr({gltfEncoded:new Uint8Array(a),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},Ln)}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 Xr,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=vs(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 y=o||ms(v.length/m.size),b=f.addMesh({attributes:s,indices:y,material:p,mode:4}),g=this._generateTransformMatrix(c),M=f.addNode({meshIndex:b,matrix:g}),O=f.addScene({nodeIndices:[M]});return f.setDefaultScene(O),f.createBinaryChunk(),Zr(f.gltf,bn)}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);ys.Ellipsoid.WGS84.cartographicToCartesian(u,gs),u=gs.subtract(c),i.set(u,s)}return i}_generateTransformMatrix(r){return new er.Matrix4().translate(r).multiplyLeft(sd)}_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}}}_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=Dn(ne({},r),{pbrMetallicRoughness:ne({},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 od=new Ft;Yt(async(e,r={})=>od.convert(e,r.featureAttributes));
|
|
3
3
|
//# sourceMappingURL=3d-tiles-attributes-worker.js.map
|