@abi-software/scaffoldvuer 1.3.1 → 1.3.3

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.
@@ -31506,7 +31506,7 @@ const Gz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31506
31506
  /* 2 */
31507
31507
  /***/
31508
31508
  (o) => {
31509
- o.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.10.0","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
31509
+ o.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.10.2","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
31510
31510
  },
31511
31511
  /* 3 */
31512
31512
  /***/
@@ -31906,7 +31906,7 @@ const Gz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31906
31906
  for (var N = 0; N < E.length; N += 3)
31907
31907
  g.set(E[N], E[N + 1], E[N + 2]), b !== void 0 && g.applyMatrix4(b), this.normals.push(g.x, g.y, g.z);
31908
31908
  for (var D = 0, B = P.length; D < B; D++)
31909
- R.push(P[D].clone());
31909
+ typeof P[D] == "number" ? R.push(P[D]) : R.push(P[D].clone());
31910
31910
  for (var G = 0, H = L.length; G < H; G++) {
31911
31911
  var K = L[G], te = void 0, W = void 0, U = K.vertexNormals, j = K.vertexColors, Z = new y(K.a + _, K.b + _, K.c + _);
31912
31912
  Z.normal.copy(K.normal), T !== void 0 && Z.normal.applyMatrix3(T).normalize();
@@ -34338,9 +34338,7 @@ void main() {
34338
34338
  var C;
34339
34339
  (C = this.markers[x]) !== null && C !== void 0 && C.isMarker && this.markers[x].isEnabled() && this.markers[x].setVisibility(!0);
34340
34340
  }
34341
- }, this.zoomToCluster = (x) => {
34342
- x !== void 0 && -1 < x && (this._v1.set(...M[x].min), this._v2.set(...M[x].max), this._b1.set(this._v1, this._v2), T.translateBoundingBoxToCameraView(this._b1, 3, 300), this.markerUpdateRequired = !0);
34343
- }, this.clusterIsVisible = (x) => {
34341
+ }, this.zoomToCluster = (x) => !!(x !== void 0 && -1 < x && (this._v1.set(...M[x].min), this._v2.set(...M[x].max), Math.abs(0 < this._v1.distanceTo(this._v2)))) && (this._b1.set(this._v1, this._v2), T.translateBoundingBoxToCameraView(this._b1, 3, 300), this.markerUpdateRequired = !0, !0), this.clusterIsVisible = (x) => {
34344
34342
  if (x !== void 0 && -1 < x && M[x]) {
34345
34343
  var C;
34346
34344
  return (C = M[x].group) === null || C === void 0 ? void 0 : C.visible;
@@ -36295,8 +36293,8 @@ void main() {
36295
36293
  if (P && L && j && I) {
36296
36294
  this.getIntersectsObjectWithCamera(j, Z, Q);
36297
36295
  for (var ee, ie = H.length, Y = 0; Y < ie; Y++)
36298
- if (ee = H[Y].object ? H[Y].object.userData : void 0, ee && ee.isMarkerCluster && ee.visible && ee.clusterIsVisible(H[Y].object.clusterIndex))
36299
- return void ee.zoomToCluster(H[Y].object.clusterIndex);
36296
+ if (ee = H[Y].object ? H[Y].object.userData : void 0, ee && ee.isMarkerCluster && ee.visible && ee.clusterIsVisible(H[Y].object.clusterIndex) && ee.zoomToCluster(H[Y].object.clusterIndex))
36297
+ return;
36300
36298
  I(H, Z, Q);
36301
36299
  }
36302
36300
  };
@@ -3179,7 +3179,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3179
3179
  `),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
3180
3180
  `),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join(`
3181
3181
  `),l={specular:{value:new Ce().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=l,this.onBeforeCompile=function(u){for(const c in l)u.uniforms[c]=l[c];u.fragmentShader=u.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class qB{constructor(){this.name=nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return Tf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Ce(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Ce(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Ce(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new Tf(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=rr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class KB{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class Eo extends si{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}}Eo.prototype.beforeStart_=Eo.prototype.copySampleValue_,Eo.prototype.afterEnd_=Eo.prototype.copySampleValue_,Eo.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,h=f*f,m=h*f,y=n*u,p=y-u,d=-2*m+3*h,b=m-h,v=1-d,g=b-h+f;for(let x=0;x!==o;x++){const T=s[p+x+o],E=s[p+x+l]*c,_=s[y+x+o],M=s[y+x]*c;r[x]=v*T+g*E+d*_+b*M}return r};const Vi={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},ka={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},gx={9728:At,9729:wt,9984:Ko,9985:Ul,9986:Qo,9987:Ti},yx={33071:zt,33648:Ps,10497:ir},vx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ef={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Mr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},QB={CUBICSPLINE:void 0,LINEAR:Vr,STEP:Ns},Cf={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function bx(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function eF(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Kr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:er})),n.DefaultMaterial}function za(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function cs(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function tF(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l<u;l++){const c=e[l];if(c.POSITION!==void 0&&(i=!0),c.NORMAL!==void 0&&(r=!0),i&&r)break}if(!i&&!r)return Promise.resolve(n);const s=[],o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];if(i){const f=c.POSITION!==void 0?t.getDependency("accessor",c.POSITION):n.attributes.position;s.push(f)}if(r){const f=c.NORMAL!==void 0?t.getDependency("accessor",c.NORMAL):n.attributes.normal;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(o)]).then(function(l){const u=l[0],c=l[1];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=c),n.morphTargetsRelative=!0,n})}function nF(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function iF(n){const e=n.extensions&&n.extensions[nt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+xx(e.attributes):t=n.indices+":"+xx(n.attributes)+":"+n.mode,t}function xx(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function Af(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class rF{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new zB,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},typeof createImageBitmap<"u"&&/Firefox/.test(navigator.userAgent)===!1?this.textureLoader=new cf(this.options.manager):this.textureLoader=new Qh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Sn(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const l={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};za(s,l,r),cs(l,r),Promise.all(i._invokeAll(function(u){return u.afterRoot&&u.afterRoot(l)})).then(function(){e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone();return r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[nt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(bx(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],u=vx[r.type],c=ka[r.componentType],f=c.BYTES_PER_ELEMENT,h=f*u,m=r.byteOffset||0,y=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,p=r.normalized===!0;let d,b;if(y&&y!==h){const v=Math.floor(m/y),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let x=t.cache.get(g);x||(d=new c(l,v*y,r.count*y/f),x=new mr(d,y/f),t.cache.add(g,x)),b=new Bi(x,u,m%y/f,p)}else l===null?d=new c(r.count*u):d=new c(l,m,r.count*u),b=new He(d,u,p);if(r.sparse!==void 0){const v=vx.SCALAR,g=ka[r.sparse.indices.componentType],x=r.sparse.indices.byteOffset||0,T=r.sparse.values.byteOffset||0,E=new g(o[1],x,r.sparse.count*v),_=new c(o[2],T,r.sparse.count*u);l!==null&&(b=new He(b.array.slice(),b.itemSize,b.normalized));for(let M=0,S=E.length;M<S;M++){const C=E[M];if(b.setX(C,_[M*u]),u>=2&&b.setY(C,_[M*u+1]),u>=3&&b.setZ(C,_[M*u+2]),u>=4&&b.setW(C,_[M*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",h=!1,m=!0;const y=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||y)&&(m=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(d){if(t.mimeType==="image/png"){const v=new DataView(d,25,1).getUint8(0,!1);m=v===6||v===4||v===3}h=!0;const b=new Blob([d],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const p=Promise.resolve(f).then(function(d){return new Promise(function(b,v){let g=b;i.isImageBitmapLoader===!0&&(g=function(x){const T=new Lt(x);T.needsUpdate=!0,b(T)}),i.load(bx(d,o.path),g,void 0,v)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),m||(d.format=Ci);const v=(s.samplers||{})[l.sampler]||{};return d.magFilter=gx[v.magFilter]||wt,d.minFilter=gx[v.minFilter]||Ti,d.wrapS=yx[v.wrapS]||ir,d.wrapT=yx[v.wrapT]||ir,r.associations.set(d,{type:"textures",index:e}),d}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=p,p}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[nt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[nt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[nt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new gr,Bt.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new kt,Bt.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Kr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const h=r[nt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Ce(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const m=h.baseColorFactor;l.color.fromArray(m),l.opacity=m[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",h.baseColorTexture)),l.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,l.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=tr);const f=s.alphaMode||Cf.OPAQUE;return f===Cf.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===Cf.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==mn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Se(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==mn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==mn&&(l.emissive=new Ce().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==mn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===Tf?h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Ur),h.emissiveMap&&(h.emissiveMap.encoding=Ur),cs(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&za(r,h,s),h})}createUniqueName(e){const t=Qe.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[nt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return Mx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=iF(c),h=r[f];if(h)o.push(h.promise);else{let m;c.extensions&&c.extensions[nt.KHR_DRACO_MESH_COMPRESSION]?m=s(c):m=Mx(new Ve,c,t),r[f]={primitive:c,promise:m},o.push(m)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,l=[];for(let u=0,c=o.length;u<c;u++){const f=o[u].material===void 0?eF(this.cache):this.getDependency("material",o[u].material);l.push(f)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(u){const c=u.slice(0,u.length-1),f=u[u.length-1],h=[];for(let y=0,p=f.length;y<p;y++){const d=f[y],b=o[y];let v;const g=c[y];if(b.mode===Vi.TRIANGLES||b.mode===Vi.TRIANGLE_STRIP||b.mode===Vi.TRIANGLE_FAN||b.mode===void 0)v=s.isSkinnedMesh===!0?new xa(d,g):new Pt(d,g),v.isSkinnedMesh===!0&&!v.geometry.attributes.skinWeight.normalized&&v.normalizeSkinWeights(),b.mode===Vi.TRIANGLE_STRIP?v.geometry=Sx(v.geometry,Ey):b.mode===Vi.TRIANGLE_FAN&&(v.geometry=Sx(v.geometry,kd));else if(b.mode===Vi.LINES)v=new un(d,g);else if(b.mode===Vi.LINE_STRIP)v=new ni(d,g);else if(b.mode===Vi.LINE_LOOP)v=new _c(d,g);else if(b.mode===Vi.POINTS)v=new ro(d,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(v.geometry.morphAttributes).length>0&&nF(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),cs(v,s),b.extensions&&za(r,v,b),t.assignFinalMaterial(v),h.push(v)}if(h.length===1)return h[0];const m=new ti;for(let y=0,p=h.length;y<p;y++)m.add(h[y]);return m})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Vt($d.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new wo(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),cs(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],l=[],u=[];for(let c=0,f=i.channels.length;c<f;c++){const h=i.channels[c],m=i.samplers[h.sampler],y=h.target,p=y.node!==void 0?y.node:y.id,d=i.parameters!==void 0?i.parameters[m.input]:m.input,b=i.parameters!==void 0?i.parameters[m.output]:m.output;r.push(this.getDependency("node",p)),s.push(this.getDependency("accessor",d)),o.push(this.getDependency("accessor",b)),l.push(m),u.push(y)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u)]).then(function(c){const f=c[0],h=c[1],m=c[2],y=c[3],p=c[4],d=[];for(let v=0,g=f.length;v<g;v++){const x=f[v],T=h[v],E=m[v],_=y[v],M=p[v];if(x===void 0)continue;x.updateMatrix(),x.matrixAutoUpdate=!0;let S;switch(Mr[M.path]){case Mr.weights:S=vo;break;case Mr.rotation:S=es;break;case Mr.position:case Mr.scale:default:S=bo;break}const C=x.name?x.name:x.uuid,A=_.interpolation!==void 0?QB[_.interpolation]:Vr,R=[];Mr[M.path]===Mr.weights?x.traverse(function(I){I.isMesh===!0&&I.morphTargetInfluences&&R.push(I.name?I.name:I.uuid)}):R.push(C);let P=E.array;if(E.normalized){const I=Af(P.constructor),O=new Float32Array(P.length);for(let N=0,w=P.length;N<w;N++)O[N]=P[N]*I;P=O}for(let I=0,O=R.length;I<O;I++){const N=new S(R[I]+"."+Mr[M.path],T.array,P,A);_.interpolation==="CUBICSPLINE"&&(N.createInterpolant=function(L){return new Eo(this.times,this.values,this.getValueSize()/3,L)},N.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),d.push(N)}}const b=i.name?i.name:"animation_"+e;return new xo(b,void 0,d)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let u=0,c=r.weights.length;u<c;u++)l.morphTargetInfluences[u]=r.weights[u]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const l=[],u=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return u&&l.push(u),s.camera!==void 0&&l.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){l.push(c)}),Promise.all(l)}().then(function(l){let u;if(s.isBone===!0?u=new wa:l.length>1?u=new ti:l.length===1?u=l[0]:u=new We,u!==l[0])for(let c=0,f=l.length;c<f;c++)u.add(l[c]);if(s.name&&(u.userData.name=s.name,u.name=o),cs(u,s),s.extensions&&za(i,u,s),s.matrix!==void 0){const c=new De;c.fromArray(s.matrix),u.applyMatrix4(c)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.set(u,{type:"nodes",index:e}),u})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new ti;r.name&&(o.name=s.createUniqueName(r.name)),cs(o,r),r.extensions&&za(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(wx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function wx(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(l){o=l;const u=[];for(let c=0,f=o.joints.length;c<f;c++)u.push(i.getDependency("node",o.joints[c]));return Promise.all(u)}).then(function(l){return s.traverse(function(u){if(!u.isMesh)return;const c=[],f=[];for(let h=0,m=l.length;h<m;h++){const y=l[h];if(y){c.push(y);const p=new De;o.inverseBindMatrices!==void 0&&p.fromArray(o.inverseBindMatrices.array,h*16),f.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}u.bind(new Ma(c,f),u.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const l=r.children;for(let u=0,c=l.length;u<c;u++){const f=l[u];o.push(wx(f,s,t,i))}}return Promise.all(o)})}function sF(n,e,t){const i=e.attributes,r=new pn;if(i.POSITION!==void 0){const l=t.json.accessors[i.POSITION],u=l.min,c=l.max;if(u!==void 0&&c!==void 0){if(r.set(new X(u[0],u[1],u[2]),new X(c[0],c[1],c[2])),l.normalized){const f=Af(ka[l.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new X,u=new X;for(let c=0,f=s.length;c<f;c++){const h=s[c];if(h.POSITION!==void 0){const m=t.json.accessors[h.POSITION],y=m.min,p=m.max;if(y!==void 0&&p!==void 0){if(u.setX(Math.max(Math.abs(y[0]),Math.abs(p[0]))),u.setY(Math.max(Math.abs(y[1]),Math.abs(p[1]))),u.setZ(Math.max(Math.abs(y[2]),Math.abs(p[2]))),m.normalized){const d=Af(ka[m.componentType]);u.multiplyScalar(d)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new Li;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function Mx(n,e,t){const i=e.attributes,r=[];function s(o,l){return t.getDependency("accessor",o).then(function(u){n.setAttribute(l,u)})}for(const o in i){const l=Ef[o]||o.toLowerCase();l in n.attributes||r.push(s(i[o],l))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(l){n.setIndex(l)});r.push(o)}return cs(n,e),sF(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?tF(n,e.targets,t):n})}function Sx(n,e){let t=n.getIndex();if(t===null){const o=[],l=n.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)o.push(u);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===kd)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}const oF=Rl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:kB},Symbol.toStringTag,{value:"Module"})));var Lf={exports:{}},_x;function aF(){return _x||(_x=1,function(n){function e(c){var f={};function h(y){if(f[y])return f[y].exports;var p=f[y]={i:y,l:!1,exports:{}};return c[y].call(p.exports,p,p.exports,h),p.l=!0,p.exports}h.m=c,h.c=f,h.i=function(y){return y},h.d=function(y,p,d){h.o(y,p)||Object.defineProperty(y,p,{configurable:!1,enumerable:!0,get:d})},h.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},h.n=function(y){var p=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(p,"a",p),p},h.o=function(y,p){return Object.prototype.hasOwnProperty.call(y,p)},h.p="/",h.oe=function(y){throw console.error(y),y};var m=h(h.s=ENTRY_MODULE);return m.default||m}var t="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+t+").*?\\)";function r(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(c){return!isNaN(1*c)}function o(c,f,h){var m={};m[h]=[];var y=f.toString(),p=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!p)return m;for(var d=p[1],b=new RegExp("(\\\\n|\\W)"+r(d)+i,"g"),v;v=b.exec(y);)v[3]!=="dll-reference"&&m[h].push(v[3]);for(b=new RegExp("\\("+r(d)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");v=b.exec(y);)c[v[2]]||(m[h].push(v[1]),c[v[2]]=__webpack_require__(v[1]).m),m[v[2]]=m[v[2]]||[],m[v[2]].push(v[4]);for(var g=Object.keys(m),x=0;x<g.length;x++)for(var T=0;T<m[g[x]].length;T++)s(m[g[x]][T])&&(m[g[x]][T]=1*m[g[x]][T]);return m}function l(c){var f=Object.keys(c);return f.reduce(function(h,m){return h||c[m].length>0},!1)}function u(c,f){for(var h={main:[f]},m={main:[]},y={main:{}};l(h);)for(var p=Object.keys(h),d=0;d<p.length;d++){var b=p[d],v=h[b],g=v.pop();if(y[b]=y[b]||{},!(y[b][g]||!c[b][g])){y[b][g]=!0,m[b]=m[b]||[],m[b].push(g);for(var x=o(c,c[b][g],b),T=Object.keys(x),E=0;E<T.length;E++)h[T[E]]=h[T[E]]||[],h[T[E]]=h[T[E]].concat(x[T[E]])}}return m}n.exports=function(c,f){f=f||{};var h={main:__webpack_modules__},m=f.all?{main:Object.keys(h.main)}:u(h,c),y="";Object.keys(m).filter(function(g){return g!=="main"}).forEach(function(g){for(var x=0;m[g][x];)x++;m[g].push(x),h[g][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+m[g].map(function(T){return""+JSON.stringify(T)+": "+h[g][T].toString()}).join(",")+`});
3182
- `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+m.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var p=new window.Blob([y],{type:"text/javascript"});if(f.bare)return p;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(p),v=new window.Worker(b);return v.objectURL=b,v}}(Lf)),Lf.exports}function lF(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function cF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function Tx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}Tx.prototype=Error.prototype;function uF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new Tx(s,"All promises were rejected"))})}catch(l){i(l)}})}var dF=setTimeout;function Ex(n){return!!(n&&typeof n.length<"u")}function hF(){}function fF(n,e){return function(){n.apply(e,arguments)}}function xt(n){if(!(this instanceof xt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ax(n,this)}function Cx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,xt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Rf:Ua)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ua(e.promise,r);return}Rf(e.promise,i)})}function Rf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof xt){n._state=3,n._value=e,Pf(n);return}else if(typeof t=="function"){Ax(fF(t,e),n);return}}n._state=1,n._value=e,Pf(n)}catch(i){Ua(n,i)}}function Ua(n,e){n._state=2,n._value=e,Pf(n)}function Pf(n){n._state===2&&n._deferreds.length===0&&xt._immediateFn(function(){n._handled||xt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Cx(n,n._deferreds[e]);n._deferreds=null}function pF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Ax(n,e){var t=!1;try{n(function(i){t||(t=!0,Rf(e,i))},function(i){t||(t=!0,Ua(e,i))})}catch(i){if(t)return;t=!0,Ua(e,i)}}xt.prototype.catch=function(n){return this.then(null,n)},xt.prototype.then=function(n,e){var t=new this.constructor(hF);return Cx(this,new pF(n,e,t)),t},xt.prototype.finally=lF,xt.all=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},xt.any=uF,xt.allSettled=cF,xt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===xt?n:new xt(function(e){e(n)})},xt.reject=function(n){return new xt(function(e,t){t(n)})},xt.race=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)xt.resolve(n[i]).then(e,t)})},xt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){dF(n,0)},xt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const mF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:xt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=lR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.10.0","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,p,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var x=d.localTimeEnabled||d.localMorphColour;p?(g=p,g.morphTargets=x,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var T=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:T,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},m=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,p,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,p,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,p=this.geometry.boundingBox.min,d=new c.Vector2(0-p.x,0-p.y),b=new c.Vector2(y.x-p.x,y.y-p.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],x=this.geometry.vertices[this.geometry.faces[v].b],T=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((x.x+d.x)/b.x,(x.y+d.y)/b.y),new c.Vector2((T.x+d.x)/b.x,(T.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,p){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>p)return;var v=3*p;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=m},o=>{o.exports=wB},(o,l,u)=>{function c(M){throw new TypeError('"'+M+'" is read-only')}var f=u(4),h=u(6).Geometry,m=u(7).default;function y(M){var S=M,C=u(0).modelPrefix;return C&&(C[C.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(M)||(S=C+M)),S}function p(M,S){var C=(R,P)=>{try{var I=new URL(R,P).href;if(R&&2>R.split("?").length){var O=P.split("?");O.length===2&&(I=I+"?"+O[1])}return I}catch{console.error("There is an issue creting the url link with: ".concat(R,"."))}};if(!Array.isArray(M))return C(M,S);var A=[];return M.forEach(R=>{A.push(C(R,S))}),A}function d(M,S,C,A,R){var P=M.morphTargetInfluences,I=void 0;M.geometry&&(I=M.geometry.morphAttributes);var O=!1;if(P&&I&&I.position){A.set(0,0,0),R.set(0,0,0);for(var N=0;N<P.length;N++)0<P[N]&&(O=!0,C.setFromArray(I.position[N].array),A.add(C.min.multiplyScalar(P[N])),R.add(C.max.multiplyScalar(P[N])));O&&S.set(A,R)}O||S.setFromBufferAttribute(M.geometry.attributes.position),M.updateWorldMatrix(!0,!0),S.applyMatrix4(M.matrixWorld)}function b(M,S,C,A){var R=new XMLHttpRequest;R.open("GET",y(M),!0),R.onreadystatechange=()=>{R.readyState==4&&(R.status==200?C(R.responseText,S):A(M))},R.send(null)}function v(M,S,C){function A(N,w){I[w]=N,P++,P==R&&S(I)}for(var R=M.length,P=0,I=[],O=0;O<R;O++)b(M[O],O,A,C)}l.getColorsRGB=(M,S)=>{var C=Math.floor(S/3),A=S%3,R=0;A==0?R=M[C].r:A==1?R=M[C].g:A==2&&(R=M[C].b);var P=new f.Color(R);return[P.r,P.g,P.b]},l.updateMorphColorAttribute=function(M,S){if(S&&M&&M.morphAttributes&&M.morphAttributes.color){var C=M.morphAttributes.color,A=S.morphTargetInfluences,R=A.length;M.deleteAttribute("morphColor0"),M.deleteAttribute("morphColor1");for(var P=0,I=[],O=0;1>P||O<R;O++)0<A[O]&&(P++,I.push([O,A[O]]));I.length==2?(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[1][0]])):I.length==1&&(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[0][0]]))}},l.toBufferGeometry=(M,S)=>{var C;return M instanceof h?(S.localTimeEnabled&&!M.morphNormalsReady&&(M.morphNormals==null||M.morphNormals.length==0)&&M.computeMorphNormals(),C=M.toIndexedBufferGeometry(),S.localMorphColour&&g(M,C)):M instanceof f.BufferGeometry&&(C=M.clone()),C.colorsNeedUpdate=!0,C.computeBoundingBox(),C.computeBoundingSphere(),M._video&&(C._video=M._video),C},l.copyMorphColorsToBufferGeometry=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O=A[P],N=[],w=0;w<M.faces.length;w++){var L=M.faces[w],B=R(O.colors,L.a);N.push(B[0],B[1],B[2]),B=R(O.colors,L.b),N.push(B[0],B[1],B[2]),B=R(O.colors,L.c),N.push(B[0],B[1],B[2])}var D=new f.Float32BufferAttribute(3*(3*M.faces.length),3);D.name=O.name,C.push(D.copyArray(N))}S.morphAttributes.color=C}};var g=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O,N=A[P],w=[],L=0;L<3*N.colors.length;L++)O=R(N.colors,L),w.push(O[0],O[1],O[2]);var B=new f.Float32BufferAttribute(w,3);B.name=N.name,C.push(B)}S.morphAttributes.color=C}};l.mergeVertices=function(M){var S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;S=Math.max(S,Number.EPSILON);for(var C,A={},R=M.getIndex(),P=M.getAttribute("position"),I=R?R.count:P.count,O=0,N=Object.keys(M.attributes),w={},L={},le=[],B=["getX","getY","getZ","getW"],D=0,V=N.length;D<V;D++){C=N[D],w[C]=[];var G=M.morphAttributes[C];G&&(L[C]=Array(G.length).fill().map(()=>[]))}for(var H=Math.log10(1/S),K=Math.pow(10,H),D=0;D<I;D++){for(var te=R?R.getX(D):D,W="",z=0,V=N.length;z<V;z++)for(var C=N[z],j=M.getAttribute(C),Z=j.itemSize,Q=0;Q<Z;Q++)W+="".concat(~~(j[B[Q]](te)*K),",");if(W in A)le.push(A[W]);else{for(var z=0,V=N.length;z<V;z++)for(var ee,C=N[z],j=M.getAttribute(C),G=M.morphAttributes[C],Z=j.itemSize,ie=w[C],Y=L[C],Q=0;Q<Z;Q++)if(ee=B[Q],ie.push(j[ee](te)),G)for(var ne=0,F=G.length;ne<F;ne++)Y[ne].push(G[ne][ee](te));A[W]=O,le.push(O),O++}}for(var $=M.clone(),D=0,V=N.length;D<V;D++){var j,C=N[D],J=M.getAttribute(C),k=new J.array.constructor(w[C]);if(J.isInterleavedBufferAttribute?j=new f.BufferAttribute(k,J.itemSize,J.itemSize):(j=M.getAttribute(C).clone(),j.setArray(k)),$.setAttribute(C,j),C in L)for(var U,z=0;z<L[C].length;z++)U=M.morphAttributes[C][z].clone(),U.setArray(new U.array.constructor(L[C][z])),$.morphAttributes[C][z]=U}var oe=Uint8Array;le.length>=Math.pow(2,8)&&(oe=Uint16Array),le.length>=Math.pow(2,16)&&(oe=Uint32Array);var ae=new oe(le),le=null;return R===null?le=new f.BufferAttribute(ae,1):(le=M.getIndex().clone(),le.setArray(ae)),$.setIndex(le),$};function x(M){if(M.isMeshPhongMaterial){var S=new f.MeshToonMaterial({color:M.color.clone(),morphTargets:M.morphTargets,morphNormals:M.morphNormals,vertexColors:M.vertexColors,transparent:M.transparent,opacity:M.opacity,side:M.side});return M.map&&(S.map=M.map),S}return M}function T(M,S){if(S&&M>=S.length){var C=new f.BufferGeometry,A=new Float32Array(3*M),R=0;return S.forEach(P=>{A[R++]=P[0],A[R++]=P[1],A[R++]=P[2]}),C.setAttribute("position",new f.BufferAttribute(A,3)),C.setDrawRange(0,S.length),C}}function E(){var M=new Image;M.src=u(8);var S=new f.Texture;return S.image=M,S.needsUpdate=!0,S}function _(M,S,C,A,R,P){var I=new m(M,S,C,A,R,P);return I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}l.getBoundingBox=d,l.createNewURL=p,l.createBufferGeometry=T,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=x,l.createNewSpriteText=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>p});var c=u(4),f=new c.Matrix4,h=new c.Object3D,m=new c.Vector3,y=new c.Vector3;function p(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}p.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:p,isGeometry:!0,applyMatrix4:function(g){for(var x,T=new c.Matrix3().getNormalMatrix(g),E=0,_=this.vertices.length;E<_;E++)x=this.vertices[E],x.applyMatrix4(g);for(var M,S=0,C=this.faces.length;S<C;S++){M=this.faces[S],M.normal.applyMatrix3(T).normalize();for(var A=0,R=M.vertexNormals.length;A<R;A++)M.vertexNormals[A].applyMatrix3(T).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,x,T){return f.makeTranslation(g,x,T),this.applyMatrix4(f),this},scale:function(g,x,T){return f.makeScale(g,x,T),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function x(H,K,te,W){var z=C===void 0?[]:[T.colors[H].clone(),T.colors[K].clone(),T.colors[te].clone()],j=S===void 0?[]:[new c.Vector3().fromBufferAttribute(S,H),new c.Vector3().fromBufferAttribute(S,K),new c.Vector3().fromBufferAttribute(S,te)],Z=new b(H,K,te,j,z,W);T.faces.push(Z),A!==void 0&&T.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(A,H),new c.Vector2().fromBufferAttribute(A,K),new c.Vector2().fromBufferAttribute(A,te)]),R!==void 0&&T.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(R,H),new c.Vector2().fromBufferAttribute(R,K),new c.Vector2().fromBufferAttribute(R,te)])}var T=this,E=g.index===null?void 0:g.index,_=g.attributes;if(_.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var M=_.position,S=_.normal,C=_.color,A=_.uv,R=_.uv2;R!==void 0&&(this.faceVertexUvs[1]=[]);for(var P=0;P<M.count;P++)T.vertices.push(new c.Vector3().fromBufferAttribute(M,P)),C!==void 0&&T.colors.push(new c.Color().fromBufferAttribute(C,P));var I=g.groups;if(0<I.length)for(var O=0;O<I.length;O++)for(var N=I[O],w=N.start,L=N.count,B=w,D=w+L;B<D;B+=3)E===void 0?x(B,B+1,B+2,N.materialIndex):x(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var V=0;V<E.count;V+=3)x(E.getX(V),E.getX(V+1),E.getX(V+2));else for(var G=0;G<M.count;G+=3)x(G,G+1,G+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(m).negate(),this.translate(m.x,m.y,m.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,x=this.boundingSphere.radius,T=x===0?1:1/x,E=new c.Matrix4;return E.set(T,0,0,-T*g.x,0,T,0,-T*g.y,0,0,T,-T*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,x=new c.Vector3,T=0,E=this.faces.length;T<E;T++){var _=this.faces[T],M=this.vertices[_.a],S=this.vertices[_.b],C=this.vertices[_.c];g.subVectors(C,S),x.subVectors(M,S),g.cross(x),g.normalize(),_.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],x=Array(this.vertices.length),T=0,E=this.vertices.length;T<E;T++)x[T]=new c.Vector3;if(g)for(var _=new c.Vector3,M=new c.Vector3,S=0,C=this.faces.length;S<C;S++){var A=this.faces[S],R=this.vertices[A.a],P=this.vertices[A.b],I=this.vertices[A.c];_.subVectors(I,P),M.subVectors(R,P),_.cross(M),x[A.a].add(_),x[A.b].add(_),x[A.c].add(_)}else{this.computeFaceNormals();for(var O,N=0,w=this.faces.length;N<w;N++)O=this.faces[N],x[O.a].add(O.normal),x[O.b].add(O.normal),x[O.c].add(O.normal)}for(var L=0,B=this.vertices.length;L<B;L++)x[L].normalize();for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=G.vertexNormals;H.length===3?(H[0].copy(x[G.a]),H[1].copy(x[G.b]),H[2].copy(x[G.c])):(H[0]=x[G.a].clone(),H[1]=x[G.b].clone(),H[2]=x[G.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),x},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,x=this.faces.length;g<x;g++){var T=this.faces[g],E=T.vertexNormals;E.length===3?(E[0].copy(T.normal),E[1].copy(T.normal),E[2].copy(T.normal)):(E[0]=T.normal.clone(),E[1]=T.normal.clone(),E[2]=T.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,x=0,T=this.faces.length;x<T;x++){g=this.faces[x],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,_=g.vertexNormals.length;E<_;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var M=new p;M.faces=this.faces;for(var S=0,C=this.morphTargets.length;S<C;S++){if(!this.morphNormals[S]){this.morphNormals[S]={},this.morphNormals[S].faceNormals=[],this.morphNormals[S].vertexNormals=[];for(var A=this.morphNormals[S].faceNormals,R=this.morphNormals[S].vertexNormals,P=0,I=this.faces.length;P<I;P++){var O=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};A.push(O),R.push(N)}}var w=this.morphNormals[S];M.vertices=this.morphTargets[S].vertices,M.computeFaceNormals();var L=M.computeVertexNormals();if(L&&0<L.length){this.morphTargets[S].normals=Array(this.vertices.length);for(var B=0;B<L.length;B++)this.morphTargets[S].normals[B]=L[B].clone()}for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=w.faceNormals[D],K=w.vertexNormals[D];H.copy(G.normal),K.a.copy(G.vertexNormals[0]),K.b.copy(G.vertexNormals[1]),K.c.copy(G.vertexNormals[2])}}for(var te,W=0,z=this.faces.length;W<z;W++)te=this.faces[W],te.normal=te.__originalFaceNormal,te.vertexNormals=te.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,x){var T=this.morphTargets.length,E=this.morphTargets,_=g.morphTargets,M=this.morphColors.length,S=this.morphColors,C=g.morphColors;if(0<T&&T==_.length)for(var A=0,R=E.length;A<R;A++){for(var P=E[A],I=_[A],O=0,N=I.vertices.length;O<N;O++){var w=I.vertices[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),P.vertices.push(L)}if(P.normals&&I.normals)for(var B=0;B<I.normals.length;B+=3)y.set(I.normals2[B],I.normals2[B+1],I.normals2[B+2]),x!==void 0&&y.applyMatrix4(x),P.normals.push(y.x,y.y,y.z)}if(0<M&&M==C.length)for(var D=0,V=S.length;D<V;D++)for(var G=S[D],H=C[D],K=0,te=H.colors;K<te;K++)G.colors.push(H.colors[K].clone())},merge:function(g,x){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var E,_=this.vertices.length,M=this.vertices,S=g.vertices,C=g.normals,A=this.faces,R=g.faces,P=this.colors,I=g.colors;x!==void 0&&(E=new c.Matrix3().getNormalMatrix(x));for(var O=0,N=S.length;O<N;O++){var w=S[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),M.push(L)}for(var B=0;B<C.length;B+=3)y.set(C[B],C[B+1],C[B+2]),x!==void 0&&y.applyMatrix4(x),this.normals.push(y.x,y.y,y.z);for(var D=0,V=I.length;D<V;D++)P.push(I[D].clone());for(var G=0,H=R.length;G<H;G++){var K=R[G],te=void 0,W=void 0,z=K.vertexNormals,j=K.vertexColors,Z=new b(K.a+_,K.b+_,K.c+_);Z.normal.copy(K.normal),E!==void 0&&Z.normal.applyMatrix3(E).normalize();for(var Q=0,ee=z.length;Q<ee;Q++)te=z[Q].clone(),E!==void 0&&te.applyMatrix3(E).normalize(),Z.vertexNormals.push(te);Z.color.copy(K.color);for(var ie=0,Y=j.length;ie<Y;ie++)W=j[ie],Z.vertexColors.push(W.clone());Z.materialIndex=K.materialIndex+T,A.push(Z)}for(var ne,F=0,$=g.faceVertexUvs.length;F<$;F++){ne=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var J=0,k=ne.length;J<k;J++){for(var U=ne[J],oe=[],ae=0,le=U.length;ae<le;ae++)oe.push(U[ae].clone());this.faceVertexUvs[F].push(oe)}}this.mergeMorph(g,x)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,x={},T=[],E=[],_=Math.pow(10,g),M=0,S=this.vertices.length;M<S;M++){var C=this.vertices[M],A=Math.round(C.x*_)+"_"+Math.round(C.y*_)+"_"+Math.round(C.z*_);x[A]===void 0?(x[A]=M,T.push(this.vertices[M]),E[M]=T.length-1):E[M]=E[x[A]]}for(var R,P=[],I=0,O=this.faces.length;I<O;I++){R=this.faces[I],R.a=E[R.a],R.b=E[R.b],R.c=E[R.c];for(var N=[R.a,R.b,R.c],w=0;3>w;w++)if(N[w]===N[(w+1)%3]){P.push(I);break}}for(var L,B=P.length-1;0<=B;B--){L=P[B],this.faces.splice(L,1);for(var D=0,V=this.faceVertexUvs.length;D<V;D++)this.faceVertexUvs[D].splice(L,1)}var G=this.vertices.length-T.length;return this.vertices=T,G},setFromPoints:function(g){this.vertices=[];for(var x,T=0,E=g.length;T<E;T++)x=g[T],this.vertices.push(new c.Vector3(x.x,x.y,x.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,x=g.length,T=0;T<x;T++)g[T]._id=T;g.sort(function(R,P){return R.materialIndex-P.materialIndex});var E,_,M=this.faceVertexUvs[0],S=this.faceVertexUvs[1];M&&M.length===x&&(E=[]),S&&S.length===x&&(_=[]);for(var C,A=0;A<x;A++)C=g[A]._id,E&&E.push(M[C]),_&&_.push(S[C]);E&&(this.faceVertexUvs[0]=E),_&&(this.faceVertexUvs[1]=_)},toJSON:function(){function g(Y,ne,F){return F?Y|1<<ne:Y&~(1<<ne)}function x(Y){var ne=Y.x.toString()+Y.y.toString()+Y.z.toString();return O[ne]===void 0&&(O[ne]=I.length/3,I.push(Y.x,Y.y,Y.z)),O[ne]}function T(Y){var ne=Y.r.toString()+Y.g.toString()+Y.b.toString();return w[ne]===void 0&&(w[ne]=N.length,N.push(Y.getHex())),w[ne]}function E(Y){var ne=Y.x.toString()+Y.y.toString();return B[ne]===void 0&&(B[ne]=L.length/2,L.push(Y.x,Y.y)),B[ne]}var _={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(_.uuid=this.uuid,_.type=this.type,this.name!==""&&(_.name=this.name),this.parameters!==void 0){var M=this.parameters;for(var S in M)M[S]!==void 0&&(_[S]=M[S]);return _}for(var C,A=[],R=0;R<this.vertices.length;R++)C=this.vertices[R],A.push(C.x,C.y,C.z);for(var P=[],I=[],O={},N=[],w={},L=[],B={},D=0;D<this.faces.length;D++){var V=this.faces[D],G=!0,H=!1,K=this.faceVertexUvs[0][D]!==void 0,te=0<V.normal.length(),W=0<V.vertexNormals.length,z=V.color.r!==1||V.color.g!==1||V.color.b!==1,j=0<V.vertexColors.length,Z=0;if(Z=g(Z,0,0),Z=g(Z,1,G),Z=g(Z,2,H),Z=g(Z,3,K),Z=g(Z,4,te),Z=g(Z,5,W),Z=g(Z,6,z),Z=g(Z,7,j),P.push(Z),P.push(V.a,V.b,V.c),P.push(V.materialIndex),K){var Q=this.faceVertexUvs[0][D];P.push(E(Q[0]),E(Q[1]),E(Q[2]))}if(te&&P.push(x(V.normal)),W){var ee=V.vertexNormals;P.push(x(ee[0]),x(ee[1]),x(ee[2]))}if(z&&P.push(T(V.color)),j){var ie=V.vertexColors;P.push(T(ie[0]),T(ie[1]),T(ie[2]))}}return _.data={},_.data.vertices=A,_.data.normals=I,0<N.length&&(_.data.colors=N),0<L.length&&(_.data.uvs=[L]),_.data.faces=P,_},clone:function(){return new p().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var x=g.vertices,T=0,E=x.length;T<E;T++)this.vertices.push(x[T].clone());for(var _=g.colors,M=0,S=_.length;M<S;M++)this.colors.push(_[M].clone());for(var C=g.faces,A=0,R=C.length;A<R;A++)this.faces.push(C[A].clone());for(var P,I=0,O=g.faceVertexUvs.length;I<O;I++){P=g.faceVertexUvs[I],this.faceVertexUvs[I]===void 0&&(this.faceVertexUvs[I]=[]);for(var N=0,w=P.length;N<w;N++){for(var L,B=P[N],D=[],V=0,G=B.length;V<G;V++)L=B[V],D.push(L.clone());this.faceVertexUvs[I].push(D)}}for(var H,K=g.morphTargets,te=0,W=K.length;te<W;te++){if(H={},H.name=K[te].name,K[te].vertices!==void 0){H.vertices=[];for(var z=0,j=K[te].vertices.length;z<j;z++)H.vertices.push(K[te].vertices[z].clone())}if(K[te].normals!==void 0){H.normals=[];for(var Z=0,Q=K[te].normals.length;Z<Q;Z++)H.normals.push(K[te].normals[Z].clone())}this.morphTargets.push(H)}for(var ee,ie=g.morphNormals,Y=0,ne=ie.length;Y<ne;Y++){if(ee={},ie[Y].vertexNormals!==void 0){ee.vertexNormals=[];for(var F=0,$=ie[Y].vertexNormals.length;F<$;F++){var J=ie[Y].vertexNormals[F],k={};k.a=J.a.clone(),k.b=J.b.clone(),k.c=J.c.clone(),ee.vertexNormals.push(k)}}if(ie[Y].faceNormals!==void 0){ee.faceNormals=[];for(var U=0,oe=ie[Y].faceNormals.length;U<oe;U++)ee.faceNormals.push(ie[Y].faceNormals[U].clone())}this.morphNormals.push(ee)}for(var ae=g.skinWeights,le=0,de=ae.length;le<de;le++)this.skinWeights.push(ae[le].clone());for(var be=g.skinIndices,we=0,ue=be.length;we<ue;we++)this.skinIndices.push(be[we].clone());for(var me=g.lineDistances,se=0,xe=me.length;se<xe;se++)this.lineDistances.push(me[se]);var he=g.boundingBox;he!==null&&(this.boundingBox=he.clone());var ge=g.boundingSphere;return ge!==null&&(this.boundingSphere=ge.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,x=[],T=void 0,E=this.faces;for(g=0;g<E.length;g++){var _=E[g];_.materialIndex!==T&&(T=_.materialIndex,v!==void 0&&(v.count=3*g-v.start,x.push(v)),v={start:3*g,materialIndex:T})}return v!==void 0&&(v.count=3*g-v.start,x.push(v)),x},toBufferGeometry:function(){var g=new d().fromGeometry(this),x=new c.BufferGeometry,T=new Float32Array(3*g.vertices.length);if(x.setAttribute("position",new c.BufferAttribute(T,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);x.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var _=new Float32Array(3*g.colors.length);x.setAttribute("color",new c.BufferAttribute(_,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var M=new Float32Array(2*g.uvs.length);x.setAttribute("uv",new c.BufferAttribute(M,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var S=new Float32Array(2*g.uvs2.length);x.setAttribute("uv2",new c.BufferAttribute(S,2).copyVector2sArray(g.uvs2))}for(var C in x.groups=g.groups,g.morphTargets){for(var A=[],R=g.morphTargets[C],P=0,I=R.length;P<I;P++){var O=R[P],N=new c.Float32BufferAttribute(3*O.data.length,3);N.name=O.name,A.push(N.copyVector3sArray(O.data))}x.morphAttributes[C]=A}if(0<g.skinIndices.length){var w=new c.Float32BufferAttribute(4*g.skinIndices.length,4);x.setAttribute("skinIndex",w.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var L=new c.Float32BufferAttribute(4*g.skinWeights.length,4);x.setAttribute("skinWeight",L.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(x.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(x.boundingBox=g.boundingBox.clone()),x},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,x=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(x,3).copyVector3sArray(this.vertices)),0<this.normals.length){var T=new Float32Array(this.normals.length),E=new c.BufferAttribute(T,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var _=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(_,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var M=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(M,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var S=[],C=0;C<this.colors.length;C++)S.push(new c.Color(this.colors[C]));var A=new Float32Array(3*S.length);g.setAttribute("color",new c.BufferAttribute(A,3).copyColorsArray(S))}else{for(var R=new Float32Array(3*this.vertices.length),P=0;P<3*this.vertices.length;P++)R[P]=1;g.setAttribute("color",new c.BufferAttribute(R,3))}if(0<this.faces.length){for(var I=[],O=[],N=0;N<this.faces.length;N++){O.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var w=this.faces[N].vertexColors;if(w.length===3)I.push(w[0],w[1],w[2]);else{var L=this.faces[N].color;I.push(L,L,L)}}g.setIndex(O),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],V=0,G=this.morphTargets.length;V<G;V++){var H=this.morphTargets[V],K=new c.Float32BufferAttribute(3*H.vertices.length,3);if(K.name=H.name,B.push(K.copyVector3sArray(H.vertices)),H.normals){var te=new c.Float32BufferAttribute(3*H.normals.length,3);te.name=H.name,D.push(te.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var W=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",W.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var z=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",z.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),p.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,x=v.geometry;if(v.isPoints||v.isLine){var T=new c.Float32BufferAttribute(3*x.vertices.length,3),E=new c.Float32BufferAttribute(3*x.colors.length,3);if(g.setAttribute("position",T.copyVector3sArray(x.vertices)),g.setAttribute("color",E.copyColorsArray(x.colors)),x.lineDistances&&x.lineDistances.length===x.vertices.length){var _=new c.Float32BufferAttribute(x.lineDistances.length,1);g.setAttribute("lineDistance",_.copyArray(x.lineDistances))}x.boundingSphere!==null&&(g.boundingSphere=x.boundingSphere.clone()),x.boundingBox!==null&&(g.boundingBox=x.boundingBox.clone())}else v.isMesh&&(g=x.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var x,T,E=[],_=void 0,M=g.faces;for(T=0;T<M.length;T++){var S=M[T];S.materialIndex!==_&&(_=S.materialIndex,x!==void 0&&(x.count=3*T-x.start,E.push(x)),x={start:3*T,materialIndex:_})}x!==void 0&&(x.count=3*T-x.start,E.push(x)),this.groups=E}fromGeometry(g){var x,T=g.faces,E=g.vertices,_=g.faceVertexUvs,M=_[0]&&0<_[0].length,S=_[1]&&0<_[1].length,C=g.morphTargets,A=C.length;if(0<A){x=[];for(var R=0;R<A;R++)x[R]={name:C[R].name,data:[]};this.morphTargets.position=x}var P,I=g.morphNormals,O=I.length;if(0<O){P=[];for(var N=0;N<O;N++)P[N]={name:I[N].name,data:[]};this.morphTargets.normal=P}var w=g.skinIndices,L=g.skinWeights,B=w.length===E.length,D=L.length===E.length;0<E.length&&T.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,G=0;G<T.length;G++){V=T[G],this.vertices.push(E[V.a],E[V.b],E[V.c]);var H=V.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var K=V.normal;this.normals.push(K,K,K)}var te=V.vertexColors;if(te.length===3)this.colors.push(te[0],te[1],te[2]);else{var W=V.color;this.colors.push(W,W,W)}if(M===!0){var z=_[0][G];z===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",G),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(z[0],z[1],z[2])}if(S===!0){var j=_[1][G];j===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",G),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(j[0],j[1],j[2])}for(var Z,Q=0;Q<A;Q++)Z=C[Q].vertices,x[Q].data.push(Z[V.a],Z[V.b],Z[V.c]);for(var ee,ie=0;ie<O;ie++)ee=I[ie].vertexNormals[G],P[ie].data.push(ee.a,ee.b,ee.c);B&&this.skinIndices.push(w[V.a],w[V.b],w[V.c]),D&&this.skinWeights.push(L[V.a],L[V.b],L[V.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,x,T,E,_){var M=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=x,this.c=T,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=_&&_.isColor?_:new c.Color,this.vertexColors=Array.isArray(_)?_:[],this.materialIndex=M}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var x=0,T=g.vertexNormals.length;x<T;x++)this.vertexNormals[x]=g.vertexNormals[x].clone();for(var E=0,_=g.vertexColors.length;E<_;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=FB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3182
+ `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+m.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var p=new window.Blob([y],{type:"text/javascript"});if(f.bare)return p;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(p),v=new window.Worker(b);return v.objectURL=b,v}}(Lf)),Lf.exports}function lF(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function cF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function Tx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}Tx.prototype=Error.prototype;function uF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new Tx(s,"All promises were rejected"))})}catch(l){i(l)}})}var dF=setTimeout;function Ex(n){return!!(n&&typeof n.length<"u")}function hF(){}function fF(n,e){return function(){n.apply(e,arguments)}}function xt(n){if(!(this instanceof xt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ax(n,this)}function Cx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,xt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Rf:Ua)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ua(e.promise,r);return}Rf(e.promise,i)})}function Rf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof xt){n._state=3,n._value=e,Pf(n);return}else if(typeof t=="function"){Ax(fF(t,e),n);return}}n._state=1,n._value=e,Pf(n)}catch(i){Ua(n,i)}}function Ua(n,e){n._state=2,n._value=e,Pf(n)}function Pf(n){n._state===2&&n._deferreds.length===0&&xt._immediateFn(function(){n._handled||xt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Cx(n,n._deferreds[e]);n._deferreds=null}function pF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Ax(n,e){var t=!1;try{n(function(i){t||(t=!0,Rf(e,i))},function(i){t||(t=!0,Ua(e,i))})}catch(i){if(t)return;t=!0,Ua(e,i)}}xt.prototype.catch=function(n){return this.then(null,n)},xt.prototype.then=function(n,e){var t=new this.constructor(hF);return Cx(this,new pF(n,e,t)),t},xt.prototype.finally=lF,xt.all=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},xt.any=uF,xt.allSettled=cF,xt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===xt?n:new xt(function(e){e(n)})},xt.reject=function(n){return new xt(function(e,t){t(n)})},xt.race=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)xt.resolve(n[i]).then(e,t)})},xt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){dF(n,0)},xt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const mF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:xt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=lR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.10.2","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,p,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var x=d.localTimeEnabled||d.localMorphColour;p?(g=p,g.morphTargets=x,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var T=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:T,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},m=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,p,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,p,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,p=this.geometry.boundingBox.min,d=new c.Vector2(0-p.x,0-p.y),b=new c.Vector2(y.x-p.x,y.y-p.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],x=this.geometry.vertices[this.geometry.faces[v].b],T=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((x.x+d.x)/b.x,(x.y+d.y)/b.y),new c.Vector2((T.x+d.x)/b.x,(T.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,p){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>p)return;var v=3*p;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=m},o=>{o.exports=wB},(o,l,u)=>{function c(M){throw new TypeError('"'+M+'" is read-only')}var f=u(4),h=u(6).Geometry,m=u(7).default;function y(M){var S=M,C=u(0).modelPrefix;return C&&(C[C.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(M)||(S=C+M)),S}function p(M,S){var C=(R,P)=>{try{var I=new URL(R,P).href;if(R&&2>R.split("?").length){var O=P.split("?");O.length===2&&(I=I+"?"+O[1])}return I}catch{console.error("There is an issue creting the url link with: ".concat(R,"."))}};if(!Array.isArray(M))return C(M,S);var A=[];return M.forEach(R=>{A.push(C(R,S))}),A}function d(M,S,C,A,R){var P=M.morphTargetInfluences,I=void 0;M.geometry&&(I=M.geometry.morphAttributes);var O=!1;if(P&&I&&I.position){A.set(0,0,0),R.set(0,0,0);for(var N=0;N<P.length;N++)0<P[N]&&(O=!0,C.setFromArray(I.position[N].array),A.add(C.min.multiplyScalar(P[N])),R.add(C.max.multiplyScalar(P[N])));O&&S.set(A,R)}O||S.setFromBufferAttribute(M.geometry.attributes.position),M.updateWorldMatrix(!0,!0),S.applyMatrix4(M.matrixWorld)}function b(M,S,C,A){var R=new XMLHttpRequest;R.open("GET",y(M),!0),R.onreadystatechange=()=>{R.readyState==4&&(R.status==200?C(R.responseText,S):A(M))},R.send(null)}function v(M,S,C){function A(N,w){I[w]=N,P++,P==R&&S(I)}for(var R=M.length,P=0,I=[],O=0;O<R;O++)b(M[O],O,A,C)}l.getColorsRGB=(M,S)=>{var C=Math.floor(S/3),A=S%3,R=0;A==0?R=M[C].r:A==1?R=M[C].g:A==2&&(R=M[C].b);var P=new f.Color(R);return[P.r,P.g,P.b]},l.updateMorphColorAttribute=function(M,S){if(S&&M&&M.morphAttributes&&M.morphAttributes.color){var C=M.morphAttributes.color,A=S.morphTargetInfluences,R=A.length;M.deleteAttribute("morphColor0"),M.deleteAttribute("morphColor1");for(var P=0,I=[],O=0;1>P||O<R;O++)0<A[O]&&(P++,I.push([O,A[O]]));I.length==2?(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[1][0]])):I.length==1&&(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[0][0]]))}},l.toBufferGeometry=(M,S)=>{var C;return M instanceof h?(S.localTimeEnabled&&!M.morphNormalsReady&&(M.morphNormals==null||M.morphNormals.length==0)&&M.computeMorphNormals(),C=M.toIndexedBufferGeometry(),S.localMorphColour&&g(M,C)):M instanceof f.BufferGeometry&&(C=M.clone()),C.colorsNeedUpdate=!0,C.computeBoundingBox(),C.computeBoundingSphere(),M._video&&(C._video=M._video),C},l.copyMorphColorsToBufferGeometry=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O=A[P],N=[],w=0;w<M.faces.length;w++){var L=M.faces[w],B=R(O.colors,L.a);N.push(B[0],B[1],B[2]),B=R(O.colors,L.b),N.push(B[0],B[1],B[2]),B=R(O.colors,L.c),N.push(B[0],B[1],B[2])}var D=new f.Float32BufferAttribute(3*(3*M.faces.length),3);D.name=O.name,C.push(D.copyArray(N))}S.morphAttributes.color=C}};var g=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O,N=A[P],w=[],L=0;L<3*N.colors.length;L++)O=R(N.colors,L),w.push(O[0],O[1],O[2]);var B=new f.Float32BufferAttribute(w,3);B.name=N.name,C.push(B)}S.morphAttributes.color=C}};l.mergeVertices=function(M){var S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;S=Math.max(S,Number.EPSILON);for(var C,A={},R=M.getIndex(),P=M.getAttribute("position"),I=R?R.count:P.count,O=0,N=Object.keys(M.attributes),w={},L={},le=[],B=["getX","getY","getZ","getW"],D=0,V=N.length;D<V;D++){C=N[D],w[C]=[];var G=M.morphAttributes[C];G&&(L[C]=Array(G.length).fill().map(()=>[]))}for(var H=Math.log10(1/S),K=Math.pow(10,H),D=0;D<I;D++){for(var te=R?R.getX(D):D,W="",z=0,V=N.length;z<V;z++)for(var C=N[z],j=M.getAttribute(C),Z=j.itemSize,Q=0;Q<Z;Q++)W+="".concat(~~(j[B[Q]](te)*K),",");if(W in A)le.push(A[W]);else{for(var z=0,V=N.length;z<V;z++)for(var ee,C=N[z],j=M.getAttribute(C),G=M.morphAttributes[C],Z=j.itemSize,ie=w[C],Y=L[C],Q=0;Q<Z;Q++)if(ee=B[Q],ie.push(j[ee](te)),G)for(var ne=0,F=G.length;ne<F;ne++)Y[ne].push(G[ne][ee](te));A[W]=O,le.push(O),O++}}for(var $=M.clone(),D=0,V=N.length;D<V;D++){var j,C=N[D],J=M.getAttribute(C),k=new J.array.constructor(w[C]);if(J.isInterleavedBufferAttribute?j=new f.BufferAttribute(k,J.itemSize,J.itemSize):(j=M.getAttribute(C).clone(),j.setArray(k)),$.setAttribute(C,j),C in L)for(var U,z=0;z<L[C].length;z++)U=M.morphAttributes[C][z].clone(),U.setArray(new U.array.constructor(L[C][z])),$.morphAttributes[C][z]=U}var oe=Uint8Array;le.length>=Math.pow(2,8)&&(oe=Uint16Array),le.length>=Math.pow(2,16)&&(oe=Uint32Array);var ae=new oe(le),le=null;return R===null?le=new f.BufferAttribute(ae,1):(le=M.getIndex().clone(),le.setArray(ae)),$.setIndex(le),$};function x(M){if(M.isMeshPhongMaterial){var S=new f.MeshToonMaterial({color:M.color.clone(),morphTargets:M.morphTargets,morphNormals:M.morphNormals,vertexColors:M.vertexColors,transparent:M.transparent,opacity:M.opacity,side:M.side});return M.map&&(S.map=M.map),S}return M}function T(M,S){if(S&&M>=S.length){var C=new f.BufferGeometry,A=new Float32Array(3*M),R=0;return S.forEach(P=>{A[R++]=P[0],A[R++]=P[1],A[R++]=P[2]}),C.setAttribute("position",new f.BufferAttribute(A,3)),C.setDrawRange(0,S.length),C}}function E(){var M=new Image;M.src=u(8);var S=new f.Texture;return S.image=M,S.needsUpdate=!0,S}function _(M,S,C,A,R,P){var I=new m(M,S,C,A,R,P);return I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}l.getBoundingBox=d,l.createNewURL=p,l.createBufferGeometry=T,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=x,l.createNewSpriteText=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>p});var c=u(4),f=new c.Matrix4,h=new c.Object3D,m=new c.Vector3,y=new c.Vector3;function p(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}p.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:p,isGeometry:!0,applyMatrix4:function(g){for(var x,T=new c.Matrix3().getNormalMatrix(g),E=0,_=this.vertices.length;E<_;E++)x=this.vertices[E],x.applyMatrix4(g);for(var M,S=0,C=this.faces.length;S<C;S++){M=this.faces[S],M.normal.applyMatrix3(T).normalize();for(var A=0,R=M.vertexNormals.length;A<R;A++)M.vertexNormals[A].applyMatrix3(T).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,x,T){return f.makeTranslation(g,x,T),this.applyMatrix4(f),this},scale:function(g,x,T){return f.makeScale(g,x,T),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function x(H,K,te,W){var z=C===void 0?[]:[T.colors[H].clone(),T.colors[K].clone(),T.colors[te].clone()],j=S===void 0?[]:[new c.Vector3().fromBufferAttribute(S,H),new c.Vector3().fromBufferAttribute(S,K),new c.Vector3().fromBufferAttribute(S,te)],Z=new b(H,K,te,j,z,W);T.faces.push(Z),A!==void 0&&T.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(A,H),new c.Vector2().fromBufferAttribute(A,K),new c.Vector2().fromBufferAttribute(A,te)]),R!==void 0&&T.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(R,H),new c.Vector2().fromBufferAttribute(R,K),new c.Vector2().fromBufferAttribute(R,te)])}var T=this,E=g.index===null?void 0:g.index,_=g.attributes;if(_.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var M=_.position,S=_.normal,C=_.color,A=_.uv,R=_.uv2;R!==void 0&&(this.faceVertexUvs[1]=[]);for(var P=0;P<M.count;P++)T.vertices.push(new c.Vector3().fromBufferAttribute(M,P)),C!==void 0&&T.colors.push(new c.Color().fromBufferAttribute(C,P));var I=g.groups;if(0<I.length)for(var O=0;O<I.length;O++)for(var N=I[O],w=N.start,L=N.count,B=w,D=w+L;B<D;B+=3)E===void 0?x(B,B+1,B+2,N.materialIndex):x(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var V=0;V<E.count;V+=3)x(E.getX(V),E.getX(V+1),E.getX(V+2));else for(var G=0;G<M.count;G+=3)x(G,G+1,G+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(m).negate(),this.translate(m.x,m.y,m.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,x=this.boundingSphere.radius,T=x===0?1:1/x,E=new c.Matrix4;return E.set(T,0,0,-T*g.x,0,T,0,-T*g.y,0,0,T,-T*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,x=new c.Vector3,T=0,E=this.faces.length;T<E;T++){var _=this.faces[T],M=this.vertices[_.a],S=this.vertices[_.b],C=this.vertices[_.c];g.subVectors(C,S),x.subVectors(M,S),g.cross(x),g.normalize(),_.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],x=Array(this.vertices.length),T=0,E=this.vertices.length;T<E;T++)x[T]=new c.Vector3;if(g)for(var _=new c.Vector3,M=new c.Vector3,S=0,C=this.faces.length;S<C;S++){var A=this.faces[S],R=this.vertices[A.a],P=this.vertices[A.b],I=this.vertices[A.c];_.subVectors(I,P),M.subVectors(R,P),_.cross(M),x[A.a].add(_),x[A.b].add(_),x[A.c].add(_)}else{this.computeFaceNormals();for(var O,N=0,w=this.faces.length;N<w;N++)O=this.faces[N],x[O.a].add(O.normal),x[O.b].add(O.normal),x[O.c].add(O.normal)}for(var L=0,B=this.vertices.length;L<B;L++)x[L].normalize();for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=G.vertexNormals;H.length===3?(H[0].copy(x[G.a]),H[1].copy(x[G.b]),H[2].copy(x[G.c])):(H[0]=x[G.a].clone(),H[1]=x[G.b].clone(),H[2]=x[G.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),x},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,x=this.faces.length;g<x;g++){var T=this.faces[g],E=T.vertexNormals;E.length===3?(E[0].copy(T.normal),E[1].copy(T.normal),E[2].copy(T.normal)):(E[0]=T.normal.clone(),E[1]=T.normal.clone(),E[2]=T.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,x=0,T=this.faces.length;x<T;x++){g=this.faces[x],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,_=g.vertexNormals.length;E<_;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var M=new p;M.faces=this.faces;for(var S=0,C=this.morphTargets.length;S<C;S++){if(!this.morphNormals[S]){this.morphNormals[S]={},this.morphNormals[S].faceNormals=[],this.morphNormals[S].vertexNormals=[];for(var A=this.morphNormals[S].faceNormals,R=this.morphNormals[S].vertexNormals,P=0,I=this.faces.length;P<I;P++){var O=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};A.push(O),R.push(N)}}var w=this.morphNormals[S];M.vertices=this.morphTargets[S].vertices,M.computeFaceNormals();var L=M.computeVertexNormals();if(L&&0<L.length){this.morphTargets[S].normals=Array(this.vertices.length);for(var B=0;B<L.length;B++)this.morphTargets[S].normals[B]=L[B].clone()}for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=w.faceNormals[D],K=w.vertexNormals[D];H.copy(G.normal),K.a.copy(G.vertexNormals[0]),K.b.copy(G.vertexNormals[1]),K.c.copy(G.vertexNormals[2])}}for(var te,W=0,z=this.faces.length;W<z;W++)te=this.faces[W],te.normal=te.__originalFaceNormal,te.vertexNormals=te.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,x){var T=this.morphTargets.length,E=this.morphTargets,_=g.morphTargets,M=this.morphColors.length,S=this.morphColors,C=g.morphColors;if(0<T&&T==_.length)for(var A=0,R=E.length;A<R;A++){for(var P=E[A],I=_[A],O=0,N=I.vertices.length;O<N;O++){var w=I.vertices[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),P.vertices.push(L)}if(P.normals&&I.normals)for(var B=0;B<I.normals.length;B+=3)y.set(I.normals2[B],I.normals2[B+1],I.normals2[B+2]),x!==void 0&&y.applyMatrix4(x),P.normals.push(y.x,y.y,y.z)}if(0<M&&M==C.length)for(var D=0,V=S.length;D<V;D++)for(var G=S[D],H=C[D],K=0,te=H.colors;K<te;K++)G.colors.push(H.colors[K].clone())},merge:function(g,x){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var E,_=this.vertices.length,M=this.vertices,S=g.vertices,C=g.normals,A=this.faces,R=g.faces,P=this.colors,I=g.colors;x!==void 0&&(E=new c.Matrix3().getNormalMatrix(x));for(var O=0,N=S.length;O<N;O++){var w=S[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),M.push(L)}for(var B=0;B<C.length;B+=3)y.set(C[B],C[B+1],C[B+2]),x!==void 0&&y.applyMatrix4(x),this.normals.push(y.x,y.y,y.z);for(var D=0,V=I.length;D<V;D++)typeof I[D]=="number"?P.push(I[D]):P.push(I[D].clone());for(var G=0,H=R.length;G<H;G++){var K=R[G],te=void 0,W=void 0,z=K.vertexNormals,j=K.vertexColors,Z=new b(K.a+_,K.b+_,K.c+_);Z.normal.copy(K.normal),E!==void 0&&Z.normal.applyMatrix3(E).normalize();for(var Q=0,ee=z.length;Q<ee;Q++)te=z[Q].clone(),E!==void 0&&te.applyMatrix3(E).normalize(),Z.vertexNormals.push(te);Z.color.copy(K.color);for(var ie=0,Y=j.length;ie<Y;ie++)W=j[ie],Z.vertexColors.push(W.clone());Z.materialIndex=K.materialIndex+T,A.push(Z)}for(var ne,F=0,$=g.faceVertexUvs.length;F<$;F++){ne=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var J=0,k=ne.length;J<k;J++){for(var U=ne[J],oe=[],ae=0,le=U.length;ae<le;ae++)oe.push(U[ae].clone());this.faceVertexUvs[F].push(oe)}}this.mergeMorph(g,x)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,x={},T=[],E=[],_=Math.pow(10,g),M=0,S=this.vertices.length;M<S;M++){var C=this.vertices[M],A=Math.round(C.x*_)+"_"+Math.round(C.y*_)+"_"+Math.round(C.z*_);x[A]===void 0?(x[A]=M,T.push(this.vertices[M]),E[M]=T.length-1):E[M]=E[x[A]]}for(var R,P=[],I=0,O=this.faces.length;I<O;I++){R=this.faces[I],R.a=E[R.a],R.b=E[R.b],R.c=E[R.c];for(var N=[R.a,R.b,R.c],w=0;3>w;w++)if(N[w]===N[(w+1)%3]){P.push(I);break}}for(var L,B=P.length-1;0<=B;B--){L=P[B],this.faces.splice(L,1);for(var D=0,V=this.faceVertexUvs.length;D<V;D++)this.faceVertexUvs[D].splice(L,1)}var G=this.vertices.length-T.length;return this.vertices=T,G},setFromPoints:function(g){this.vertices=[];for(var x,T=0,E=g.length;T<E;T++)x=g[T],this.vertices.push(new c.Vector3(x.x,x.y,x.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,x=g.length,T=0;T<x;T++)g[T]._id=T;g.sort(function(R,P){return R.materialIndex-P.materialIndex});var E,_,M=this.faceVertexUvs[0],S=this.faceVertexUvs[1];M&&M.length===x&&(E=[]),S&&S.length===x&&(_=[]);for(var C,A=0;A<x;A++)C=g[A]._id,E&&E.push(M[C]),_&&_.push(S[C]);E&&(this.faceVertexUvs[0]=E),_&&(this.faceVertexUvs[1]=_)},toJSON:function(){function g(Y,ne,F){return F?Y|1<<ne:Y&~(1<<ne)}function x(Y){var ne=Y.x.toString()+Y.y.toString()+Y.z.toString();return O[ne]===void 0&&(O[ne]=I.length/3,I.push(Y.x,Y.y,Y.z)),O[ne]}function T(Y){var ne=Y.r.toString()+Y.g.toString()+Y.b.toString();return w[ne]===void 0&&(w[ne]=N.length,N.push(Y.getHex())),w[ne]}function E(Y){var ne=Y.x.toString()+Y.y.toString();return B[ne]===void 0&&(B[ne]=L.length/2,L.push(Y.x,Y.y)),B[ne]}var _={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(_.uuid=this.uuid,_.type=this.type,this.name!==""&&(_.name=this.name),this.parameters!==void 0){var M=this.parameters;for(var S in M)M[S]!==void 0&&(_[S]=M[S]);return _}for(var C,A=[],R=0;R<this.vertices.length;R++)C=this.vertices[R],A.push(C.x,C.y,C.z);for(var P=[],I=[],O={},N=[],w={},L=[],B={},D=0;D<this.faces.length;D++){var V=this.faces[D],G=!0,H=!1,K=this.faceVertexUvs[0][D]!==void 0,te=0<V.normal.length(),W=0<V.vertexNormals.length,z=V.color.r!==1||V.color.g!==1||V.color.b!==1,j=0<V.vertexColors.length,Z=0;if(Z=g(Z,0,0),Z=g(Z,1,G),Z=g(Z,2,H),Z=g(Z,3,K),Z=g(Z,4,te),Z=g(Z,5,W),Z=g(Z,6,z),Z=g(Z,7,j),P.push(Z),P.push(V.a,V.b,V.c),P.push(V.materialIndex),K){var Q=this.faceVertexUvs[0][D];P.push(E(Q[0]),E(Q[1]),E(Q[2]))}if(te&&P.push(x(V.normal)),W){var ee=V.vertexNormals;P.push(x(ee[0]),x(ee[1]),x(ee[2]))}if(z&&P.push(T(V.color)),j){var ie=V.vertexColors;P.push(T(ie[0]),T(ie[1]),T(ie[2]))}}return _.data={},_.data.vertices=A,_.data.normals=I,0<N.length&&(_.data.colors=N),0<L.length&&(_.data.uvs=[L]),_.data.faces=P,_},clone:function(){return new p().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var x=g.vertices,T=0,E=x.length;T<E;T++)this.vertices.push(x[T].clone());for(var _=g.colors,M=0,S=_.length;M<S;M++)this.colors.push(_[M].clone());for(var C=g.faces,A=0,R=C.length;A<R;A++)this.faces.push(C[A].clone());for(var P,I=0,O=g.faceVertexUvs.length;I<O;I++){P=g.faceVertexUvs[I],this.faceVertexUvs[I]===void 0&&(this.faceVertexUvs[I]=[]);for(var N=0,w=P.length;N<w;N++){for(var L,B=P[N],D=[],V=0,G=B.length;V<G;V++)L=B[V],D.push(L.clone());this.faceVertexUvs[I].push(D)}}for(var H,K=g.morphTargets,te=0,W=K.length;te<W;te++){if(H={},H.name=K[te].name,K[te].vertices!==void 0){H.vertices=[];for(var z=0,j=K[te].vertices.length;z<j;z++)H.vertices.push(K[te].vertices[z].clone())}if(K[te].normals!==void 0){H.normals=[];for(var Z=0,Q=K[te].normals.length;Z<Q;Z++)H.normals.push(K[te].normals[Z].clone())}this.morphTargets.push(H)}for(var ee,ie=g.morphNormals,Y=0,ne=ie.length;Y<ne;Y++){if(ee={},ie[Y].vertexNormals!==void 0){ee.vertexNormals=[];for(var F=0,$=ie[Y].vertexNormals.length;F<$;F++){var J=ie[Y].vertexNormals[F],k={};k.a=J.a.clone(),k.b=J.b.clone(),k.c=J.c.clone(),ee.vertexNormals.push(k)}}if(ie[Y].faceNormals!==void 0){ee.faceNormals=[];for(var U=0,oe=ie[Y].faceNormals.length;U<oe;U++)ee.faceNormals.push(ie[Y].faceNormals[U].clone())}this.morphNormals.push(ee)}for(var ae=g.skinWeights,le=0,de=ae.length;le<de;le++)this.skinWeights.push(ae[le].clone());for(var be=g.skinIndices,we=0,ue=be.length;we<ue;we++)this.skinIndices.push(be[we].clone());for(var me=g.lineDistances,se=0,xe=me.length;se<xe;se++)this.lineDistances.push(me[se]);var he=g.boundingBox;he!==null&&(this.boundingBox=he.clone());var ge=g.boundingSphere;return ge!==null&&(this.boundingSphere=ge.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,x=[],T=void 0,E=this.faces;for(g=0;g<E.length;g++){var _=E[g];_.materialIndex!==T&&(T=_.materialIndex,v!==void 0&&(v.count=3*g-v.start,x.push(v)),v={start:3*g,materialIndex:T})}return v!==void 0&&(v.count=3*g-v.start,x.push(v)),x},toBufferGeometry:function(){var g=new d().fromGeometry(this),x=new c.BufferGeometry,T=new Float32Array(3*g.vertices.length);if(x.setAttribute("position",new c.BufferAttribute(T,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);x.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var _=new Float32Array(3*g.colors.length);x.setAttribute("color",new c.BufferAttribute(_,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var M=new Float32Array(2*g.uvs.length);x.setAttribute("uv",new c.BufferAttribute(M,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var S=new Float32Array(2*g.uvs2.length);x.setAttribute("uv2",new c.BufferAttribute(S,2).copyVector2sArray(g.uvs2))}for(var C in x.groups=g.groups,g.morphTargets){for(var A=[],R=g.morphTargets[C],P=0,I=R.length;P<I;P++){var O=R[P],N=new c.Float32BufferAttribute(3*O.data.length,3);N.name=O.name,A.push(N.copyVector3sArray(O.data))}x.morphAttributes[C]=A}if(0<g.skinIndices.length){var w=new c.Float32BufferAttribute(4*g.skinIndices.length,4);x.setAttribute("skinIndex",w.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var L=new c.Float32BufferAttribute(4*g.skinWeights.length,4);x.setAttribute("skinWeight",L.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(x.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(x.boundingBox=g.boundingBox.clone()),x},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,x=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(x,3).copyVector3sArray(this.vertices)),0<this.normals.length){var T=new Float32Array(this.normals.length),E=new c.BufferAttribute(T,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var _=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(_,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var M=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(M,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var S=[],C=0;C<this.colors.length;C++)S.push(new c.Color(this.colors[C]));var A=new Float32Array(3*S.length);g.setAttribute("color",new c.BufferAttribute(A,3).copyColorsArray(S))}else{for(var R=new Float32Array(3*this.vertices.length),P=0;P<3*this.vertices.length;P++)R[P]=1;g.setAttribute("color",new c.BufferAttribute(R,3))}if(0<this.faces.length){for(var I=[],O=[],N=0;N<this.faces.length;N++){O.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var w=this.faces[N].vertexColors;if(w.length===3)I.push(w[0],w[1],w[2]);else{var L=this.faces[N].color;I.push(L,L,L)}}g.setIndex(O),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],V=0,G=this.morphTargets.length;V<G;V++){var H=this.morphTargets[V],K=new c.Float32BufferAttribute(3*H.vertices.length,3);if(K.name=H.name,B.push(K.copyVector3sArray(H.vertices)),H.normals){var te=new c.Float32BufferAttribute(3*H.normals.length,3);te.name=H.name,D.push(te.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var W=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",W.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var z=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",z.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),p.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,x=v.geometry;if(v.isPoints||v.isLine){var T=new c.Float32BufferAttribute(3*x.vertices.length,3),E=new c.Float32BufferAttribute(3*x.colors.length,3);if(g.setAttribute("position",T.copyVector3sArray(x.vertices)),g.setAttribute("color",E.copyColorsArray(x.colors)),x.lineDistances&&x.lineDistances.length===x.vertices.length){var _=new c.Float32BufferAttribute(x.lineDistances.length,1);g.setAttribute("lineDistance",_.copyArray(x.lineDistances))}x.boundingSphere!==null&&(g.boundingSphere=x.boundingSphere.clone()),x.boundingBox!==null&&(g.boundingBox=x.boundingBox.clone())}else v.isMesh&&(g=x.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var x,T,E=[],_=void 0,M=g.faces;for(T=0;T<M.length;T++){var S=M[T];S.materialIndex!==_&&(_=S.materialIndex,x!==void 0&&(x.count=3*T-x.start,E.push(x)),x={start:3*T,materialIndex:_})}x!==void 0&&(x.count=3*T-x.start,E.push(x)),this.groups=E}fromGeometry(g){var x,T=g.faces,E=g.vertices,_=g.faceVertexUvs,M=_[0]&&0<_[0].length,S=_[1]&&0<_[1].length,C=g.morphTargets,A=C.length;if(0<A){x=[];for(var R=0;R<A;R++)x[R]={name:C[R].name,data:[]};this.morphTargets.position=x}var P,I=g.morphNormals,O=I.length;if(0<O){P=[];for(var N=0;N<O;N++)P[N]={name:I[N].name,data:[]};this.morphTargets.normal=P}var w=g.skinIndices,L=g.skinWeights,B=w.length===E.length,D=L.length===E.length;0<E.length&&T.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,G=0;G<T.length;G++){V=T[G],this.vertices.push(E[V.a],E[V.b],E[V.c]);var H=V.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var K=V.normal;this.normals.push(K,K,K)}var te=V.vertexColors;if(te.length===3)this.colors.push(te[0],te[1],te[2]);else{var W=V.color;this.colors.push(W,W,W)}if(M===!0){var z=_[0][G];z===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",G),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(z[0],z[1],z[2])}if(S===!0){var j=_[1][G];j===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",G),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(j[0],j[1],j[2])}for(var Z,Q=0;Q<A;Q++)Z=C[Q].vertices,x[Q].data.push(Z[V.a],Z[V.b],Z[V.c]);for(var ee,ie=0;ie<O;ie++)ee=I[ie].vertexNormals[G],P[ie].data.push(ee.a,ee.b,ee.c);B&&this.skinIndices.push(w[V.a],w[V.b],w[V.c]),D&&this.skinWeights.push(L[V.a],L[V.b],L[V.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,x,T,E,_){var M=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=x,this.c=T,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=_&&_.isColor?_:new c.Color,this.vertexColors=Array.isArray(_)?_:[],this.materialIndex=M}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var x=0,T=g.vertexNormals.length;x<T;x++)this.vertexNormals[x]=g.vertexNormals[x].clone();for(var E=0,_=g.vertexColors.length;E<_;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=FB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3183
3183
  `)),u.vertexShader=u.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(`
3184
3184
  `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,m=0,y=function(){return"pr"+m++},p=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=y(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};p.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},p.prototype.getDuration=function(){return this.duration},p.prototype.setRegion=function(d){this.region=d},p.prototype.getRegion=function(){return this.region},p.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},p.prototype.getGroup=function(){return this.group},p.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},p.prototype.checkTransparentMesh=function(){},p.prototype.setMesh=function(d,b,v){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var x=g.morphAttributes.position;x||(x=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),x&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(x,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=v,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},p.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},p.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},p.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,x=v*g;x!=this.clipAction.time&&(this.clipAction.time=x,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var T=d;T=d>this.duration?this.duration:0>d?0:d,T!=this.inbuildTime&&(this.inbuildTime=T,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},p.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},p.prototype.getVisibility=function(){return this.visible},p.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},p.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},p.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},p.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},p.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},p.prototype.setColour=function(d){this._lod.setColour(d)},p.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},p.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},p.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},p.prototype.setMaterial=function(d){this._lod.setMaterial(d)},p.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,x=0,T=0;T<v.count;T++)this._v2.fromArray(v.array,3*T),x=this._v2.distanceTo(this._v1),g==-1?g=x:g>x&&(g=x,d=T)}return d},p.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,x=v.geometry.morphAttributes;if(g&&x&&x.position){for(var T=!1,E=0;E<g.length;E++)0<g[E]&&(T=!0,this._v1.fromArray(x.position[E].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[E])));if(T)return d?b.applyMatrix4(v.matrixWorld):b}else return b.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(v.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},p.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},p.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},p.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},p.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var v=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(v=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),b&&b.camera&&(v||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},p.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},p.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},p.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},p.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,v=this.getClosestVertex(!0);return v.project(d.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},p.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number)},p.prototype.render=function(d,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var x=this.inbuildTime+d;x>this.duration&&(x-=this.duration),this.inbuildTime=x}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},p.prototype.addLOD=function(d,b,v,g,x){this._lod.addLevelFromURL(d,b,v,g,x)},p.prototype.addVertices=function(d){var b=this.getMorph(),v=void 0;if(!b)v=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(x=>{g.setXYZ(this.drawRange,x[0],x[1],x[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},p.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},p.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},p.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=p},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,m=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(d,b)=>{if(d){var v,g=Math.abs(b);for(v=0;v<this.levels.length&&!(g<this.levels[v].distance);v++);this.levels.splice(v,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var v=Math.abs(b),g=0;g<this.levels.length;g++)if(v===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,v,g,x)=>{this._loader=d;var T,E=this.calculateDistance(b);for(T=0;T<this.levels.length&&!(E<this.levels[T].distance);T++);this.levels.splice(T,0,{distance:E,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),x&&this.loadLevel(T)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return d==="far"?v=4.5*b:d==="medium"?v=2.5*b:d=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},x=h(b,g),T=void 0;this._parent.isGeometry?T=new c.Mesh(x,v):this._parent.isLines&&(T=new(u(12)).LineSegments(x,v)),T.userData=this._parent,T.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(T,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),p()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,p(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,x,T=d.cameraObject.position.distanceTo(b),E=-1,_=-1;for(g=0,x=v.length;g<x&&T>=v[g].distance;g++)v[g].morph?(-1<E&&v[E].morph&&(v[E].morph.visible=!1),E=g,v[g].morph.visible=!0,_=-1):_=g;for(-1<_&&this.loadLevel(_);g<x;g++)v[g].morph&&(-1<E?v[g].morph.visible=!1:(v[g].morph.visible=!0,E=g));this._currentLevel!=E&&(this._currentLevel=E,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(d):v.morph.remove(d))})};var p=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=m},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,m=new f.Vector3;class y extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,v=[],g=0,x=b.count;g<x;g+=2)h.fromBufferAttribute(b,g),m.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(m);d.setAttribute("lineDistance",new f.Float32BufferAttribute(v,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}y.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>x});var c=u(4),f=new c.Vector3,h=new c.Vector3,m=new c.Matrix4,y=new c.Ray,p=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class x extends c.Object3D{constructor(){var _=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,M=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=_,this.material=M,this.updateMorphTargets()}copy(_){return super.copy(_),this.material=_.material,this.geometry=_.geometry,this}computeLineDistances(){var _=this.geometry;if(!_.isBufferGeometry)_.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(_.index===null){for(var M=_.attributes.position,S=[0],C=1,A=M.count;C<A;C++)f.fromBufferAttribute(M,C-1),h.fromBufferAttribute(M,C),S[C]=S[C-1],S[C]+=f.distanceTo(h);_.setAttribute("lineDistance",new c.Float32BufferAttribute(S,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(_,M){var S=this.geometry,C=this.matrixWorld,A=_.params.Line.threshold,R=S.drawRange,P=S.morphAttributes.position;if(S.boundingSphere===null&&S.computeBoundingSphere(),p.copy(S.boundingSphere),p.applyMatrix4(C),p.radius+=A,_.ray.intersectsSphere(p)!==!1){m.copy(C).invert(),y.copy(_.ray).applyMatrix4(m);var I=A/((this.scale.x+this.scale.y+this.scale.z)/3),O=I*I,N=new c.Vector3,w=new c.Vector3,L=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(S.isBufferGeometry){var V=S.index,G=S.attributes,H=G.position;if(V!==null)for(var K=Math.max(0,R.start),te=Math.min(V.count,R.start+R.count),W=K;W<te-1;W+=D){var z=V.getX(W),j=V.getX(W+1);T(N,w,this,H,P,z,j);var Z=y.distanceSqToSegment(N,w,B,L);if(!(Z>O)){B.applyMatrix4(this.matrixWorld);var Q=_.ray.origin.distanceTo(B);Q<_.near||Q>_.far||M.push({distance:Q,point:L.clone().applyMatrix4(this.matrixWorld),index:W,face:null,faceIndex:null,object:this})}}else for(var ee=Math.max(0,R.start),ie=Math.min(H.count,R.start+R.count),Y=ee;Y<ie-1;Y+=D){T(N,w,this,H,P,Y,Y+1);var ne=y.distanceSqToSegment(N,w,B,L);if(!(ne>O)){B.applyMatrix4(this.matrixWorld);var F=_.ray.origin.distanceTo(B);F<_.near||F>_.far||M.push({distance:F,point:L.clone().applyMatrix4(this.matrixWorld),index:Y,face:null,faceIndex:null,object:this})}}}else S.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var _=this.geometry;if(_.isBufferGeometry){var M=_.morphAttributes,S=Object.keys(M);if(0<S.length){var C=M[S[0]];if(C!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var A,R=0,P=C.length;R<P;R++)A=C[R].name||R+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[A]=R}}}else{var I=_.morphTargets;I!==void 0&&0<I.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function T(E,_,M,S,C,A,R){E.fromBufferAttribute(S,A),_.fromBufferAttribute(S,R);var P=M.morphTargetInfluences;if(M.material.morphTargets&&C&&P){d.set(0,0,0),b.set(0,0,0);for(var I=0,O=C.length;I<O;I++){var N=P[I],w=C[I];N!==0&&(v.fromBufferAttribute(w,A),g.fromBufferAttribute(w,R),d.addScaledVector(v.sub(E),N),b.addScaledVector(g.sub(_),N))}E.add(d),_.add(b)}}x.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var m=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),p=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var g=!1;this.ndc=new c.Vector3;var x=void 0,T=void 0,E=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(m[0],m[1],m[2]),v.userData=this};this.updateVisual=(_,M)=>{var S=1,C=0;_!==M&&(C=1-(this.ndc.z-_)/(M-_),S=.6+.4*C),this.setSpriteSize(S)},this.updateNDC=_=>(this.ndc.copy(this.morph.position),this.ndc.project(_),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(_,M,S)=>{this.morph.position.set(_,M,S)},this.setSpriteSize=_=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(_)},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),T&&(T.material.map.dispose(),T.material.dispose(),T=void 0)},this.isEnabled=()=>g,this.setNumber=_=>{(!_||x!=_)&&T&&(this.morph.remove(T),T.material.map.dispose(),T.material.dispose(),T=void 0),!T&&_&&(T=p(_,.012,"black","Asap",50,500),this.morph.add(T)),x=_},this.getNumber=()=>x||1,this.setVisibility=function(_){_!==this.visible&&(this.visible=_,this.group.visible=_,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{g=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{g=!1,this.morph.visible=!1,this.visible=!1},E()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,m,y,p){u(10).ZincObject.call(this);var d;m&&(d=m.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0,this.fromMesh=g=>!!(g&&g.isMesh)&&(this.morph=g.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return p},this.setLabel=g=>{g&&(typeof g=="string"||g instanceof String)&&(v=g,this.morph&&(this.morph.name=g)),b&&this.showLabel()},this.showLabel=g=>{if(b&&(position=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)){var x=[0,0,0];b=new(u(17)).Label(v,g),b.setPosition(x[0],x[1],x[2]),this.group.add(b.getSprite())}},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(g,x,T,E)=>{this.morph&&(this.morph.matrix.elements[0]=x[0],this.morph.matrix.elements[1]=x[1],this.morph.matrix.elements[2]=x[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=T[0],this.morph.matrix.elements[5]=T[1],this.morph.matrix.elements[6]=T[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=E[0],this.morph.matrix.elements[9]=E[1],this.morph.matrix.elements[10]=E[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=g[0],this.morph.matrix.elements[13]=g[1],this.morph.matrix.elements[14]=g[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),b&&b.setPosition(g[0],g[1],g[2])},this.setColour=g=>{b&&b.setColour(g),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry.colorsNeedUpdate=!0},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var m=f,y=void 0;y=h?new c(m,.015,h.getStyle()):new c(m,.015),y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(p,d,b)=>{y&&y.position.set(p,d,b)},this.setColour=p=>{y.color=p.getStyle()},this.setScale=p=>{y&&0<p&&y.scale.set(p,p,1)},this.dispose=()=>{y.dispose()},this.getSprite=()=>y,this.getString=()=>m}},(o,l,u)=>{function c(y){throw new TypeError('"'+y+'" is read-only')}var f=u(4),h=u(19).JSONLoader,m=function(){u(10).ZincObject.call(this);var y=[],p=void 0,d=void 0,b=void 0,v=void 0,g=void 0,x=void 0,T=void 0,E=0,_=0,M=[0,0,0],S=[0,0,0],C=[0,0,0],A="NONE";this.ready=!1;var R=!1,P=!1;this.isGlyphset=!0;for(var I=new f.Matrix4,O=new f.Color,N=new f.Color,w=new f.Box3,L=new f.Box3,B=new f.Box3,D=[],V=[],G=[],H=[],K=[],te=[],W=[],z=[],j=0;8>j;j++)D[j]=new f.Vector3;this.load=(F,$,J,k,U)=>{p=F.axis1,d=F.axis2,b=F.axis3,v=F.positions,g=F.scale,x=F.colors,T=F.label,R=F.metadata.MorphColours,P=F.metadata.MorphVertices,E=F.metadata.number_of_time_steps,A=F.metadata.repeat_mode,_=F.metadata.number_of_vertices,A=="AXES_2D"||A=="MIRROR"?_*=2:A=="AXES_3D"&&(_*=3),M=F.metadata.base_size,S=F.metadata.offset,C=F.metadata.scale_factors;var oe=new h;this.geometry=new f.BufferGeometry;var ae=new f.InstancedMesh(this.geometry,void 0,_);if(this.setMorph(ae),k){var le=oe.parse($);ne(J,U)(le.geometry,le.materials),le.geometry.dispose()}else oe.crossOrigin="Anonymous",oe.load($,ne(J,U))};var Z=(F,$,J,k,U,oe)=>{if(A=="NONE"||A=="MIRROR"){for(var ae,le=[0,0,0],de=[0,0,0],be=[0,0,0],we=[0,0,0],ue=[0,0,0],me=[0,0,0],se=[0,0,0],xe=[0,0,0],he=[0,0,0],ge=0;3>ge;ge++)ae=0>U[ge]?-1:1,le[ge]=ae*M[ge]+U[ge]*C[ge];for(var ge=0;3>ge;ge++)de[ge]=$[ge]*le[0],be[ge]=J[ge]*le[1],we[ge]=k[ge]*le[2],ue[ge]=F[ge]+S[0]*de[ge]+S[1]*be[ge]+S[2]*we[ge],A=="MIRROR"&&(me[ge]=-de[ge],se[ge]=-be[ge],xe[ge]=-we[ge],he[ge]=ue[ge],0>U[0]&&(ue[ge]-=de[ge],he[ge]-=me[ge]));0>we[0]*(de[1]*be[2]-de[2]*be[1])+we[1]*(de[2]*be[0]-de[0]*be[2])+we[2]*(de[0]*be[1]-de[1]*be[0])&&(we[0]=-we[0],we[1]=-we[1],we[2]=-we[2]),oe[0]=[ue,de,be,we],A=="MIRROR"&&(0>xe[0]*(me[1]*se[2]-me[2]*se[1])+xe[1]*(me[2]*se[0]-me[0]*se[2])+xe[2]*(me[0]*se[1]-me[1]*se[0])&&(xe[0]=-xe[0],xe[1]=-xe[1],xe[2]=-xe[2]),oe[1]=[he,me,se,xe])}else if(A=="AXES_2D"||A=="AXES_3D"){for(var ae,_e=[0,0,0],Ue=[0,0,0],ge=0;3>ge;ge++)ae=0>U[ge]?-1:1,_e[ge]=ae*M[0]+U[ge]*C[0];for(var ge=0;3>ge;ge++)Ue[ge]=F[ge]+S[0]*_e[0]*$[ge]+S[1]*_e[1]*J[ge]+S[2]*_e[2]*k[ge];for(var qe=glyph_repeat_mode=="AXES_2D"?2:3,Pe=0;Pe<qe;Pe++){var ct=void 0,Ie=void 0,Ye=U[Pe],$e=[0,0,0],at=[0,0,0],et=[0,0,0];Pe==0?(ct=$,Ie=J):Pe==1?(ct=J,Ie=glyph_repeat_mode=="AXES_2D"?$:k):(ct=k,Ie=$);var Gt=M[0]+Ye*C[0];$e[0]=ct[0]*Gt,$e[1]=ct[1]*Gt,$e[2]=ct[2]*Gt,et[0]=$e[1]*Ie[2]-Ie[1]*$e[2],et[1]=$e[2]*Ie[0]-Ie[2]*$e[0],et[2]=$e[0]*Ie[1]-$e[1]*Ie[0];var re=Math.sqrt(et[0]*et[0]+et[1]*et[1]+et[2]*et[2]);if(0<re){var Me=(M[2]+Ye*C[2])/re;A=="AXES_2D"&&0<Pe&&(Me*=-1),et[0]*=Me,et[1]*=Me,et[2]*=Me}if(at[0]=et[1]*$e[2]-$e[1]*et[2],at[1]=et[2]*$e[0]-$e[2]*et[0],at[2]=et[0]*$e[1]-et[1]*$e[0],re=Math.sqrt(at[0]*at[0]+at[1]*at[1]+at[2]*at[2]),0<re){var Ee=(M[1]+Ye*C[1])/re;at[0]*=Ee,at[1]*=Ee,at[2]*=Ee}oe[Pe]=[Ue,$e,at,et]}}return oe},Q=(F,$,J,k,U)=>{var oe=1;A=="AXES_2D"||A=="MIRROR"?oe=2:A=="AXES_3D"&&(oe=3);var ae=F.length/3,le=0;z.length=oe;for(var de=0;de<ae;de++){var be=3*de,we=[F[be],F[be+1],F[be+2]],ue=[$[be],$[be+1],$[be+2]],me=[J[be],J[be+1],J[be+2]],se=[k[be],k[be+1],k[be+2]],xe=[U[be],U[be+1],U[be+2]],he=Z(we,ue,me,se,xe,z);if(he.length==oe)for(var ge=0;ge<oe;ge++){I.elements[0]=he[ge][1][0],I.elements[1]=he[ge][1][1],I.elements[2]=he[ge][1][2],I.elements[3]=0,I.elements[4]=he[ge][2][0],I.elements[5]=he[ge][2][1],I.elements[6]=he[ge][2][2],I.elements[7]=0,I.elements[8]=he[ge][3][0],I.elements[9]=he[ge][3][1],I.elements[10]=he[ge][3][2],I.elements[11]=0,I.elements[12]=he[ge][0][0],I.elements[13]=he[ge][0][1],I.elements[14]=he[ge][0][2],I.elements[15]=1,this.morph.setMatrixAt(le,I);var _e=y[le];_e&&_e.setTransformation(he[ge][0],he[ge][1],he[ge][2],he[ge][3]),le++}}this.morph.instanceMatrix.needsUpdate=!0},ee=F=>{var $=1;A=="AXES_2D"||A=="MIRROR"?$=2:A=="AXES_3D"&&($=3);for(var J,k=F.length,U=0,oe=0;oe<k;oe++){J=F[oe];for(var ae=0;ae<$;ae++){O.setHex(J),this.morph.setColorAt(U,O);var le=y[U];le&&le.setColour(O),U++}}this.morph.instanceColor.needsUpdate=!0},ie=()=>{var F=V,$=G,J=H,k=K,U=te,oe=W,ae=this.inbuildTime/this.duration*(E-1),le=Math.floor(ae),de=1-(ae-le),be=Math.ceil(ae);if(P){var we=v[le.toString()],ue=v[be.toString()],me=p[le.toString()],se=p[be.toString()],xe=d[le.toString()],he=d[be.toString()],ge=b[le.toString()],_e=b[be.toString()],Ue=g[le.toString()],qe=g[be.toString()];V.length=we.length,G.length=we.length,H.length=we.length,K.length=we.length,te.length=we.length;for(var Pe=0;Pe<we.length;Pe++)F[Pe]=de*we[Pe]+(1-de)*ue[Pe],$[Pe]=de*me[Pe]+(1-de)*se[Pe],J[Pe]=de*xe[Pe]+(1-de)*he[Pe],k[Pe]=de*ge[Pe]+(1-de)*_e[Pe],U[Pe]=de*Ue[Pe]+(1-de)*qe[Pe]}else v[0],c("current_positions"),p[0],c("current_axis1s"),d[0],c("current_axis2s"),b[0],c("current_axis3s"),g[0],c("current_scales");if(Q(F,$,J,k,U),this.boundingBoxUpdateRequired=!0,x!=null){if(R){var ct=x[le.toString()],Ie=x[be.toString()];oe.length=ct.length;for(var Ye=0;Ye<ct.length;Ye++)O.setHex(ct[Ye]),N.setHex(Ie[Ye]),O.setRGB(O.r*de+N.r*(1-de),O.g*de+N.g*(1-de),O.b*de+N.b*(1-de)),oe[Ye]=O.getHex()}else x[0],c("current_colors");ee(oe)}};this.showLabel=()=>{for(var F=0;F<y.length;F++)y[F].showLabel(this.morph.material?this.morph.material.color:void 0)};var Y=F=>{if(T!=null&&F)for(var $,J=0;J<_;J++)$=new(u(16)).Glyph(void 0,void 0,J,this),T!=null&&T[J]!=null&&$.setLabel(T[J]),0<E&&$.setFrustumCulled(!1),y[J]=$,this.morph.add($.getGroup());T!=null&&F&&this.showLabel(this.morph.material?this.morph.material.color:void 0),Q(v[0],p[0],d[0],b[0],g[0]),x!=null&&ee(x[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=F=>{F.isGlyph&&y.push(F),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(F,$)=>{if(F.isMesh){var J=new(u(16)).Glyph(void 0,void 0,$,this);return J.fromMesh(F),y.push(J),this.morph.add(J.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,J}},this.forEachGlyph=F=>{for(var $=0;$<y.length;$++)F(y[$])};var ne=(F,$)=>(J,k)=>{var U=J.toBufferGeometry();this.geometry.copy(U),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),U.dispose(),k&&k[0]&&(this.morph.material=k[0]),Y($),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),J.dispose(),F!=null&&typeof F=="function"&&F(this)};this.getClosestVertexIndex=function(){var F=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var $,J=v[0],k=J.length/3,U=-1,oe=0,ae=0;ae<k;ae++)$=3*ae,this._v2.set(J[$],J[$+1],J[$+2]),oe=this._v1.distanceTo(this._v2),(U==-1||U>oe)&&(U=oe,F=ae)}return F},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var F=new f.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,I),F.setFromMatrixPosition(I),F}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){w.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var F=0;F<_;F++)this.morph.getMatrixAt(F,I),L.copy(w).applyMatrix4(I),F==0?B.copy(L):B.union(L);if(B)this.cachedBoundingBox.copy(B),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=F=>{this.inbuildTime=F>this.duration?this.duration:0>F?0:F,(R||P)&&(ie(),P&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<E)&&(R||P)),this.getCurrentTime=()=>this.inbuildTime,this.dispose=()=>{for(var F=y.length-1;0<=F;F--)y[F].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),p=void 0,d=void 0,b=void 0,v=void 0,g=void 0,x=void 0,this.ready=!1,this.groupName=void 0},this.render=(F,$,J)=>{if($==!0){var k=this.inbuildTime+F;k>this.duration&&(k-=this.duration),this.inbuildTime=k,(R||P)&&ie()}this.updateMarker($,J)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=m},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>_});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,m=c.AnimationClip,y=c.Vector3,p=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,x=c.FileLoader,T=c.DefaultLoadingManager,E=u(21).VideoHandler;function _(M){typeof M=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),M=void 0),this.manager=M===void 0?T:M,this.withCredentials=!1,this.paramsString=""}Object.assign(_.prototype,{load:function(S,C,A,R){var P=this,I=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(S),O=new x(this.manager);S.split("?"),this.paramsString=S.length===2?paramsStrings[1]:"",O.setWithCredentials(this.withCredentials),O.load(S,function(N){var w=JSON.parse(N),L=w.metadata;if(L!==void 0){var B=L.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+S+" should be loaded with THREE.ObjectLoader instead.")}if(P&&P.parse){var D=P.parse(w,I);C(D.geometry,D.materials)}},A,R)},setTexturePath:function(S){this.texturePath=S},parse:function(){function M(R,P){function I(xe,he){return xe&1<<he}var O,N,w,L,B,D,V,G,H,K,te,W,z,j,Z,Q,ee,ie,Y,ne,F,$,J,k,U,oe,ae,le=R.faces,de=R.vertices,be=R.normals,we=R.colors,ue=R.scale,me=0;if(R.uvs!==void 0){for(O=0;O<R.uvs.length;O++)R.uvs[O].length&&me++;for(O=0;O<me;O++)P.faceVertexUvs[O]=[]}for(L=0,B=de.length;L<B;)ie=new y,ie.x=de[L++]*ue,ie.y=de[L++]*ue,ie.z=de[L++]*ue,P.vertices.push(ie);if(L=0,B=le.length,R.uvs)for(O=0;O<R.uvs.length;O++){P.uvs[O]=[];for(var se=0;se<R.uvs[O].length;se++)P.uvs[O][se]=R.uvs[O][se]}if(be)for(O=0;O<be.length;O++)P.normals[O]=be[O];if(we)for(O=0;O<we.length;O++)P.colors[O]=we[O];for(;L<B;)if(K=le[L++],te=I(K,0),W=I(K,1),z=I(K,3),j=I(K,4),Z=I(K,5),Q=I(K,6),ee=I(K,7),te){if(ne=new v,ne.a=le[L],ne.b=le[L+1],ne.c=le[L+3],F=new v,F.a=le[L+1],F.b=le[L+2],F.c=le[L+3],L+=4,W&&(H=le[L++],ne.materialIndex=H,F.materialIndex=H),w=P.faces.length,z)for(O=0;O<me;O++)for(k=R.uvs[O],P.faceVertexUvs[O][w]=[],P.faceVertexUvs[O][w+1]=[],N=0;4>N;N++)G=le[L++],oe=k[2*G],ae=k[2*G+1],U=new b(oe,ae),N!==2&&P.faceVertexUvs[O][w].push(U),N!==0&&P.faceVertexUvs[O][w+1].push(U);if(j&&(V=3*le[L++],ne.normal.set(be[V++],be[V++],be[V]),F.normal.copy(ne.normal)),Z)for(O=0;4>O;O++)V=3*le[L++],J=new y(be[V++],be[V++],be[V]),O!==2&&ne.vertexNormals.push(J),O!==0&&F.vertexNormals.push(J);if(Q&&(D=le[L++],$=we[D],ne.color.setHex($),F.color.setHex($)),ee)for(O=0;4>O;O++)D=le[L++],$=we[D],O!==2&&ne.vertexColors.push(new d($)),O!==0&&F.vertexColors.push(new d($));P.faces.push(ne),P.faces.push(F)}else{if(Y=new v,Y.a=le[L++],Y.b=le[L++],Y.c=le[L++],W&&(H=le[L++],Y.materialIndex=H),w=P.faces.length,z)for(O=0;O<me;O++)for(k=R.uvs[O],P.faceVertexUvs[O][w]=[],N=0;3>N;N++)G=le[L++],oe=k[2*G],ae=k[2*G+1],U=new b(oe,ae),P.faceVertexUvs[O][w].push(U);if(j&&(V=3*le[L++],Y.normal.set(be[V++],be[V++],be[V])),Z)for(O=0;3>O;O++)V=3*le[L++],J=new y(be[V++],be[V++],be[V]),Y.vertexNormals.push(J);if(Q&&(D=le[L++],Y.color.setHex(we[D])),ee)for(O=0;3>O;O++)D=le[L++],Y.vertexColors.push(new d(we[D]));P.faces.push(Y)}}function S(R,P){var I=R.influencesPerVertex===void 0?2:R.influencesPerVertex;if(R.skinWeights)for(var O=0,N=R.skinWeights.length;O<N;O+=I){var w=R.skinWeights[O],L=1<I?R.skinWeights[O+1]:0,B=2<I?R.skinWeights[O+2]:0,D=3<I?R.skinWeights[O+3]:0;P.skinWeights.push(new p(w,L,B,D))}if(R.skinIndices)for(var O=0,N=R.skinIndices.length;O<N;O+=I){var V=R.skinIndices[O],G=1<I?R.skinIndices[O+1]:0,H=2<I?R.skinIndices[O+2]:0,K=3<I?R.skinIndices[O+3]:0;P.skinIndices.push(new p(V,G,H,K))}P.bones=R.bones,P.bones&&0<P.bones.length&&(P.skinWeights.length!==P.skinIndices.length||P.skinIndices.length!==P.vertices.length)&&console.warn("When skinning, number of vertices ("+P.vertices.length+"), skinIndices ("+P.skinIndices.length+"), and skinWeights ("+P.skinWeights.length+") should match.")}function C(R,P){var I=R.scale;if(R.morphTargets!==void 0)for(var O=0,N=R.morphTargets.length;O<N;O++){P.morphTargets[O]={},P.morphTargets[O].name=R.morphTargets[O].name,P.morphTargets[O].vertices=[];for(var w,L=P.morphTargets[O].vertices,B=R.morphTargets[O].vertices,D=0,V=B.length;D<V;D+=3)w=new y,w.x=B[D]*I,w.y=B[D+1]*I,w.z=B[D+2]*I,L.push(w)}if(R.morphNormals!==void 0){for(var O=0,N=R.morphNormals.length;O<N;O++)if(P.morphTargets[O]){P.morphTargets[O].normals=[];for(var G,H=P.morphTargets[O].normals,K=R.morphNormals[O].normals,D=0,V=K.length;D<V;D+=3)G=new y,G.x=K[D],G.y=K[D+1],G.z=K[D+2],H.push(G);P.morphNormalsReady=!0}}if(R.morphColors!==void 0){var O,N,te,W,z,j,Z;for(O=0,N=R.morphColors.length;O<N;O++)for(P.morphColors[O]={},P.morphColors[O].name=R.morphColors[O].name,P.morphColors[O].colors=[],z=P.morphColors[O].colors,j=R.morphColors[O].colors,te=0,W=j.length;te<W;te+=3)Z=new c.Color(16755200),Z.setRGB(j[te],j[te+1],j[te+2]),z.push(Z)}}function A(R,P){var I=[],O=[];R.animation!==void 0&&O.push(R.animation),R.animations!==void 0&&(R.animations.length?O=O.concat(R.animations):O.push(R.animations));for(var N,w=0;w<O.length;w++)N=m.parseAnimation(O[w],P.bones),N&&I.push(N);if(P.morphTargets){var L=m.CreateClipsFromMorphTargetSequences(P.morphTargets,10);I=I.concat(L)}0<I.length&&(P.animations=I)}return function(R,P){R.data!==void 0&&(R=R.data),R.scale=R.scale===void 0?1:1/R.scale;var I=new g;if(I.morphColors=[],M(R,I),S(R,I),C(R,I),A(R,I),I.computeFaceNormals(),I.computeBoundingSphere(),R.materials===void 0||R.materials.length===0)return{geometry:I};var O=f.prototype.initMaterials(R.materials,P,"Anonymous");if(R.materials[0].video){var N=P+R.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var w=new E(N);I._video=w}return O&&0<O.length&&(O[0].side=R.materials[0].singleSided?c.FrontSide:R.materials[0].flipSided?c.BackSide:c.DoubleSide,R.materials[0].specularCoef&&(O[0].shininess=Math.floor(R.materials[0].specularCoef/3))),{geometry:I,materials:O}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(m,y){this.handlers.push(m,y)},get:function(m){for(var y=this.handlers,p=0,d=y.length;p<d;p+=2){var b=y[p],v=y[p+1];if(b.test(m))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(m,y,p){for(var d=[],b=0;b<m.length;++b)d[b]=this.createMaterial(m[b],y,p);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},m=new c.Color,y=new c.TextureLoader,p=new c.MaterialLoader;return function(d,b,v){function g(M,S,C,A,R){var P,I=b+M,O=f.Handlers.get(I);O===null?(y.setCrossOrigin(v),P=y.load(I)):P=O.load(I),S!==void 0&&(P.repeat.fromArray(S),S[0]!==1&&(P.wrapS=c.RepeatWrapping),S[1]!==1&&(P.wrapT=c.RepeatWrapping)),C!==void 0&&P.offset.fromArray(C),A!==void 0&&(A[0]==="repeat"&&(P.wrapS=c.RepeatWrapping),A[0]==="mirror"&&(P.wrapS=c.MirroredRepeatWrapping),A[1]==="repeat"&&(P.wrapT=c.RepeatWrapping),A[1]==="mirror"&&(P.wrapT=c.MirroredRepeatWrapping)),R!==void 0&&(P.anisotropy=R);var N=c.MathUtils.generateUUID();return x[N]=P,N}var x={},T={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var E in d){var _=d[E];switch(E){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":T.name=_;break;case"blending":T.blending=h[_];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",E,"is no longer supported.");break;case"colorDiffuse":T.color=m.fromArray(_).getHex();break;case"colorSpecular":T.specular=m.fromArray(_).getHex();break;case"colorEmissive":T.emissive=m.fromArray(_).getHex();break;case"specularCoef":T.shininess=_;break;case"shading":_.toLowerCase()==="basic"&&(T.type="MeshBasicMaterial"),_.toLowerCase()==="phong"&&(T.type="MeshPhongMaterial"),_.toLowerCase()==="standard"&&(T.type="MeshStandardMaterial");break;case"mapDiffuse":T.map=g(_,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":T.emissiveMap=g(_,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":T.lightMap=g(_,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":T.aoMap=g(_,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":T.bumpMap=g(_,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":T.bumpScale=_;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":T.normalMap=g(_,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":T.normalScale=_;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":T.specularMap=g(_,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":T.metalnessMap=g(_,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":T.roughnessMap=g(_,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":T.alphaMap=g(_,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":T.side=c.BackSide;break;case"doubleSided":T.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),T.opacity=_;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":T[E]=_;break;case"vertexColors":_===!0&&(T.vertexColors=c.VertexColors),_==="face"&&(T.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",E,_)}}return T.type==="MeshBasicMaterial"&&delete T.emissive,T.type!=="MeshPhongMaterial"&&delete T.specular,1>T.opacity&&(T.transparent=!0),p.setTextures(x),p.parse(T)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(m,y){var p=m/y*h.video.duration;h.video.currentTime=p},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(m){return h.video?m*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,m=u(5).getCircularTexture,y=u(17).Label,p=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,x)=>{if(v&&g){var T=h(v,x),E=m();g.map=E;var _=new f(T,g);this.setMesh(_,x.localTimeEnabled,x.localMorphColour)}};var b=(v,g,x,T)=>{if(x){var E=new c.Color(T),_=new y(x,E);_.setPosition(g[0],g[1],g[2]);var M=_.getSprite();M.material.sizeAttenuation=!1,M.material.alphaTest=.5,M.material.transparent=!0,M.material.depthWrite=!1,M.material.depthTest=!1,this.group.add(M),d[v]=_}};this.addPoints=(v,g,x)=>{if(v&&0<v.length){var T=this.drawRange-1,E=this.addVertices(v),_=this.getMorph();if(!_){var M=new c.PointsMaterial({alphaTest:.5,size:10,color:x,sizeAttenuation:!1});E.colorsNeedUpdate=!0,this.createMesh(E,M,{localTimeEnabled:!1,localMorphColour:!1})}var S=T+v.length,C=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(T;T+C<S;){var A=typeof g=="string"?g:g[C];b(C,v[C],A,x),C++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=v=>{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var x=this.getMorph(),T=g+v.length-1;if(!x||0>g||T>=this.drawRange)return;var E=x.geometry.getAttribute("position"),_=g;v.forEach(M=>{var S=d[_];S&&S.setPosition(M[0],M[1],M[2]),E.setXYZ(_++,M[0],M[1],M[2])}),E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,x,T)=>{this.morph&&x&&(this.morph.sizePerPixel=x.pixelHeight),p.prototype.render.call(this,v,g,x,T)}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=p},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,m=new c.Sphere,y=new c.Vector3,p=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var T=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,E=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=T,this.material=E,this.sizePerPixel=1,this.updateMorphTargets()}copy(T){return super.copy(T),this.material=T.material,this.geometry=T.geometry,this}raycast(T,E){var _=this.geometry,M=this.matrixWorld,S=T.params.Points.threshold,C=_.drawRange;if(_.boundingSphere===null&&_.computeBoundingSphere(),m.copy(_.boundingSphere),m.applyMatrix4(M),m.radius+=S,T.ray.intersectsSphere(m)!==!1){f.copy(M).invert(),h.copy(T.ray).applyMatrix4(f);var A=S/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,R=A*A;if(_.isBufferGeometry){var P=_.index,I=_.attributes,O=I.position,N=_.morphAttributes.position;if(P!==null)for(var w,L=Math.max(0,C.start),B=Math.min(P.count,C.start+C.count),D=L;D<B;D++)w=P.getX(D),g(this,O,N,w),v(y,w,R,M,T,E,this);else for(var V=Math.max(0,C.start),G=Math.min(O.count,C.start+C.count),H=V;H<G;H++)g(this,O,N,H),v(y,H,R,M,T,E,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var T=this.geometry;if(T.isBufferGeometry){var E=T.morphAttributes,_=Object.keys(E);if(0<_.length){var M=E[_[0]];if(M!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var S,C=0,A=M.length;C<A;C++)S=M[C].name||C+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[S]=C}}}else{var R=T.morphTargets;R!==void 0&&0<R.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(x,T,E,_,M,S,C){var A=h.distanceSqToPoint(x);if(A<E){var R=new c.Vector3;h.closestPointToPoint(x,R),R.applyMatrix4(_);var P=M.ray.origin.distanceTo(R);if(P<M.near||P>M.far)return;S.push({distance:P,distanceToRay:Math.sqrt(A),point:R,index:T,face:null,object:C})}}function g(x,T,E,_){y.fromBufferAttribute(T,_);var M=x.morphTargetInfluences;if(x.material.morphTargets&&E&&M){p.set(0,0,0);for(var S=0,C=E.length;S<C;S++){var A=M[S],R=E[S];A!==0&&(d.fromBufferAttribute(R,_),p.addScaledVector(d.sub(y),A))}y.add(p)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(m,y,p)=>{if(m&&y){var d=f(m,p);p.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,p.localTimeEnabled,p.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addLines=(m,y)=>{if(m&&0<m.length){var p=this.addVertices(m),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});p.colorsNeedUpdate=!0,this.createLineSegment(p,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(y,p,d,b,v,g,x){try{var T=y[g](x),E=T.value}catch(_){return void d(_)}T.done?p(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var p=this,d=arguments;return new Promise(function(b,v){function g(E){c(T,b,v,g,x,"next",E)}function x(E){c(T,b,v,g,x,"throw",E)}var T=y.apply(p,d);g(void 0)})}}var h=u(4),m=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var p=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var x=new Image;x.crossOrigin="Anonymous";for(var T,E=document.createElement("canvas"),_=0,M=Array(d.length),S=0;S<d.length;S++)T=yield y.imageToUint8Array(y,x,d[S],E),T&&T.array&&(b=T.width,v=T.height,M[g]=T.array,_+=M[g].length,g++);var C=new Uint8Array(_);_=0,M.forEach(A=>{C.set(A,_),_+=A.length}),y.impl=new h.DataTexture2DArray(C,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return p.apply(this,arguments)}}(),this.getMaterial=p=>{if(this.impl){var d;if(!p)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(p.vs&&p.fs){var b=!0;p.transparent&&(b=p.transparent);var v=h.FrontSide;p.side&&(v=p.side),d=new h.ShaderMaterial({transparent:b,uniforms:p.uniforms,vertexShader:p.vs,fragmentShader:p.fs,side:v}),p.glslVersion&&(d.glslVersion=p.glslVersion)}if(d)return d.needsUpdate=!0,d}}};m.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=m},(o,l,u)=>{function c(y,p,d,b,v,g,x){try{var T=y[g](x),E=T.value}catch(_){return void d(_)}T.done?p(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var p=this,d=arguments;return new Promise(function(b,v){function g(E){c(T,b,v,g,x,"next",E)}function x(E){c(T,b,v,g,x,"throw",E)}var T=y.apply(p,d);g(void 0)})}}var h=u(4),m=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};m.prototype.loadImage=function(y,p){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=p})},m.prototype.imageToUint8Array=function(){var y=f(function*(p,d,b,v){yield p.loadImage(d,b),v.width=d.width,v.height=d.height;var g=v.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),m.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),m.prototype.isReady=function(){return!(!this.impl||this.isLoading)},m.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=m},(o,l,u)=>{function c(v,g){var x=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);g&&(T=T.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),x.push.apply(x,T)}return x}function f(v){for(var g,x=1;x<arguments.length;x++)g=arguments[x]==null?{}:arguments[x],x%2?c(Object(g),!0).forEach(function(T){h(v,T,g[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(g,T))});return v}function h(v,g,x){return g=m(g),g in v?Object.defineProperty(v,g,{value:x,enumerable:!0,configurable:!0,writable:!0}):v[g]=x,v}function m(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var x=v[Symbol.toPrimitive];if(x!==void 0){var T=x.call(v,g);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}var p=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],x={};this.morph=new p.Group,this.group=this.morph,this.morph.userData=this;var T=!0;this.createSlides=M=>{M.forEach(S=>this.createSlide(S))};var E=(M,S)=>{var C=M.material,A=C.uniforms;switch(M.rotation.x=0,M.rotation.y=0,M.rotation.z=0,M.position.x=0,M.position.y=0,M.position.z=0,S.direction){case"x":var R=T?-Math.PI/2:Math.PI/2;M.rotation.y=R,A.direction.value=1,A.slide.value.set(S.value,0,0),M.position.x=S.value;break;case"y":M.rotation.x=Math.PI/2,A.direction.value=2,A.slide.value.set(0,S.value,0),M.position.y=S.value;break;case"z":A.direction.value=3,A.slide.value.set(0,0,S.value),M.position.z=S.value;break}C.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=M=>{M&&M.id&&M.id in x&&x[M.id]&&E(x[M.id],M)},this.createSlide=M=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&M&&M.direction&&M.value!==void 0){var S=new p.PlaneGeometry(1,1);S.translate(.5,.5,0);var C=d.getUniforms();C.diffuse.value=this.texture.impl,C.depth.value=this.texture.size.depth,C.flipY.value=T;var A={fs:d.fs,vs:d.vs,uniforms:C,glslVersion:d.glslVersion,side:p.DoubleSide,transparent:!1},R=this.texture.getMaterial(A);R.needsUpdate=!0;var P=new p.Mesh(S,R);P.name=this.groupName,P.userData=this;var I={value:M.value,direction:M.direction,id:P.id};return g.push(I),E(P,I),x[P.id]=P,this.morph.add(P),this.boundingBoxUpdateRequired=!0,I}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=M=>{for(var S=0;S<g.length;S++)if(M===g[S].id)return f({},g[S])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=M=>{M&&this.removeSlideWithId(M.id)},this.removeSlideWithId=M=>{if(this.morph&&M in x&&x[M]){if(this.morph.getObjectById(M)){var S=x[M];this.morph.remove(S),S.clear(),S.geometry&&S.geometry.dispose(),S.material&&S.material.dispose(),this.boundingBoxUpdateRequired=!0}var C=g.findIndex(A=>A.id===M);-1<C&&g.splice(C,1)}},this.dispose=()=>{this.morph.children.forEach(M=>{M.geometry&&M.geometry.dispose(),M.material&&M.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var _=(M,S,C)=>{switch(S.direction.value){case 1:C.copy(S.slide.value),M.expandByPoint(C),C.setY(1),C.setZ(1),M.expandByPoint(C);break;case 2:C.copy(S.slide.value),M.expandByPoint(C),C.setX(1),C.setZ(1),M.expandByPoint(C);break;case 3:C.copy(S.slide.value),M.expandByPoint(C),C.setX(1),C.setY(1),M.expandByPoint(C);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var M=new p.Vector3(0,0,0);this.morph.children.forEach(S=>{_(this.cachedBoundingBox,S.material.uniforms,M)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(M,S,C)=>{var A=new p.Matrix4;A.set(M[0],M[1],M[2],0,M[3],M[4],M[5],0,M[6],M[7],M[8],0,0,0,0,0);var R=new p.Quaternion().setFromRotationMatrix(A);this.morph.position.set(...S),this.morph.quaternion.copy(R),this.morph.scale.set(...C),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(M,S)=>{if(M){var C=M.locations;C&&0<C.length&&(this.applyTransformation(C[0].orientation,C[0].position,C[0].scale),"flipY"in C[0]&&(T=C[0].flipY)),this.createSlides(M.settings.slides),S!=null&&typeof S=="function"&&S(this)}}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3185
3185
  precision highp float;
@@ -3224,11 +3224,11 @@ void main() {
3224
3224
  vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth);
3225
3225
 
3226
3226
  }
3227
- `,y=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0}}};l.fs=h,l.vs=m,l.glslVersion=f,l.getUniforms=y},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(h){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=h,this.load=(m,y)=>{if(m&&m.images&&m.images.source){var p=new(u(25)).TextureArray,d=[];m.images.source.forEach(v=>{d.push(c(v))});var b=this;p.loadFromImages(d).then(()=>{b.texture=p,b.initialise(m,y)})}},this.initialise=(m,y)=>{y!=null&&typeof y=="function"&&y(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(h){var m=h,y=void 0,p=void 0,d=new c.Clock(!1);this.playAnimation=!0;var b=1e3,v=[],g=0,x=[],T=0,E=void 0,_=void 0,M=void 0,S=void 0,C=[],A=[],R=new c.Group,P=void 0,I=void 0,O=!1;this.getDrawingWidth=()=>m?m.clientWidth:P?typeof P.clientWidth>"u"?Math.round(P.width):Math.round(P.clientWidth):0,this.getDrawingHeight=()=>m?m.clientHeight:P?typeof P.clientHeight>"u"?Math.round(P.height):Math.round(P.clientHeight):0,this.onWindowResize=()=>{p.onWindowResize();var L=this.getDrawingWidth(),B=this.getDrawingHeight();if(y!=null){var D;m?(D=m.getBoundingClientRect(),y.setSize(L,B)):P&&(typeof P.getBoundingClientRect>"u"||(D=P.getBoundingClientRect(),P.width=L,P.height=B),y.setSize(L,B,!1)),D&&(D.left,D.top);var V=new c.Vector2;y.getSize(V),V.x,V.y}},this.initialiseVisualisation=L=>{if(L=L||{},L.antialias===void 0){var B=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(B=!0)}catch{B=!1}L.antialias=!B}L.canvas&&(m=void 0,P=L.canvas),y=new c.WebGLRenderer(L),m!==void 0&&m.appendChild(y.domElement),y.setClearColor(16777215,1),P&&P.style&&(P.style.height="100%",P.style.width="100%"),y.autoClear=!1;var D=this.createScene("default");this.setCurrentScene(D)},this.getCurrentScene=()=>p,this.setCurrentScene=L=>{if(L){this.removeActiveScene(L);var B=p;p=L,B&&B.setInteractiveControlEnable(!1),p.setInteractiveControlEnable(!0),p.setAdditionalScenesGroup(R),this.onWindowResize()}},this.getSceneByName=L=>C[L],this.createScene=L=>{if(C[L]==null){var B;return B=P?new(u(32)).Scene(P,y):new(u(32)).Scene(m,y),C[L]=B,B.sceneName=L,B}},this.resetView=()=>{p.resetView()},this.viewAll=()=>{if(p){var L=p.getBoundingBox();if(L){for(var B,D=0;D<A.length;D++)B=A[D].getBoundingBox(),B&&L.union(B);p.viewAllWithBoundingBox(L)}}},this.loadModelsURL=(L,B,D,V,G,H)=>{p.loadModelsURL(L,B,D,V,G,H)},this.loadViewURL=L=>{p.loadViewURL(L)},this.loadFromViewURL=(L,B)=>{p.loadFromViewURL(L,B)},this.updateDirectionalLight=()=>{p.updateDirectionalLight()};var N=()=>{O?(E=requestAnimationFrame(N),this.render()):(cancelAnimationFrame(E),E=void 0)};this.stopAnimate=()=>{O&&(d.stop(),O=!1)},this.animate=()=>{O||(d.start(),O=!0,N())},this.addPreRenderCallbackFunction=L=>(++g,v[g]=L,g),this.removePreRenderCallbackFunction=L=>{L in v&&delete v[L]},this.addPostRenderCallbackFunction=L=>(++T,x[T]=L,T),this.removePostRenderCallbackFunction=L=>{L in x&&delete x[L]},this.getPlayRate=()=>b,this.setPlayRate=L=>{b=L},this.getCurrentTime=()=>p.getCurrentTime(),this.setMorphsTime=L=>{p.setMorphsTime(L)},this.getZincGeometryByID=L=>p.getZincGeometryByID(L),this.addToScene=L=>{p.addObject(L)},this.addToOrthoScene=L=>{if(M==null&&(M=new c.Scene),_==null){var B=this.getDrawingWidth(),D=this.getDrawingHeight();_=new c.OrthographicCamera(-B/2,B/2,D/2,-D/2,1,10),_.position.z=10}M.add(L)};var w=L=>B=>{B.needsUpdate=!0;var D=new c.SpriteMaterial({map:B}),V=D.map.image.width,G=D.map.image.height;L.material=D,L.scale.set(V,G,1);var H=this.getDrawingWidth(),K=this.getDrawingHeight();L.position.set((H-V)/2,(-K+G)/2,1),this.addToOrthoScene(L)};this.addLogo=()=>{S=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,w(S))},this.render=()=>{I||(m?0<m.clientWidth&&0<m.clientHeight&&(I=new f(m,this.onWindowResize)):P&&0<P.width&&0<P.height&&(I=new f(P,this.onWindowResize)));var L=d.getDelta();p.renderGeometries(b,L,this.playAnimation);for(var B,D=0;D<A.length;D++)B=A[D],B.renderGeometries(b,L,this.playAnimation);for(var V in _!=null&&M!=null&&(y.clearDepth(),y.render(M,_)),v)v.hasOwnProperty(V)&&v[V].call();for(var G in p.render(y),x)x.hasOwnProperty(G)&&x[G].call()},this.getThreeJSRenderer=()=>y,this.isSceneActive=L=>{if(p===L)return!0;for(var B,D=0;D<A.length;D++)if(B=A[D],B===L)return!0;return!1},this.addActiveScene=L=>{this.isSceneActive(L)||(A.push(L),R.add(L.getThreeJSScene()))},this.removeActiveScene=L=>{for(var B,D=0;D<A.length;D++)if(B=A[D],B===L)return A.splice(D,1),void R.remove(L.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var L=0;L<A.length;L++)R.remove(A[L].getThreeJSScene());A.splice(0,A.length)},this.dispose=()=>{for(var L in O&&cancelAnimationFrame(E),C)C.hasOwnProperty(L)&&C[L].clearAll();C=[],A=[],R=new c.Group,this.stopAnimate(),v=[],g=0,_=void 0,M=void 0,S=void 0;var B=this.createScene("default");this.setCurrentScene(B),I=void 0},this.transitionScene=(L,B)=>{if(p){var D=p.getZincCameraControls(),V=L.getBoundingBox();if(V){var G=V.min.distanceTo(V.max)/2,H=(V.min.x+V.max.x)/2,K=(V.min.y+V.max.y)/2,te=(V.min.z+V.max.z)/2,W=D.getViewportFromCentreAndRadius(H,K,te,G,40,G*4),z=D.getCurrentViewport();D.cameraTransition(z,W,B),D.enableCameraTransition()}}},this.isWebGL2=()=>!!y&&y.capabilities.isWebGL2}},o=>{o.exports=VB()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,h=u(35).SceneLoader,m=u(41).SceneExporter,y=u(43).Viewport,p=u(5).createBufferGeometry,d=u(5).getCircularTexture,b=0,v=function(){return"sc"+b++},g=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},x=6e3;l.Scene=function(T,E){var _=this,M=T,S=void 0,C=new h(this),A=void 0,R={},P=0,I={},O=0,N=new c.Scene,w=new(u(44)).Region(void 0,this);N.add(w.getGroup());var L=new c.Group;N.add(L),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var B=6e3,D=void 0;this.sceneName=void 0;var V=!1,G=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-left",updateRequired:!0};var H={x:0,y:0},K=g(),te=new c.Vector2,W=[];this.forcePickableObjectsUpdate=!1,this.uuid=v();var z=new f(this);z.disable(),N.add(z.group);var j=()=>M?typeof M.clientWidth>"u"?M.width:M.clientWidth:0,Z=()=>M?typeof M.clientHeight>"u"?M.height:M.clientHeight:0;this.getDownloadProgress=()=>C.getDownloadProgress(),this.onWindowResize=()=>{var F=Z();this.camera.aspect=j()/F,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,D.onResize(),D.calculateHeightPerPixelAtZeroDepth(F)},this.resetView=()=>{this.onWindowResize(),D.resetView()},this.changeZoomByScrollRateUnit=F=>{D.changeZoomByScrollRateUnit(F)};var Q=()=>{this.camera=new c.PerspectiveCamera(40,j()/Z(),0,10),this.ambient=new c.AmbientLight(16777215,.2),N.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),N.add(this.directionalLight),D=new(u(43)).CameraControls(this.camera,E.domElement,E,this),D.setDirectionalLight(this.directionalLight),D.resetView(),A=new(u(49)).Minimap(this)};Q(),this.loadView=F=>{var $=new y;return $.setFromObject(F),D.setCurrentCameraSettings($),!0},this.setupMultipleViews=(F,$)=>{for(var[J,k]of Object.entries($)){var U=new y;U.setFromObject(k),D.addViewport(J,U)}D.setDefaultViewport(F)},this.getBoundingBox=()=>w.getBoundingBox(!0),this.viewAllWithBoundingBox=F=>{if(F){var $=D.getViewportFromBoundingBox(F,1);D.setCurrentCameraSettings($),D.calculateHeightPerPixelAtZeroDepth(Z()),z.markerUpdateRequired=!0}},this.viewAll=()=>{var F=this.getBoundingBox();this.viewAllWithBoundingBox(F),z.markerUpdateRequired=!0},this.forEachGeometry=F=>{w.forEachGeometry(F,!0)},this.forEachGlyphset=F=>{w.forEachGlyphset(F,!0)},this.forEachPointset=F=>{w.forEachPointset(F,!0)},this.forEachLine=F=>{w.forEachLine(F,!0)},this.findGeometriesWithGroupName=F=>w.findGeometriesWithGroupName(F,!0),this.findPointsetsWithGroupName=F=>w.findPointsetsWithGroupName(F,!0),this.findGlyphsetsWithGroupName=F=>w.findGlyphsetsWithGroupName(F,!0),this.findLinesWithGroupName=F=>w.findLinesWithGroupName(F,!0),this.findObjectsWithGroupName=F=>w.findObjectsWithGroupName(F,!0),this.findObjectsWithAnatomicalId=F=>w.findObjectsWithAnatomicalId(F,!0),this.getBoundingBoxOfZincObjects=F=>{for(var $,J=void 0,k=0;k<F.length;k++)$=F[k].getBoundingBox(),$&&(J?J.union($):J=$);return J},this.vectorToScreenXY=F=>{F.project(this.camera);var $=j(),J=Z(),k=$/2,U=J/2;return F.x=F.x*k+k,F.y=-(F.y*U)+U,F},this.getObjectsScreenXY=F=>{if(F&&0<F.length){var $=this.getBoundingBoxOfZincObjects(F),J=new c.Vector3;return $.getCenter(J),this.vectorToScreenXY(J)}},this.getNamedObjectsScreenXY=F=>{var $=this.findObjectsWithGroupName(F);return this.getObjectsScreenXY($)},this.addZincObject=F=>{F&&(w.addZincObject(F),D&&D.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(F,$,J,k)=>{C.loadGlyphsetURL(w,F,$,J,k)},this.loadPointsetURL=(F,$,J,k,U)=>{C.loadPointsetURL(w,F,$,J,k,U)},this.loadLinesURL=(F,$,J,k,U)=>{C.loadLinesURL(w,F,$,J,k,U)},this.loadSTL=(F,$,J)=>{C.loadSTL(w,F,$,J)},this.loadOBJ=(F,$,J)=>{C.loadOBJ(w,F,$,J)},this.loadMetadataURL=(F,$,J)=>{C.loadMetadataURL(w,F,$,J)},this.loadModelsURL=(F,$,J,k,U,oe)=>{C.loadModelsURL(w.urls,$,J,k,U,oe)},this.loadViewURL=F=>{C.loadViewURL(F)},this.loadFromViewURL=(F,$)=>{C.loadFromViewURL(F,$)},this.loadGLTF=(F,$,J,k)=>{C.loadGLTF(w,F,$,J,k)},this.updateDirectionalLight=()=>{D.updateDirectionalLight()},this.addObject=F=>{N.add(F)},this.removeObject=F=>{N.remove(F)},this.getCurrentTime=()=>{if(S!=null)return S.getCurrentTime(B);var F=w.getCurrentTime();return F===-1?0:F},this.setMorphsTime=F=>{S!=null&&S.setMorphTime(F,B),w.setMorphTime(F,!0)},this.isTimeVarying=()=>!!(S&&S.video&&!S.video.error)||w.isTimeVarying(),this.renderGeometries=(F,$,J)=>{var k={};if(k.camera=D,k.displayMarkers=this.displayMarkers,k.markerCluster=z,k.markersList=z.markers,k.ndcToBeUpdated=!1,J&&(k.markerCluster.markerUpdateRequired=!0),!S)C.toBeDownloaded==0?(k.ndcToBeUpdated=D.update($),k.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(Z()),w.renderGeometries(F,$,J,D,k,!0)):D.update(0);else if(S.isReadyToPlay()){J?S.video.play():S.video.pause();var U=S.video.currentTime/S.getVideoDuration()*B;C.toBeDownloaded==0?(D.setTime(U),k.ndcToBeUpdated=D.update(0),k.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(Z()),w.setMorphTime(U,!0),w.renderGeometries(0,0,J,D,k,!0)):D.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>N,this.setVideoHandler=F=>{S||(S=F)},this.setAdditionalScenesGroup=F=>{N.add(F)};var ee=(F,$,J,k,U,oe,ae)=>{var le=0,de=0;return de=F.includes("top")?ae-U-J:F.includes("bottom")?J:Math.floor((ae-U)/2),le=F.includes("left")?$:F.includes("right")?oe-$-k:Math.floor((oe-k)/2),{x:le,y:de}},ie=F=>{this.displayMinimap===!0&&(F.setScissorTest(!0),F.getSize(te),this.minimapScissor.updateRequired&&(H=ee(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,te.x,te.y),this.minimapScissor.updateRequired=!1),F.setScissor(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),F.setViewport(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),A.updateCamera(),N.add(A.mask),F.render(N,A.camera),N.remove(A.mask),F.setScissorTest(!1),F.setViewport(0,0,te.x,te.y))};this.render=F=>{this.autoClearFlag&&F.clear(),V&&G?G.render(N,this.camera):(F.render(N,this.camera),ie(F))},this.setInteractiveControlEnable=F=>{F==!0?D.enable():D.disable()},this.getZincCameraControls=()=>D,this.getThreeJSScene=()=>N,this.setDuration=F=>{w.setDuration(F),B=F,D.setPathDuration(F),C.duration=F},this.getDuration=()=>B,this.setStereoEffectEnable=F=>{F!=!0||G||(G=new u(43).StereoEffect(E)),E.setSize(j(),Z()),this.camera.updateProjectionMatrix(),V=F},this.objectIsInScene=F=>w.objectIsInRegion(F,!0),this.alignBoundingBoxToCameraView=(F,$)=>{if(F){var J=new c.Vector3;F.getCenter(J);var k=this.getZincCameraControls().getCurrentViewport(),U=new c.Vector3(k.targetPosition[0],k.targetPosition[1],k.targetPosition[2]),oe=new c.Vector3(k.eyePosition[0],k.eyePosition[1],k.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(U,oe).normalize(),le.subVectors(U,J).normalize();var de=new c.Vector3;de.crossVectors(ae,le);var be=ae.angleTo(le);0<$?(this.getZincCameraControls().rotateCameraTransition(de,be,$),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(de,be),z.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(F,$,J)=>{if(F){var k=this.getZincCameraControls().getCurrentViewport(),U=this.getZincCameraControls().getViewportFromBoundingBox(F,$);0<J&&(this.getZincCameraControls().cameraTransition(k,U,J),this.getZincCameraControls().enableCameraTransition()),z.markerUpdateRequired=!0}},this.alignObjectToCameraView=(F,$)=>{if(this.objectIsInScene(F)){var J=F.getBoundingBox();this.alignBoundingBoxToCameraView(J,$)}},this.setCameraTargetToObject=F=>{if(this.objectIsInScene(F)){var $=new c.Vector3,J=F.getBoundingBox(),k=this.getZincCameraControls().getCurrentViewport();J.getCenter($);var U=new c.Vector3(k.targetPosition[0],k.targetPosition[1],k.targetPosition[2]),oe=new c.Vector3(k.eyePosition[0],k.eyePosition[1],k.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(oe,U),le.addVectors($,ae),k.eyePosition[0]=le.x,k.eyePosition[1]=le.y,k.eyePosition[2]=le.z,k.targetPosition[0]=$.x,k.targetPosition[1]=$.y,k.targetPosition[2]=$.z,this.getZincCameraControls().setCurrentCameraSettings(k),z.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>V,this.removeZincObject=F=>{w.removeZincObject(F),D&&D.calculateMaxAllowedDistance(this),z.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{W.length=0,z.isEnabled&&W.push(z.group),w.getPickableThreeJSObjects(W,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||w.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),W),this.getNormalisedMinimapCoordinates=(F,$)=>{if(this.displayMinimap){var J=new c.Vector2;F.getSize(J);var k=J.y-$.clientY;if(H.x+this.minimapScissor.width>$.clientX&&$.clientX>H.x&&H.y+this.minimapScissor.height>k&&k>H.y){var U=2*(($.clientX-H.x)/this.minimapScissor.width)-1,oe=2*((k-H.y)/this.minimapScissor.height)-1;return{x:U,y:oe}}}},this.getMinimapDiffFromNormalised=(F,$)=>A?A.getDiffFromNormalised(F,$):void 0,this.isWebGL2=()=>E.isWebGL2(),this.clearAll=()=>{z.clear(),w.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),C.toBeDwonloaded=0,D&&D.calculateMaxAllowedDistance(this),z.markerUpdateRequired=!0},this.addMetadataTimeStamp=(F,$)=>{K.TimeStamps[F]=ne($)},this.getMetadataTag=F=>K[F],this.getMetadata=()=>K,this.setMetadataTag=(F,$)=>{K[F]=$},this.removeMetadataTag=F=>{delete K[F]},this.resetMetadata=()=>{K=g()},this.resetDuration=()=>{this.setDuration(x)};var Y=F=>[...F.years?["".concat(F.years,"years")]:[],...F.months?["".concat(F.months,"months")]:[],...F.weeks?["".concat(F.weeks,"weeks")]:[],...F.days?["".concat(F.days,"days")]:[],...F.hours?["".concat(F.hours,"hours")]:[],...F.mins?["".concat(F.mins,"mins")]:[],...F.secs?["".concat(F.secs,"secs")]:[]].join(" "),ne=F=>F.years?31536e6*F.years:0+F.months?2592e6*F.months:0+F.weeks?6048e5*F.weeks:0+F.days?864e5*F.days:0+F.hours?36e5*F.hours:0+F.mins?6e4*F.mins:0+F.secs?1e3*F.secs:0;this.setDurationFromObject=F=>{var $=Y(F),J=ne(F);this.setMetadataTag("Duration",$),this.setDuration(J)},this.setOriginalDurationFromObject=F=>{var $=Y(F);this.setMetadataTag("OriginalDuration",$)},this.exportGLTF=F=>{var $=new m(this);return $.exportGLTF(F)},this.getRootRegion=()=>w,this.createLines=(F,$,J,k)=>{var U=w.findChildFromPath(F);return U===void 0&&(U=w.createChildFromPath(F)),U.createLines($,J,k)},this.createPoints=(F,$,J,k,U)=>{var oe=w.findChildFromPath(F);return oe===void 0&&(oe=w.createChildFromPath(F)),oe.createPoints($,J,k,U)},this.addZincObjectAddedCallbacks=F=>(++P,R[P]=F,P),this.addZincObjectRemovedCallbacks=F=>(++O,I[O]=F,O),this.removeZincObjectAddedCallbacks=F=>{F in P&&delete R[F]},this.removeZincObjectRemovedCallbacks=F=>{F in O&&delete I[F]},this.clearZincObjectAddedCallbacks=()=>{R={},P=0},this.clearZincObjectRemovedCallbacks=()=>{I={},O=0},this.triggerObjectAddedCallback=F=>{for(var $ in R)R.hasOwnProperty($)&&R[$](F)},this.triggerObjectRemovedCallback=F=>{for(var $ in I)I.hasOwnProperty($)&&I[$](F)},this.addTemporaryPoints=(F,$)=>{var J=p(F.length,F),k=new c.PointsMaterial({alphaTest:.5,size:15,color:$,sizeAttenuation:!1}),U=d();k.map=U;var oe=new(u(23)).Points(J,k);return L.add(oe),oe},this.addTemporaryLines=(F,$)=>{var J=p(F.length,F),k=new c.LineBasicMaterial({color:$}),U=new(u(12)).LineSegments(J,k);return L.add(U),U},this.removeTemporaryPrimitive=F=>{L.remove(F),F.geometry.dispose(),F.material.dispose()},this.clearTemporaryPrimitives=()=>{var F=L.children;F.forEach($=>{$.geometry.dispose(),$.material.dispose()}),L.clear()},this.addBoundingBoxPrimitive=function(F,$,J,k,U){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,ae=w.findChildFromPath(F);ae===void 0&&(ae=w.createChildFromPath(F));var le=oe||_.getBoundingBox(),de=new c.Vector3().subVectors(le.max,le.min),be=new c.BoxGeometry(de.x,de.y,de.z),we=ae.createGeometryFromThreeJSGeometry($,be,J,k,U,1e4);return de.addVectors(le.min,le.max).multiplyScalar(.5),we.setPosition(de.x,de.y,de.z),we},this.addSlicesPrimitive=function(F,$,J,k,U){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if($&&3<=$.length&&J&&3<=J.length){var ae=w.findChildFromPath(F);ae===void 0&&(ae=w.createChildFromPath(F));var le=oe||_.getBoundingBox(),de=new c.Vector3().subVectors(le.max,le.min),be=[],we=0;return["x","y","z"].forEach(ue=>{var me;switch(ue){case"x":me=new c.PlaneGeometry(de.z,de.y),me.rotateY(Math.PI/2);break;case"y":me=new c.PlaneGeometry(de.x,de.z),me.rotateX(Math.PI/2);break;case"z":me=new c.PlaneGeometry(de.x,de.y);break}var se=ae.createGeometryFromThreeJSGeometry($[we],me,J[we],k,U,10001);be.push(se),we++}),de.addVectors(le.min,le.max).multiplyScalar(.5),be.forEach(ue=>{ue.setPosition(de.x,de.y,de.z)}),be}},this.enableMarkerCluster=F=>{F?(z.markerUpdateRequired=!0,z.enable()):(z.markerUpdateRequired=!1,z.disable()),this.forcePickableObjectsUpdate=!0}}},(o,l,u)=>{function c(E,_){var M=Object.keys(E);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(E);_&&(S=S.filter(function(C){return Object.getOwnPropertyDescriptor(E,C).enumerable})),M.push.apply(M,S)}return M}function f(E){for(var _,M=1;M<arguments.length;M++)_=arguments[M]==null?{}:arguments[M],M%2?c(Object(_),!0).forEach(function(S){h(E,S,_[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(_)):c(Object(_)).forEach(function(S){Object.defineProperty(E,S,Object.getOwnPropertyDescriptor(_,S))});return E}function h(E,_,M){return _=m(_),_ in E?Object.defineProperty(E,_,{value:M,enumerable:!0,configurable:!0,writable:!0}):E[_]=M,E}function m(E){var _=y(E,"string");return typeof _=="symbol"?_:_+""}function y(E,_){if(typeof E!="object"||!E)return E;var M=E[Symbol.toPrimitive];if(M!==void 0){var S=M.call(E,_);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}var p=u(4),d=new Image(128,128);d.src=u(34);var b=new p.Texture;b.image=d,b.needsUpdate=!0;var v=[.02,.03,1],g=new p.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),x=u(5).createNewSpriteText,T=function(E){u(10).ZincObject.call(this),this.texture=b;var _=void 0;this.morph=new p.Group,this.group=this.morph,this.isMarkerCluster=!0;var M=!0,S=[];this.markers={};var C=new p.Vector2,A=new p.Vector2,R=Date.now();this.setSpriteSize=w=>{_.scale.set(.015,.02,1),_.scale.multiplyScalar(w)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var P=w=>{var L=new p.Group,B=new p.Sprite(g);return B.clusterIndex=w,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(v[0],v[1],v[2]),B.userData=this,L.add(B),this.group.add(L),{group:L,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},I=(w,L,B)=>{w.group.visible=!0,w.group.position.set(L.coords[0],L.coords[1],L.coords[2]),(w.label===void 0||B!==w.number)&&(w.label&&(w.group.remove(w.label),w.label.material.map.dispose(),w.label.material.dispose()),w.label=x(B,.012,"black","Asap",50,500),w.number=B,w.group.add(w.label)),w.min=L.min,w.max=L.max},O=w=>{var L=0;for(w.forEach(B=>{var D=B.members.length,V=0;D===1?B.members[0].setVisibility(!0):(B.members.forEach(G=>{V+=G.getNumber(),G.setVisibility(!1)}),!S[L]&&S.push(P(L)),I(S[L],B,V),L++)}),L;L<S.length;L++)S[L].group.visible=!1},N=(w,L)=>{var B=!0,D={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},V=0;for(var G in w)B?(C.set(w[G].ndc.x,w[G].ndc.y),this._b1.setFromPoints([w[G].morph.position]),B=!1,D.members.push(w[G]),D.coords=[w[G].morph.position.x,w[G].morph.position.y,w[G].morph.position.z],L.push(D),delete w[G]):(A.set(w[G].ndc.x,w[G].ndc.y),V=C.distanceTo(A),.1>V&&(D.members.push(w[G]),this._b1.expandByPoint(w[G].morph.position),delete w[G]));D.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],D.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&N(w,L)};this.calculate=()=>{if(M){var w=Date.now();if(500<w-R){var L=[];N(f({},this.markers),L),O(L),R=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>M,this.enable=()=>{M=!0,this.morph.visible=!0},this.disable=()=>{for(var w in M=!1,this.morph.visible=!1,this.markers){var L;(L=this.markers[w])!==null&&L!==void 0&&L.isMarker&&this.markers[w].isEnabled()&&this.markers[w].setVisibility(!0)}},this.zoomToCluster=w=>{w!==void 0&&-1<w&&(this._v1.set(...S[w].min),this._v2.set(...S[w].max),this._b1.set(this._v1,this._v2),E.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0)},this.clusterIsVisible=w=>{if(w!==void 0&&-1<w&&S[w]){var L;return(L=S[w].group)===null||L===void 0?void 0:L.visible}return!1}};T.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=T},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=u(5).createNewURL,m=u(36).STLLoader,y=u(37).OBJLoader,p=u(38).PrimitivesLoader;l.SceneLoader=function(d){var b=d;this.toBeDownloaded=0,this.progressMap={};var v=!1,g=!1,x=new p;this.getDownloadProgress=()=>{var W=0,z=0,j=!1;for(var Z in this.progressMap){var Q=this.progressMap[Z];W+=Q[1],z+=Q[0],Q[1]==0&&(j=!0)}return j&&(W=0),[W,z,g]},this.onProgress=W=>z=>{this.progressMap[W]=[z.loaded,z.total]},this.onError=W=>z=>{--this.toBeDownloaded,g=!0,console.error("There is an issue with one of the external resource: ".concat(z==null?void 0:z.responseURL,".")),W&&W()};var T=(W,z)=>{var j=z.Default;if(z.Inline)b.setupMultipleViews(j,z.Entries);else{var Z=[],Q=function(ne){W&&(newURL=h(ie,W),Z.push(new Promise((F,$)=>{fetch(newURL).then(J=>J.json()).then(J=>F({key:ne,data:J})).catch(J=>$(J))})))};for(var[ee,ie]of Object.entries(z.Entries))Q(ee);Promise.all(Z).then(Y=>{var ne={};Y.forEach($=>{ne[$.key]=$.data}),b.setupMultipleViews(j,ne);var F=b.getZincCameraControls();F&&F.setCurrentViewport(j),v=!0})}};this.loadViewURL=(W,z)=>{this.toBeDownloaded+=1;var j=new XMLHttpRequest;j.onreadystatechange=()=>{if(j.readyState==4)if(j.status==200){var Q=JSON.parse(j.responseText);b.setupMultipleViews("default",{default:Q}),b.resetView(),v=!0,--this.toBeDownloaded,z!=null&&typeof z=="function"&&z()}else this.onError()};var Z=f(W);j.open("GET",Z,!0),j.send()},this.loadModelsURL=(W,z,j,Z,Q,ee,ie)=>{var Y=z.length;this.toBeDownloaded+=Y;for(var ne=0;ne<Y;ne++){var F=z[ne],$=u(0).defaultMaterialColor,J=u(0).defaultOpacity;j!=null&&j[ne]!=null&&($=!!j[ne]),Z!=null&&Z[ne]!=null&&(J=Z[ne]);var k=0;Q!=null&&Q[ne]!=null&&(k=!!Q[ne]);var U=0;ee!=null&&ee[ne]!=null&&(U=!!ee[ne]),x.load(f(F),O(W,$,J,k,U,void 0,void 0,void 0,void 0,ie),this.onProgress(F),this.onError(ie))}},this.loadFromViewURL=(W,z,j)=>{var Z=new XMLHttpRequest;Z.onreadystatechange=()=>{if(Z.readyState==4&&Z.status==200){var ee=JSON.parse(Z.responseText);b.loadView(ee);for(var ie,Y=[],ne=z+"_",F=0;F<ee.numberOfResources;F++)ie=ne+(F+1)+".json",Y.push(ie);this.loadModelsURL(W,Y,ee.colour,ee.opacity,ee.timeEnabled,ee.morphColour,j)}};var Q=f(z+"_view.json");Z.open("GET",Q,!0),Z.send()};var E=(W,z,j,Z,Q,ee,ie,Y)=>(ne,F)=>{var $=new(u(24)).Lines,J=void 0;F&&F[0]&&(J=new c.LineBasicMaterial({color:F[0].color.clone()}),1>F[0].opacity&&(J.transparent=!0),J.opacity=F[0].opacity,J.morphTargets=z,J.vertexColors=F[0].vertexColors);var k={localTimeEnabled:z,localMorphColour:j};if($&&($.createLineSegment(ne,J,k),$.setName(Z),$.anatomicalId=Q,$.setRenderOrder(ee),W.addZincObject($),$.setDuration(b.getDuration()),console.log(ie),ie&&ie.levels))for(var[U,oe]of Object.entries(ie.levels))$.addLOD(x,U,oe.URL,oe.Index,ie.preload);--this.toBeDownloaded,ne.dispose(),Y!=null&&typeof Y=="function"&&Y($)};this.loadLinesURL=(W,z,j,Z,Q,ee,ie)=>{var Y=0;this.toBeDownloaded+=1;var ne=!!(ie&&ie.isInline)&&ie.isInline,F=ie&&ie.anatomicalId?ie.anatomicalId:void 0,$=ie&&ie.renderOrder?ie.renderOrder:void 0;j!=null&&(Y=!!j);var J=0;if(Z!=null&&(J=!!Z),ne){var k=x.parse(z);E(W,Y,J,Q,F,$,ie.lod,ee)(k.geometry,k.materials)}else x.load(z,E(W,Y,J,Q,F,$,ie.lod,ee),this.onProgress(z),this.onError(ee),ie.loaderOptions)};var _=(W,z,j,Z,Q,ee)=>{var ie=ee&&ee.isInline?ee.isInline:void 0,Y=ee&&ee.anatomicalId?ee.anatomicalId:void 0,ne=ee&&ee.displayLabels?ee.displayLabels:void 0,F=ee&&ee.renderOrder?ee.renderOrder:void 0,$=new(u(18)).Glyphset;$.setDuration(b.getDuration()),$.groupName=Z;var J=()=>{--this.toBeDownloaded,Q!=null&&typeof Q=="function"&&Q($)};++this.toBeDownloaded,ie?$.load(z,j,J,ie,ne):$.load(z,f(j),J,ie,ne),$.anatomicalId=Y,$.setRenderOrder(F),W.addZincObject($)},M=(W,z,j,Z,Q,ee)=>()=>{if(z.readyState==4&&z.status==200){var ie=JSON.parse(z.responseText);_(W,ie,j,Z,Q,ee)}},S=(W,z,j,Z,Q,ee,ie)=>(Y,ne)=>{var F=new(u(22)).Pointset,$=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});ne&&ne[0]&&(1>ne[0].opacity&&($.transparent=!0),$.opacity=ne[0].opacity,$.color=ne[0].color,$.morphTargets=z,$.vertexColors=ne[0].vertexColors);var J={};J.localTimeEnabled=z,J.localMorphColour=j,F&&(F.createMesh(Y,$,J),F.setName(Z),F.anatomicalId=Q,W.addZincObject(F),F.setDuration(b.getDuration()),F.setRenderOrder(ee)),Y.dispose(),--this.toBeDownloaded,ie!=null&&typeof ie=="function"&&ie(F)};this.loadSTL=(W,z,j,Z)=>{this.toBeDownloaded+=1;var Q=u(0).defaultMaterialColor,ee=u(0).defaultOpacity,ie=new m;ie.crossOrigin="Anonymous",ie.load(f(z),O(W,Q,ee,!1,!1,j,void 0,void 0,void 0,Z))},this.loadOBJ=(W,z,j,Z)=>{this.toBeDownloaded+=1;var Q=u(0).defaultMaterialColor,ee=u(0).defaultOpacity,ie=new y;ie.crossOrigin="Anonymous",ie.load(f(z),O(W,Q,ee,!1,!1,j,void 0,void 0,void 0,Z))};var C=(W,z,j,Z,Q,ee,ie)=>{this.toBeDownloaded+=1;var Y=u(0).defaultMaterialColor,ne=u(0).defaultOpacity,F=0,$=!!(ie&&ie.isInline)&&ie.isInline,J=ie&&ie.fileFormat?ie.fileFormat:void 0,k=ie&&ie.anatomicalId?ie.anatomicalId:void 0,U=ie&&ie.renderOrder?ie.renderOrder:void 0;j!=null&&(F=!!j);var oe=0;Z!=null&&(oe=!!Z);var ae=x;if(J!==void 0){if(J=="STL")ae=new m;else if(J=="OBJ")return ae=new y,ae.crossOrigin="Anonymous",void ae.load(z,objloader(W,Y,ne,F,oe,Q,k,ee),this.onProgress(z),this.onError,ie.loaderOptions)}if($){var le=x.parse(z);O(W,Y,ne,F,oe,Q,k,U,ie,ee)(le.geometry,le.materials)}else ae.crossOrigin="Anonymous",x.load(z,O(W,Y,ne,F,oe,Q,k,U,ie,ee),this.onProgress(z),this.onError(ee),ie.loaderOptions)},A=function(z,j,Z){var Q=0;return ee=>{if(++Q,ee&&j!=null&&typeof j=="function"){j(ee);var ie=b.getZincCameraControls();ie&&ie.calculateMaxAllowedDistance(b)}Q==z&&(v==!1&&b.viewAll(),Z!=null&&typeof Z=="function"&&Z())}};this.loadPointsetURL=(W,z,j,Z,Q,ee,ie)=>{var Y=0;this.toBeDownloaded+=1,j!=null&&(Y=!!j);var ne=0;Z!=null&&(ne=!!Z);var F=!!(ie&&ie.isInline)&&ie.isInline,$=ie&&ie.anatomicalId?ie.anatomicalId:void 0,J=ie&&ie.renderOrder?ie.renderOrder:void 0;if(F){var k=x.parse(z);S(W,Y,ne,Q,$,J,ee)(k.geometry,k.materials)}else x.load(z,S(W,Y,ne,Q,$,J,ee),this.onProgress(z),this.onError(ee),ie.loaderOptions)};var R=(W,z,j,Z,Q,ee)=>{var ie=ee&&ee.isInline?ee.isInline:void 0,Y=ee&&ee.anatomicalId?ee.anatomicalId:void 0,ne=ee&&ee.renderOrder?ee.renderOrder:void 0,F=void 0;if(j){if(z&&j.images&&j.images.source)for(var $,J=j.images.source,k=0;k<J.length;k++)$=h(J[k],z),j.images.source[k]=$;if(j.type==="slides"&&(F=new(u(27)).TextureSlides),F){F.groupName=Z;var U=()=>{--this.toBeDownloaded,Q!=null&&typeof Q=="function"&&Q(F)};++this.toBeDownloaded,F.load(j,U,ie),F.anatomicalId=Y,F.setRenderOrder(ne),W.addZincObject(F)}}},P=(W,z,j,Z,Q)=>()=>{if(z.readyState==4&&z.status==200){var ee=JSON.parse(z.responseText);R(W,z.responseURL,ee,j,Z,Q)}};this.loadTextureURL=(W,z,j,Z,Q)=>{var ee=!!(Q&&Q.isInline)&&Q.isInline;if(ee)R(W,void 0,z,j,Z,Q);else{var ie=new XMLHttpRequest;ie.onreadystatechange=P(W,ie,j,Z,Q),ie.open("GET",f(z),!0),ie.send()}},this.loadGlyphsetURL=(W,z,j,Z,Q,ee)=>{var ie=!!(ee&&ee.isInline)&&ee.isInline;if(ie)_(W,z,j,Z,Q,ee);else{var Y=new XMLHttpRequest;Y.onreadystatechange=M(W,Y,j,Z,Q,ee),Y.open("GET",f(z),!0),Y.send()}};var I=(W,z,j,Z,Q,ee,ie,Y,ne)=>{var F={colour:j,opacity:Z,localTimeEnabled:Q,localMorphColour:ee},$=new(u(3)).Geometry;return $.createMesh(z,Y,F),$.getMorph()?($.setName(ne),W&&W.addZincObject($),$.setDuration(b.getDuration()),$.videoHandler&&b.setVideoHandler($.videoHandler),$):void 0},O=(W,z,j,Z,Q,ee,ie,Y,ne,F)=>($,J)=>{var k;J&&J[0]&&(k=J[0]);var U=I(W,$,z,j,Z,Q,void 0,k,ee);if(U.anatomicalId=ie,U.setRenderOrder(Y),ne.lod&&ne.lod.levels)for(var[oe,ae]of Object.entries(ne.lod.levels))U.addLOD(x,oe,ae.URL,ae.Index,ne.lod.preload);--this.toBeDownloaded,$.dispose(),F!=null&&typeof F=="function"&&F(U)},N=W=>{var z=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,j,Z,Q,ee,ie,Y,ne]=W.match(z);return{years:j,months:Z,weeks:Q,days:ee,hours:ie,mins:Y,secs:ne}};this.loadSettings=W=>{if(W){if(W.Duration){var z=N(W.Duration);b.setDurationFromObject(z)}if(W.OriginalDuration){var j=N(W.OriginalDuration);b.setOriginalDurationFromObject(j)}if(W.TimeStamps)for(var Z in W.TimeStamps){var Q=N(W.TimeStamps[Z]);b.addMetadataTimeStamp(Z,Q)}}};var w=(W,z,j,Z,Q)=>{if(j){var ee=void 0,ie=!1;j.URL?(ee=j.URL,z&&(ee=h(ee,z))):j.Inline&&(ee=j.Inline.URL,ie=!0);var Y={};if(j.LOD&&j.LOD.Levels){Y.preload=!!j.LOD.Preload,Y.levels={};for(var[ne,F]of Object.entries(j.LOD.Levels))Y.levels[ne]={},Y.levels[ne].URL=h(F.URL,z),Y.levels[ne].Index=F.Index}var $=j.GroupName;($===void 0||$==="")&&($="_Unnamed");var J={loaderOptions:{index:j.Index},isInline:ie,fileFormat:j.FileFormat,anatomicalId:j.AnatomicalId,compression:j.compression,lod:Y,renderOrder:Z};switch(j.Type){case"Surfaces":C(W,ee,j.MorphVertices,j.MorphColours,$,Q,J);break;case"Glyph":var k;ie?k=j.Inline.GlyphGeometriesURL:(k=j.GlyphGeometriesURL,k=h(j.GlyphGeometriesURL,z)),j.DisplayLabels&&(J.displayLabels=!0),this.loadGlyphsetURL(W,ee,k,$,Q,J);break;case"Points":this.loadPointsetURL(W,ee,j.MorphVertices,j.MorphColours,$,Q,J);break;case"Lines":this.loadLinesURL(W,ee,j.MorphVertices,j.MorphColours,$,Q,J);break;case"Texture":this.loadTextureURL(W,ee,$,Q,J);break}}},L=(W,z,j)=>{if(z){var Z=void 0,Q=!1;switch(z.URL?(Z=z.URL,W&&(Z=h(z.URL,W))):z.Inline&&(Z=z.Inline.URL,Q=!0),z.Type){case"View":Q?(b.setupMultipleViews("default",{default:Z}),v=!0,j!=null&&typeof j=="function"&&j()):this.loadViewURL(Z,j);break;case"Settings":this.loadSettings(z);break}}};this.loadGLTF=(W,z,j,Z,Q)=>{var ee=new(u(39)).GLTFToZincJSLoader;ee.load(b,W,z,j,Z,Q)};var B=(W,z,j,Z)=>{if(j.Primitives&&j.Primitives.forEach(Y=>{var ne=1;Y.Order&&(ne=Y.Order),w(W,z,Y,ne,Z)}),j.Transformation&&W.setTransformation(j.Transformation),j.Children)for(var[Q,ee]of Object.entries(j.Children)){var ie=W.findOrCreateChildFromPath(Q);ie&&B(ie,z,ee,Z)}},D=(W,z)=>{if(Array.isArray(W)){for(var j=0,Z=0;Z<W.length;Z++)W[Z].Type&&(z&&W[Z].Type==="View"||W[Z].Type==="Surfaces"||W[Z].Type==="Glyph"||W[Z].Type==="Points"||W[Z].Type==="Lines"||W[Z].Type==="Texture")&&j++;return j}return 0},V=W=>{var z=W.Primitives?D(W.Primitives,!1):0;return W.Children&&Object.values(W.Children).forEach(j=>{z+=V(j)}),z},G=W=>Array.isArray(W)?D(W,!0):typeof W=="object"&&W!==null&&W.Version==="2.0"?V(W.Regions):void 0,H=(W,z,j,Z,Q)=>{var ee=W;j.RegionPath&&j.RegionPath!==""&&(ee=W.findOrCreateChildFromPath(j.RegionPath)),w(ee,z,j,2*Z,Q)},K=(W,z,j,Z,Q)=>{for(var ee=G(z),ie=new A(ee,Z,Q),Y=0;Y<z.length;Y++)L(j,z[Y],ie);for(var ne=0;ne<z.length;ne++)H(W,j,z[ne],ne,ie)},te=(W,z,j,Z,Q)=>{var ee=G(z),ie=new A(ee,Z,Q);z.Settings&&this.loadSettings(z.Settings),z.Views&&T(j,z.Views),z.Regions&&B(W,j,z.Regions,ie)};this.loadMetadataURL=(W,z,j,Z)=>{var Q=new XMLHttpRequest,ee=f(z);Q.onreadystatechange=()=>{if(Q.readyState==4&&Q.status==200){b.resetMetadata(),b.resetDuration(),v=!1;var ie=Q.responseURL;ie===void 0&&(ie=new URL(ee).href);var Y=JSON.parse(Q.responseText);Array.isArray(Y)?K(W,Y,ie,j,Z):typeof Y=="object"&&Y!==null&&Y.Version=="2.0"&&te(W,Y,ie,j,Z)}},Q.open("GET",ee,!0),Q.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(m){super(m)}load(m,y,p,d){var b=this,v=new c.FileLoader(this.manager);v.setPath(this.path),v.setResponseType("arraybuffer"),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(m,function(g){try{y(b.parse(g))}catch(x){d?d(x):console.error(x),b.manager.itemError(m)}},p,d)}parse(m){function y(d,b,v){for(var g=0,x=d.length;g<x;g++)if(d[g]!==b.getUint8(v+g,!1))return!1;return!0}var p=function(d){if(typeof d=="string"){for(var b=new Uint8Array(d.length),v=0;v<d.length;v++)b[v]=255&d.charCodeAt(v);return b.buffer||b}return d}(m);return function(d){var b=new DataView(d),v=b.getUint32(80,!0);if(84+v*50===b.byteLength)return!0;for(var g=[115,111,108,105,100],x=0;5>x;x++)if(y(g,b,x))return!1;return!0}(p)?function(d){for(var b,v,g,x,T,E,_,M,S=new DataView(d),C=S.getUint32(80,!0),A=!1,R=0;R<70;R++)S.getUint32(R,!1)==1129270351&&S.getUint8(R+4)==82&&S.getUint8(R+5)==61&&(A=!0,x=new Float32Array(3*(3*C)),T=S.getUint8(R+6)/255,E=S.getUint8(R+7)/255,_=S.getUint8(R+8)/255,M=S.getUint8(R+9)/255);for(var P=new c.BufferGeometry,I=new Float32Array(3*(3*C)),O=new Float32Array(3*(3*C)),N=0;N<C;N++){var w=84+N*50,L=S.getFloat32(w,!0),B=S.getFloat32(w+4,!0),D=S.getFloat32(w+8,!0);if(A){var V=S.getUint16(w+48,!0);32768&V?(b=T,v=E,g=_):(b=(31&V)/31,v=(31&V>>5)/31,g=(31&V>>10)/31)}for(var G=1;3>=G;G++){var H=w+12*G,K=3*(3*N)+3*(G-1);I[K]=S.getFloat32(H,!0),I[K+1]=S.getFloat32(H+4,!0),I[K+2]=S.getFloat32(H+8,!0),O[K]=L,O[K+1]=B,O[K+2]=D,A&&(x[K]=b,x[K+1]=v,x[K+2]=g)}}return P.setAttribute("position",new c.BufferAttribute(I,3)),P.setAttribute("normal",new c.BufferAttribute(O,3)),A&&(P.setAttribute("color",new c.BufferAttribute(x,3)),P.hasColors=!0,P.alpha=M),P}(p):function(d){for(var b,v=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,x=/facet([\s\S]*?)endfacet/g,T=0,E=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,_=new RegExp("vertex"+E+E+E,"g"),M=new RegExp("normal"+E+E+E,"g"),S=[],C=[],A=new c.Vector3,R=0,P=0,I=0;(b=g.exec(d))!==null;){P=I;for(var O=b[0];(b=x.exec(O))!==null;){for(var N=0,w=0,L=b[0];(b=M.exec(L))!==null;)A.x=parseFloat(b[1]),A.y=parseFloat(b[2]),A.z=parseFloat(b[3]),w++;for(;(b=_.exec(L))!==null;)S.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),C.push(A.x,A.y,A.z),N++,I++;w!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+T),N!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+T),T++}var B=P,D=I-P;v.addGroup(B,D,R),R++}return v.setAttribute("position",new c.Float32BufferAttribute(S,3)),v.setAttribute("normal",new c.Float32BufferAttribute(C,3)),v}(function(d){return typeof d=="string"?d:c.LoaderUtils.decodeText(new Uint8Array(d))}(m))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>T});var c=u(4),f=/^[og]\s*(.+)?/,h=/^mtllib /,m=/^usemtl /,y=/^usemap /,p=new c.Vector3,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;function x(){var E={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(M,S){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=M,void(this.object.fromDeclaration=S!==!1);var C=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:M||"",fromDeclaration:S!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(P,I){var O=this._finalize(!1);O&&(O.inherited||0>=O.groupCount)&&this.materials.splice(O.index,1);var N={index:this.materials.length,name:P||"",mtllib:Array.isArray(I)&&0<I.length?I[I.length-1]:"",smooth:O===void 0?this.smooth:O.smooth,groupStart:O===void 0?0:O.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(L){var B={index:typeof L=="number"?L:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(N),N},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(P){var I=this.currentMaterial();if(I&&I.groupEnd===-1&&(I.groupEnd=this.geometry.vertices.length/3,I.groupCount=I.groupEnd-I.groupStart,I.inherited=!1),P&&1<this.materials.length)for(var O=this.materials.length-1;0<=O;O--)0>=this.materials[O].groupCount&&this.materials.splice(O,1);return P&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),I}},C&&C.name&&typeof C.clone=="function"){var A=C.clone(0);A.inherited=!0,this.object.materials.push(A)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(M,S){var C=parseInt(M,10);return 3*(0<=C?C-1:C+S/3)},parseNormalIndex:function(M,S){var C=parseInt(M,10);return 3*(0<=C?C-1:C+S/3)},parseUVIndex:function(M,S){var C=parseInt(M,10);return 2*(0<=C?C-1:C+S/2)},addVertex:function(M,S,C){var A=this.vertices,R=this.object.geometry.vertices;R.push(A[M+0],A[M+1],A[M+2]),R.push(A[S+0],A[S+1],A[S+2]),R.push(A[C+0],A[C+1],A[C+2])},addVertexPoint:function(M){var S=this.vertices,C=this.object.geometry.vertices;C.push(S[M+0],S[M+1],S[M+2])},addVertexLine:function(M){var S=this.vertices,C=this.object.geometry.vertices;C.push(S[M+0],S[M+1],S[M+2])},addNormal:function(M,S,C){var A=this.normals,R=this.object.geometry.normals;R.push(A[M+0],A[M+1],A[M+2]),R.push(A[S+0],A[S+1],A[S+2]),R.push(A[C+0],A[C+1],A[C+2])},addFaceNormal:function(M,S,C){var A=this.vertices,R=this.object.geometry.normals;p.fromArray(A,M),d.fromArray(A,S),b.fromArray(A,C),g.subVectors(b,d),v.subVectors(p,d),g.cross(v),g.normalize(),R.push(g.x,g.y,g.z),R.push(g.x,g.y,g.z),R.push(g.x,g.y,g.z)},addColor:function(M,S,C){var A=this.colors,R=this.object.geometry.colors;A[M]!==void 0&&R.push(A[M+0],A[M+1],A[M+2]),A[S]!==void 0&&R.push(A[S+0],A[S+1],A[S+2]),A[C]!==void 0&&R.push(A[C+0],A[C+1],A[C+2])},addUV:function(M,S,C){var A=this.uvs,R=this.object.geometry.uvs;R.push(A[M+0],A[M+1]),R.push(A[S+0],A[S+1]),R.push(A[C+0],A[C+1])},addDefaultUV:function(){var M=this.object.geometry.uvs;M.push(0,0),M.push(0,0),M.push(0,0)},addUVLine:function(M){var S=this.uvs,C=this.object.geometry.uvs;C.push(S[M+0],S[M+1])},addFace:function(M,S,C,A,R,P,I,O,N){var w=this.vertices.length,L=this.parseVertexIndex(M,w),B=this.parseVertexIndex(S,w),D=this.parseVertexIndex(C,w);if(this.addVertex(L,B,D),this.addColor(L,B,D),I!==void 0&&I!==""){var V=this.normals.length;L=this.parseNormalIndex(I,V),B=this.parseNormalIndex(O,V),D=this.parseNormalIndex(N,V),this.addNormal(L,B,D)}else this.addFaceNormal(L,B,D);if(A!==void 0&&A!==""){var G=this.uvs.length;L=this.parseUVIndex(A,G),B=this.parseUVIndex(R,G),D=this.parseUVIndex(P,G),this.addUV(L,B,D),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(M){this.object.geometry.type="Points";for(var S,C=this.vertices.length,A=0,R=M.length;A<R;A++)S=this.parseVertexIndex(M[A],C),this.addVertexPoint(S),this.addColor(S)},addLineGeometry:function(M,S){this.object.geometry.type="Line";for(var C=this.vertices.length,A=this.uvs.length,R=0,P=M.length;R<P;R++)this.addVertexLine(this.parseVertexIndex(M[R],C));for(var I=0,O=S.length;I<O;I++)this.addUVLine(this.parseUVIndex(S[I],A))}};return E.startObject("",!1),E}class T extends c.Loader{constructor(_){super(_),this.materials=null}load(_,M,S,C){var A=this,R=new c.FileLoader(this.manager);R.setPath(this.path),R.setRequestHeader(this.requestHeader),R.setWithCredentials(this.withCredentials),R.load(_,function(P){try{M(A.parse(P))}catch(I){C?C(I):console.error(I),A.manager.itemError(_)}},S,C)}setMaterials(_){return this.materials=_,this}parse(_){var M=new x;_.indexOf(`\r
3227
+ `,y=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0}}};l.fs=h,l.vs=m,l.glslVersion=f,l.getUniforms=y},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(h){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=h,this.load=(m,y)=>{if(m&&m.images&&m.images.source){var p=new(u(25)).TextureArray,d=[];m.images.source.forEach(v=>{d.push(c(v))});var b=this;p.loadFromImages(d).then(()=>{b.texture=p,b.initialise(m,y)})}},this.initialise=(m,y)=>{y!=null&&typeof y=="function"&&y(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(h){var m=h,y=void 0,p=void 0,d=new c.Clock(!1);this.playAnimation=!0;var b=1e3,v=[],g=0,x=[],T=0,E=void 0,_=void 0,M=void 0,S=void 0,C=[],A=[],R=new c.Group,P=void 0,I=void 0,O=!1;this.getDrawingWidth=()=>m?m.clientWidth:P?typeof P.clientWidth>"u"?Math.round(P.width):Math.round(P.clientWidth):0,this.getDrawingHeight=()=>m?m.clientHeight:P?typeof P.clientHeight>"u"?Math.round(P.height):Math.round(P.clientHeight):0,this.onWindowResize=()=>{p.onWindowResize();var L=this.getDrawingWidth(),B=this.getDrawingHeight();if(y!=null){var D;m?(D=m.getBoundingClientRect(),y.setSize(L,B)):P&&(typeof P.getBoundingClientRect>"u"||(D=P.getBoundingClientRect(),P.width=L,P.height=B),y.setSize(L,B,!1)),D&&(D.left,D.top);var V=new c.Vector2;y.getSize(V),V.x,V.y}},this.initialiseVisualisation=L=>{if(L=L||{},L.antialias===void 0){var B=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(B=!0)}catch{B=!1}L.antialias=!B}L.canvas&&(m=void 0,P=L.canvas),y=new c.WebGLRenderer(L),m!==void 0&&m.appendChild(y.domElement),y.setClearColor(16777215,1),P&&P.style&&(P.style.height="100%",P.style.width="100%"),y.autoClear=!1;var D=this.createScene("default");this.setCurrentScene(D)},this.getCurrentScene=()=>p,this.setCurrentScene=L=>{if(L){this.removeActiveScene(L);var B=p;p=L,B&&B.setInteractiveControlEnable(!1),p.setInteractiveControlEnable(!0),p.setAdditionalScenesGroup(R),this.onWindowResize()}},this.getSceneByName=L=>C[L],this.createScene=L=>{if(C[L]==null){var B;return B=P?new(u(32)).Scene(P,y):new(u(32)).Scene(m,y),C[L]=B,B.sceneName=L,B}},this.resetView=()=>{p.resetView()},this.viewAll=()=>{if(p){var L=p.getBoundingBox();if(L){for(var B,D=0;D<A.length;D++)B=A[D].getBoundingBox(),B&&L.union(B);p.viewAllWithBoundingBox(L)}}},this.loadModelsURL=(L,B,D,V,G,H)=>{p.loadModelsURL(L,B,D,V,G,H)},this.loadViewURL=L=>{p.loadViewURL(L)},this.loadFromViewURL=(L,B)=>{p.loadFromViewURL(L,B)},this.updateDirectionalLight=()=>{p.updateDirectionalLight()};var N=()=>{O?(E=requestAnimationFrame(N),this.render()):(cancelAnimationFrame(E),E=void 0)};this.stopAnimate=()=>{O&&(d.stop(),O=!1)},this.animate=()=>{O||(d.start(),O=!0,N())},this.addPreRenderCallbackFunction=L=>(++g,v[g]=L,g),this.removePreRenderCallbackFunction=L=>{L in v&&delete v[L]},this.addPostRenderCallbackFunction=L=>(++T,x[T]=L,T),this.removePostRenderCallbackFunction=L=>{L in x&&delete x[L]},this.getPlayRate=()=>b,this.setPlayRate=L=>{b=L},this.getCurrentTime=()=>p.getCurrentTime(),this.setMorphsTime=L=>{p.setMorphsTime(L)},this.getZincGeometryByID=L=>p.getZincGeometryByID(L),this.addToScene=L=>{p.addObject(L)},this.addToOrthoScene=L=>{if(M==null&&(M=new c.Scene),_==null){var B=this.getDrawingWidth(),D=this.getDrawingHeight();_=new c.OrthographicCamera(-B/2,B/2,D/2,-D/2,1,10),_.position.z=10}M.add(L)};var w=L=>B=>{B.needsUpdate=!0;var D=new c.SpriteMaterial({map:B}),V=D.map.image.width,G=D.map.image.height;L.material=D,L.scale.set(V,G,1);var H=this.getDrawingWidth(),K=this.getDrawingHeight();L.position.set((H-V)/2,(-K+G)/2,1),this.addToOrthoScene(L)};this.addLogo=()=>{S=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,w(S))},this.render=()=>{I||(m?0<m.clientWidth&&0<m.clientHeight&&(I=new f(m,this.onWindowResize)):P&&0<P.width&&0<P.height&&(I=new f(P,this.onWindowResize)));var L=d.getDelta();p.renderGeometries(b,L,this.playAnimation);for(var B,D=0;D<A.length;D++)B=A[D],B.renderGeometries(b,L,this.playAnimation);for(var V in _!=null&&M!=null&&(y.clearDepth(),y.render(M,_)),v)v.hasOwnProperty(V)&&v[V].call();for(var G in p.render(y),x)x.hasOwnProperty(G)&&x[G].call()},this.getThreeJSRenderer=()=>y,this.isSceneActive=L=>{if(p===L)return!0;for(var B,D=0;D<A.length;D++)if(B=A[D],B===L)return!0;return!1},this.addActiveScene=L=>{this.isSceneActive(L)||(A.push(L),R.add(L.getThreeJSScene()))},this.removeActiveScene=L=>{for(var B,D=0;D<A.length;D++)if(B=A[D],B===L)return A.splice(D,1),void R.remove(L.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var L=0;L<A.length;L++)R.remove(A[L].getThreeJSScene());A.splice(0,A.length)},this.dispose=()=>{for(var L in O&&cancelAnimationFrame(E),C)C.hasOwnProperty(L)&&C[L].clearAll();C=[],A=[],R=new c.Group,this.stopAnimate(),v=[],g=0,_=void 0,M=void 0,S=void 0;var B=this.createScene("default");this.setCurrentScene(B),I=void 0},this.transitionScene=(L,B)=>{if(p){var D=p.getZincCameraControls(),V=L.getBoundingBox();if(V){var G=V.min.distanceTo(V.max)/2,H=(V.min.x+V.max.x)/2,K=(V.min.y+V.max.y)/2,te=(V.min.z+V.max.z)/2,W=D.getViewportFromCentreAndRadius(H,K,te,G,40,G*4),z=D.getCurrentViewport();D.cameraTransition(z,W,B),D.enableCameraTransition()}}},this.isWebGL2=()=>!!y&&y.capabilities.isWebGL2}},o=>{o.exports=VB()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,h=u(35).SceneLoader,m=u(41).SceneExporter,y=u(43).Viewport,p=u(5).createBufferGeometry,d=u(5).getCircularTexture,b=0,v=function(){return"sc"+b++},g=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},x=6e3;l.Scene=function(T,E){var _=this,M=T,S=void 0,C=new h(this),A=void 0,R={},P=0,I={},O=0,N=new c.Scene,w=new(u(44)).Region(void 0,this);N.add(w.getGroup());var L=new c.Group;N.add(L),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var B=6e3,D=void 0;this.sceneName=void 0;var V=!1,G=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-left",updateRequired:!0};var H={x:0,y:0},K=g(),te=new c.Vector2,W=[];this.forcePickableObjectsUpdate=!1,this.uuid=v();var z=new f(this);z.disable(),N.add(z.group);var j=()=>M?typeof M.clientWidth>"u"?M.width:M.clientWidth:0,Z=()=>M?typeof M.clientHeight>"u"?M.height:M.clientHeight:0;this.getDownloadProgress=()=>C.getDownloadProgress(),this.onWindowResize=()=>{var F=Z();this.camera.aspect=j()/F,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,D.onResize(),D.calculateHeightPerPixelAtZeroDepth(F)},this.resetView=()=>{this.onWindowResize(),D.resetView()},this.changeZoomByScrollRateUnit=F=>{D.changeZoomByScrollRateUnit(F)};var Q=()=>{this.camera=new c.PerspectiveCamera(40,j()/Z(),0,10),this.ambient=new c.AmbientLight(16777215,.2),N.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),N.add(this.directionalLight),D=new(u(43)).CameraControls(this.camera,E.domElement,E,this),D.setDirectionalLight(this.directionalLight),D.resetView(),A=new(u(49)).Minimap(this)};Q(),this.loadView=F=>{var $=new y;return $.setFromObject(F),D.setCurrentCameraSettings($),!0},this.setupMultipleViews=(F,$)=>{for(var[J,k]of Object.entries($)){var U=new y;U.setFromObject(k),D.addViewport(J,U)}D.setDefaultViewport(F)},this.getBoundingBox=()=>w.getBoundingBox(!0),this.viewAllWithBoundingBox=F=>{if(F){var $=D.getViewportFromBoundingBox(F,1);D.setCurrentCameraSettings($),D.calculateHeightPerPixelAtZeroDepth(Z()),z.markerUpdateRequired=!0}},this.viewAll=()=>{var F=this.getBoundingBox();this.viewAllWithBoundingBox(F),z.markerUpdateRequired=!0},this.forEachGeometry=F=>{w.forEachGeometry(F,!0)},this.forEachGlyphset=F=>{w.forEachGlyphset(F,!0)},this.forEachPointset=F=>{w.forEachPointset(F,!0)},this.forEachLine=F=>{w.forEachLine(F,!0)},this.findGeometriesWithGroupName=F=>w.findGeometriesWithGroupName(F,!0),this.findPointsetsWithGroupName=F=>w.findPointsetsWithGroupName(F,!0),this.findGlyphsetsWithGroupName=F=>w.findGlyphsetsWithGroupName(F,!0),this.findLinesWithGroupName=F=>w.findLinesWithGroupName(F,!0),this.findObjectsWithGroupName=F=>w.findObjectsWithGroupName(F,!0),this.findObjectsWithAnatomicalId=F=>w.findObjectsWithAnatomicalId(F,!0),this.getBoundingBoxOfZincObjects=F=>{for(var $,J=void 0,k=0;k<F.length;k++)$=F[k].getBoundingBox(),$&&(J?J.union($):J=$);return J},this.vectorToScreenXY=F=>{F.project(this.camera);var $=j(),J=Z(),k=$/2,U=J/2;return F.x=F.x*k+k,F.y=-(F.y*U)+U,F},this.getObjectsScreenXY=F=>{if(F&&0<F.length){var $=this.getBoundingBoxOfZincObjects(F),J=new c.Vector3;return $.getCenter(J),this.vectorToScreenXY(J)}},this.getNamedObjectsScreenXY=F=>{var $=this.findObjectsWithGroupName(F);return this.getObjectsScreenXY($)},this.addZincObject=F=>{F&&(w.addZincObject(F),D&&D.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(F,$,J,k)=>{C.loadGlyphsetURL(w,F,$,J,k)},this.loadPointsetURL=(F,$,J,k,U)=>{C.loadPointsetURL(w,F,$,J,k,U)},this.loadLinesURL=(F,$,J,k,U)=>{C.loadLinesURL(w,F,$,J,k,U)},this.loadSTL=(F,$,J)=>{C.loadSTL(w,F,$,J)},this.loadOBJ=(F,$,J)=>{C.loadOBJ(w,F,$,J)},this.loadMetadataURL=(F,$,J)=>{C.loadMetadataURL(w,F,$,J)},this.loadModelsURL=(F,$,J,k,U,oe)=>{C.loadModelsURL(w.urls,$,J,k,U,oe)},this.loadViewURL=F=>{C.loadViewURL(F)},this.loadFromViewURL=(F,$)=>{C.loadFromViewURL(F,$)},this.loadGLTF=(F,$,J,k)=>{C.loadGLTF(w,F,$,J,k)},this.updateDirectionalLight=()=>{D.updateDirectionalLight()},this.addObject=F=>{N.add(F)},this.removeObject=F=>{N.remove(F)},this.getCurrentTime=()=>{if(S!=null)return S.getCurrentTime(B);var F=w.getCurrentTime();return F===-1?0:F},this.setMorphsTime=F=>{S!=null&&S.setMorphTime(F,B),w.setMorphTime(F,!0)},this.isTimeVarying=()=>!!(S&&S.video&&!S.video.error)||w.isTimeVarying(),this.renderGeometries=(F,$,J)=>{var k={};if(k.camera=D,k.displayMarkers=this.displayMarkers,k.markerCluster=z,k.markersList=z.markers,k.ndcToBeUpdated=!1,J&&(k.markerCluster.markerUpdateRequired=!0),!S)C.toBeDownloaded==0?(k.ndcToBeUpdated=D.update($),k.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(Z()),w.renderGeometries(F,$,J,D,k,!0)):D.update(0);else if(S.isReadyToPlay()){J?S.video.play():S.video.pause();var U=S.video.currentTime/S.getVideoDuration()*B;C.toBeDownloaded==0?(D.setTime(U),k.ndcToBeUpdated=D.update(0),k.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(Z()),w.setMorphTime(U,!0),w.renderGeometries(0,0,J,D,k,!0)):D.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>N,this.setVideoHandler=F=>{S||(S=F)},this.setAdditionalScenesGroup=F=>{N.add(F)};var ee=(F,$,J,k,U,oe,ae)=>{var le=0,de=0;return de=F.includes("top")?ae-U-J:F.includes("bottom")?J:Math.floor((ae-U)/2),le=F.includes("left")?$:F.includes("right")?oe-$-k:Math.floor((oe-k)/2),{x:le,y:de}},ie=F=>{this.displayMinimap===!0&&(F.setScissorTest(!0),F.getSize(te),this.minimapScissor.updateRequired&&(H=ee(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,te.x,te.y),this.minimapScissor.updateRequired=!1),F.setScissor(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),F.setViewport(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),A.updateCamera(),N.add(A.mask),F.render(N,A.camera),N.remove(A.mask),F.setScissorTest(!1),F.setViewport(0,0,te.x,te.y))};this.render=F=>{this.autoClearFlag&&F.clear(),V&&G?G.render(N,this.camera):(F.render(N,this.camera),ie(F))},this.setInteractiveControlEnable=F=>{F==!0?D.enable():D.disable()},this.getZincCameraControls=()=>D,this.getThreeJSScene=()=>N,this.setDuration=F=>{w.setDuration(F),B=F,D.setPathDuration(F),C.duration=F},this.getDuration=()=>B,this.setStereoEffectEnable=F=>{F!=!0||G||(G=new u(43).StereoEffect(E)),E.setSize(j(),Z()),this.camera.updateProjectionMatrix(),V=F},this.objectIsInScene=F=>w.objectIsInRegion(F,!0),this.alignBoundingBoxToCameraView=(F,$)=>{if(F){var J=new c.Vector3;F.getCenter(J);var k=this.getZincCameraControls().getCurrentViewport(),U=new c.Vector3(k.targetPosition[0],k.targetPosition[1],k.targetPosition[2]),oe=new c.Vector3(k.eyePosition[0],k.eyePosition[1],k.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(U,oe).normalize(),le.subVectors(U,J).normalize();var de=new c.Vector3;de.crossVectors(ae,le);var be=ae.angleTo(le);0<$?(this.getZincCameraControls().rotateCameraTransition(de,be,$),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(de,be),z.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(F,$,J)=>{if(F){var k=this.getZincCameraControls().getCurrentViewport(),U=this.getZincCameraControls().getViewportFromBoundingBox(F,$);0<J&&(this.getZincCameraControls().cameraTransition(k,U,J),this.getZincCameraControls().enableCameraTransition()),z.markerUpdateRequired=!0}},this.alignObjectToCameraView=(F,$)=>{if(this.objectIsInScene(F)){var J=F.getBoundingBox();this.alignBoundingBoxToCameraView(J,$)}},this.setCameraTargetToObject=F=>{if(this.objectIsInScene(F)){var $=new c.Vector3,J=F.getBoundingBox(),k=this.getZincCameraControls().getCurrentViewport();J.getCenter($);var U=new c.Vector3(k.targetPosition[0],k.targetPosition[1],k.targetPosition[2]),oe=new c.Vector3(k.eyePosition[0],k.eyePosition[1],k.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(oe,U),le.addVectors($,ae),k.eyePosition[0]=le.x,k.eyePosition[1]=le.y,k.eyePosition[2]=le.z,k.targetPosition[0]=$.x,k.targetPosition[1]=$.y,k.targetPosition[2]=$.z,this.getZincCameraControls().setCurrentCameraSettings(k),z.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>V,this.removeZincObject=F=>{w.removeZincObject(F),D&&D.calculateMaxAllowedDistance(this),z.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{W.length=0,z.isEnabled&&W.push(z.group),w.getPickableThreeJSObjects(W,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||w.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),W),this.getNormalisedMinimapCoordinates=(F,$)=>{if(this.displayMinimap){var J=new c.Vector2;F.getSize(J);var k=J.y-$.clientY;if(H.x+this.minimapScissor.width>$.clientX&&$.clientX>H.x&&H.y+this.minimapScissor.height>k&&k>H.y){var U=2*(($.clientX-H.x)/this.minimapScissor.width)-1,oe=2*((k-H.y)/this.minimapScissor.height)-1;return{x:U,y:oe}}}},this.getMinimapDiffFromNormalised=(F,$)=>A?A.getDiffFromNormalised(F,$):void 0,this.isWebGL2=()=>E.isWebGL2(),this.clearAll=()=>{z.clear(),w.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),C.toBeDwonloaded=0,D&&D.calculateMaxAllowedDistance(this),z.markerUpdateRequired=!0},this.addMetadataTimeStamp=(F,$)=>{K.TimeStamps[F]=ne($)},this.getMetadataTag=F=>K[F],this.getMetadata=()=>K,this.setMetadataTag=(F,$)=>{K[F]=$},this.removeMetadataTag=F=>{delete K[F]},this.resetMetadata=()=>{K=g()},this.resetDuration=()=>{this.setDuration(x)};var Y=F=>[...F.years?["".concat(F.years,"years")]:[],...F.months?["".concat(F.months,"months")]:[],...F.weeks?["".concat(F.weeks,"weeks")]:[],...F.days?["".concat(F.days,"days")]:[],...F.hours?["".concat(F.hours,"hours")]:[],...F.mins?["".concat(F.mins,"mins")]:[],...F.secs?["".concat(F.secs,"secs")]:[]].join(" "),ne=F=>F.years?31536e6*F.years:0+F.months?2592e6*F.months:0+F.weeks?6048e5*F.weeks:0+F.days?864e5*F.days:0+F.hours?36e5*F.hours:0+F.mins?6e4*F.mins:0+F.secs?1e3*F.secs:0;this.setDurationFromObject=F=>{var $=Y(F),J=ne(F);this.setMetadataTag("Duration",$),this.setDuration(J)},this.setOriginalDurationFromObject=F=>{var $=Y(F);this.setMetadataTag("OriginalDuration",$)},this.exportGLTF=F=>{var $=new m(this);return $.exportGLTF(F)},this.getRootRegion=()=>w,this.createLines=(F,$,J,k)=>{var U=w.findChildFromPath(F);return U===void 0&&(U=w.createChildFromPath(F)),U.createLines($,J,k)},this.createPoints=(F,$,J,k,U)=>{var oe=w.findChildFromPath(F);return oe===void 0&&(oe=w.createChildFromPath(F)),oe.createPoints($,J,k,U)},this.addZincObjectAddedCallbacks=F=>(++P,R[P]=F,P),this.addZincObjectRemovedCallbacks=F=>(++O,I[O]=F,O),this.removeZincObjectAddedCallbacks=F=>{F in P&&delete R[F]},this.removeZincObjectRemovedCallbacks=F=>{F in O&&delete I[F]},this.clearZincObjectAddedCallbacks=()=>{R={},P=0},this.clearZincObjectRemovedCallbacks=()=>{I={},O=0},this.triggerObjectAddedCallback=F=>{for(var $ in R)R.hasOwnProperty($)&&R[$](F)},this.triggerObjectRemovedCallback=F=>{for(var $ in I)I.hasOwnProperty($)&&I[$](F)},this.addTemporaryPoints=(F,$)=>{var J=p(F.length,F),k=new c.PointsMaterial({alphaTest:.5,size:15,color:$,sizeAttenuation:!1}),U=d();k.map=U;var oe=new(u(23)).Points(J,k);return L.add(oe),oe},this.addTemporaryLines=(F,$)=>{var J=p(F.length,F),k=new c.LineBasicMaterial({color:$}),U=new(u(12)).LineSegments(J,k);return L.add(U),U},this.removeTemporaryPrimitive=F=>{L.remove(F),F.geometry.dispose(),F.material.dispose()},this.clearTemporaryPrimitives=()=>{var F=L.children;F.forEach($=>{$.geometry.dispose(),$.material.dispose()}),L.clear()},this.addBoundingBoxPrimitive=function(F,$,J,k,U){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,ae=w.findChildFromPath(F);ae===void 0&&(ae=w.createChildFromPath(F));var le=oe||_.getBoundingBox(),de=new c.Vector3().subVectors(le.max,le.min),be=new c.BoxGeometry(de.x,de.y,de.z),we=ae.createGeometryFromThreeJSGeometry($,be,J,k,U,1e4);return de.addVectors(le.min,le.max).multiplyScalar(.5),we.setPosition(de.x,de.y,de.z),we},this.addSlicesPrimitive=function(F,$,J,k,U){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if($&&3<=$.length&&J&&3<=J.length){var ae=w.findChildFromPath(F);ae===void 0&&(ae=w.createChildFromPath(F));var le=oe||_.getBoundingBox(),de=new c.Vector3().subVectors(le.max,le.min),be=[],we=0;return["x","y","z"].forEach(ue=>{var me;switch(ue){case"x":me=new c.PlaneGeometry(de.z,de.y),me.rotateY(Math.PI/2);break;case"y":me=new c.PlaneGeometry(de.x,de.z),me.rotateX(Math.PI/2);break;case"z":me=new c.PlaneGeometry(de.x,de.y);break}var se=ae.createGeometryFromThreeJSGeometry($[we],me,J[we],k,U,10001);be.push(se),we++}),de.addVectors(le.min,le.max).multiplyScalar(.5),be.forEach(ue=>{ue.setPosition(de.x,de.y,de.z)}),be}},this.enableMarkerCluster=F=>{F?(z.markerUpdateRequired=!0,z.enable()):(z.markerUpdateRequired=!1,z.disable()),this.forcePickableObjectsUpdate=!0}}},(o,l,u)=>{function c(E,_){var M=Object.keys(E);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(E);_&&(S=S.filter(function(C){return Object.getOwnPropertyDescriptor(E,C).enumerable})),M.push.apply(M,S)}return M}function f(E){for(var _,M=1;M<arguments.length;M++)_=arguments[M]==null?{}:arguments[M],M%2?c(Object(_),!0).forEach(function(S){h(E,S,_[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(_)):c(Object(_)).forEach(function(S){Object.defineProperty(E,S,Object.getOwnPropertyDescriptor(_,S))});return E}function h(E,_,M){return _=m(_),_ in E?Object.defineProperty(E,_,{value:M,enumerable:!0,configurable:!0,writable:!0}):E[_]=M,E}function m(E){var _=y(E,"string");return typeof _=="symbol"?_:_+""}function y(E,_){if(typeof E!="object"||!E)return E;var M=E[Symbol.toPrimitive];if(M!==void 0){var S=M.call(E,_);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}var p=u(4),d=new Image(128,128);d.src=u(34);var b=new p.Texture;b.image=d,b.needsUpdate=!0;var v=[.02,.03,1],g=new p.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),x=u(5).createNewSpriteText,T=function(E){u(10).ZincObject.call(this),this.texture=b;var _=void 0;this.morph=new p.Group,this.group=this.morph,this.isMarkerCluster=!0;var M=!0,S=[];this.markers={};var C=new p.Vector2,A=new p.Vector2,R=Date.now();this.setSpriteSize=w=>{_.scale.set(.015,.02,1),_.scale.multiplyScalar(w)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var P=w=>{var L=new p.Group,B=new p.Sprite(g);return B.clusterIndex=w,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(v[0],v[1],v[2]),B.userData=this,L.add(B),this.group.add(L),{group:L,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},I=(w,L,B)=>{w.group.visible=!0,w.group.position.set(L.coords[0],L.coords[1],L.coords[2]),(w.label===void 0||B!==w.number)&&(w.label&&(w.group.remove(w.label),w.label.material.map.dispose(),w.label.material.dispose()),w.label=x(B,.012,"black","Asap",50,500),w.number=B,w.group.add(w.label)),w.min=L.min,w.max=L.max},O=w=>{var L=0;for(w.forEach(B=>{var D=B.members.length,V=0;D===1?B.members[0].setVisibility(!0):(B.members.forEach(G=>{V+=G.getNumber(),G.setVisibility(!1)}),!S[L]&&S.push(P(L)),I(S[L],B,V),L++)}),L;L<S.length;L++)S[L].group.visible=!1},N=(w,L)=>{var B=!0,D={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},V=0;for(var G in w)B?(C.set(w[G].ndc.x,w[G].ndc.y),this._b1.setFromPoints([w[G].morph.position]),B=!1,D.members.push(w[G]),D.coords=[w[G].morph.position.x,w[G].morph.position.y,w[G].morph.position.z],L.push(D),delete w[G]):(A.set(w[G].ndc.x,w[G].ndc.y),V=C.distanceTo(A),.1>V&&(D.members.push(w[G]),this._b1.expandByPoint(w[G].morph.position),delete w[G]));D.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],D.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&N(w,L)};this.calculate=()=>{if(M){var w=Date.now();if(500<w-R){var L=[];N(f({},this.markers),L),O(L),R=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>M,this.enable=()=>{M=!0,this.morph.visible=!0},this.disable=()=>{for(var w in M=!1,this.morph.visible=!1,this.markers){var L;(L=this.markers[w])!==null&&L!==void 0&&L.isMarker&&this.markers[w].isEnabled()&&this.markers[w].setVisibility(!0)}},this.zoomToCluster=w=>!!(w!==void 0&&-1<w&&(this._v1.set(...S[w].min),this._v2.set(...S[w].max),Math.abs(0<this._v1.distanceTo(this._v2))))&&(this._b1.set(this._v1,this._v2),E.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0,!0),this.clusterIsVisible=w=>{if(w!==void 0&&-1<w&&S[w]){var L;return(L=S[w].group)===null||L===void 0?void 0:L.visible}return!1}};T.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=T},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=u(5).createNewURL,m=u(36).STLLoader,y=u(37).OBJLoader,p=u(38).PrimitivesLoader;l.SceneLoader=function(d){var b=d;this.toBeDownloaded=0,this.progressMap={};var v=!1,g=!1,x=new p;this.getDownloadProgress=()=>{var W=0,z=0,j=!1;for(var Z in this.progressMap){var Q=this.progressMap[Z];W+=Q[1],z+=Q[0],Q[1]==0&&(j=!0)}return j&&(W=0),[W,z,g]},this.onProgress=W=>z=>{this.progressMap[W]=[z.loaded,z.total]},this.onError=W=>z=>{--this.toBeDownloaded,g=!0,console.error("There is an issue with one of the external resource: ".concat(z==null?void 0:z.responseURL,".")),W&&W()};var T=(W,z)=>{var j=z.Default;if(z.Inline)b.setupMultipleViews(j,z.Entries);else{var Z=[],Q=function(ne){W&&(newURL=h(ie,W),Z.push(new Promise((F,$)=>{fetch(newURL).then(J=>J.json()).then(J=>F({key:ne,data:J})).catch(J=>$(J))})))};for(var[ee,ie]of Object.entries(z.Entries))Q(ee);Promise.all(Z).then(Y=>{var ne={};Y.forEach($=>{ne[$.key]=$.data}),b.setupMultipleViews(j,ne);var F=b.getZincCameraControls();F&&F.setCurrentViewport(j),v=!0})}};this.loadViewURL=(W,z)=>{this.toBeDownloaded+=1;var j=new XMLHttpRequest;j.onreadystatechange=()=>{if(j.readyState==4)if(j.status==200){var Q=JSON.parse(j.responseText);b.setupMultipleViews("default",{default:Q}),b.resetView(),v=!0,--this.toBeDownloaded,z!=null&&typeof z=="function"&&z()}else this.onError()};var Z=f(W);j.open("GET",Z,!0),j.send()},this.loadModelsURL=(W,z,j,Z,Q,ee,ie)=>{var Y=z.length;this.toBeDownloaded+=Y;for(var ne=0;ne<Y;ne++){var F=z[ne],$=u(0).defaultMaterialColor,J=u(0).defaultOpacity;j!=null&&j[ne]!=null&&($=!!j[ne]),Z!=null&&Z[ne]!=null&&(J=Z[ne]);var k=0;Q!=null&&Q[ne]!=null&&(k=!!Q[ne]);var U=0;ee!=null&&ee[ne]!=null&&(U=!!ee[ne]),x.load(f(F),O(W,$,J,k,U,void 0,void 0,void 0,void 0,ie),this.onProgress(F),this.onError(ie))}},this.loadFromViewURL=(W,z,j)=>{var Z=new XMLHttpRequest;Z.onreadystatechange=()=>{if(Z.readyState==4&&Z.status==200){var ee=JSON.parse(Z.responseText);b.loadView(ee);for(var ie,Y=[],ne=z+"_",F=0;F<ee.numberOfResources;F++)ie=ne+(F+1)+".json",Y.push(ie);this.loadModelsURL(W,Y,ee.colour,ee.opacity,ee.timeEnabled,ee.morphColour,j)}};var Q=f(z+"_view.json");Z.open("GET",Q,!0),Z.send()};var E=(W,z,j,Z,Q,ee,ie,Y)=>(ne,F)=>{var $=new(u(24)).Lines,J=void 0;F&&F[0]&&(J=new c.LineBasicMaterial({color:F[0].color.clone()}),1>F[0].opacity&&(J.transparent=!0),J.opacity=F[0].opacity,J.morphTargets=z,J.vertexColors=F[0].vertexColors);var k={localTimeEnabled:z,localMorphColour:j};if($&&($.createLineSegment(ne,J,k),$.setName(Z),$.anatomicalId=Q,$.setRenderOrder(ee),W.addZincObject($),$.setDuration(b.getDuration()),console.log(ie),ie&&ie.levels))for(var[U,oe]of Object.entries(ie.levels))$.addLOD(x,U,oe.URL,oe.Index,ie.preload);--this.toBeDownloaded,ne.dispose(),Y!=null&&typeof Y=="function"&&Y($)};this.loadLinesURL=(W,z,j,Z,Q,ee,ie)=>{var Y=0;this.toBeDownloaded+=1;var ne=!!(ie&&ie.isInline)&&ie.isInline,F=ie&&ie.anatomicalId?ie.anatomicalId:void 0,$=ie&&ie.renderOrder?ie.renderOrder:void 0;j!=null&&(Y=!!j);var J=0;if(Z!=null&&(J=!!Z),ne){var k=x.parse(z);E(W,Y,J,Q,F,$,ie.lod,ee)(k.geometry,k.materials)}else x.load(z,E(W,Y,J,Q,F,$,ie.lod,ee),this.onProgress(z),this.onError(ee),ie.loaderOptions)};var _=(W,z,j,Z,Q,ee)=>{var ie=ee&&ee.isInline?ee.isInline:void 0,Y=ee&&ee.anatomicalId?ee.anatomicalId:void 0,ne=ee&&ee.displayLabels?ee.displayLabels:void 0,F=ee&&ee.renderOrder?ee.renderOrder:void 0,$=new(u(18)).Glyphset;$.setDuration(b.getDuration()),$.groupName=Z;var J=()=>{--this.toBeDownloaded,Q!=null&&typeof Q=="function"&&Q($)};++this.toBeDownloaded,ie?$.load(z,j,J,ie,ne):$.load(z,f(j),J,ie,ne),$.anatomicalId=Y,$.setRenderOrder(F),W.addZincObject($)},M=(W,z,j,Z,Q,ee)=>()=>{if(z.readyState==4&&z.status==200){var ie=JSON.parse(z.responseText);_(W,ie,j,Z,Q,ee)}},S=(W,z,j,Z,Q,ee,ie)=>(Y,ne)=>{var F=new(u(22)).Pointset,$=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});ne&&ne[0]&&(1>ne[0].opacity&&($.transparent=!0),$.opacity=ne[0].opacity,$.color=ne[0].color,$.morphTargets=z,$.vertexColors=ne[0].vertexColors);var J={};J.localTimeEnabled=z,J.localMorphColour=j,F&&(F.createMesh(Y,$,J),F.setName(Z),F.anatomicalId=Q,W.addZincObject(F),F.setDuration(b.getDuration()),F.setRenderOrder(ee)),Y.dispose(),--this.toBeDownloaded,ie!=null&&typeof ie=="function"&&ie(F)};this.loadSTL=(W,z,j,Z)=>{this.toBeDownloaded+=1;var Q=u(0).defaultMaterialColor,ee=u(0).defaultOpacity,ie=new m;ie.crossOrigin="Anonymous",ie.load(f(z),O(W,Q,ee,!1,!1,j,void 0,void 0,void 0,Z))},this.loadOBJ=(W,z,j,Z)=>{this.toBeDownloaded+=1;var Q=u(0).defaultMaterialColor,ee=u(0).defaultOpacity,ie=new y;ie.crossOrigin="Anonymous",ie.load(f(z),O(W,Q,ee,!1,!1,j,void 0,void 0,void 0,Z))};var C=(W,z,j,Z,Q,ee,ie)=>{this.toBeDownloaded+=1;var Y=u(0).defaultMaterialColor,ne=u(0).defaultOpacity,F=0,$=!!(ie&&ie.isInline)&&ie.isInline,J=ie&&ie.fileFormat?ie.fileFormat:void 0,k=ie&&ie.anatomicalId?ie.anatomicalId:void 0,U=ie&&ie.renderOrder?ie.renderOrder:void 0;j!=null&&(F=!!j);var oe=0;Z!=null&&(oe=!!Z);var ae=x;if(J!==void 0){if(J=="STL")ae=new m;else if(J=="OBJ")return ae=new y,ae.crossOrigin="Anonymous",void ae.load(z,objloader(W,Y,ne,F,oe,Q,k,ee),this.onProgress(z),this.onError,ie.loaderOptions)}if($){var le=x.parse(z);O(W,Y,ne,F,oe,Q,k,U,ie,ee)(le.geometry,le.materials)}else ae.crossOrigin="Anonymous",x.load(z,O(W,Y,ne,F,oe,Q,k,U,ie,ee),this.onProgress(z),this.onError(ee),ie.loaderOptions)},A=function(z,j,Z){var Q=0;return ee=>{if(++Q,ee&&j!=null&&typeof j=="function"){j(ee);var ie=b.getZincCameraControls();ie&&ie.calculateMaxAllowedDistance(b)}Q==z&&(v==!1&&b.viewAll(),Z!=null&&typeof Z=="function"&&Z())}};this.loadPointsetURL=(W,z,j,Z,Q,ee,ie)=>{var Y=0;this.toBeDownloaded+=1,j!=null&&(Y=!!j);var ne=0;Z!=null&&(ne=!!Z);var F=!!(ie&&ie.isInline)&&ie.isInline,$=ie&&ie.anatomicalId?ie.anatomicalId:void 0,J=ie&&ie.renderOrder?ie.renderOrder:void 0;if(F){var k=x.parse(z);S(W,Y,ne,Q,$,J,ee)(k.geometry,k.materials)}else x.load(z,S(W,Y,ne,Q,$,J,ee),this.onProgress(z),this.onError(ee),ie.loaderOptions)};var R=(W,z,j,Z,Q,ee)=>{var ie=ee&&ee.isInline?ee.isInline:void 0,Y=ee&&ee.anatomicalId?ee.anatomicalId:void 0,ne=ee&&ee.renderOrder?ee.renderOrder:void 0,F=void 0;if(j){if(z&&j.images&&j.images.source)for(var $,J=j.images.source,k=0;k<J.length;k++)$=h(J[k],z),j.images.source[k]=$;if(j.type==="slides"&&(F=new(u(27)).TextureSlides),F){F.groupName=Z;var U=()=>{--this.toBeDownloaded,Q!=null&&typeof Q=="function"&&Q(F)};++this.toBeDownloaded,F.load(j,U,ie),F.anatomicalId=Y,F.setRenderOrder(ne),W.addZincObject(F)}}},P=(W,z,j,Z,Q)=>()=>{if(z.readyState==4&&z.status==200){var ee=JSON.parse(z.responseText);R(W,z.responseURL,ee,j,Z,Q)}};this.loadTextureURL=(W,z,j,Z,Q)=>{var ee=!!(Q&&Q.isInline)&&Q.isInline;if(ee)R(W,void 0,z,j,Z,Q);else{var ie=new XMLHttpRequest;ie.onreadystatechange=P(W,ie,j,Z,Q),ie.open("GET",f(z),!0),ie.send()}},this.loadGlyphsetURL=(W,z,j,Z,Q,ee)=>{var ie=!!(ee&&ee.isInline)&&ee.isInline;if(ie)_(W,z,j,Z,Q,ee);else{var Y=new XMLHttpRequest;Y.onreadystatechange=M(W,Y,j,Z,Q,ee),Y.open("GET",f(z),!0),Y.send()}};var I=(W,z,j,Z,Q,ee,ie,Y,ne)=>{var F={colour:j,opacity:Z,localTimeEnabled:Q,localMorphColour:ee},$=new(u(3)).Geometry;return $.createMesh(z,Y,F),$.getMorph()?($.setName(ne),W&&W.addZincObject($),$.setDuration(b.getDuration()),$.videoHandler&&b.setVideoHandler($.videoHandler),$):void 0},O=(W,z,j,Z,Q,ee,ie,Y,ne,F)=>($,J)=>{var k;J&&J[0]&&(k=J[0]);var U=I(W,$,z,j,Z,Q,void 0,k,ee);if(U.anatomicalId=ie,U.setRenderOrder(Y),ne.lod&&ne.lod.levels)for(var[oe,ae]of Object.entries(ne.lod.levels))U.addLOD(x,oe,ae.URL,ae.Index,ne.lod.preload);--this.toBeDownloaded,$.dispose(),F!=null&&typeof F=="function"&&F(U)},N=W=>{var z=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,j,Z,Q,ee,ie,Y,ne]=W.match(z);return{years:j,months:Z,weeks:Q,days:ee,hours:ie,mins:Y,secs:ne}};this.loadSettings=W=>{if(W){if(W.Duration){var z=N(W.Duration);b.setDurationFromObject(z)}if(W.OriginalDuration){var j=N(W.OriginalDuration);b.setOriginalDurationFromObject(j)}if(W.TimeStamps)for(var Z in W.TimeStamps){var Q=N(W.TimeStamps[Z]);b.addMetadataTimeStamp(Z,Q)}}};var w=(W,z,j,Z,Q)=>{if(j){var ee=void 0,ie=!1;j.URL?(ee=j.URL,z&&(ee=h(ee,z))):j.Inline&&(ee=j.Inline.URL,ie=!0);var Y={};if(j.LOD&&j.LOD.Levels){Y.preload=!!j.LOD.Preload,Y.levels={};for(var[ne,F]of Object.entries(j.LOD.Levels))Y.levels[ne]={},Y.levels[ne].URL=h(F.URL,z),Y.levels[ne].Index=F.Index}var $=j.GroupName;($===void 0||$==="")&&($="_Unnamed");var J={loaderOptions:{index:j.Index},isInline:ie,fileFormat:j.FileFormat,anatomicalId:j.AnatomicalId,compression:j.compression,lod:Y,renderOrder:Z};switch(j.Type){case"Surfaces":C(W,ee,j.MorphVertices,j.MorphColours,$,Q,J);break;case"Glyph":var k;ie?k=j.Inline.GlyphGeometriesURL:(k=j.GlyphGeometriesURL,k=h(j.GlyphGeometriesURL,z)),j.DisplayLabels&&(J.displayLabels=!0),this.loadGlyphsetURL(W,ee,k,$,Q,J);break;case"Points":this.loadPointsetURL(W,ee,j.MorphVertices,j.MorphColours,$,Q,J);break;case"Lines":this.loadLinesURL(W,ee,j.MorphVertices,j.MorphColours,$,Q,J);break;case"Texture":this.loadTextureURL(W,ee,$,Q,J);break}}},L=(W,z,j)=>{if(z){var Z=void 0,Q=!1;switch(z.URL?(Z=z.URL,W&&(Z=h(z.URL,W))):z.Inline&&(Z=z.Inline.URL,Q=!0),z.Type){case"View":Q?(b.setupMultipleViews("default",{default:Z}),v=!0,j!=null&&typeof j=="function"&&j()):this.loadViewURL(Z,j);break;case"Settings":this.loadSettings(z);break}}};this.loadGLTF=(W,z,j,Z,Q)=>{var ee=new(u(39)).GLTFToZincJSLoader;ee.load(b,W,z,j,Z,Q)};var B=(W,z,j,Z)=>{if(j.Primitives&&j.Primitives.forEach(Y=>{var ne=1;Y.Order&&(ne=Y.Order),w(W,z,Y,ne,Z)}),j.Transformation&&W.setTransformation(j.Transformation),j.Children)for(var[Q,ee]of Object.entries(j.Children)){var ie=W.findOrCreateChildFromPath(Q);ie&&B(ie,z,ee,Z)}},D=(W,z)=>{if(Array.isArray(W)){for(var j=0,Z=0;Z<W.length;Z++)W[Z].Type&&(z&&W[Z].Type==="View"||W[Z].Type==="Surfaces"||W[Z].Type==="Glyph"||W[Z].Type==="Points"||W[Z].Type==="Lines"||W[Z].Type==="Texture")&&j++;return j}return 0},V=W=>{var z=W.Primitives?D(W.Primitives,!1):0;return W.Children&&Object.values(W.Children).forEach(j=>{z+=V(j)}),z},G=W=>Array.isArray(W)?D(W,!0):typeof W=="object"&&W!==null&&W.Version==="2.0"?V(W.Regions):void 0,H=(W,z,j,Z,Q)=>{var ee=W;j.RegionPath&&j.RegionPath!==""&&(ee=W.findOrCreateChildFromPath(j.RegionPath)),w(ee,z,j,2*Z,Q)},K=(W,z,j,Z,Q)=>{for(var ee=G(z),ie=new A(ee,Z,Q),Y=0;Y<z.length;Y++)L(j,z[Y],ie);for(var ne=0;ne<z.length;ne++)H(W,j,z[ne],ne,ie)},te=(W,z,j,Z,Q)=>{var ee=G(z),ie=new A(ee,Z,Q);z.Settings&&this.loadSettings(z.Settings),z.Views&&T(j,z.Views),z.Regions&&B(W,j,z.Regions,ie)};this.loadMetadataURL=(W,z,j,Z)=>{var Q=new XMLHttpRequest,ee=f(z);Q.onreadystatechange=()=>{if(Q.readyState==4&&Q.status==200){b.resetMetadata(),b.resetDuration(),v=!1;var ie=Q.responseURL;ie===void 0&&(ie=new URL(ee).href);var Y=JSON.parse(Q.responseText);Array.isArray(Y)?K(W,Y,ie,j,Z):typeof Y=="object"&&Y!==null&&Y.Version=="2.0"&&te(W,Y,ie,j,Z)}},Q.open("GET",ee,!0),Q.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(m){super(m)}load(m,y,p,d){var b=this,v=new c.FileLoader(this.manager);v.setPath(this.path),v.setResponseType("arraybuffer"),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(m,function(g){try{y(b.parse(g))}catch(x){d?d(x):console.error(x),b.manager.itemError(m)}},p,d)}parse(m){function y(d,b,v){for(var g=0,x=d.length;g<x;g++)if(d[g]!==b.getUint8(v+g,!1))return!1;return!0}var p=function(d){if(typeof d=="string"){for(var b=new Uint8Array(d.length),v=0;v<d.length;v++)b[v]=255&d.charCodeAt(v);return b.buffer||b}return d}(m);return function(d){var b=new DataView(d),v=b.getUint32(80,!0);if(84+v*50===b.byteLength)return!0;for(var g=[115,111,108,105,100],x=0;5>x;x++)if(y(g,b,x))return!1;return!0}(p)?function(d){for(var b,v,g,x,T,E,_,M,S=new DataView(d),C=S.getUint32(80,!0),A=!1,R=0;R<70;R++)S.getUint32(R,!1)==1129270351&&S.getUint8(R+4)==82&&S.getUint8(R+5)==61&&(A=!0,x=new Float32Array(3*(3*C)),T=S.getUint8(R+6)/255,E=S.getUint8(R+7)/255,_=S.getUint8(R+8)/255,M=S.getUint8(R+9)/255);for(var P=new c.BufferGeometry,I=new Float32Array(3*(3*C)),O=new Float32Array(3*(3*C)),N=0;N<C;N++){var w=84+N*50,L=S.getFloat32(w,!0),B=S.getFloat32(w+4,!0),D=S.getFloat32(w+8,!0);if(A){var V=S.getUint16(w+48,!0);32768&V?(b=T,v=E,g=_):(b=(31&V)/31,v=(31&V>>5)/31,g=(31&V>>10)/31)}for(var G=1;3>=G;G++){var H=w+12*G,K=3*(3*N)+3*(G-1);I[K]=S.getFloat32(H,!0),I[K+1]=S.getFloat32(H+4,!0),I[K+2]=S.getFloat32(H+8,!0),O[K]=L,O[K+1]=B,O[K+2]=D,A&&(x[K]=b,x[K+1]=v,x[K+2]=g)}}return P.setAttribute("position",new c.BufferAttribute(I,3)),P.setAttribute("normal",new c.BufferAttribute(O,3)),A&&(P.setAttribute("color",new c.BufferAttribute(x,3)),P.hasColors=!0,P.alpha=M),P}(p):function(d){for(var b,v=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,x=/facet([\s\S]*?)endfacet/g,T=0,E=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,_=new RegExp("vertex"+E+E+E,"g"),M=new RegExp("normal"+E+E+E,"g"),S=[],C=[],A=new c.Vector3,R=0,P=0,I=0;(b=g.exec(d))!==null;){P=I;for(var O=b[0];(b=x.exec(O))!==null;){for(var N=0,w=0,L=b[0];(b=M.exec(L))!==null;)A.x=parseFloat(b[1]),A.y=parseFloat(b[2]),A.z=parseFloat(b[3]),w++;for(;(b=_.exec(L))!==null;)S.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),C.push(A.x,A.y,A.z),N++,I++;w!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+T),N!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+T),T++}var B=P,D=I-P;v.addGroup(B,D,R),R++}return v.setAttribute("position",new c.Float32BufferAttribute(S,3)),v.setAttribute("normal",new c.Float32BufferAttribute(C,3)),v}(function(d){return typeof d=="string"?d:c.LoaderUtils.decodeText(new Uint8Array(d))}(m))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>T});var c=u(4),f=/^[og]\s*(.+)?/,h=/^mtllib /,m=/^usemtl /,y=/^usemap /,p=new c.Vector3,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;function x(){var E={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(M,S){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=M,void(this.object.fromDeclaration=S!==!1);var C=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:M||"",fromDeclaration:S!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(P,I){var O=this._finalize(!1);O&&(O.inherited||0>=O.groupCount)&&this.materials.splice(O.index,1);var N={index:this.materials.length,name:P||"",mtllib:Array.isArray(I)&&0<I.length?I[I.length-1]:"",smooth:O===void 0?this.smooth:O.smooth,groupStart:O===void 0?0:O.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(L){var B={index:typeof L=="number"?L:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(N),N},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(P){var I=this.currentMaterial();if(I&&I.groupEnd===-1&&(I.groupEnd=this.geometry.vertices.length/3,I.groupCount=I.groupEnd-I.groupStart,I.inherited=!1),P&&1<this.materials.length)for(var O=this.materials.length-1;0<=O;O--)0>=this.materials[O].groupCount&&this.materials.splice(O,1);return P&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),I}},C&&C.name&&typeof C.clone=="function"){var A=C.clone(0);A.inherited=!0,this.object.materials.push(A)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(M,S){var C=parseInt(M,10);return 3*(0<=C?C-1:C+S/3)},parseNormalIndex:function(M,S){var C=parseInt(M,10);return 3*(0<=C?C-1:C+S/3)},parseUVIndex:function(M,S){var C=parseInt(M,10);return 2*(0<=C?C-1:C+S/2)},addVertex:function(M,S,C){var A=this.vertices,R=this.object.geometry.vertices;R.push(A[M+0],A[M+1],A[M+2]),R.push(A[S+0],A[S+1],A[S+2]),R.push(A[C+0],A[C+1],A[C+2])},addVertexPoint:function(M){var S=this.vertices,C=this.object.geometry.vertices;C.push(S[M+0],S[M+1],S[M+2])},addVertexLine:function(M){var S=this.vertices,C=this.object.geometry.vertices;C.push(S[M+0],S[M+1],S[M+2])},addNormal:function(M,S,C){var A=this.normals,R=this.object.geometry.normals;R.push(A[M+0],A[M+1],A[M+2]),R.push(A[S+0],A[S+1],A[S+2]),R.push(A[C+0],A[C+1],A[C+2])},addFaceNormal:function(M,S,C){var A=this.vertices,R=this.object.geometry.normals;p.fromArray(A,M),d.fromArray(A,S),b.fromArray(A,C),g.subVectors(b,d),v.subVectors(p,d),g.cross(v),g.normalize(),R.push(g.x,g.y,g.z),R.push(g.x,g.y,g.z),R.push(g.x,g.y,g.z)},addColor:function(M,S,C){var A=this.colors,R=this.object.geometry.colors;A[M]!==void 0&&R.push(A[M+0],A[M+1],A[M+2]),A[S]!==void 0&&R.push(A[S+0],A[S+1],A[S+2]),A[C]!==void 0&&R.push(A[C+0],A[C+1],A[C+2])},addUV:function(M,S,C){var A=this.uvs,R=this.object.geometry.uvs;R.push(A[M+0],A[M+1]),R.push(A[S+0],A[S+1]),R.push(A[C+0],A[C+1])},addDefaultUV:function(){var M=this.object.geometry.uvs;M.push(0,0),M.push(0,0),M.push(0,0)},addUVLine:function(M){var S=this.uvs,C=this.object.geometry.uvs;C.push(S[M+0],S[M+1])},addFace:function(M,S,C,A,R,P,I,O,N){var w=this.vertices.length,L=this.parseVertexIndex(M,w),B=this.parseVertexIndex(S,w),D=this.parseVertexIndex(C,w);if(this.addVertex(L,B,D),this.addColor(L,B,D),I!==void 0&&I!==""){var V=this.normals.length;L=this.parseNormalIndex(I,V),B=this.parseNormalIndex(O,V),D=this.parseNormalIndex(N,V),this.addNormal(L,B,D)}else this.addFaceNormal(L,B,D);if(A!==void 0&&A!==""){var G=this.uvs.length;L=this.parseUVIndex(A,G),B=this.parseUVIndex(R,G),D=this.parseUVIndex(P,G),this.addUV(L,B,D),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(M){this.object.geometry.type="Points";for(var S,C=this.vertices.length,A=0,R=M.length;A<R;A++)S=this.parseVertexIndex(M[A],C),this.addVertexPoint(S),this.addColor(S)},addLineGeometry:function(M,S){this.object.geometry.type="Line";for(var C=this.vertices.length,A=this.uvs.length,R=0,P=M.length;R<P;R++)this.addVertexLine(this.parseVertexIndex(M[R],C));for(var I=0,O=S.length;I<O;I++)this.addUVLine(this.parseUVIndex(S[I],A))}};return E.startObject("",!1),E}class T extends c.Loader{constructor(_){super(_),this.materials=null}load(_,M,S,C){var A=this,R=new c.FileLoader(this.manager);R.setPath(this.path),R.setRequestHeader(this.requestHeader),R.setWithCredentials(this.withCredentials),R.load(_,function(P){try{M(A.parse(P))}catch(I){C?C(I):console.error(I),A.manager.itemError(_)}},S,C)}setMaterials(_){return this.materials=_,this}parse(_){var M=new x;_.indexOf(`\r
3228
3228
  `)!==-1&&(_=_.replace(/\r\n/g,`
3229
3229
  `)),_.indexOf(`\\
3230
3230
  `)!==-1&&(_=_.replace(/\\\n/g,""));for(var S=_.split(`
3231
- `),C="",A="",R=0,P=[],I=typeof"".trimLeft=="function",O=0,N=S.length;O<N;O++)if(C=S[O],C=I?C.trimLeft():C.trim(),R=C.length,R!==0&&(A=C.charAt(0),A!=="#"))if(A==="v"){var w=C.split(/\s+/);switch(w[0]){case"v":M.vertices.push(parseFloat(w[1]),parseFloat(w[2]),parseFloat(w[3])),7<=w.length?M.colors.push(parseFloat(w[4]),parseFloat(w[5]),parseFloat(w[6])):M.colors.push(void 0,void 0,void 0);break;case"vn":M.normals.push(parseFloat(w[1]),parseFloat(w[2]),parseFloat(w[3]));break;case"vt":M.uvs.push(parseFloat(w[1]),parseFloat(w[2]))}}else if(A==="f"){for(var L,B=C.substr(1).trim(),D=B.split(/\s+/),V=[],G=0,H=D.length;G<H;G++)if(L=D[G],0<L.length){var K=L.split("/");V.push(K)}for(var te=V[0],W=1,z=V.length-1;W<z;W++){var j=V[W],Z=V[W+1];M.addFace(te[0],j[0],Z[0],te[1],j[1],Z[1],te[2],j[2],Z[2])}}else if(A==="l"){var Q=C.substring(1).trim().split(" "),ee=[],ie=[];if(C.indexOf("/")===-1)ee=Q;else for(var Y,ne=0,F=Q.length;ne<F;ne++)Y=Q[ne].split("/"),Y[0]!==""&&ee.push(Y[0]),Y[1]!==""&&ie.push(Y[1]);M.addLineGeometry(ee,ie)}else if(A==="p"){var $=C.substr(1).trim(),J=$.split(" ");M.addPointGeometry(J)}else if((P=f.exec(C))!==null){var k=(" "+P[0].substr(1).trim()).substr(1);M.startObject(k)}else if(m.test(C))M.object.startMaterial(C.substring(7).trim(),M.materialLibraries);else if(h.test(C))M.materialLibraries.push(C.substring(7).trim());else if(y.test(C))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(A==="s"){if(P=C.split(" "),1<P.length){var U=P[1].trim().toLowerCase();M.object.smooth=U!=="0"&&U!=="off"}else M.object.smooth=!0;var oe=M.object.currentMaterial();oe&&(oe.smooth=M.object.smooth)}else{if(C==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+C+'"')}M.finalize();var ae=new c.Group;ae.materialLibraries=[].concat(M.materialLibraries);var le=M.objects.length!==1||M.objects[0].geometry.vertices.length!==0;if(le==!0)for(var de=0,be=M.objects.length;de<be;de++){var we=M.objects[de],ue=we.geometry,me=we.materials,se=ue.type==="Line",xe=ue.type==="Points",he=!1;if(ue.vertices.length!==0){var ge=new c.BufferGeometry;ge.setAttribute("position",new c.Float32BufferAttribute(ue.vertices,3)),0<ue.normals.length&&ge.setAttribute("normal",new c.Float32BufferAttribute(ue.normals,3)),0<ue.colors.length&&(he=!0,ge.setAttribute("color",new c.Float32BufferAttribute(ue.colors,3))),ue.hasUVIndices===!0&&ge.setAttribute("uv",new c.Float32BufferAttribute(ue.uvs,2));for(var _e=[],Ue=0,qe=me.length;Ue<qe;Ue++){var Pe=me[Ue],ct=Pe.name+"_"+Pe.smooth+"_"+he,Ie=M.materials[ct];if(this.materials!==null){if(Ie=this.materials.create(Pe.name),se&&Ie&&!(Ie instanceof c.LineBasicMaterial)){var Ye=new c.LineBasicMaterial;c.Material.prototype.copy.call(Ye,Ie),Ye.color.copy(Ie.color),Ie=Ye}else if(xe&&Ie&&!(Ie instanceof c.PointsMaterial)){var $e=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call($e,Ie),$e.color.copy(Ie.color),$e.map=Ie.map,Ie=$e}}Ie===void 0&&(Ie=se?new c.LineBasicMaterial:xe?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Ie.name=Pe.name,Ie.flatShading=!Pe.smooth,Ie.vertexColors=he,M.materials[ct]=Ie),_e.push(Ie)}var at=void 0;if(1<_e.length){for(var et,Gt=0,re=me.length;Gt<re;Gt++)et=me[Gt],ge.addGroup(et.groupStart,et.groupCount,Gt);at=se?new c.LineSegments(ge,_e):xe?new c.Points(ge,_e):new c.Mesh(ge,_e)}else at=se?new c.LineSegments(ge,_e[0]):xe?new c.Points(ge,_e[0]):new c.Mesh(ge,_e[0]);at.name=we.name,ae.add(at)}}else if(0<M.vertices.length){var Me=new c.PointsMaterial({size:1,sizeAttenuation:!1}),Ee=new c.BufferGeometry;Ee.setAttribute("position",new c.Float32BufferAttribute(M.vertices,3)),0<M.colors.length&&M.colors[0]!==void 0&&(Ee.setAttribute("color",new c.Float32BufferAttribute(M.colors,3)),Me.vertexColors=!0);var Oe=new c.Points(Ee,Me);ae.add(Oe)}return ae}}},(o,l,u)=>{function c(T,E){var _=Object.keys(T);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);E&&(M=M.filter(function(S){return Object.getOwnPropertyDescriptor(T,S).enumerable})),_.push.apply(_,M)}return _}function f(T){for(var E,_=1;_<arguments.length;_++)E=arguments[_]==null?{}:arguments[_],_%2?c(Object(E),!0).forEach(function(M){h(T,M,E[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(M){Object.defineProperty(T,M,Object.getOwnPropertyDescriptor(E,M))});return T}function h(T,E,_){return E=m(E),E in T?Object.defineProperty(T,E,{value:_,enumerable:!0,configurable:!0,writable:!0}):T[E]=_,T}function m(T){var E=y(T,"string");return typeof E=="symbol"?E:E+""}function y(T,E){if(typeof T!="object"||!T)return T;var _=T[Symbol.toPrimitive];if(_!==void 0){var M=_.call(T,E);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}var p=u(19).JSONLoader,d=u(4),b=d.FileLoader,v=T=>{var E=(M,S)=>{M.merge(S)};if(T&&0<T.length){for(;1<T.length;){var _=T.splice(1,1);E(T[0],_[0])}return T[0]}},g=function(E,_,M){var S=new b,C=new p;S.crossOrigin=_;var A=E,R=M,P=void 0,I=!1,O=!1,N=void 0,w=[],L=G=>{var H=P[G.index];if(H){var K=C.parse(H);G.onLoad(K.geometry,K.materials)}else B(G)},B=G=>{G.onError&&(!N&&(N={responseURL:A}),G.onError(N))};this.downloadCompleted=G=>{try{P=JSON.parse(G[0]),I=!1,O=!0,Array.isArray(P)?w.forEach(H=>L(H)):w.forEach(H=>B(H))}catch{w.forEach(K=>B(K))}};var D=()=>G=>{N=G,O=!0,I=!1,w.forEach(H=>{B(H)})},V=()=>G=>{w.forEach(H=>{H.onProgress&&H.onProgress(G)})};this.load=(G,H,K,te)=>{var W={index:G,onLoad:H,onProgress:K,onError:te};O?P?L(W):B(N):I?w.push(W):(w.push(W),I=!0,S.load(A,R,V,D))}},x=function(E,_){var M=[],S=E,C=_,A=0;this.itemDownloaded=(R,P)=>{if(M[R]=P,A++,A==S){for(var I=M[0][1],O=M.map(L=>L[0]),N=v(O),w=1;w<S;w++)M[R][0].dispose(),M[R][1].forEach(L=>L.dispose());C(N,I)}}};l.PrimitivesLoader=function(){var T=0,E=20;this.crossOrigin="Anonymous";var _=new p,M=[],S={},C=(I,O,N,w,L)=>{var B=I.length,D=new x(B,O),V=0;I.forEach(G=>{var H=L?f({},L):{};H.msHandler=D,H.order=V,V++,R(G,O,N,w,H)})},A=(I,O,N,w,L)=>{var B=L?f({},L):{},D=S[I];if(!D){var V=new P(void 0,this,B);++T,D=new g(I,this.crossOrigin,V),S[I]=D}B.isHandler=D,D.load(L.index,O,N,w)},R=(I,O,N,w,L)=>{if(!(E>T))M.push({url:I,onLoad:O,onProgress:N,onError:w,options:L});else if(L&&L.index!==void 0)A(I,O,N,w,L);else{++T;var B=new P(O,this,L),D=new P(w,this,L);_.crossOrigin=this.crossOrigin,_.load(I,B,N,D)}};this.load=(I,O,N,w,L)=>{Array.isArray(I)?C(I,O,N,w,L):R(I,O,N,w,L)},this.loadFromWaitingList=()=>{var I=M.shift();if(I)this.load(I.url,I.onLoad,I.onProgress,I.onError,I.options);else for(var O in S)S.hasOwnProperty(O)&&delete S[O]};var P=function(O,N,w){return function(){--T;for(var L=arguments.length,B=Array(L),D=0;D<L;D++)B[D]=arguments[D];w!=null&&w.msHandler?w.msHandler.itemDownloaded(w.order,B):w!=null&&w.isHandler?w.isHandler.downloadCompleted(B):O&&O(...B),N.loadFromWaitingList()}};this.parse=I=>_.parse(I)}},(o,l,u)=>{u(4);var c=u(40).GLTFLoader,f=function(){var h=this;this.parseGLTFObjects=(m,y,p,d)=>{var b=y;if(p!==0){if(m.type!=="Object3D"){var v;if(m.type==="Mesh"?v=new(u(3)).Geometry:m.type==="LineSegments"?v=new(u(24)).Lines:m.type==="Points"&&(v=new(u(22)).Pointset),v){var g=!1,x=!1;m.geometry&&m.geometry.morphAttributes&&(g=!!m.geometry.morphAttributes.position,x=!!m.geometry.morphAttributes.color),v.setMesh(m.clone(),g,x);var T=v.getMorph();v.groupName=T.name,T.matrixAutoUpdate=!0,y.addZincObject(v),d!=null&&typeof d=="function"&&d(v)}}else if(m.name!==""&&(y&&(b=y.findOrCreateChildFromPath(m.name)),b)){var E=b.getGroup();E.position.copy(m.position),E.rotation.copy(m.rotation),E.quaternion.copy(m.quaternion),E.matrixAutoUpdate=!0}}p++,m.children.forEach(_=>{h.parseGLTFObjects(_,b,p,d)})},this.setCamera=m=>{m.viewAll();var y=m.getZincCameraControls(),p=y.getCurrentViewport();y.addViewport("default",p),y.setDefaultViewport("default")},this.load=(m,y,p,d,b)=>{var v=p.substring(0,p.lastIndexOf("/")+1),g=p.substring(p.lastIndexOf("/")+1,p.length),x=new c().setPath(v);x.load(g,function(T){console.log(T),h.parseGLTFObjects(T.scene,y,0,d),h.setCamera(m),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=oF},(o,l,u)=>{var c=u(42).GLTFExporter,f=function(h){var m=h;this.exportGLTF=y=>{var p=m.getRootRegion(),d=p.getAllObjects(!0),b=[];d.forEach(x=>{x.animationClip&&b.push({clip:x.animationClip[0],mesh:x.getMorph()})});var v=new c,g={binary:y,animations:b};return new Promise(x=>{v.parse(m.getThreeJSScene(),function(T){x(T)},g)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(w){return new P(w)}),this.register(function(w){return new I(w)}),this.register(function(w){return new O(w)})}register(w){return this.pluginCallbacks.indexOf(w)===-1&&this.pluginCallbacks.push(w),this}unregister(w){return this.pluginCallbacks.indexOf(w)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(w),1),this}parse(w,L,B){for(var D=new R,V=[],G=0,H=this.pluginCallbacks.length;G<H;G++)V.push(this.pluginCallbacks[G](D));D.setPlugins(V),D.write(w,L,B)}}var h={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},m={};m[c.NearestFilter]=h.NEAREST,m[c.NearestMipmapNearestFilter]=h.NEAREST_MIPMAP_NEAREST,m[c.NearestMipmapLinearFilter]=h.NEAREST_MIPMAP_LINEAR,m[c.LinearFilter]=h.LINEAR,m[c.LinearMipmapNearestFilter]=h.LINEAR_MIPMAP_NEAREST,m[c.LinearMipmapLinearFilter]=h.LINEAR_MIPMAP_LINEAR,m[c.ClampToEdgeWrapping]=h.CLAMP_TO_EDGE,m[c.RepeatWrapping]=h.REPEAT,m[c.MirroredRepeatWrapping]=h.MIRRORED_REPEAT;var y={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},p=12,d=1179937895,b=2,v=8,g=1313821514,x=5130562;function T(N,w){return N.length===w.length&&N.every(function(L,B){return L===w[B]})}function E(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var w,L=new Uint8Array(new ArrayBuffer(N.length)),B=0,D=N.length;B<D;B++)w=N.charCodeAt(B),L[B]=255<w?32:w;return L.buffer}function _(N){return T(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function M(N,w,L){for(var B={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},D=w;D<w+L;D++)for(var V,G=0;G<N.itemSize;G++)V=void 0,4<N.itemSize?V=N.array[D*N.itemSize+G]:G===0?V=N.getX(D):G===1?V=N.getY(D):G===2?V=N.getZ(D):G==3&&(V=N.getW(D)),B.min[G]=Math.min(B.min[G],V),B.max[G]=Math.max(B.max[G],V);return B}function S(N){return 4*Math.ceil(N/4)}function C(N){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,L=S(N.byteLength);if(L!==N.byteLength){var B=new Uint8Array(L);if(B.set(new Uint8Array(N)),w!==0)for(var D=N.byteLength;D<L;D++)B[D]=w;return B.buffer}return N}var A=null;class R{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(w){this.plugins=w}write(w,L,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(w);var D=this;Promise.all(this.pending).then(function(){var V=D.buffers,G=D.json,H=D.options,K=D.extensionsUsed,te=new Blob(V,{type:"application/octet-stream"}),W=Object.keys(K);if(0<W.length&&(G.extensionsUsed=W),G.buffers&&0<G.buffers.length&&(G.buffers[0].byteLength=te.size),H.binary===!0){var z=new window.FileReader;z.readAsArrayBuffer(te),z.onloadend=function(){var Z=C(z.result),Q=new DataView(new ArrayBuffer(v));Q.setUint32(0,Z.byteLength,!0),Q.setUint32(4,x,!0);var ee=C(E(JSON.stringify(G)),32),ie=new DataView(new ArrayBuffer(v));ie.setUint32(0,ee.byteLength,!0),ie.setUint32(4,g,!0);var Y=new ArrayBuffer(p),ne=new DataView(Y);ne.setUint32(0,d,!0),ne.setUint32(4,b,!0);var F=p+ie.byteLength+ee.byteLength+Q.byteLength+Z.byteLength;ne.setUint32(8,F,!0);var $=new Blob([Y,ie,ee,Q,Z],{type:"application/octet-stream"}),J=new window.FileReader;J.readAsArrayBuffer($),J.onloadend=function(){L(J.result)}}}else if(G.buffers&&0<G.buffers.length){var j=new window.FileReader;j.readAsDataURL(te),j.onloadend=function(){var Z=j.result;G.buffers[0].uri=Z,L(G)}}else L(G)})}serializeUserData(w,L){if(!(w.userData&&w.userData.isZincObject)&&Object.keys(w.userData).length!==0){var B=this.options,D=this.extensionsUsed;try{var V=JSON.parse(JSON.stringify(w.userData));if(B.includeCustomExtensions&&V.gltfExtensions){for(var G in L.extensions===void 0&&(L.extensions={}),V.gltfExtensions)L.extensions[G]=V.gltfExtensions[G],D[G]=!0;delete V.gltfExtensions}0<Object.keys(V).length&&(L.extras=V)}catch(H){console.warn("THREE.GLTFExporter: userData of '"+w.name+"' won't be serialized because of JSON.stringify error - "+H.message)}}}getUID(w){return this.uids.has(w)||this.uids.set(w,this.uid++),this.uids.get(w)}isNormalizedNormalAttribute(w){var L=this.cache;if(L.attributesNormalized.has(w))return!1;for(var B=new c.Vector3,D=0,V=w.count;D<V;D++)if(5e-4<Math.abs(B.fromBufferAttribute(w,D).length()-1))return!1;return!0}createNormalizedNormalAttribute(w){var L=this.cache;if(L.attributesNormalized.has(w))return L.attributesNormalized.get(w);for(var B=w.clone(),D=new c.Vector3,V=0,G=B.count;V<G;V++)D.fromBufferAttribute(B,V),D.x===0&&D.y===0&&D.z===0?D.setX(1):D.normalize(),B.setXYZ(V,D.x,D.y,D.z);return L.attributesNormalized.set(w,B),B}applyTextureTransform(w,L){var B=!1,D={};(L.offset.x!==0||L.offset.y!==0)&&(D.offset=L.offset.toArray(),B=!0),L.rotation!==0&&(D.rotation=L.rotation,B=!0),(L.repeat.x!==1||L.repeat.y!==1)&&(D.scale=L.repeat.toArray(),B=!0),B&&(w.extensions=w.extensions||{},w.extensions.KHR_texture_transform=D,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(w){var L=this.json,B=this.buffers;return L.buffers||(L.buffers=[{byteLength:0}]),B.push(w),0}processBufferView(w,L,B,D,V){var G=this.json;G.bufferViews||(G.bufferViews=[]);for(var H=L===h.UNSIGNED_BYTE?1:L===h.UNSIGNED_SHORT?2:4,K=S(D*w.itemSize*H),te=new DataView(new ArrayBuffer(K)),W=0,z=B;z<B+D;z++)for(var j,Z=0;Z<w.itemSize;Z++)j=void 0,4<w.itemSize?j=w.array[z*w.itemSize+Z]:Z===0?j=w.getX(z):Z===1?j=w.getY(z):Z===2?j=w.getZ(z):Z==3&&(j=w.getW(z)),L===h.FLOAT?te.setFloat32(W,j,!0):L===h.UNSIGNED_INT?te.setUint32(W,j,!0):L===h.UNSIGNED_SHORT?te.setUint16(W,j,!0):L===h.UNSIGNED_BYTE&&te.setUint8(W,j),W+=H;var Q={buffer:this.processBuffer(te.buffer),byteOffset:this.byteOffset,byteLength:K};V!==void 0&&(Q.target=V),V===h.ARRAY_BUFFER&&(Q.byteStride=w.itemSize*H),this.byteOffset+=K,G.bufferViews.push(Q);var ee={id:G.bufferViews.length-1,byteLength:0};return ee}processBufferViewImage(w){var L=this,B=L.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(D){var V=new window.FileReader;V.readAsArrayBuffer(w),V.onloadend=function(){var G=C(V.result),H={buffer:L.processBuffer(G),byteOffset:L.byteOffset,byteLength:G.byteLength};L.byteOffset+=G.byteLength,D(B.bufferViews.push(H)-1)}})}processAccessor(w,L,B,D){var V,G=this.options,H=this.json;if(w.array.constructor===Float32Array)V=h.FLOAT;else if(w.array.constructor===Uint32Array)V=h.UNSIGNED_INT;else if(w.array.constructor===Uint16Array)V=h.UNSIGNED_SHORT;else if(w.array.constructor===Uint8Array)V=h.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),D===void 0&&(D=w.count),G.truncateDrawRange&&L!==void 0&&L.index===null){var K=B+D,te=L.drawRange.count===1/0?w.count:L.drawRange.start+L.drawRange.count;B=Math.max(B,L.drawRange.start),D=Math.min(K,te)-B,0>D&&(D=0)}if(D===0)return null;var W,z=M(w,B,D);L!==void 0&&(W=w===L.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);var j=this.processBufferView(w,V,B,D,W),Z={bufferView:j.id,byteOffset:j.byteOffset,componentType:V,count:D,max:z.max,min:z.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[w.itemSize]};return w.normalized===!0&&(Z.normalized=!0),H.accessors||(H.accessors=[]),H.accessors.push(Z)-1}processImage(w,L,B){var D=this,V=D.cache,G=D.json,H=D.options,K=D.pending;V.images.has(w)||V.images.set(w,{});var te=V.images.get(w),W=L===c.RGBAFormat?"image/png":"image/jpeg",z=W+":flipY/"+B.toString();if(te[z]!==void 0)return te[z];G.images||(G.images=[]);var j={mimeType:W};if(H.embedImages){var Z=A=A||document.createElement("canvas");Z.width=Math.min(w.width,H.maxTextureSize),Z.height=Math.min(w.height,H.maxTextureSize);var Q=Z.getContext("2d");if(B===!0&&(Q.translate(0,Z.height),Q.scale(1,-1)),typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&w instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&w instanceof ImageBitmap)Q.drawImage(w,0,0,Z.width,Z.height);else{L!==c.RGBAFormat&&L!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(w.width>H.maxTextureSize||w.height>H.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",w);var ee=new Uint8ClampedArray(4*(w.height*w.width));if(L===c.RGBAFormat)for(var ie=0;ie<ee.length;ie+=4)ee[ie+0]=w.data[ie+0],ee[ie+1]=w.data[ie+1],ee[ie+2]=w.data[ie+2],ee[ie+3]=w.data[ie+3];else for(var Y=0,ne=0;Y<ee.length;Y+=4,ne+=3)ee[Y+0]=w.data[ne+0],ee[Y+1]=w.data[ne+1],ee[Y+2]=w.data[ne+2],ee[Y+3]=255;Q.putImageData(new ImageData(ee,w.width,w.height),0,0)}H.binary===!0?K.push(new Promise(function($){Z.toBlob(function(J){D.processBufferViewImage(J).then(function(k){j.bufferView=k,$()})},W)})):j.uri=Z.toDataURL(W)}else j.uri=w.src;var F=G.images.push(j)-1;return te[z]=F,F}processSampler(w){var L=this.json;L.samplers||(L.samplers=[]);var B={magFilter:m[w.magFilter],minFilter:m[w.minFilter],wrapS:m[w.wrapS],wrapT:m[w.wrapT]};return L.samplers.push(B)-1}processTexture(w){var L=this.cache,B=this.json;if(L.textures.has(w))return L.textures.get(w);B.textures||(B.textures=[]);var D={sampler:this.processSampler(w),source:this.processImage(w.image,w.format,w.flipY)};w.name&&(D.name=w.name),this._invokeAll(function(G){G.writeTexture&&G.writeTexture(w,D)});var V=B.textures.push(D)-1;return L.textures.set(w,V),V}processMaterial(w){var L=this.cache,B=this.json;if(L.materials.has(w))return L.materials.get(w);if(w.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var D={pbrMetallicRoughness:{}};w.isMeshStandardMaterial!==!0&&w.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var V=w.color.toArray().concat([w.opacity]);if(T(V,[1,1,1,1])||(D.pbrMetallicRoughness.baseColorFactor=V),w.isMeshStandardMaterial?(D.pbrMetallicRoughness.metallicFactor=w.metalness,D.pbrMetallicRoughness.roughnessFactor=w.roughness):(D.pbrMetallicRoughness.metallicFactor=.5,D.pbrMetallicRoughness.roughnessFactor=.5),w.metalnessMap||w.roughnessMap)if(w.metalnessMap===w.roughnessMap){var G={index:this.processTexture(w.metalnessMap)};this.applyTextureTransform(G,w.metalnessMap),D.pbrMetallicRoughness.metallicRoughnessTexture=G}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(w.map){var H={index:this.processTexture(w.map)};this.applyTextureTransform(H,w.map),D.pbrMetallicRoughness.baseColorTexture=H}if(w.emissive){var K=w.emissive.clone().multiplyScalar(w.emissiveIntensity),te=Math.max(K.r,K.g,K.b);if(1<te&&(K.multiplyScalar(1/te),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<te&&(D.emissiveFactor=K.toArray()),w.emissiveMap){var W={index:this.processTexture(w.emissiveMap)};this.applyTextureTransform(W,w.emissiveMap),D.emissiveTexture=W}}if(w.normalMap){var z={index:this.processTexture(w.normalMap)};w.normalScale&&w.normalScale.x!==-1&&(w.normalScale.x!==w.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),z.scale=w.normalScale.x),this.applyTextureTransform(z,w.normalMap),D.normalTexture=z}if(w.aoMap){var j={index:this.processTexture(w.aoMap),texCoord:1};w.aoMapIntensity!==1&&(j.strength=w.aoMapIntensity),this.applyTextureTransform(j,w.aoMap),D.occlusionTexture=j}w.transparent?D.alphaMode="BLEND":0<w.alphaTest&&(D.alphaMode="MASK",D.alphaCutoff=w.alphaTest),w.side===c.DoubleSide&&(D.doubleSided=!0),w.name!==""&&(D.name=w.name),this.serializeUserData(w,D),this._invokeAll(function(Q){Q.writeMaterial&&Q.writeMaterial(w,D)});var Z=B.materials.push(D)-1;return L.materials.set(w,Z),Z}processMesh(w){var L=this.cache,B=this.json,D=[w.geometry.uuid];if(Array.isArray(w.material))for(var V=0,G=w.material.length;V<G;V++)D.push(w.material[V].uuid);else D.push(w.material.uuid);var H=D.join(":");if(L.meshes.has(H))return L.meshes.get(H);var K,te=w.geometry;if(K=w.isLineSegments?h.LINES:w.isLineLoop?h.LINE_LOOP:w.isLine?h.LINE_STRIP:w.isPoints?h.POINTS:w.material.wireframe?h.LINES:h.TRIANGLES,te.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var W={},z={},j=[],Z=[],Q={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},ee=te.getAttribute("normal");ee===void 0||this.isNormalizedNormalAttribute(ee)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),te.setAttribute("normal",this.createNormalizedNormalAttribute(ee)));var ie=null;for(var Y in te.attributes)if(Y.substr(0,5)!=="morph"){var ne=te.attributes[Y];Y=Q[Y]||Y.toUpperCase();var F=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(F.test(Y)||(Y="_"+Y),L.attributes.has(this.getUID(ne))){z[Y]=L.attributes.get(this.getUID(ne));continue}ie=null;var $=ne.array;Y!=="JOINTS_0"||$ instanceof Uint16Array||$ instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),ie=new c.BufferAttribute(new Uint16Array($),ne.itemSize,ne.normalized));var J=this.processAccessor(ie||ne,te);J!==null&&(z[Y]=J,L.attributes.set(this.getUID(ne),J))}if(ee!==void 0&&te.setAttribute("normal",ee),Object.keys(z).length===0)return null;if(w.morphTargetInfluences!==void 0&&0<w.morphTargetInfluences.length){var k=[],U=[],oe={};if(w.morphTargetDictionary!==void 0)for(var ae in w.morphTargetDictionary)oe[w.morphTargetDictionary[ae]]=ae;for(var le=0;le<w.morphTargetInfluences.length;++le){var de={},be=!1;for(var we in te.morphAttributes){if(we!="position"&&we!=="normal"&&we!=="color"){be||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),be=!0);continue}var ue=te.morphAttributes[we][le],me=we.toUpperCase();Q[we]&&(me=Q[we]);var se=te.attributes[we];if(L.attributes.has(this.getUID(ue))){de[me]=L.attributes.get(this.getUID(ue));continue}var xe=se.clone();if(!te.morphTargetsRelative)if(se)for(var he=0,ge=ue.count;he<ge;he++)se.count>he&&xe.setXYZ(he,ue.getX(he)-se.getX(he),ue.getY(he)-se.getY(he),ue.getZ(he)-se.getZ(he));else for(var _e=0,Ue=ue.count;_e<Ue;_e++)xe.setXYZ(_e,0,0,0);de[me]=this.processAccessor(xe,te),L.attributes.set(this.getUID(se),de[me])}Z.push(de),k.push(w.morphTargetInfluences[le]),w.morphTargetDictionary!==void 0&&U.push(oe[le])}W.weights=k,0<U.length&&(W.extras={},W.extras.targetNames=U)}var qe=Array.isArray(w.material);if(qe&&te.groups.length===0)return null;for(var Pe,ct=qe?w.material:[w.material],Ie=qe?te.groups:[{materialIndex:0,start:void 0,count:void 0}],Ye=0,$e=Ie.length;Ye<$e;Ye++){if(Pe={mode:K,attributes:z},this.serializeUserData(te,Pe),0<Z.length&&(Pe.targets=Z),te.index!==null){var at=this.getUID(te.index);(Ie[Ye].start!==void 0||Ie[Ye].count!==void 0)&&(at+=":"+Ie[Ye].start+":"+Ie[Ye].count),L.attributes.has(at)?Pe.indices=L.attributes.get(at):(Pe.indices=this.processAccessor(te.index,te,Ie[Ye].start,Ie[Ye].count),L.attributes.set(at,Pe.indices)),Pe.indices===null&&delete Pe.indices}var et=this.processMaterial(ct[Ie[Ye].materialIndex]);et!==null&&(Pe.material=et),j.push(Pe)}W.primitives=j,B.meshes||(B.meshes=[]),this._invokeAll(function(re){re.writeMesh&&re.writeMesh(w,W)});var Gt=B.meshes.push(W)-1;return L.meshes.set(H,Gt),Gt}processCamera(w){var L=this.json;L.cameras||(L.cameras=[]);var B=w.isOrthographicCamera,D={type:B?"orthographic":"perspective"};return B?D.orthographic={xmag:2*w.right,ymag:2*w.top,zfar:0>=w.far?.001:w.far,znear:0>w.near?0:w.near}:D.perspective={aspectRatio:w.aspect,yfov:c.MathUtils.degToRad(w.fov),zfar:0>=w.far?.001:w.far,znear:0>w.near?0:w.near},w.name!==""&&(D.name=w.type),L.cameras.push(D)-1}processAnimation(w,L){var B=this.json,D=this.nodeMap;B.animations||(B.animations=[]),w=f.Utils.mergeMorphTargetTracks(w.clone(),L);for(var V=w.tracks,G=[],H=[],K=0;K<V.length;++K){var te=V[K],W=c.PropertyBinding.parseTrackName(te.name),z=c.PropertyBinding.findNode(L,W.nodeName),j=y[W.propertyName];if(W.objectName==="bones"&&(z.isSkinnedMesh===!0?z=z.skeleton.getBoneByName(W.objectIndex):z=void 0),!z||!j)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',te.name),null;var Z=1,Q=te.values.length/te.times.length;j===y.morphTargetInfluences&&(Q/=z.morphTargetInfluences.length);var ee=void 0;te.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(ee="CUBICSPLINE",Q/=3):te.getInterpolation()===c.InterpolateDiscrete?ee="STEP":ee="LINEAR",H.push({input:this.processAccessor(new c.BufferAttribute(te.times,Z)),output:this.processAccessor(new c.BufferAttribute(te.values,Q)),interpolation:ee}),G.push({sampler:H.length-1,target:{node:D.get(z),path:j}})}return B.animations.push({name:w.name||"clip_"+B.animations.length,samplers:H,channels:G}),B.animations.length-1}processSkin(w){var L=this.json,B=this.nodeMap,D=L.nodes[B.get(w)],V=w.skeleton;if(V===void 0)return null;var G=w.skeleton.bones[0];if(G===void 0)return null;for(var H=[],K=new Float32Array(16*V.bones.length),te=new c.Matrix4,W=0;W<V.bones.length;++W)H.push(B.get(V.bones[W])),te.copy(V.boneInverses[W]),te.multiply(w.bindMatrix).toArray(K,16*W);L.skins===void 0&&(L.skins=[]),L.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(K,16)),joints:H,skeleton:B.get(G)});var z=D.skin=L.skins.length-1;return z}processNode(w){var L=this.json,B=this.options,D=this.nodeMap;L.nodes||(L.nodes=[]);var V={};if(B.trs){var G=w.quaternion.toArray(),H=w.position.toArray(),K=w.scale.toArray();T(G,[0,0,0,1])||(V.rotation=G),T(H,[0,0,0])||(V.translation=H),T(K,[1,1,1])||(V.scale=K)}else w.matrixAutoUpdate&&w.updateMatrix(),_(w.matrix)===!1&&(V.matrix=w.matrix.elements);if(w.name!==""&&(V.name=w.name+""),this.serializeUserData(w,V),w.isMesh||w.isLine||w.isPoints){var te=this.processMesh(w);te!==null&&(V.mesh=te)}else w.isCamera&&(V.camera=this.processCamera(w));if(w.isSkinnedMesh&&this.skins.push(w),0<w.children.length){for(var W,z=[],j=0,Z=w.children.length;j<Z;j++)if(W=w.children[j],W.visible||B.onlyVisible===!1){var Q=this.processNode(W);Q!==null&&z.push(Q)}0<z.length&&(V.children=z)}this._invokeAll(function(ie){ie.writeNode&&ie.writeNode(w,V)});var ee=L.nodes.push(V)-1;return D.set(w,ee),ee}processScene(w){var L=this.json,B=this.options;L.scenes||(L.scenes=[],L.scene=0);var D={};w.name!==""&&(D.name=w.name),L.scenes.push(D);for(var V,G=[],H=0,K=w.children.length;H<K;H++)if(V=w.children[H],V.visible||B.onlyVisible===!1){var te=this.processNode(V);te!==null&&G.push(te)}0<G.length&&(D.nodes=G),this.serializeUserData(w,D)}processObjects(w){var L=new c.Scene;L.name="AuxScene";for(var B=0;B<w.length;B++)L.children.push(w[B]);this.processScene(L)}processInput(w){var L=this.options;w=w instanceof Array?w:[w],this._invokeAll(function(H){H.beforeParse&&H.beforeParse(w)});for(var B=[],D=0;D<w.length;D++)w[D]instanceof c.Scene?this.processScene(w[D]):B.push(w[D]);0<B.length&&this.processObjects(B);for(var V=0;V<this.skins.length;++V)this.processSkin(this.skins[V]);for(var G=0;G<L.animations.length;++G)this.processAnimation(L.animations[G].clip,L.animations[G].mesh);this._invokeAll(function(H){H.afterParse&&H.afterParse(w)})}_invokeAll(w){for(var L=0,B=this.plugins.length;L<B;L++)w(this.plugins[L])}}class P{constructor(w){this.writer=w,this.name="KHR_lights_punctual"}writeNode(w,L){if(w.isLight){if(!w.isDirectionalLight&&!w.isPointLight&&!w.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",w);var B=this.writer,D=B.json,V=B.extensionsUsed,G={};w.name&&(G.name=w.name),G.color=w.color.toArray(),G.intensity=w.intensity,w.isDirectionalLight?G.type="directional":w.isPointLight?(G.type="point",0<w.distance&&(G.range=w.distance)):w.isSpotLight&&(G.type="spot",0<w.distance&&(G.range=w.distance),G.spot={},G.spot.innerConeAngle=-1*((w.penumbra-1)*w.angle),G.spot.outerConeAngle=w.angle),w.decay!==void 0&&w.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),w.target&&(w.target.parent!==w||w.target.position.x!==0||w.target.position.y!==0||w.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),V[this.name]||(D.extensions=D.extensions||{},D.extensions[this.name]={lights:[]},V[this.name]=!0);var H=D.extensions[this.name].lights;H.push(G),L.extensions=L.extensions||{},L.extensions[this.name]={light:H.length-1}}}}class I{constructor(w){this.writer=w,this.name="KHR_materials_unlit"}writeMaterial(w,L){if(w.isMeshBasicMaterial){var B=this.writer,D=B.extensionsUsed;L.extensions=L.extensions||{},L.extensions[this.name]={},D[this.name]=!0,L.pbrMetallicRoughness.metallicFactor=0,L.pbrMetallicRoughness.roughnessFactor=.9}}}class O{constructor(w){this.writer=w,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(w,L){if(w.isGLTFSpecularGlossinessMaterial){var B=this.writer,D=B.extensionsUsed,V={};L.pbrMetallicRoughness.baseColorFactor&&(V.diffuseFactor=L.pbrMetallicRoughness.baseColorFactor);var G=[1,1,1];if(w.specular.toArray(G,0),V.specularFactor=G,V.glossinessFactor=w.glossiness,L.pbrMetallicRoughness.baseColorTexture&&(V.diffuseTexture=L.pbrMetallicRoughness.baseColorTexture),w.specularMap){var H={index:B.processTexture(w.specularMap)};B.applyTextureTransform(H,w.specularMap),V.specularGlossinessTexture=H}L.extensions=L.extensions||{},L.extensions[this.name]=V,D[this.name]=!0}}}f.Utils={insertKeyframe:function(w,L){var B,D=.001,V=w.getValueSize(),G=new w.TimeBufferType(w.times.length+1),H=new w.ValueBufferType(w.values.length+V),K=w.createInterpolant(new w.ValueBufferType(V));if(w.times.length===0){G[0]=L;for(var te=0;te<V;te++)H[te]=0;B=0}else if(L<w.times[0]){if(Math.abs(w.times[0]-L)<D)return 0;G[0]=L,G.set(w.times,1),H.set(K.evaluate(L),0),H.set(w.values,V),B=0}else if(L>w.times[w.times.length-1]){if(Math.abs(w.times[w.times.length-1]-L)<D)return w.times.length-1;G[G.length-1]=L,G.set(w.times,0),H.set(w.values,0),H.set(K.evaluate(L),w.values.length),B=G.length-1}else for(var W=0;W<w.times.length;W++){if(Math.abs(w.times[W]-L)<D)return W;if(w.times[W]<L&&w.times[W+1]>L){G.set(w.times.slice(0,W+1),0),G[W+1]=L,G.set(w.times.slice(W+1),W+2),H.set(w.values.slice(0,(W+1)*V),0),H.set(K.evaluate(L),(W+1)*V),H.set(w.values.slice((W+1)*V),(W+2)*V),B=W+1;break}}return w.times=G,w.values=H,B},mergeMorphTargetTracks:function(w,L){for(var B=[],D={},V=w.tracks,G=0;G<V.length;++G){var H=V[G],K=c.PropertyBinding.parseTrackName(H.name),te=c.PropertyBinding.findNode(L,K.nodeName);if(K.propertyName!=="morphTargetInfluences"||K.propertyIndex===void 0){B.push(H);continue}if(H.createInterpolant!==H.InterpolantFactoryMethodDiscrete&&H.createInterpolant!==H.InterpolantFactoryMethodLinear){if(H.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),H=H.clone(),H.setInterpolation(c.InterpolateLinear)}var W=te.morphTargetInfluences.length,z=te.morphTargetDictionary[K.propertyIndex];if(z===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+K.propertyIndex);var j=void 0;if(D[te.uuid]===void 0){j=H.clone();for(var Z=new j.ValueBufferType(W*j.times.length),Q=0;Q<j.times.length;Q++)Z[Q*W+z]=j.values[Q];j.name=(K.nodeName||"")+".morphTargetInfluences",j.values=Z,D[te.uuid]=j,B.push(j);continue}var ee=H.createInterpolant(new H.ValueBufferType(1));j=D[te.uuid];for(var ie=0;ie<j.times.length;ie++)j.values[ie*W+z]=ee.evaluate(j.times[ie]);for(var Y,ne=0;ne<H.times.length;ne++)Y=this.insertKeyframe(j,H.times[ne]),j.values[Y*W+z]=H.values[ne]}return w.tracks=B,w}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var E=this;this.setFromObject=_=>{var{nearPlane:M,farPlane:S,eyePosition:C,targetPosition:A,upVector:R}=_;E.nearPlane=M,E.farPlane=S,E.eyePosition=C,E.targetPosition=A,E.upVector=R}},m=function(E,_,M,S){var C={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},A={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},R={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},P={};P.MAIN=A.ROTATE,P.AUXILIARY=A.ZOOM,P.SECONDARY=A.PAN,this.cameraObject=E,this.domElement=_===void 0?document:_,this.renderer=M,this.scene=S,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50,this.pixelHeight=1;var I=6e3,O=!0,N=0,w=void 0,L=void 0,B=!1,D=500,V=void 0,G="default",H=C.DEFAULT,K=void 0,te=void 0,W=void 0,z=0,j=R.FREE;this._state=A.NONE;var Z;this.targetTouchId=-1;var Q=void 0,ee=new c.Vector3,ie=new c.Vector3,Y=new c.Vector3,ne=new c.Vector3,F=new c.Vector3,$=new c.Vector3,J=new c.Vector3,k=new c.Vector3,U=new c.Sphere,oe=new c.Vector3,ae=void 0,le=0,de={default:new h};de.default.nearPlane=.1,de.default.farPlane=2e3,de.default.eyePosition=[0,0,0],de.default.targetPosition=[0,0,-1],de.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...de.default.targetPosition)),this.calculateMaxAllowedDistance=re=>{var Me=re.getBoundingBox();if(Me){Me.getBoundingSphere(U),le=6*U.radius;var Ee=0;this.cameraObject&&(Ee=this.cameraObject.position.distanceTo(U.center)),le=Ee>le?Ee:le}else le=0},this.addViewport=(re,Me)=>{re&&Me&&(de[re]=Me)},this.setDefaultViewport=re=>!!(re&&re in de)&&(G=re,!0),this.getDefaultViewport=()=>G,this.getViewportOfName=re=>de[re],this.setCurrentViewport=re=>re in de&&(this.setCurrentCameraSettings(de[re]),!0),this.setRotationMode=re=>{switch(re){case"none":j=R.NONE;break;case"horizontal":j=R.HORIZONTAL;break;case"vertical":j=R.VERTICAL;break;case"free":default:j=R.FREE}},this.onResize=()=>{Q&&(Q=void 0),ae&&ae.setCurrentCameraSettings(this.cameraObject,de[G])},this.getVisibleHeightAtZDepth=re=>{var Me=this.cameraObject.position.distanceTo(this.cameraObject.target);re<Me?re-=Me:re+=Me;var Ee=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Ee/2)*Math.abs(re)},this.calculateHeightPerPixelAtZeroDepth=re=>{var Me=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=Me/re,this.pixelHeight},this.getNDCFromDocumentCoords=(re,Me,Ee)=>{qe(!1);var Oe=Ee||new c.Vector2,Je=2*((re-Q.left)/Q.width)-1,it=2*-((Me-Q.top)/Q.height)+1;return Oe.set(Je,it)},this.getRelativeCoordsFromNDC=(re,Me,Ee)=>{qe(!1);var Oe=Ee||new c.Vector2;return Oe.x=(re+1)*Q.width/2,Oe.y=(1-Me)*Q.height/2,Oe},this.setMouseButtonAction=(re,Me)=>{P[re]=A[Me]};var be=()=>{if(0<le){var re=oe.distanceTo(U.center);return le>re||this.cameraObject.position.distanceTo(U.center)>re}return!0},we=re=>{oe.copy(this.cameraObject.position).add(re),be()&&(this.cameraObject.target.add(re),this.cameraObject.position.add(re),this.updateDirectionalLight())},ue=re=>{qe(!1);var Me;if(H===C.DEFAULT&&(Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,re)),!Me)re.button==0?re.ctrlKey?this._state=P.AUXILIARY:re.shiftKey?this._state=P.SECONDARY:this._state=P.MAIN:re.button==1?(re.preventDefault(),this._state=P.AUXILIARY):re.button==2&&(this._state=P.SECONDARY),this.pointer_x=re.clientX-Q.left,this.pointer_y=re.clientY-Q.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{H=C.MINIMAP;var Ee=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);we(Ee)}},me=re=>{if(qe(!1),Q)if(this.pointer_x=re.clientX-Q.left,this.pointer_y=re.clientY-Q.top,H===C.MINIMAP){var Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,re);if(Me){var Ee=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);we(Ee)}}else this._state===A.NONE&&Z!==void 0&&Z.move(this,re.clientX,re.clientY,this.renderer)},se=re=>{this._state=A.NONE,H==C.MINIMAP&&(H=C.DEFAULT),Z!==void 0&&this.pointer_x_start==re.clientX-Q.left&&this.pointer_y_start==re.clientY-Q.top&&Z.pick(this,re.clientX,re.clientY,this.renderer)},xe=re=>{this._state=A.NONE},he=re=>{qe(!1);var Me=re.touches.length;if(Me==1)this._state=A.TOUCH_ROTATE,this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(Me==2){this._state=A.TOUCH_ZOOM;var Ee=re.touches[0].clientX-re.touches[1].clientX,Oe=re.touches[0].clientY-re.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Ee*Ee+Oe*Oe)}else Me==3&&(this._state=A.TOUCH_PAN,this.targetTouchId=re.touches[0].identifier,this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},ge=re=>{re.preventDefault(),re.stopPropagation();var Me=re.touches.length;if(Me==1)this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top;else if(Me==2){if(this._state===A.TOUCH_ZOOM){var Ee=re.touches[0].clientX-re.touches[1].clientX,Oe=re.touches[0].clientY-re.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ee*Ee+Oe*Oe)}}else if(Me==3&&this._state===A.TOUCH_PAN)for(var Je=0;3>Je;Je++)re.touches[Je].identifier==this.targetTouchId&&(this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top)},_e=re=>{var Me=re.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=A.NONE,Me==1&&Z!==void 0&&this.pointer_x_start==re.touches[0].clientX-Q.left&&this.pointer_y_start==re.touches[0].clientY-Q.top&&Z.pick(this.cameraObject,re.touches[0].clientX,re.touches[0].clientY,this.renderer)},Ue=()=>{qe(!0)},qe=re=>{if(re||Q===void 0){var Me=new IntersectionObserver(Ee=>{for(var Oe of Ee)Q=Oe.boundingClientRect;Me.disconnect()});Me.observe(this.domElement)}},Pe=re=>{qe(!1),this._state=A.SCROLL;var Me=0;0<re.deltaY?Me=this.scrollRate:0>re.deltaY&&(Me=-1*this.scrollRate),z+=Me,re.preventDefault(),re.stopImmediatePropagation()},ct=()=>{if(typeof this.cameraObject<"u"){var re=Q.height,Me=this.cameraObject.position.distanceTo(this.cameraObject.target),Ee=0;this.cameraObject.far>this.cameraObject.near&&Me>=this.cameraObject.near&&Me<=this.cameraObject.far&&(Ee=(Me-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),ie.set(this.previous_pointer_x,re-this.previous_pointer_y,0),Y.set(this.previous_pointer_x,re-this.previous_pointer_y,1),ne.set(this.pointer_x,re-this.pointer_y,0),F.set(this.pointer_x,re-this.pointer_y,1),ie.unproject(this.cameraObject),Y.unproject(this.cameraObject),ne.unproject(this.cameraObject),F.unproject(this.cameraObject);var Oe=-.002;ne.sub(ie).multiplyScalar(1-Ee),F.sub(Y).multiplyScalar(Ee),ne.add(F).multiplyScalar(Oe),we(ne)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(re,Me)=>{re.normalize(),J.copy(this.cameraObject.position).sub(this.cameraObject.target),k.copy(J),J.normalize(),.8<Math.abs(J.dot(re))&&J.copy(this.cameraObject.up),ie.crossVectors(re,J).normalize(),Y.crossVectors(re,ie);var Ee=re.dot(k),Oe=ie.dot(k),Je=Y.dot(k),it=re.dot(this.cameraObject.up),ut=ie.dot(this.cameraObject.up),rt=Y.dot(this.cameraObject.up),Tt=Math.cos(Me),qt=Math.sin(Me);return ne.set(Tt*ie.x+qt*Y.x,Tt*ie.y+qt*Y.y,Tt*ie.z+qt*Y.z),F.set(Tt*Y.x-qt*ie.x,Tt*Y.y-qt*ie.y,Tt*Y.z-qt*ie.z),J.copy(this.cameraObject.target),J.x=J.x+re.x*Ee+ne.x*Oe+F.x*Je,J.y=J.y+re.y*Ee+ne.y*Oe+F.y*Je,J.z=J.z+re.z*Ee+ne.z*Oe+F.z*Je,ee.set(re.x*it+ne.x*ut+F.x*rt,re.y*it+ne.y*ut+F.y*rt,re.z*it+ne.z*ut+F.z*rt),{position:J,up:ee}},this.rotateAboutLookAtpoint=(re,Me)=>{var Ee=this.getVectorsFromRotateAboutLookAtPoints(re,Me);this.cameraObject.position.copy(Ee.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ee.up)};var Ie=()=>{if(typeof this.cameraObject<"u"){var re=Q.width,Me=Q.height;if(0<re&&0<Me){var Ee=.25*(re+Me),Oe=0,Je=0;(j===R.FREE||j===R.HORIZONTAL)&&(Oe=this.pointer_x-this.previous_pointer_x),(j===R.FREE||j===R.VERTICAL)&&(Je=this.previous_pointer_y-this.pointer_y);var it=Math.sqrt(Oe*Oe+Je*Je);if(0<it){var ut=1*-Je/it,rt=1*Oe/it,Tt=0;j===R.FREE&&ut*(this.pointer_x-.5*(re-1))+rt*(.5*(Me-1)-this.pointer_y);var qt=Math.acos(Tt/Ee)-.5*Math.PI,q=this.tumble_rate*it/Ee;ee.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),ie.copy(this.cameraObject.up).normalize(),Y.copy(ie).cross(ee).normalize().multiplyScalar(ut),ie.multiplyScalar(rt),$.addVectors(Y,ie).multiplyScalar(Math.cos(qt)),ee.multiplyScalar(Math.sin(qt)),$.add(ee),this.rotateAboutLookAtpoint($,-q)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},Ye=()=>{var re=0;return this._state===A.ZOOM?re=this.previous_pointer_y-this.pointer_y:this._state===A.SCROLL?re=z:(re=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),re};this.changeZoomByScrollRateUnit=re=>{var Me=re*this.scrollRate;this.changeZoomByValue(Me)},this.changeZoomByValue=re=>{if(typeof this.cameraObject<"u"){Q.width;var Me=Q.height,Ee=this.cameraObject.position.clone();Ee.sub(this.cameraObject.target);var Oe=Ee.length(),Je=1.5*re/Me;if(.01<Oe+Je*Oe&&(Ee.normalize(),oe.copy(this.cameraObject.position),oe.x+=Ee.x*Je*Oe,oe.y+=Ee.y*Je*Oe,oe.z+=Ee.z*Je*Oe,be())){this.cameraObject.position.copy(oe),this.updateDirectionalLight();var it=1e-5;if(it*this.cameraObject.far<this.cameraObject.near+Je*Oe+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Je*Oe,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Je*Oe,this.cameraObject.far+=Je*Oe));else{if(this.near_plane_fly_debt==0){var ut=this.cameraObject.near-it*this.cameraObject.far;this.cameraObject.near=it*this.cameraObject.far,this.cameraObject.far-=ut,this.near_plane_fly_debt-=it*this.cameraObject.far}this.near_plane_fly_debt+=Je*Oe}}}};var $e=()=>{var re=Ye();this.changeZoomByValue(re),this._state===A.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===A.SCROLL&&(z=0,this._state=A.NONE)};this.setDirectionalLight=re=>{this.directionalLight=re},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){O=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",ue,!1),this.domElement.addEventListener("mousemove",me,!1),this.domElement.addEventListener("mouseup",se,!1),this.domElement.addEventListener("mouseleave",xe,!1),this.domElement.addEventListener("touchstart",he,!1),this.domElement.addEventListener("touchmove",ge,!1),this.domElement.addEventListener("touchend",_e,!1),this.domElement.addEventListener("wheel",Pe,!1),this.domElement.addEventListener("contextmenu",re=>{re.preventDefault()},!1),this.domElement.addEventListener("mouseenter",Ue,!1))},this.disable=function(){O=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",ue,!1),this.domElement.removeEventListener("mousemove",me,!1),this.domElement.removeEventListener("mouseup",se,!1),this.domElement.removeEventListener("mouseleave",xe,!1),this.domElement.removeEventListener("touchstart",he,!1),this.domElement.removeEventListener("touchmove",ge,!1),this.domElement.removeEventListener("touchend",_e,!1),this.domElement.removeEventListener("wheel",Pe,!1),this.domElement.removeEventListener("mouseenter",Ue,!1),this.domElement.removeEventListener("contextmenu",re=>{re.preventDefault()},!1))},this.loadPath=re=>{w=re.CameraPath,L=re.NumberOfPoints},this.loadPathURL=(re,Me)=>{var Ee=new XMLHttpRequest;Ee.onreadystatechange=()=>{if(Ee.readyState==4&&Ee.status==200){var Je=JSON.parse(Ee.responseText);this.loadPath(Je),Me!=null&&typeof Me=="function"&&Me()}};var Oe=f(re);Ee.open("GET",Oe,!0),Ee.send()},this.setPathDuration=re=>{I=re,K&&K.setDuration(I),te&&te.setDuration(I)},this.getPlayRate=()=>D,this.setPlayRate=re=>{D=re};var at=re=>{var Me=N+re;Me>I&&(Me-=I),N=Me};this.getTime=()=>N,this.setTime=re=>{N=re>I?I:0>re?0:re},this.getNumberOfTimeFrame=()=>L,this.getCurrentTimeFrame=()=>{if(2<L){var re=N/I*(L-1),Me=Math.floor(re),Ee=1-(re-Me),Oe=Math.ceil(re);return Me==Oe?Me==L-1?[Me-1,Oe,0]:[Me,Oe+1,1]:[Me,Oe,Ee]}return L==1?[0,0,0]:void 0},this.setCurrentTimeFrame=re=>{2<L&&(N=I*re/(L-1),0>N&&(N=0),N>I&&(N=I))};var et=re=>{if(H===C.PATH&&(at(re),w)){for(var Me=this.getCurrentTimeFrame(),Ee=Me[0],Oe=Me[1],Je=Me[2],it=[w[3*Ee],w[3*Ee+1],w[3*Ee+2]],ut=[w[3*Oe],w[3*Oe+1],w[3*Oe+2]],rt=[],Tt=0;Tt<it.length;Tt++)rt.push(Je*it[Tt]+(1-Je)*ut[Tt]);this.cameraObject.position.set(rt[0],rt[1],rt[2]),this.cameraObject.target.set(ut[0],ut[1],ut[2]),V&&this.cameraObject.lookAt(this.cameraObject.target),B&&(this.directionalLight.position.set(rt[0],rt[1],rt[2]),this.directionalLight.target.position.set(ut[0],ut[1],ut[2]))}};this.calculatePathNow=()=>{et(0)};var Gt=()=>{this._state===A.ROTATE||this._state===A.TOUCH_ROTATE?Ie():this._state===A.PAN||this._state===A.TOUCH_PAN?(ct(),ae.triggerCallback()):(this._state===A.ZOOM||this._state===A.TOUCH_ZOOM||this._state===A.SCROLL)&&(ae.zoom(Ye()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===A.SCROLL&&(this._state=A.NONE),z=0,ae.triggerCallback())};this.update=re=>{var Me=re*D,Ee=O,Oe=!0;return H===C.PATH?et(Me):H===C.SMOOTH_CAMERA_TRANSITION&&K?(K.update(Me),K.isTransitionCompleted()&&(H=C.DEFAULT),Ee=!1):H===C.ROTATE_CAMERA_TRANSITION&&te?(te.update(Me),te.isTransitionCompleted()&&(H=C.DEFAULT),Ee=!1):H===C.AUTO_TUMBLE&&W?W.update(Me):H===C.SYNC_CONTROL&&ae?(Gt(),Ee=!1):Oe=!1,Ee&&(this._state!==A.NONE&&(Oe=!0),this._state===A.ROTATE||this._state===A.TOUCH_ROTATE?Ie():this._state===A.PAN||this._state===A.TOUCH_PAN?ct():(this._state===A.ZOOM||this._state===A.TOUCH_ZOOM||this._state===A.SCROLL)&&$e(),this._state!==A.NONE&&H===C.AUTO_TUMBLE&&W&&W.stopOnCameraInput,this._state===A.SCROLL&&(this._state=A.NONE)),V?(Oe=!0,V.update()):this.cameraObject.lookAt(this.cameraObject.target),Oe},this.playPath=()=>{H=C.PATH},this.stopPath=()=>{H=C.DEFAULT},this.isPlayingPath=()=>H===C.PATH,this.enableDirectionalLightUpdateWithPath=re=>{B=re},this.enableDeviceOrientation=()=>{V||(V=new x(this.cameraObject))},this.disableDeviceOrientation=()=>{V&&(V.dispose(),V=void 0)},this.isDeviceOrientationEnabled=()=>!!V,this.resetView=()=>{var re=de[G];this.cameraObject.near=re.nearPlane,this.cameraObject.far=re.farPlane,this.cameraObject.position.set(re.eyePosition[0],re.eyePosition[1],re.eyePosition[2]),this.cameraObject.target.set(re.targetPosition[0],re.targetPosition[1],re.targetPosition[2]),this.cameraObject.up.set(re.upVector[0],re.upVector[1],re.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=re=>{re.nearPlane&&(this.cameraObject.near=re.nearPlane),re.farPlane&&(this.cameraObject.far=re.farPlane),re.eyePosition&&this.cameraObject.position.set(re.eyePosition[0],re.eyePosition[1],re.eyePosition[2]),re.targetPosition&&this.cameraObject.target.set(re.targetPosition[0],re.targetPosition[1],re.targetPosition[2]),re.upVector&&this.cameraObject.up.set(re.upVector[0],re.upVector[1],re.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.getViewportFromCentreAndRadius=(re,Me,Ee,Oe,Je,it)=>{var ut=this.cameraObject.position.x-this.cameraObject.target.x,rt=this.cameraObject.position.y-this.cameraObject.target.y,Tt=this.cameraObject.position.z-this.cameraObject.target.z,qt=1/Math.sqrt(ut*ut+rt*rt+Tt*Tt);ut*=qt,rt*=qt,Tt*=qt;var q=[re,Me,Ee],pe=Oe/Math.tan(Je*Math.PI/360),fe=[re+ut*pe,Me+rt*pe,Ee+Tt*pe],ve=pe+it,Te=0,ze=.95;Te=it>ze*pe?(1-ze)*pe:pe-it;var ce=new h;return ce.nearPlane=Te,ce.farPlane=ve,ce.eyePosition=fe,ce.targetPosition=q,ce.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],ce},this.getViewportFromBoundingBox=(re,Me)=>{var Ee=re.min.distanceTo(re.max)/2*Me,Oe=(re.min.x+re.max.x)/2,Je=(re.min.y+re.max.y)/2,it=(re.min.z+re.max.z)/2,ut=4,rt=this.getViewportFromCentreAndRadius(Oe,Je,it,Ee,40,Ee*ut);return rt},this.getCurrentViewport=()=>{var re=new h;return re.nearPlane=this.cameraObject.near,re.farPlane=this.cameraObject.far,re.eyePosition[0]=this.cameraObject.position.x,re.eyePosition[1]=this.cameraObject.position.y,re.eyePosition[2]=this.cameraObject.position.z,re.targetPosition[0]=this.cameraObject.target.x,re.targetPosition[1]=this.cameraObject.target.y,re.targetPosition[2]=this.cameraObject.target.z,re.upVector[0]=this.cameraObject.up.x,re.upVector[1]=this.cameraObject.up.y,re.upVector[2]=this.cameraObject.up.z,re},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(re,Me,Ee)=>{te==null&&(K=new y(re,Me,this,Ee))},this.rotateCameraTransition=(re,Me,Ee)=>{K==null&&(te=new p(re,Me,this,Ee))},this.enableCameraTransition=()=>{K&&(H=C.SMOOTH_CAMERA_TRANSITION),te&&(H=C.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{H=C.DEFAULT},this.stopCameraTransition=()=>{H=C.DEFAULT,K=void 0,te=void 0},this.isTransitioningCamera=()=>H===C.SMOOTH_CAMERA_TRANSITION||H===C.ROTATE_CAMERA_TRANSITION,this.autoTumble=(re,Me,Ee)=>{W=new b(re,Me,Ee,this)},this.enableAutoTumble=()=>{H=C.AUTO_TUMBLE},this.stopAutoTumble=()=>{H=C.DEFAULT,W=void 0},this.updateAutoTumble=()=>{W&&(W.requireUpdate=!0)},this.isAutoTumble=()=>H===C.AUTO_TUMBLE,this.enableRaycaster=(re,Me,Ee)=>{Z==null&&(Z=new d(re,this.scene,Me,Ee,this.renderer))},this.disableRaycaster=()=>{Z.disable(),Z=void 0},this.isSyncControl=()=>currentMpde===C.SYNC_CONTROL,this.enableSyncControl=()=>(H=C.SYNC_CONTROL,ae||(ae=new T),ae.setCurrentCameraSettings(this.cameraObject,de[G]),ae),this.disableSyncControl=()=>{H=C.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},y=function(_,M,S,C){var A=_.eyePosition,R=_.targetPosition,P=_.upVector,I=M.eyePosition,O=M.targetPosition,N=M.upVector,w=S,L=C,B=0,D=!1;w.near=Math.min(_.nearPlane,M.nearPlane),w.far=Math.max(_.farPlane,M.farPlane),w.cameraObject.up.set(M.upVector[0],M.upVector[1],M.upVector[2]),this.setDuration=H=>{L=H};var V=H=>{var K=B+H;K>L&&(K=L),B=K},G=()=>{var H=B/L,K=[A[0]*(1-H)+I[0]*H,A[1]*(1-H)+I[1]*H,A[2]*(1-H)+I[2]*H],te=[R[0]*(1-H)+O[0]*H,R[1]*(1-H)+O[1]*H,R[2]*(1-H)+O[2]*H];P[0]*(1-H)+N[0]*H,P[1]*(1-H)+N[1]*H,P[2]*(1-H)+N[2]*H,w.cameraObject.position.set(K[0],K[1],K[2]),w.cameraObject.target.set(te[0],te[1],te[2])};this.update=H=>{this.enabled===!1||(V(H),G(),B==L&&(D=!0))},this.isTransitionCompleted=()=>D},p=function(_,M,S,C){var A=_,R=M,P=S,I=C,O=0,N=!1;this.setDuration=L=>{I=L};var w=L=>{var B=O,D=O+L;D>I&&(D=I),O=D;var V=O-B,G=V/I,H=G*R;P.rotateAboutLookAtpoint(A,H)};this.update=L=>{this.enabled===!1||(w(L),O==I&&(N=!0))},this.isTransitionCompleted=()=>N},d=function(_,M,S,C,A){var R=_,P=M,I=A,O=S,N=C,w=new c.Raycaster;w.params.Line.threshold=.1,w.params.Points.threshold=1;var L=new c.Vector2,B=!1,D=new Date,V=!1,G=0,H=[],K={zincCamera:void 0,x:-1,y:-1},te=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=j=>{if(P!==R){var Z=R.getThreeJSScene();I.render(Z,j.cameraObject)}var Q=te||R.getPickableThreeJSObjects();return H.length=0,w.intersectObjects(Q,!0,H)},this.setPickableObjects=j=>{j===void 0?te=void 0:(te=[],j.forEach(Z=>{Z.getGroup()&&Z.getGroup().visible&&te.push(Z.getGroup())}))},this.getIntersectsObjectWithOrigin=(j,Z,Q)=>(w.set(Z,Q),this.getIntersectsObject(j)),this.getIntersectsObjectWithCamera=(j,Z,Q)=>(j.getNDCFromDocumentCoords(Z,Q,L),w.setFromCamera(L,j.cameraObject),this.getIntersectsObject(j)),this.pick=(j,Z,Q)=>{if(I&&R&&j&&O){this.getIntersectsObjectWithCamera(j,Z,Q);for(var ee,ie=H.length,Y=0;Y<ie;Y++)if(ee=H[Y].object?H[Y].object.userData:void 0,ee&&ee.isMarkerCluster&&ee.visible&&ee.clusterIsVisible(H[Y].object.clusterIndex))return void ee.zoomToCluster(H[Y].object.clusterIndex);O(H,Z,Q)}};var W=(j,Z,Q)=>{if(I&&R&&j&&N){if(this.getIntersectsObjectWithCamera(j,Z,Q),D.setTime(Date.now()),H.length===0){if(V)return;V=!0}else V=!1;N(H,Z,Q)}};this.move=(j,Z,Q)=>{I&&R&&j&&N&&(R.displayMarkers?W(j,Z,Q):(K.zincCamera=j,K.x=Z,K.y=Q,!B&&(G=D?Date.now()-D.getTime():250,250<=G?W(j,Z,Q):(B=!0,setTimeout(z(K),G)))))};var z=j=>function(){B=!1,W(j.zincCamera,j.x,j.y)}},b=function(_,M,S,C){var A=new c.Vector3,R=-M,P=C,I=_;this.stopOnCameraInput=S,this.requireUpdate=!0;var O=new c.Vector3,N=new c.Vector3,w=L=>{var B=Math.sqrt(L[0]*L[0]+L[1]*L[1]),D=4*Math.abs(L[0]),V=4*Math.abs(L[1]),G=.25*(D+V),H=-L[1]/B,K=L[0]/B,te=H*L[0]+K*-L[1];te>G?te=G:te<-G&&(te=-G);var W=Math.acos(te/G)-.5*Math.PI;A.copy(P.cameraObject.position).sub(P.cameraObject.target).normalize(),O.copy(P.cameraObject.up).normalize(),N.crossVectors(O,A).normalize().multiplyScalar(H),O.multiplyScalar(K),O.add(N).multiplyScalar(Math.cos(W)),A.multiplyScalar(Math.sin(W)).add(O)};this.update=L=>{this.enabled===!1||(this.requireUpdate&&(w(I),this.requireUpdate=!1),P.rotateAboutLookAtpoint(A,R*L/1e3))}},v=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(v.prototype,{update:(()=>{var E,_,M,S,C,A,R=new c.Matrix4,P=new c.Matrix4;return function(O){var N=E!==O.focus||_!==O.fov||M!==O.aspect*this.aspect||S!==O.near||C!==O.far||A!==O.zoom;if(N){E=O.focus,_=O.fov,M=O.aspect*this.aspect,S=O.near,C=O.far,A=O.zoom;var w,L,B=O.projectionMatrix.clone(),D=.064/2,V=D*S/E,G=S*Math.tan(.5*(c.Math.DEG2RAD*_))/O.zoom;P.elements[12]=-D,R.elements[12]=D,w=-G*M+V,L=G*M+V,B.elements[0]=2*S/(L-w),B.elements[8]=(L+w)/(L-w),this.cameraL.projectionMatrix.copy(B),w=-G*M-V,L=G*M-V,B.elements[0]=2*S/(L-w),B.elements[8]=(L+w)/(L-w),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(O.matrixWorld).multiply(P),this.cameraR.matrixWorld.copy(O.matrixWorld).multiply(R)}})()});var g=function(_){var M=new v;M.aspect=.5,this.setSize=(S,C)=>{_.setSize(S,C)},this.render=(S,C)=>{S.updateMatrixWorld(),C.parent===null&&C.updateMatrixWorld(),M.update(C);var A=_.getSize();_.setScissorTest(!0),_.clear(),_.setScissor(0,0,A.width/2,A.height),_.setViewport(0,0,A.width/2,A.height),_.render(S,M.cameraL),_.setScissor(A.width/2,0,A.width/2,A.height),_.setViewport(A.width/2,0,A.width/2,A.height),_.render(S,M.cameraR),_.setScissorTest(!1)}},x=function(_){var M=this;this.object=_,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var S=R=>{M.deviceOrientation=R},C=()=>{typeof window<"u"&&(M.screenOrientation=window.orientation||0)},A=(()=>{var R=new c.Vector3(0,0,1),P=new c.Euler,I=new c.Quaternion,O=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(N,w,L,B,D)=>{var V=new c.Vector3(0,0,1);V.subVectors(N.target,N.position),P.set(L,w,-B,"YXZ");var G=new c.Quaternion;G.setFromEuler(P),G.multiply(O),G.multiply(I.setFromAxisAngle(R,-D)),V.applyQuaternion(G),V.addVectors(N.position,V),N.lookAt(V)}})();this.connect=()=>{C(),typeof window<"u"&&(window.addEventListener("orientationchange",C,!1),window.addEventListener("deviceorientation",S,!1)),M.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",C,!1),window.removeEventListener("deviceorientation",S,!1)),M.enabled=!1},this.update=()=>{if(M.enabled!==!1){var R=M.deviceOrientation.alpha?c.Math.degToRad(M.deviceOrientation.alpha):0,P=M.deviceOrientation.beta?c.Math.degToRad(M.deviceOrientation.beta):0,I=M.deviceOrientation.gamma?c.Math.degToRad(M.deviceOrientation.gamma):0,O=M.screenOrientation?c.Math.degToRad(M.screenOrientation):0;A(M.object,R,P,I,O)}},this.dispose=function(){this.disconnect()},this.connect()},T=function(){var _=void 0,M=void 0,S=void 0,C=new c.Vector3,A=new c.Vector3,R=new c.Vector3,P=new c.Vector3,I=void 0;this.setCurrentCameraSettings=(O,N)=>{_=O.clone(),M=O,S=N,_.near=S.nearPlane,S.farPlane&&(_.far=S.farPlane),S.eyePosition&&_.position.set(S.eyePosition[0],S.eyePosition[1],S.eyePosition[2]),S.upVector&&_.up.set(S.upVector[0],S.upVector[1],S.upVector[2]),S.targetPosition&&(_.target=new c.Vector3(S.targetPosition[0],S.targetPosition[1],S.targetPosition[2]),_.lookAt(_.target)),_.updateProjectionMatrix(),C.copy(_.position).project(_),A.copy(_.target).project(_)},this.getCurrentPosition=()=>(A.copy(M.target).project(_),[A.x,A.y]),this.zoom=O=>{var N=.002*O,w=Math.max(M.zoom-N,1);M.zoom=w,M.updateProjectionMatrix()},this.zoomToBox=(O,N)=>{O.getCenter(R),R.project(_),this.setCenterZoom([R.x,R.y],N)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:M.zoom}),this.setCenterZoom=(O,N)=>{R.set(O[0],O[1],A.z).unproject(_),P.copy(R).sub(M.target),M.target.copy(R),M.lookAt(M.target),M.position.add(P),M.zoom=N,M.updateProjectionMatrix()},this.setEventCallback=O=>{(O===void 0||typeof O=="function")&&(I=O)},this.triggerCallback=()=>{I!==void 0&&typeof I=="function"&&I()}};l.Viewport=h,l.CameraControls=m,l.SmoothCameraTransition=y,l.RotateCameraTransition=p,l.RayCaster=d,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=T},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),h=u(22).Pointset;u(24).Lines;var m=u(45).Lines2,y=u(3).Geometry,p=u(4),d=0,b=function(){return"re"+d++},v=function(g,x){var T=g,E=new c;E.matrixAutoUpdate=!1,E.userData=this;var _=[],M="",S=[],C=x,A=new f,R=3e3;A.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{_.forEach(P=>P.hideAllPrimitives()),S.forEach(P=>P.setVisibility(!1))},this.showAllPrimitives=()=>{_.forEach(P=>P.showAllPrimitives()),S.forEach(P=>P.setVisibility(!0))},this.setVisibility=P=>{P!=E.visible&&(E.visible=P,this.pickableUpdateRequired=!0)},this.getVisibility=()=>E.visible,this.getGroup=()=>E,this.setTransformation=P=>{A.set(...P),E.matrix.copy(A),E.updateMatrixWorld()},this.setName=P=>{P&&P!==""&&(M=P)},this.getName=()=>M,this.getParent=()=>T,this.getFullSeparatedPath=()=>{var P=[];if(M!==""){P.push(M);for(var I,O=T;O!==void 0;)I=O.getName(),I!==""&&P.unshift(I),O=O.getParent()}return P},this.getFullPath=()=>{var P=this.getFullSeparatedPath();if(0<P.length){var I=P.shift();return P.forEach(O=>{I=I.concat("/",O)}),I}return""},this.createChild=P=>{var I=new v(this,C);return I.setName(P),_.push(I),E.add(I.getGroup()),I},this.getChildWithName=P=>{if(P){for(var I=P.toLowerCase(),O=0;O<_.length;O++)if(_[O].getName().toLowerCase()===I)return _[O]}},this.findChildFromSeparatedPath=P=>{if(P&&0<P.length&&P[0]===""&&P.shift(),P&&0<P.length){var I=this.getChildWithName(P[0]);return I?(P.shift(),I.findChildFromSeparatedPath(P)):void 0}return this},this.findChildFromPath=P=>{var I=P.split("/");return this.findChildFromSeparatedPath(I)},this.createChildFromSeparatedPath=P=>{if(0<P.length&&P[0]===""&&P.shift(),0<P.length){var I=this.getChildWithName(P[0]);return I||(I=this.createChild(P[0])),P.shift(),I.createChildFromSeparatedPath(P)}return this},this.createChildFromPath=P=>{var I=P.split("/");return this.createChildFromSeparatedPath(I)},this.findOrCreateChildFromPath=P=>{var I=this.findChildFromPath(P);return I||(I=this.createChildFromPath(P)),I},this.addZincObject=P=>{P&&(P.setRegion(this),E.add(P.getGroup()),S.push(P),this.pickableUpdateRequired=!0,C&&C.triggerObjectAddedCallback(P))},this.removeZincObject=P=>{for(var I=0;I<S.length;I++)if(P===S[I])return E.remove(P.getGroup()),S.splice(I,1),C&&C.triggerObjectRemovedCallback(P),P.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=P=>{if(this.pickableUpdateRequired)return!0;if(P){for(var I=!1,O=0;O<_.length;O++)if(I=_[O].checkPickableUpdateRequred(P),I)return!0}return!1},this.getPickableThreeJSObjects=(P,I)=>(E.visible&&(S.forEach(O=>{if(O.getGroup()&&O.getGroup().visible){var N=O.marker;N&&N.isEnabled()&&P.push(N.getMorph()),P.push(O.getGroup())}}),I&&_.forEach(O=>{O.getPickableThreeJSObjects(P,I)}),this.pickableUpdateRequired=!1),P),this.setDuration=P=>{R=P,S.forEach(I=>I.setDuration(P)),_.forEach(I=>I.setDuration(P))},this.getDuration=()=>R,this.getBoundingBox=P=>{var I,O;return S.forEach(N=>{O=N.getBoundingBox(),O&&(I==null?I=O.clone():I.union(O))}),P&&_.forEach(N=>{O=N.getBoundingBox(P),O&&(I==null?I=O.clone():I.union(O))}),I},this.clear=P=>{P&&_.forEach(I=>I.clear(P)),S.forEach(I=>{E.remove(I.getGroup()),I.dispose()}),_=[],S=[]},this.objectIsInRegion=(P,I)=>{for(var O=0;O<S.length;O++)if(P===S[O])return!0;if(I){for(var N=0;N<_.length;N++)if(_[N].objectIsInRegion(P,I))return!0}return!1},this.forEachGeometry=(P,I)=>{S.forEach(O=>{O.isGeometry&&P(O)}),I&&_.forEach(O=>O.forEachGeometry(P,I))},this.forEachGlyphset=(P,I)=>{S.forEach(O=>{O.isGlyphset&&P(O)}),I&&_.forEach(O=>O.forEachGlyphset(P,I))},this.forEachPointset=(P,I)=>{S.forEach(O=>{O.isPointset&&P(O)}),I&&_.forEach(O=>O.forEachPointset(P,I))},this.forEachLine=(P,I)=>{S.forEach(O=>{O.isLines&&P(O)}),I&&_.forEach(O=>O.forEachLine(P,I))},this.findObjectsWithAnatomicalId=(P,I)=>(S.forEach(O=>{O.anatomicalId===P&&objectsArray.push(O)}),I&&_.forEach(O=>{var N=O.findObjectsWithAnatomicalId(P,I);objectsArray.push(...N)}),objectsArray),this.findObjectsWithGroupName=(P,I)=>{var O=[];return S.forEach(N=>{var w=N.groupName?N.groupName.toLowerCase():N.groupName,L=P&&P.toLowerCase();w===L&&O.push(N)}),I&&_.forEach(N=>{var w=N.findObjectsWithGroupName(P,I);O.push(...w)}),O},this.findGeometriesWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isGeometry);return N},this.findPointsetsWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isPointset);return N},this.findGlyphsetsWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isGlyphset);return N},this.findLinesWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isLines);return N},this.getAllObjects=P=>{var I=[...S];return P&&_.forEach(O=>{var N=O.getAllObjects(P);I.push(...N)}),I},this.getChildRegions=P=>{var I=[..._];return P&&_.forEach(O=>{var N=O.getChildRegions(P);I.push(...N)}),I},this.getCurrentTime=()=>{if(S[0]!=null)return S[0].getCurrentTime();for(var P,I=0;I<_.length;I++)if(P=_[I].getCurrentTime(),P!==-1)return P;return-1},this.setMorphTime=(P,I)=>{S.forEach(O=>{O.setMorphTime(P)}),I&&_.forEach(O=>{O.setMorphTime(P)})},this.isTimeVarying=()=>{for(var P=0;P<S.length;P++)if(S[P].isTimeVarying())return!0;for(var I=0;I<_.length;I++)if(_[I].isTimeVarying())return!0;return!1},this.renderGeometries=(P,I,O,N,w,L)=>{var B,D=this.getAllObjects(L);D.forEach(V=>{V.render(P*I,O,N,w)}),w&&O===!1&&(B=w.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&w.markerCluster.calculate()},this.createPoints=(P,I,O,N)=>{var w=!1,L=this.findObjectsWithGroupName(P,!1),B=L.findIndex(V=>V.isPointset),D=-1<B?L[B]:new h;return D.addPoints(I,O,N),B===-1?(D.setName(P),this.addZincObject(D),w=!0):this.pickableUpdateRequired=!0,{zincObject:D,isNew:w}},this.createLines=(P,I,O)=>{var N=!1,w=this.findObjectsWithGroupName(P,!1),L=w.findIndex(D=>D.isLines),B=-1<L?w[L]:new m;return B.addLines(I,O),L===-1?(B.setName(P),this.addZincObject(B),N=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:N}},this.createGeometryFromThreeJSGeometry=(P,I,O,N,w,L)=>{var B=new y,D=new p.MeshPhongMaterial({color:O,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:N,side:p.DoubleSide});return B.createMesh(I,D,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(P),B.setRenderOrder(L),this.addZincObject(B),B):void 0}};l.Region=v},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(46).LineSegments2,f=u(48).LineMaterial,h=u(47).LineSegmentsGeometry,m=function(){u(24).Lines.call(this),this.isLines2=!0;var y=Array(300);this.createLineSegment=(p,d,b)=>{if(p&&d){var v=new h;v.setPositions(p),v.colorsNeedUpdate=!0;var g=new c(v,d);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addVertices=function(p){if(p&&p.length){var d=this.getMorph();d||(this.drawRange=0);var b=3*this.drawRange;if(p.forEach(v=>{y[b++]=v[0],y[b++]=v[1],y[b++]=v[2],this.drawRange++}),!d)for(;300>b;)y[b++]=p[0][0],y[b++]=p[0][1],y[b++]=p[0][2];d&&(d.geometry.setPositions(y),d.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return y},this.getVerticesByFaceIndex=function(p){var d=3*(2*p),b=this.getMorph();if(b&&3*this.drawRange>d){var v=b.geometry.getAttribute("instanceStart");return[[v.data.array[d],v.data.array[++d],v.data.array[++d]],[v.data.array[++d],v.data.array[++d],v.data.array[++d]]]}return[]},this.editVertices=function(p,d){if(p&&p.length){var b=this.getMorph(),v=d+p.length-1;if(!b||0>d||v>=this.drawRange)return;var g=3*d;for(p.forEach(x=>{y[g++]=x[0],y[g++]=x[1],y[g++]=x[2]}),g=3*this.drawRange;300>g;)y[g++]=p[0][0],y[g++]=p[0][1],y[g++]=p[0][2];b.geometry.setPositions(y),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return y},this.addLines=(p,d)=>{if(p&&0<p.length){this.addVertices(p);var b=this.getMorph();if(!b){var v=new f({color:d,linewidth:1,vertexColors:!1,worldUnits:!1});v.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(y,v,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var p=this.getMorph().material;p.resolution.set(window.innerWidth,window.innerHeight)}};m.prototype=Object.create(u(24).Lines.prototype),m.prototype.constructor=m,l.Lines2=m},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>S});var c=u(4),f=u(47),h=u(48),m=new c.Vector3,y=new c.Vector3,p=new c.Vector4,d=new c.Vector4,b=new c.Vector4,v=new c.Vector3,g=new c.Matrix4,x=new c.Line3,T=new c.Vector3,E=new c.Box3,_=new c.Sphere,M=new c.Vector4;class S extends c.Mesh{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,R=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new h.LineMaterial({color:16777215*Math.random()});super(A,R),this.type="LineSegments2"}computeLineDistances(){for(var A=this.geometry,R=A.attributes.instanceStart,P=A.attributes.instanceEnd,I=new Float32Array(2*R.count),O=0,N=0,w=R.count;O<w;O++,N+=2)m.fromBufferAttribute(R,O),y.fromBufferAttribute(P,O),I[N]=N==0?0:I[N-1],I[N+1]=I[N]+m.distanceTo(y);var L=new c.InstancedInterleavedBuffer(I,2,1);return A.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(L,1,0)),A.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(L,1,1)),this}raycast(A,R){A.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var P=A.params.Line2===void 0?0:A.params.Line2.threshold||0,I=A.ray,O=A.camera,N=O.projectionMatrix,w=this.matrixWorld,L=this.geometry,B=this.material,D=B.resolution,V=B.linewidth+P,G=L.attributes.instanceStart,H=L.attributes.instanceEnd,K=-O.near,te=2*Math.max(V/D.width,V/D.height);L.boundingSphere===null&&L.computeBoundingSphere(),_.copy(L.boundingSphere).applyMatrix4(w);var W=Math.max(O.near,_.distanceToPoint(I.origin));M.set(0,0,-W,1).applyMatrix4(O.projectionMatrix),M.multiplyScalar(1/M.w),M.applyMatrix4(O.projectionMatrixInverse);var z=.5*Math.abs(te/M.w);if(_.radius+=z,A.ray.intersectsSphere(_)!==!1){L.boundingBox===null&&L.computeBoundingBox(),E.copy(L.boundingBox).applyMatrix4(w);var j=Math.max(O.near,E.distanceToPoint(I.origin));M.set(0,0,-j,1).applyMatrix4(O.projectionMatrix),M.multiplyScalar(1/M.w),M.applyMatrix4(O.projectionMatrixInverse);var Z=.5*Math.abs(te/M.w);if(E.max.x+=Z,E.max.y+=Z,E.max.z+=Z,E.min.x-=Z,E.min.y-=Z,E.min.z-=Z,A.ray.intersectsBox(E)!==!1){I.at(1,b),b.w=1,b.applyMatrix4(O.matrixWorldInverse),b.applyMatrix4(N),b.multiplyScalar(1/b.w),b.x*=D.x/2,b.y*=D.y/2,b.z=0,v.copy(b),g.multiplyMatrices(O.matrixWorldInverse,w);for(var Q=0,ee=G.count;Q<ee;Q++){p.fromBufferAttribute(G,Q),d.fromBufferAttribute(H,Q),p.w=1,d.w=1,p.applyMatrix4(g),d.applyMatrix4(g);var ie=p.z>K&&d.z>K;if(!ie){if(p.z>K){var Y=p.z-d.z,ne=(p.z-K)/Y;p.lerp(d,ne)}else if(d.z>K){var F=d.z-p.z,$=(d.z-K)/F;d.lerp(p,$)}p.applyMatrix4(N),d.applyMatrix4(N),p.multiplyScalar(1/p.w),d.multiplyScalar(1/d.w),p.x*=D.x/2,p.y*=D.y/2,d.x*=D.x/2,d.y*=D.y/2,x.start.copy(p),x.start.z=0,x.end.copy(d),x.end.z=0;var J=x.closestPointToPointParameter(v,!0);x.at(J,T);var k=c.MathUtils.lerp(p.z,d.z,J),U=-1<=k&&1>=k,oe=v.distanceTo(T)<.5*V;if(U&&oe){x.start.fromBufferAttribute(G,Q),x.end.fromBufferAttribute(H,Q),x.start.applyMatrix4(w),x.end.applyMatrix4(w);var ae=new c.Vector3,le=new c.Vector3;I.distanceSqToSegment(x.start,x.end,le,ae),R.push({point:le,pointOnLine:ae,distance:I.origin.distanceTo(le),object:this,face:null,faceIndex:Q,uv:null,uv2:null})}}}}}}}S.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>m});var c=u(4),f=new c.Box3,h=new c.Vector3;class m extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(p){var d=this.attributes.instanceStart,b=this.attributes.instanceEnd;return d!==void 0&&(d.applyMatrix4(p),b.applyMatrix4(p),d.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(p){var d;p instanceof Float32Array?d=p:Array.isArray(p)&&(d=new Float32Array(p));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(p){var d;p instanceof Float32Array?d=p:Array.isArray(p)&&(d=new Float32Array(p));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(p){return this.setPositions(p.attributes.position.array),this}fromEdgesGeometry(p){return this.setPositions(p.attributes.position.array),this}fromMesh(p){return this.fromWireframeGeometry(new c.WireframeGeometry(p.geometry)),this}fromLineSegments(p){var d=p.geometry;return d.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(d.isBufferGeometry&&this.setPositions(d.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var p=this.attributes.instanceStart,d=this.attributes.instanceEnd;p!==void 0&&d!==void 0&&(this.boundingBox.setFromBufferAttribute(p),f.setFromBufferAttribute(d),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var p=this.attributes.instanceStart,d=this.attributes.instanceEnd;if(p!==void 0&&d!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var v=0,g=0,x=p.count;g<x;g++)h.fromBufferAttribute(p,g),v=Math.max(v,b.distanceToSquared(h)),h.fromBufferAttribute(d,g),v=Math.max(v,b.distanceToSquared(h));this.boundingSphere.radius=Math.sqrt(v),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(p){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(p)}}m.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3231
+ `),C="",A="",R=0,P=[],I=typeof"".trimLeft=="function",O=0,N=S.length;O<N;O++)if(C=S[O],C=I?C.trimLeft():C.trim(),R=C.length,R!==0&&(A=C.charAt(0),A!=="#"))if(A==="v"){var w=C.split(/\s+/);switch(w[0]){case"v":M.vertices.push(parseFloat(w[1]),parseFloat(w[2]),parseFloat(w[3])),7<=w.length?M.colors.push(parseFloat(w[4]),parseFloat(w[5]),parseFloat(w[6])):M.colors.push(void 0,void 0,void 0);break;case"vn":M.normals.push(parseFloat(w[1]),parseFloat(w[2]),parseFloat(w[3]));break;case"vt":M.uvs.push(parseFloat(w[1]),parseFloat(w[2]))}}else if(A==="f"){for(var L,B=C.substr(1).trim(),D=B.split(/\s+/),V=[],G=0,H=D.length;G<H;G++)if(L=D[G],0<L.length){var K=L.split("/");V.push(K)}for(var te=V[0],W=1,z=V.length-1;W<z;W++){var j=V[W],Z=V[W+1];M.addFace(te[0],j[0],Z[0],te[1],j[1],Z[1],te[2],j[2],Z[2])}}else if(A==="l"){var Q=C.substring(1).trim().split(" "),ee=[],ie=[];if(C.indexOf("/")===-1)ee=Q;else for(var Y,ne=0,F=Q.length;ne<F;ne++)Y=Q[ne].split("/"),Y[0]!==""&&ee.push(Y[0]),Y[1]!==""&&ie.push(Y[1]);M.addLineGeometry(ee,ie)}else if(A==="p"){var $=C.substr(1).trim(),J=$.split(" ");M.addPointGeometry(J)}else if((P=f.exec(C))!==null){var k=(" "+P[0].substr(1).trim()).substr(1);M.startObject(k)}else if(m.test(C))M.object.startMaterial(C.substring(7).trim(),M.materialLibraries);else if(h.test(C))M.materialLibraries.push(C.substring(7).trim());else if(y.test(C))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(A==="s"){if(P=C.split(" "),1<P.length){var U=P[1].trim().toLowerCase();M.object.smooth=U!=="0"&&U!=="off"}else M.object.smooth=!0;var oe=M.object.currentMaterial();oe&&(oe.smooth=M.object.smooth)}else{if(C==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+C+'"')}M.finalize();var ae=new c.Group;ae.materialLibraries=[].concat(M.materialLibraries);var le=M.objects.length!==1||M.objects[0].geometry.vertices.length!==0;if(le==!0)for(var de=0,be=M.objects.length;de<be;de++){var we=M.objects[de],ue=we.geometry,me=we.materials,se=ue.type==="Line",xe=ue.type==="Points",he=!1;if(ue.vertices.length!==0){var ge=new c.BufferGeometry;ge.setAttribute("position",new c.Float32BufferAttribute(ue.vertices,3)),0<ue.normals.length&&ge.setAttribute("normal",new c.Float32BufferAttribute(ue.normals,3)),0<ue.colors.length&&(he=!0,ge.setAttribute("color",new c.Float32BufferAttribute(ue.colors,3))),ue.hasUVIndices===!0&&ge.setAttribute("uv",new c.Float32BufferAttribute(ue.uvs,2));for(var _e=[],Ue=0,qe=me.length;Ue<qe;Ue++){var Pe=me[Ue],ct=Pe.name+"_"+Pe.smooth+"_"+he,Ie=M.materials[ct];if(this.materials!==null){if(Ie=this.materials.create(Pe.name),se&&Ie&&!(Ie instanceof c.LineBasicMaterial)){var Ye=new c.LineBasicMaterial;c.Material.prototype.copy.call(Ye,Ie),Ye.color.copy(Ie.color),Ie=Ye}else if(xe&&Ie&&!(Ie instanceof c.PointsMaterial)){var $e=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call($e,Ie),$e.color.copy(Ie.color),$e.map=Ie.map,Ie=$e}}Ie===void 0&&(Ie=se?new c.LineBasicMaterial:xe?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Ie.name=Pe.name,Ie.flatShading=!Pe.smooth,Ie.vertexColors=he,M.materials[ct]=Ie),_e.push(Ie)}var at=void 0;if(1<_e.length){for(var et,Gt=0,re=me.length;Gt<re;Gt++)et=me[Gt],ge.addGroup(et.groupStart,et.groupCount,Gt);at=se?new c.LineSegments(ge,_e):xe?new c.Points(ge,_e):new c.Mesh(ge,_e)}else at=se?new c.LineSegments(ge,_e[0]):xe?new c.Points(ge,_e[0]):new c.Mesh(ge,_e[0]);at.name=we.name,ae.add(at)}}else if(0<M.vertices.length){var Me=new c.PointsMaterial({size:1,sizeAttenuation:!1}),Ee=new c.BufferGeometry;Ee.setAttribute("position",new c.Float32BufferAttribute(M.vertices,3)),0<M.colors.length&&M.colors[0]!==void 0&&(Ee.setAttribute("color",new c.Float32BufferAttribute(M.colors,3)),Me.vertexColors=!0);var Oe=new c.Points(Ee,Me);ae.add(Oe)}return ae}}},(o,l,u)=>{function c(T,E){var _=Object.keys(T);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);E&&(M=M.filter(function(S){return Object.getOwnPropertyDescriptor(T,S).enumerable})),_.push.apply(_,M)}return _}function f(T){for(var E,_=1;_<arguments.length;_++)E=arguments[_]==null?{}:arguments[_],_%2?c(Object(E),!0).forEach(function(M){h(T,M,E[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(M){Object.defineProperty(T,M,Object.getOwnPropertyDescriptor(E,M))});return T}function h(T,E,_){return E=m(E),E in T?Object.defineProperty(T,E,{value:_,enumerable:!0,configurable:!0,writable:!0}):T[E]=_,T}function m(T){var E=y(T,"string");return typeof E=="symbol"?E:E+""}function y(T,E){if(typeof T!="object"||!T)return T;var _=T[Symbol.toPrimitive];if(_!==void 0){var M=_.call(T,E);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}var p=u(19).JSONLoader,d=u(4),b=d.FileLoader,v=T=>{var E=(M,S)=>{M.merge(S)};if(T&&0<T.length){for(;1<T.length;){var _=T.splice(1,1);E(T[0],_[0])}return T[0]}},g=function(E,_,M){var S=new b,C=new p;S.crossOrigin=_;var A=E,R=M,P=void 0,I=!1,O=!1,N=void 0,w=[],L=G=>{var H=P[G.index];if(H){var K=C.parse(H);G.onLoad(K.geometry,K.materials)}else B(G)},B=G=>{G.onError&&(!N&&(N={responseURL:A}),G.onError(N))};this.downloadCompleted=G=>{try{P=JSON.parse(G[0]),I=!1,O=!0,Array.isArray(P)?w.forEach(H=>L(H)):w.forEach(H=>B(H))}catch{w.forEach(K=>B(K))}};var D=()=>G=>{N=G,O=!0,I=!1,w.forEach(H=>{B(H)})},V=()=>G=>{w.forEach(H=>{H.onProgress&&H.onProgress(G)})};this.load=(G,H,K,te)=>{var W={index:G,onLoad:H,onProgress:K,onError:te};O?P?L(W):B(N):I?w.push(W):(w.push(W),I=!0,S.load(A,R,V,D))}},x=function(E,_){var M=[],S=E,C=_,A=0;this.itemDownloaded=(R,P)=>{if(M[R]=P,A++,A==S){for(var I=M[0][1],O=M.map(L=>L[0]),N=v(O),w=1;w<S;w++)M[R][0].dispose(),M[R][1].forEach(L=>L.dispose());C(N,I)}}};l.PrimitivesLoader=function(){var T=0,E=20;this.crossOrigin="Anonymous";var _=new p,M=[],S={},C=(I,O,N,w,L)=>{var B=I.length,D=new x(B,O),V=0;I.forEach(G=>{var H=L?f({},L):{};H.msHandler=D,H.order=V,V++,R(G,O,N,w,H)})},A=(I,O,N,w,L)=>{var B=L?f({},L):{},D=S[I];if(!D){var V=new P(void 0,this,B);++T,D=new g(I,this.crossOrigin,V),S[I]=D}B.isHandler=D,D.load(L.index,O,N,w)},R=(I,O,N,w,L)=>{if(!(E>T))M.push({url:I,onLoad:O,onProgress:N,onError:w,options:L});else if(L&&L.index!==void 0)A(I,O,N,w,L);else{++T;var B=new P(O,this,L),D=new P(w,this,L);_.crossOrigin=this.crossOrigin,_.load(I,B,N,D)}};this.load=(I,O,N,w,L)=>{Array.isArray(I)?C(I,O,N,w,L):R(I,O,N,w,L)},this.loadFromWaitingList=()=>{var I=M.shift();if(I)this.load(I.url,I.onLoad,I.onProgress,I.onError,I.options);else for(var O in S)S.hasOwnProperty(O)&&delete S[O]};var P=function(O,N,w){return function(){--T;for(var L=arguments.length,B=Array(L),D=0;D<L;D++)B[D]=arguments[D];w!=null&&w.msHandler?w.msHandler.itemDownloaded(w.order,B):w!=null&&w.isHandler?w.isHandler.downloadCompleted(B):O&&O(...B),N.loadFromWaitingList()}};this.parse=I=>_.parse(I)}},(o,l,u)=>{u(4);var c=u(40).GLTFLoader,f=function(){var h=this;this.parseGLTFObjects=(m,y,p,d)=>{var b=y;if(p!==0){if(m.type!=="Object3D"){var v;if(m.type==="Mesh"?v=new(u(3)).Geometry:m.type==="LineSegments"?v=new(u(24)).Lines:m.type==="Points"&&(v=new(u(22)).Pointset),v){var g=!1,x=!1;m.geometry&&m.geometry.morphAttributes&&(g=!!m.geometry.morphAttributes.position,x=!!m.geometry.morphAttributes.color),v.setMesh(m.clone(),g,x);var T=v.getMorph();v.groupName=T.name,T.matrixAutoUpdate=!0,y.addZincObject(v),d!=null&&typeof d=="function"&&d(v)}}else if(m.name!==""&&(y&&(b=y.findOrCreateChildFromPath(m.name)),b)){var E=b.getGroup();E.position.copy(m.position),E.rotation.copy(m.rotation),E.quaternion.copy(m.quaternion),E.matrixAutoUpdate=!0}}p++,m.children.forEach(_=>{h.parseGLTFObjects(_,b,p,d)})},this.setCamera=m=>{m.viewAll();var y=m.getZincCameraControls(),p=y.getCurrentViewport();y.addViewport("default",p),y.setDefaultViewport("default")},this.load=(m,y,p,d,b)=>{var v=p.substring(0,p.lastIndexOf("/")+1),g=p.substring(p.lastIndexOf("/")+1,p.length),x=new c().setPath(v);x.load(g,function(T){console.log(T),h.parseGLTFObjects(T.scene,y,0,d),h.setCamera(m),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=oF},(o,l,u)=>{var c=u(42).GLTFExporter,f=function(h){var m=h;this.exportGLTF=y=>{var p=m.getRootRegion(),d=p.getAllObjects(!0),b=[];d.forEach(x=>{x.animationClip&&b.push({clip:x.animationClip[0],mesh:x.getMorph()})});var v=new c,g={binary:y,animations:b};return new Promise(x=>{v.parse(m.getThreeJSScene(),function(T){x(T)},g)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(w){return new P(w)}),this.register(function(w){return new I(w)}),this.register(function(w){return new O(w)})}register(w){return this.pluginCallbacks.indexOf(w)===-1&&this.pluginCallbacks.push(w),this}unregister(w){return this.pluginCallbacks.indexOf(w)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(w),1),this}parse(w,L,B){for(var D=new R,V=[],G=0,H=this.pluginCallbacks.length;G<H;G++)V.push(this.pluginCallbacks[G](D));D.setPlugins(V),D.write(w,L,B)}}var h={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},m={};m[c.NearestFilter]=h.NEAREST,m[c.NearestMipmapNearestFilter]=h.NEAREST_MIPMAP_NEAREST,m[c.NearestMipmapLinearFilter]=h.NEAREST_MIPMAP_LINEAR,m[c.LinearFilter]=h.LINEAR,m[c.LinearMipmapNearestFilter]=h.LINEAR_MIPMAP_NEAREST,m[c.LinearMipmapLinearFilter]=h.LINEAR_MIPMAP_LINEAR,m[c.ClampToEdgeWrapping]=h.CLAMP_TO_EDGE,m[c.RepeatWrapping]=h.REPEAT,m[c.MirroredRepeatWrapping]=h.MIRRORED_REPEAT;var y={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},p=12,d=1179937895,b=2,v=8,g=1313821514,x=5130562;function T(N,w){return N.length===w.length&&N.every(function(L,B){return L===w[B]})}function E(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var w,L=new Uint8Array(new ArrayBuffer(N.length)),B=0,D=N.length;B<D;B++)w=N.charCodeAt(B),L[B]=255<w?32:w;return L.buffer}function _(N){return T(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function M(N,w,L){for(var B={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},D=w;D<w+L;D++)for(var V,G=0;G<N.itemSize;G++)V=void 0,4<N.itemSize?V=N.array[D*N.itemSize+G]:G===0?V=N.getX(D):G===1?V=N.getY(D):G===2?V=N.getZ(D):G==3&&(V=N.getW(D)),B.min[G]=Math.min(B.min[G],V),B.max[G]=Math.max(B.max[G],V);return B}function S(N){return 4*Math.ceil(N/4)}function C(N){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,L=S(N.byteLength);if(L!==N.byteLength){var B=new Uint8Array(L);if(B.set(new Uint8Array(N)),w!==0)for(var D=N.byteLength;D<L;D++)B[D]=w;return B.buffer}return N}var A=null;class R{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(w){this.plugins=w}write(w,L,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(w);var D=this;Promise.all(this.pending).then(function(){var V=D.buffers,G=D.json,H=D.options,K=D.extensionsUsed,te=new Blob(V,{type:"application/octet-stream"}),W=Object.keys(K);if(0<W.length&&(G.extensionsUsed=W),G.buffers&&0<G.buffers.length&&(G.buffers[0].byteLength=te.size),H.binary===!0){var z=new window.FileReader;z.readAsArrayBuffer(te),z.onloadend=function(){var Z=C(z.result),Q=new DataView(new ArrayBuffer(v));Q.setUint32(0,Z.byteLength,!0),Q.setUint32(4,x,!0);var ee=C(E(JSON.stringify(G)),32),ie=new DataView(new ArrayBuffer(v));ie.setUint32(0,ee.byteLength,!0),ie.setUint32(4,g,!0);var Y=new ArrayBuffer(p),ne=new DataView(Y);ne.setUint32(0,d,!0),ne.setUint32(4,b,!0);var F=p+ie.byteLength+ee.byteLength+Q.byteLength+Z.byteLength;ne.setUint32(8,F,!0);var $=new Blob([Y,ie,ee,Q,Z],{type:"application/octet-stream"}),J=new window.FileReader;J.readAsArrayBuffer($),J.onloadend=function(){L(J.result)}}}else if(G.buffers&&0<G.buffers.length){var j=new window.FileReader;j.readAsDataURL(te),j.onloadend=function(){var Z=j.result;G.buffers[0].uri=Z,L(G)}}else L(G)})}serializeUserData(w,L){if(!(w.userData&&w.userData.isZincObject)&&Object.keys(w.userData).length!==0){var B=this.options,D=this.extensionsUsed;try{var V=JSON.parse(JSON.stringify(w.userData));if(B.includeCustomExtensions&&V.gltfExtensions){for(var G in L.extensions===void 0&&(L.extensions={}),V.gltfExtensions)L.extensions[G]=V.gltfExtensions[G],D[G]=!0;delete V.gltfExtensions}0<Object.keys(V).length&&(L.extras=V)}catch(H){console.warn("THREE.GLTFExporter: userData of '"+w.name+"' won't be serialized because of JSON.stringify error - "+H.message)}}}getUID(w){return this.uids.has(w)||this.uids.set(w,this.uid++),this.uids.get(w)}isNormalizedNormalAttribute(w){var L=this.cache;if(L.attributesNormalized.has(w))return!1;for(var B=new c.Vector3,D=0,V=w.count;D<V;D++)if(5e-4<Math.abs(B.fromBufferAttribute(w,D).length()-1))return!1;return!0}createNormalizedNormalAttribute(w){var L=this.cache;if(L.attributesNormalized.has(w))return L.attributesNormalized.get(w);for(var B=w.clone(),D=new c.Vector3,V=0,G=B.count;V<G;V++)D.fromBufferAttribute(B,V),D.x===0&&D.y===0&&D.z===0?D.setX(1):D.normalize(),B.setXYZ(V,D.x,D.y,D.z);return L.attributesNormalized.set(w,B),B}applyTextureTransform(w,L){var B=!1,D={};(L.offset.x!==0||L.offset.y!==0)&&(D.offset=L.offset.toArray(),B=!0),L.rotation!==0&&(D.rotation=L.rotation,B=!0),(L.repeat.x!==1||L.repeat.y!==1)&&(D.scale=L.repeat.toArray(),B=!0),B&&(w.extensions=w.extensions||{},w.extensions.KHR_texture_transform=D,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(w){var L=this.json,B=this.buffers;return L.buffers||(L.buffers=[{byteLength:0}]),B.push(w),0}processBufferView(w,L,B,D,V){var G=this.json;G.bufferViews||(G.bufferViews=[]);for(var H=L===h.UNSIGNED_BYTE?1:L===h.UNSIGNED_SHORT?2:4,K=S(D*w.itemSize*H),te=new DataView(new ArrayBuffer(K)),W=0,z=B;z<B+D;z++)for(var j,Z=0;Z<w.itemSize;Z++)j=void 0,4<w.itemSize?j=w.array[z*w.itemSize+Z]:Z===0?j=w.getX(z):Z===1?j=w.getY(z):Z===2?j=w.getZ(z):Z==3&&(j=w.getW(z)),L===h.FLOAT?te.setFloat32(W,j,!0):L===h.UNSIGNED_INT?te.setUint32(W,j,!0):L===h.UNSIGNED_SHORT?te.setUint16(W,j,!0):L===h.UNSIGNED_BYTE&&te.setUint8(W,j),W+=H;var Q={buffer:this.processBuffer(te.buffer),byteOffset:this.byteOffset,byteLength:K};V!==void 0&&(Q.target=V),V===h.ARRAY_BUFFER&&(Q.byteStride=w.itemSize*H),this.byteOffset+=K,G.bufferViews.push(Q);var ee={id:G.bufferViews.length-1,byteLength:0};return ee}processBufferViewImage(w){var L=this,B=L.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(D){var V=new window.FileReader;V.readAsArrayBuffer(w),V.onloadend=function(){var G=C(V.result),H={buffer:L.processBuffer(G),byteOffset:L.byteOffset,byteLength:G.byteLength};L.byteOffset+=G.byteLength,D(B.bufferViews.push(H)-1)}})}processAccessor(w,L,B,D){var V,G=this.options,H=this.json;if(w.array.constructor===Float32Array)V=h.FLOAT;else if(w.array.constructor===Uint32Array)V=h.UNSIGNED_INT;else if(w.array.constructor===Uint16Array)V=h.UNSIGNED_SHORT;else if(w.array.constructor===Uint8Array)V=h.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),D===void 0&&(D=w.count),G.truncateDrawRange&&L!==void 0&&L.index===null){var K=B+D,te=L.drawRange.count===1/0?w.count:L.drawRange.start+L.drawRange.count;B=Math.max(B,L.drawRange.start),D=Math.min(K,te)-B,0>D&&(D=0)}if(D===0)return null;var W,z=M(w,B,D);L!==void 0&&(W=w===L.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);var j=this.processBufferView(w,V,B,D,W),Z={bufferView:j.id,byteOffset:j.byteOffset,componentType:V,count:D,max:z.max,min:z.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[w.itemSize]};return w.normalized===!0&&(Z.normalized=!0),H.accessors||(H.accessors=[]),H.accessors.push(Z)-1}processImage(w,L,B){var D=this,V=D.cache,G=D.json,H=D.options,K=D.pending;V.images.has(w)||V.images.set(w,{});var te=V.images.get(w),W=L===c.RGBAFormat?"image/png":"image/jpeg",z=W+":flipY/"+B.toString();if(te[z]!==void 0)return te[z];G.images||(G.images=[]);var j={mimeType:W};if(H.embedImages){var Z=A=A||document.createElement("canvas");Z.width=Math.min(w.width,H.maxTextureSize),Z.height=Math.min(w.height,H.maxTextureSize);var Q=Z.getContext("2d");if(B===!0&&(Q.translate(0,Z.height),Q.scale(1,-1)),typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&w instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&w instanceof ImageBitmap)Q.drawImage(w,0,0,Z.width,Z.height);else{L!==c.RGBAFormat&&L!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(w.width>H.maxTextureSize||w.height>H.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",w);var ee=new Uint8ClampedArray(4*(w.height*w.width));if(L===c.RGBAFormat)for(var ie=0;ie<ee.length;ie+=4)ee[ie+0]=w.data[ie+0],ee[ie+1]=w.data[ie+1],ee[ie+2]=w.data[ie+2],ee[ie+3]=w.data[ie+3];else for(var Y=0,ne=0;Y<ee.length;Y+=4,ne+=3)ee[Y+0]=w.data[ne+0],ee[Y+1]=w.data[ne+1],ee[Y+2]=w.data[ne+2],ee[Y+3]=255;Q.putImageData(new ImageData(ee,w.width,w.height),0,0)}H.binary===!0?K.push(new Promise(function($){Z.toBlob(function(J){D.processBufferViewImage(J).then(function(k){j.bufferView=k,$()})},W)})):j.uri=Z.toDataURL(W)}else j.uri=w.src;var F=G.images.push(j)-1;return te[z]=F,F}processSampler(w){var L=this.json;L.samplers||(L.samplers=[]);var B={magFilter:m[w.magFilter],minFilter:m[w.minFilter],wrapS:m[w.wrapS],wrapT:m[w.wrapT]};return L.samplers.push(B)-1}processTexture(w){var L=this.cache,B=this.json;if(L.textures.has(w))return L.textures.get(w);B.textures||(B.textures=[]);var D={sampler:this.processSampler(w),source:this.processImage(w.image,w.format,w.flipY)};w.name&&(D.name=w.name),this._invokeAll(function(G){G.writeTexture&&G.writeTexture(w,D)});var V=B.textures.push(D)-1;return L.textures.set(w,V),V}processMaterial(w){var L=this.cache,B=this.json;if(L.materials.has(w))return L.materials.get(w);if(w.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var D={pbrMetallicRoughness:{}};w.isMeshStandardMaterial!==!0&&w.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var V=w.color.toArray().concat([w.opacity]);if(T(V,[1,1,1,1])||(D.pbrMetallicRoughness.baseColorFactor=V),w.isMeshStandardMaterial?(D.pbrMetallicRoughness.metallicFactor=w.metalness,D.pbrMetallicRoughness.roughnessFactor=w.roughness):(D.pbrMetallicRoughness.metallicFactor=.5,D.pbrMetallicRoughness.roughnessFactor=.5),w.metalnessMap||w.roughnessMap)if(w.metalnessMap===w.roughnessMap){var G={index:this.processTexture(w.metalnessMap)};this.applyTextureTransform(G,w.metalnessMap),D.pbrMetallicRoughness.metallicRoughnessTexture=G}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(w.map){var H={index:this.processTexture(w.map)};this.applyTextureTransform(H,w.map),D.pbrMetallicRoughness.baseColorTexture=H}if(w.emissive){var K=w.emissive.clone().multiplyScalar(w.emissiveIntensity),te=Math.max(K.r,K.g,K.b);if(1<te&&(K.multiplyScalar(1/te),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<te&&(D.emissiveFactor=K.toArray()),w.emissiveMap){var W={index:this.processTexture(w.emissiveMap)};this.applyTextureTransform(W,w.emissiveMap),D.emissiveTexture=W}}if(w.normalMap){var z={index:this.processTexture(w.normalMap)};w.normalScale&&w.normalScale.x!==-1&&(w.normalScale.x!==w.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),z.scale=w.normalScale.x),this.applyTextureTransform(z,w.normalMap),D.normalTexture=z}if(w.aoMap){var j={index:this.processTexture(w.aoMap),texCoord:1};w.aoMapIntensity!==1&&(j.strength=w.aoMapIntensity),this.applyTextureTransform(j,w.aoMap),D.occlusionTexture=j}w.transparent?D.alphaMode="BLEND":0<w.alphaTest&&(D.alphaMode="MASK",D.alphaCutoff=w.alphaTest),w.side===c.DoubleSide&&(D.doubleSided=!0),w.name!==""&&(D.name=w.name),this.serializeUserData(w,D),this._invokeAll(function(Q){Q.writeMaterial&&Q.writeMaterial(w,D)});var Z=B.materials.push(D)-1;return L.materials.set(w,Z),Z}processMesh(w){var L=this.cache,B=this.json,D=[w.geometry.uuid];if(Array.isArray(w.material))for(var V=0,G=w.material.length;V<G;V++)D.push(w.material[V].uuid);else D.push(w.material.uuid);var H=D.join(":");if(L.meshes.has(H))return L.meshes.get(H);var K,te=w.geometry;if(K=w.isLineSegments?h.LINES:w.isLineLoop?h.LINE_LOOP:w.isLine?h.LINE_STRIP:w.isPoints?h.POINTS:w.material.wireframe?h.LINES:h.TRIANGLES,te.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var W={},z={},j=[],Z=[],Q={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},ee=te.getAttribute("normal");ee===void 0||this.isNormalizedNormalAttribute(ee)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),te.setAttribute("normal",this.createNormalizedNormalAttribute(ee)));var ie=null;for(var Y in te.attributes)if(Y.substr(0,5)!=="morph"){var ne=te.attributes[Y];Y=Q[Y]||Y.toUpperCase();var F=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(F.test(Y)||(Y="_"+Y),L.attributes.has(this.getUID(ne))){z[Y]=L.attributes.get(this.getUID(ne));continue}ie=null;var $=ne.array;Y!=="JOINTS_0"||$ instanceof Uint16Array||$ instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),ie=new c.BufferAttribute(new Uint16Array($),ne.itemSize,ne.normalized));var J=this.processAccessor(ie||ne,te);J!==null&&(z[Y]=J,L.attributes.set(this.getUID(ne),J))}if(ee!==void 0&&te.setAttribute("normal",ee),Object.keys(z).length===0)return null;if(w.morphTargetInfluences!==void 0&&0<w.morphTargetInfluences.length){var k=[],U=[],oe={};if(w.morphTargetDictionary!==void 0)for(var ae in w.morphTargetDictionary)oe[w.morphTargetDictionary[ae]]=ae;for(var le=0;le<w.morphTargetInfluences.length;++le){var de={},be=!1;for(var we in te.morphAttributes){if(we!="position"&&we!=="normal"&&we!=="color"){be||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),be=!0);continue}var ue=te.morphAttributes[we][le],me=we.toUpperCase();Q[we]&&(me=Q[we]);var se=te.attributes[we];if(L.attributes.has(this.getUID(ue))){de[me]=L.attributes.get(this.getUID(ue));continue}var xe=se.clone();if(!te.morphTargetsRelative)if(se)for(var he=0,ge=ue.count;he<ge;he++)se.count>he&&xe.setXYZ(he,ue.getX(he)-se.getX(he),ue.getY(he)-se.getY(he),ue.getZ(he)-se.getZ(he));else for(var _e=0,Ue=ue.count;_e<Ue;_e++)xe.setXYZ(_e,0,0,0);de[me]=this.processAccessor(xe,te),L.attributes.set(this.getUID(se),de[me])}Z.push(de),k.push(w.morphTargetInfluences[le]),w.morphTargetDictionary!==void 0&&U.push(oe[le])}W.weights=k,0<U.length&&(W.extras={},W.extras.targetNames=U)}var qe=Array.isArray(w.material);if(qe&&te.groups.length===0)return null;for(var Pe,ct=qe?w.material:[w.material],Ie=qe?te.groups:[{materialIndex:0,start:void 0,count:void 0}],Ye=0,$e=Ie.length;Ye<$e;Ye++){if(Pe={mode:K,attributes:z},this.serializeUserData(te,Pe),0<Z.length&&(Pe.targets=Z),te.index!==null){var at=this.getUID(te.index);(Ie[Ye].start!==void 0||Ie[Ye].count!==void 0)&&(at+=":"+Ie[Ye].start+":"+Ie[Ye].count),L.attributes.has(at)?Pe.indices=L.attributes.get(at):(Pe.indices=this.processAccessor(te.index,te,Ie[Ye].start,Ie[Ye].count),L.attributes.set(at,Pe.indices)),Pe.indices===null&&delete Pe.indices}var et=this.processMaterial(ct[Ie[Ye].materialIndex]);et!==null&&(Pe.material=et),j.push(Pe)}W.primitives=j,B.meshes||(B.meshes=[]),this._invokeAll(function(re){re.writeMesh&&re.writeMesh(w,W)});var Gt=B.meshes.push(W)-1;return L.meshes.set(H,Gt),Gt}processCamera(w){var L=this.json;L.cameras||(L.cameras=[]);var B=w.isOrthographicCamera,D={type:B?"orthographic":"perspective"};return B?D.orthographic={xmag:2*w.right,ymag:2*w.top,zfar:0>=w.far?.001:w.far,znear:0>w.near?0:w.near}:D.perspective={aspectRatio:w.aspect,yfov:c.MathUtils.degToRad(w.fov),zfar:0>=w.far?.001:w.far,znear:0>w.near?0:w.near},w.name!==""&&(D.name=w.type),L.cameras.push(D)-1}processAnimation(w,L){var B=this.json,D=this.nodeMap;B.animations||(B.animations=[]),w=f.Utils.mergeMorphTargetTracks(w.clone(),L);for(var V=w.tracks,G=[],H=[],K=0;K<V.length;++K){var te=V[K],W=c.PropertyBinding.parseTrackName(te.name),z=c.PropertyBinding.findNode(L,W.nodeName),j=y[W.propertyName];if(W.objectName==="bones"&&(z.isSkinnedMesh===!0?z=z.skeleton.getBoneByName(W.objectIndex):z=void 0),!z||!j)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',te.name),null;var Z=1,Q=te.values.length/te.times.length;j===y.morphTargetInfluences&&(Q/=z.morphTargetInfluences.length);var ee=void 0;te.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(ee="CUBICSPLINE",Q/=3):te.getInterpolation()===c.InterpolateDiscrete?ee="STEP":ee="LINEAR",H.push({input:this.processAccessor(new c.BufferAttribute(te.times,Z)),output:this.processAccessor(new c.BufferAttribute(te.values,Q)),interpolation:ee}),G.push({sampler:H.length-1,target:{node:D.get(z),path:j}})}return B.animations.push({name:w.name||"clip_"+B.animations.length,samplers:H,channels:G}),B.animations.length-1}processSkin(w){var L=this.json,B=this.nodeMap,D=L.nodes[B.get(w)],V=w.skeleton;if(V===void 0)return null;var G=w.skeleton.bones[0];if(G===void 0)return null;for(var H=[],K=new Float32Array(16*V.bones.length),te=new c.Matrix4,W=0;W<V.bones.length;++W)H.push(B.get(V.bones[W])),te.copy(V.boneInverses[W]),te.multiply(w.bindMatrix).toArray(K,16*W);L.skins===void 0&&(L.skins=[]),L.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(K,16)),joints:H,skeleton:B.get(G)});var z=D.skin=L.skins.length-1;return z}processNode(w){var L=this.json,B=this.options,D=this.nodeMap;L.nodes||(L.nodes=[]);var V={};if(B.trs){var G=w.quaternion.toArray(),H=w.position.toArray(),K=w.scale.toArray();T(G,[0,0,0,1])||(V.rotation=G),T(H,[0,0,0])||(V.translation=H),T(K,[1,1,1])||(V.scale=K)}else w.matrixAutoUpdate&&w.updateMatrix(),_(w.matrix)===!1&&(V.matrix=w.matrix.elements);if(w.name!==""&&(V.name=w.name+""),this.serializeUserData(w,V),w.isMesh||w.isLine||w.isPoints){var te=this.processMesh(w);te!==null&&(V.mesh=te)}else w.isCamera&&(V.camera=this.processCamera(w));if(w.isSkinnedMesh&&this.skins.push(w),0<w.children.length){for(var W,z=[],j=0,Z=w.children.length;j<Z;j++)if(W=w.children[j],W.visible||B.onlyVisible===!1){var Q=this.processNode(W);Q!==null&&z.push(Q)}0<z.length&&(V.children=z)}this._invokeAll(function(ie){ie.writeNode&&ie.writeNode(w,V)});var ee=L.nodes.push(V)-1;return D.set(w,ee),ee}processScene(w){var L=this.json,B=this.options;L.scenes||(L.scenes=[],L.scene=0);var D={};w.name!==""&&(D.name=w.name),L.scenes.push(D);for(var V,G=[],H=0,K=w.children.length;H<K;H++)if(V=w.children[H],V.visible||B.onlyVisible===!1){var te=this.processNode(V);te!==null&&G.push(te)}0<G.length&&(D.nodes=G),this.serializeUserData(w,D)}processObjects(w){var L=new c.Scene;L.name="AuxScene";for(var B=0;B<w.length;B++)L.children.push(w[B]);this.processScene(L)}processInput(w){var L=this.options;w=w instanceof Array?w:[w],this._invokeAll(function(H){H.beforeParse&&H.beforeParse(w)});for(var B=[],D=0;D<w.length;D++)w[D]instanceof c.Scene?this.processScene(w[D]):B.push(w[D]);0<B.length&&this.processObjects(B);for(var V=0;V<this.skins.length;++V)this.processSkin(this.skins[V]);for(var G=0;G<L.animations.length;++G)this.processAnimation(L.animations[G].clip,L.animations[G].mesh);this._invokeAll(function(H){H.afterParse&&H.afterParse(w)})}_invokeAll(w){for(var L=0,B=this.plugins.length;L<B;L++)w(this.plugins[L])}}class P{constructor(w){this.writer=w,this.name="KHR_lights_punctual"}writeNode(w,L){if(w.isLight){if(!w.isDirectionalLight&&!w.isPointLight&&!w.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",w);var B=this.writer,D=B.json,V=B.extensionsUsed,G={};w.name&&(G.name=w.name),G.color=w.color.toArray(),G.intensity=w.intensity,w.isDirectionalLight?G.type="directional":w.isPointLight?(G.type="point",0<w.distance&&(G.range=w.distance)):w.isSpotLight&&(G.type="spot",0<w.distance&&(G.range=w.distance),G.spot={},G.spot.innerConeAngle=-1*((w.penumbra-1)*w.angle),G.spot.outerConeAngle=w.angle),w.decay!==void 0&&w.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),w.target&&(w.target.parent!==w||w.target.position.x!==0||w.target.position.y!==0||w.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),V[this.name]||(D.extensions=D.extensions||{},D.extensions[this.name]={lights:[]},V[this.name]=!0);var H=D.extensions[this.name].lights;H.push(G),L.extensions=L.extensions||{},L.extensions[this.name]={light:H.length-1}}}}class I{constructor(w){this.writer=w,this.name="KHR_materials_unlit"}writeMaterial(w,L){if(w.isMeshBasicMaterial){var B=this.writer,D=B.extensionsUsed;L.extensions=L.extensions||{},L.extensions[this.name]={},D[this.name]=!0,L.pbrMetallicRoughness.metallicFactor=0,L.pbrMetallicRoughness.roughnessFactor=.9}}}class O{constructor(w){this.writer=w,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(w,L){if(w.isGLTFSpecularGlossinessMaterial){var B=this.writer,D=B.extensionsUsed,V={};L.pbrMetallicRoughness.baseColorFactor&&(V.diffuseFactor=L.pbrMetallicRoughness.baseColorFactor);var G=[1,1,1];if(w.specular.toArray(G,0),V.specularFactor=G,V.glossinessFactor=w.glossiness,L.pbrMetallicRoughness.baseColorTexture&&(V.diffuseTexture=L.pbrMetallicRoughness.baseColorTexture),w.specularMap){var H={index:B.processTexture(w.specularMap)};B.applyTextureTransform(H,w.specularMap),V.specularGlossinessTexture=H}L.extensions=L.extensions||{},L.extensions[this.name]=V,D[this.name]=!0}}}f.Utils={insertKeyframe:function(w,L){var B,D=.001,V=w.getValueSize(),G=new w.TimeBufferType(w.times.length+1),H=new w.ValueBufferType(w.values.length+V),K=w.createInterpolant(new w.ValueBufferType(V));if(w.times.length===0){G[0]=L;for(var te=0;te<V;te++)H[te]=0;B=0}else if(L<w.times[0]){if(Math.abs(w.times[0]-L)<D)return 0;G[0]=L,G.set(w.times,1),H.set(K.evaluate(L),0),H.set(w.values,V),B=0}else if(L>w.times[w.times.length-1]){if(Math.abs(w.times[w.times.length-1]-L)<D)return w.times.length-1;G[G.length-1]=L,G.set(w.times,0),H.set(w.values,0),H.set(K.evaluate(L),w.values.length),B=G.length-1}else for(var W=0;W<w.times.length;W++){if(Math.abs(w.times[W]-L)<D)return W;if(w.times[W]<L&&w.times[W+1]>L){G.set(w.times.slice(0,W+1),0),G[W+1]=L,G.set(w.times.slice(W+1),W+2),H.set(w.values.slice(0,(W+1)*V),0),H.set(K.evaluate(L),(W+1)*V),H.set(w.values.slice((W+1)*V),(W+2)*V),B=W+1;break}}return w.times=G,w.values=H,B},mergeMorphTargetTracks:function(w,L){for(var B=[],D={},V=w.tracks,G=0;G<V.length;++G){var H=V[G],K=c.PropertyBinding.parseTrackName(H.name),te=c.PropertyBinding.findNode(L,K.nodeName);if(K.propertyName!=="morphTargetInfluences"||K.propertyIndex===void 0){B.push(H);continue}if(H.createInterpolant!==H.InterpolantFactoryMethodDiscrete&&H.createInterpolant!==H.InterpolantFactoryMethodLinear){if(H.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),H=H.clone(),H.setInterpolation(c.InterpolateLinear)}var W=te.morphTargetInfluences.length,z=te.morphTargetDictionary[K.propertyIndex];if(z===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+K.propertyIndex);var j=void 0;if(D[te.uuid]===void 0){j=H.clone();for(var Z=new j.ValueBufferType(W*j.times.length),Q=0;Q<j.times.length;Q++)Z[Q*W+z]=j.values[Q];j.name=(K.nodeName||"")+".morphTargetInfluences",j.values=Z,D[te.uuid]=j,B.push(j);continue}var ee=H.createInterpolant(new H.ValueBufferType(1));j=D[te.uuid];for(var ie=0;ie<j.times.length;ie++)j.values[ie*W+z]=ee.evaluate(j.times[ie]);for(var Y,ne=0;ne<H.times.length;ne++)Y=this.insertKeyframe(j,H.times[ne]),j.values[Y*W+z]=H.values[ne]}return w.tracks=B,w}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var E=this;this.setFromObject=_=>{var{nearPlane:M,farPlane:S,eyePosition:C,targetPosition:A,upVector:R}=_;E.nearPlane=M,E.farPlane=S,E.eyePosition=C,E.targetPosition=A,E.upVector=R}},m=function(E,_,M,S){var C={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},A={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},R={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},P={};P.MAIN=A.ROTATE,P.AUXILIARY=A.ZOOM,P.SECONDARY=A.PAN,this.cameraObject=E,this.domElement=_===void 0?document:_,this.renderer=M,this.scene=S,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50,this.pixelHeight=1;var I=6e3,O=!0,N=0,w=void 0,L=void 0,B=!1,D=500,V=void 0,G="default",H=C.DEFAULT,K=void 0,te=void 0,W=void 0,z=0,j=R.FREE;this._state=A.NONE;var Z;this.targetTouchId=-1;var Q=void 0,ee=new c.Vector3,ie=new c.Vector3,Y=new c.Vector3,ne=new c.Vector3,F=new c.Vector3,$=new c.Vector3,J=new c.Vector3,k=new c.Vector3,U=new c.Sphere,oe=new c.Vector3,ae=void 0,le=0,de={default:new h};de.default.nearPlane=.1,de.default.farPlane=2e3,de.default.eyePosition=[0,0,0],de.default.targetPosition=[0,0,-1],de.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...de.default.targetPosition)),this.calculateMaxAllowedDistance=re=>{var Me=re.getBoundingBox();if(Me){Me.getBoundingSphere(U),le=6*U.radius;var Ee=0;this.cameraObject&&(Ee=this.cameraObject.position.distanceTo(U.center)),le=Ee>le?Ee:le}else le=0},this.addViewport=(re,Me)=>{re&&Me&&(de[re]=Me)},this.setDefaultViewport=re=>!!(re&&re in de)&&(G=re,!0),this.getDefaultViewport=()=>G,this.getViewportOfName=re=>de[re],this.setCurrentViewport=re=>re in de&&(this.setCurrentCameraSettings(de[re]),!0),this.setRotationMode=re=>{switch(re){case"none":j=R.NONE;break;case"horizontal":j=R.HORIZONTAL;break;case"vertical":j=R.VERTICAL;break;case"free":default:j=R.FREE}},this.onResize=()=>{Q&&(Q=void 0),ae&&ae.setCurrentCameraSettings(this.cameraObject,de[G])},this.getVisibleHeightAtZDepth=re=>{var Me=this.cameraObject.position.distanceTo(this.cameraObject.target);re<Me?re-=Me:re+=Me;var Ee=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Ee/2)*Math.abs(re)},this.calculateHeightPerPixelAtZeroDepth=re=>{var Me=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=Me/re,this.pixelHeight},this.getNDCFromDocumentCoords=(re,Me,Ee)=>{qe(!1);var Oe=Ee||new c.Vector2,Je=2*((re-Q.left)/Q.width)-1,it=2*-((Me-Q.top)/Q.height)+1;return Oe.set(Je,it)},this.getRelativeCoordsFromNDC=(re,Me,Ee)=>{qe(!1);var Oe=Ee||new c.Vector2;return Oe.x=(re+1)*Q.width/2,Oe.y=(1-Me)*Q.height/2,Oe},this.setMouseButtonAction=(re,Me)=>{P[re]=A[Me]};var be=()=>{if(0<le){var re=oe.distanceTo(U.center);return le>re||this.cameraObject.position.distanceTo(U.center)>re}return!0},we=re=>{oe.copy(this.cameraObject.position).add(re),be()&&(this.cameraObject.target.add(re),this.cameraObject.position.add(re),this.updateDirectionalLight())},ue=re=>{qe(!1);var Me;if(H===C.DEFAULT&&(Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,re)),!Me)re.button==0?re.ctrlKey?this._state=P.AUXILIARY:re.shiftKey?this._state=P.SECONDARY:this._state=P.MAIN:re.button==1?(re.preventDefault(),this._state=P.AUXILIARY):re.button==2&&(this._state=P.SECONDARY),this.pointer_x=re.clientX-Q.left,this.pointer_y=re.clientY-Q.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{H=C.MINIMAP;var Ee=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);we(Ee)}},me=re=>{if(qe(!1),Q)if(this.pointer_x=re.clientX-Q.left,this.pointer_y=re.clientY-Q.top,H===C.MINIMAP){var Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,re);if(Me){var Ee=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);we(Ee)}}else this._state===A.NONE&&Z!==void 0&&Z.move(this,re.clientX,re.clientY,this.renderer)},se=re=>{this._state=A.NONE,H==C.MINIMAP&&(H=C.DEFAULT),Z!==void 0&&this.pointer_x_start==re.clientX-Q.left&&this.pointer_y_start==re.clientY-Q.top&&Z.pick(this,re.clientX,re.clientY,this.renderer)},xe=re=>{this._state=A.NONE},he=re=>{qe(!1);var Me=re.touches.length;if(Me==1)this._state=A.TOUCH_ROTATE,this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(Me==2){this._state=A.TOUCH_ZOOM;var Ee=re.touches[0].clientX-re.touches[1].clientX,Oe=re.touches[0].clientY-re.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Ee*Ee+Oe*Oe)}else Me==3&&(this._state=A.TOUCH_PAN,this.targetTouchId=re.touches[0].identifier,this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},ge=re=>{re.preventDefault(),re.stopPropagation();var Me=re.touches.length;if(Me==1)this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top;else if(Me==2){if(this._state===A.TOUCH_ZOOM){var Ee=re.touches[0].clientX-re.touches[1].clientX,Oe=re.touches[0].clientY-re.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ee*Ee+Oe*Oe)}}else if(Me==3&&this._state===A.TOUCH_PAN)for(var Je=0;3>Je;Je++)re.touches[Je].identifier==this.targetTouchId&&(this.pointer_x=re.touches[0].clientX-Q.left,this.pointer_y=re.touches[0].clientY-Q.top)},_e=re=>{var Me=re.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=A.NONE,Me==1&&Z!==void 0&&this.pointer_x_start==re.touches[0].clientX-Q.left&&this.pointer_y_start==re.touches[0].clientY-Q.top&&Z.pick(this.cameraObject,re.touches[0].clientX,re.touches[0].clientY,this.renderer)},Ue=()=>{qe(!0)},qe=re=>{if(re||Q===void 0){var Me=new IntersectionObserver(Ee=>{for(var Oe of Ee)Q=Oe.boundingClientRect;Me.disconnect()});Me.observe(this.domElement)}},Pe=re=>{qe(!1),this._state=A.SCROLL;var Me=0;0<re.deltaY?Me=this.scrollRate:0>re.deltaY&&(Me=-1*this.scrollRate),z+=Me,re.preventDefault(),re.stopImmediatePropagation()},ct=()=>{if(typeof this.cameraObject<"u"){var re=Q.height,Me=this.cameraObject.position.distanceTo(this.cameraObject.target),Ee=0;this.cameraObject.far>this.cameraObject.near&&Me>=this.cameraObject.near&&Me<=this.cameraObject.far&&(Ee=(Me-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),ie.set(this.previous_pointer_x,re-this.previous_pointer_y,0),Y.set(this.previous_pointer_x,re-this.previous_pointer_y,1),ne.set(this.pointer_x,re-this.pointer_y,0),F.set(this.pointer_x,re-this.pointer_y,1),ie.unproject(this.cameraObject),Y.unproject(this.cameraObject),ne.unproject(this.cameraObject),F.unproject(this.cameraObject);var Oe=-.002;ne.sub(ie).multiplyScalar(1-Ee),F.sub(Y).multiplyScalar(Ee),ne.add(F).multiplyScalar(Oe),we(ne)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(re,Me)=>{re.normalize(),J.copy(this.cameraObject.position).sub(this.cameraObject.target),k.copy(J),J.normalize(),.8<Math.abs(J.dot(re))&&J.copy(this.cameraObject.up),ie.crossVectors(re,J).normalize(),Y.crossVectors(re,ie);var Ee=re.dot(k),Oe=ie.dot(k),Je=Y.dot(k),it=re.dot(this.cameraObject.up),ut=ie.dot(this.cameraObject.up),rt=Y.dot(this.cameraObject.up),Tt=Math.cos(Me),qt=Math.sin(Me);return ne.set(Tt*ie.x+qt*Y.x,Tt*ie.y+qt*Y.y,Tt*ie.z+qt*Y.z),F.set(Tt*Y.x-qt*ie.x,Tt*Y.y-qt*ie.y,Tt*Y.z-qt*ie.z),J.copy(this.cameraObject.target),J.x=J.x+re.x*Ee+ne.x*Oe+F.x*Je,J.y=J.y+re.y*Ee+ne.y*Oe+F.y*Je,J.z=J.z+re.z*Ee+ne.z*Oe+F.z*Je,ee.set(re.x*it+ne.x*ut+F.x*rt,re.y*it+ne.y*ut+F.y*rt,re.z*it+ne.z*ut+F.z*rt),{position:J,up:ee}},this.rotateAboutLookAtpoint=(re,Me)=>{var Ee=this.getVectorsFromRotateAboutLookAtPoints(re,Me);this.cameraObject.position.copy(Ee.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ee.up)};var Ie=()=>{if(typeof this.cameraObject<"u"){var re=Q.width,Me=Q.height;if(0<re&&0<Me){var Ee=.25*(re+Me),Oe=0,Je=0;(j===R.FREE||j===R.HORIZONTAL)&&(Oe=this.pointer_x-this.previous_pointer_x),(j===R.FREE||j===R.VERTICAL)&&(Je=this.previous_pointer_y-this.pointer_y);var it=Math.sqrt(Oe*Oe+Je*Je);if(0<it){var ut=1*-Je/it,rt=1*Oe/it,Tt=0;j===R.FREE&&ut*(this.pointer_x-.5*(re-1))+rt*(.5*(Me-1)-this.pointer_y);var qt=Math.acos(Tt/Ee)-.5*Math.PI,q=this.tumble_rate*it/Ee;ee.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),ie.copy(this.cameraObject.up).normalize(),Y.copy(ie).cross(ee).normalize().multiplyScalar(ut),ie.multiplyScalar(rt),$.addVectors(Y,ie).multiplyScalar(Math.cos(qt)),ee.multiplyScalar(Math.sin(qt)),$.add(ee),this.rotateAboutLookAtpoint($,-q)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},Ye=()=>{var re=0;return this._state===A.ZOOM?re=this.previous_pointer_y-this.pointer_y:this._state===A.SCROLL?re=z:(re=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),re};this.changeZoomByScrollRateUnit=re=>{var Me=re*this.scrollRate;this.changeZoomByValue(Me)},this.changeZoomByValue=re=>{if(typeof this.cameraObject<"u"){Q.width;var Me=Q.height,Ee=this.cameraObject.position.clone();Ee.sub(this.cameraObject.target);var Oe=Ee.length(),Je=1.5*re/Me;if(.01<Oe+Je*Oe&&(Ee.normalize(),oe.copy(this.cameraObject.position),oe.x+=Ee.x*Je*Oe,oe.y+=Ee.y*Je*Oe,oe.z+=Ee.z*Je*Oe,be())){this.cameraObject.position.copy(oe),this.updateDirectionalLight();var it=1e-5;if(it*this.cameraObject.far<this.cameraObject.near+Je*Oe+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Je*Oe,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Je*Oe,this.cameraObject.far+=Je*Oe));else{if(this.near_plane_fly_debt==0){var ut=this.cameraObject.near-it*this.cameraObject.far;this.cameraObject.near=it*this.cameraObject.far,this.cameraObject.far-=ut,this.near_plane_fly_debt-=it*this.cameraObject.far}this.near_plane_fly_debt+=Je*Oe}}}};var $e=()=>{var re=Ye();this.changeZoomByValue(re),this._state===A.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===A.SCROLL&&(z=0,this._state=A.NONE)};this.setDirectionalLight=re=>{this.directionalLight=re},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){O=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",ue,!1),this.domElement.addEventListener("mousemove",me,!1),this.domElement.addEventListener("mouseup",se,!1),this.domElement.addEventListener("mouseleave",xe,!1),this.domElement.addEventListener("touchstart",he,!1),this.domElement.addEventListener("touchmove",ge,!1),this.domElement.addEventListener("touchend",_e,!1),this.domElement.addEventListener("wheel",Pe,!1),this.domElement.addEventListener("contextmenu",re=>{re.preventDefault()},!1),this.domElement.addEventListener("mouseenter",Ue,!1))},this.disable=function(){O=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",ue,!1),this.domElement.removeEventListener("mousemove",me,!1),this.domElement.removeEventListener("mouseup",se,!1),this.domElement.removeEventListener("mouseleave",xe,!1),this.domElement.removeEventListener("touchstart",he,!1),this.domElement.removeEventListener("touchmove",ge,!1),this.domElement.removeEventListener("touchend",_e,!1),this.domElement.removeEventListener("wheel",Pe,!1),this.domElement.removeEventListener("mouseenter",Ue,!1),this.domElement.removeEventListener("contextmenu",re=>{re.preventDefault()},!1))},this.loadPath=re=>{w=re.CameraPath,L=re.NumberOfPoints},this.loadPathURL=(re,Me)=>{var Ee=new XMLHttpRequest;Ee.onreadystatechange=()=>{if(Ee.readyState==4&&Ee.status==200){var Je=JSON.parse(Ee.responseText);this.loadPath(Je),Me!=null&&typeof Me=="function"&&Me()}};var Oe=f(re);Ee.open("GET",Oe,!0),Ee.send()},this.setPathDuration=re=>{I=re,K&&K.setDuration(I),te&&te.setDuration(I)},this.getPlayRate=()=>D,this.setPlayRate=re=>{D=re};var at=re=>{var Me=N+re;Me>I&&(Me-=I),N=Me};this.getTime=()=>N,this.setTime=re=>{N=re>I?I:0>re?0:re},this.getNumberOfTimeFrame=()=>L,this.getCurrentTimeFrame=()=>{if(2<L){var re=N/I*(L-1),Me=Math.floor(re),Ee=1-(re-Me),Oe=Math.ceil(re);return Me==Oe?Me==L-1?[Me-1,Oe,0]:[Me,Oe+1,1]:[Me,Oe,Ee]}return L==1?[0,0,0]:void 0},this.setCurrentTimeFrame=re=>{2<L&&(N=I*re/(L-1),0>N&&(N=0),N>I&&(N=I))};var et=re=>{if(H===C.PATH&&(at(re),w)){for(var Me=this.getCurrentTimeFrame(),Ee=Me[0],Oe=Me[1],Je=Me[2],it=[w[3*Ee],w[3*Ee+1],w[3*Ee+2]],ut=[w[3*Oe],w[3*Oe+1],w[3*Oe+2]],rt=[],Tt=0;Tt<it.length;Tt++)rt.push(Je*it[Tt]+(1-Je)*ut[Tt]);this.cameraObject.position.set(rt[0],rt[1],rt[2]),this.cameraObject.target.set(ut[0],ut[1],ut[2]),V&&this.cameraObject.lookAt(this.cameraObject.target),B&&(this.directionalLight.position.set(rt[0],rt[1],rt[2]),this.directionalLight.target.position.set(ut[0],ut[1],ut[2]))}};this.calculatePathNow=()=>{et(0)};var Gt=()=>{this._state===A.ROTATE||this._state===A.TOUCH_ROTATE?Ie():this._state===A.PAN||this._state===A.TOUCH_PAN?(ct(),ae.triggerCallback()):(this._state===A.ZOOM||this._state===A.TOUCH_ZOOM||this._state===A.SCROLL)&&(ae.zoom(Ye()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===A.SCROLL&&(this._state=A.NONE),z=0,ae.triggerCallback())};this.update=re=>{var Me=re*D,Ee=O,Oe=!0;return H===C.PATH?et(Me):H===C.SMOOTH_CAMERA_TRANSITION&&K?(K.update(Me),K.isTransitionCompleted()&&(H=C.DEFAULT),Ee=!1):H===C.ROTATE_CAMERA_TRANSITION&&te?(te.update(Me),te.isTransitionCompleted()&&(H=C.DEFAULT),Ee=!1):H===C.AUTO_TUMBLE&&W?W.update(Me):H===C.SYNC_CONTROL&&ae?(Gt(),Ee=!1):Oe=!1,Ee&&(this._state!==A.NONE&&(Oe=!0),this._state===A.ROTATE||this._state===A.TOUCH_ROTATE?Ie():this._state===A.PAN||this._state===A.TOUCH_PAN?ct():(this._state===A.ZOOM||this._state===A.TOUCH_ZOOM||this._state===A.SCROLL)&&$e(),this._state!==A.NONE&&H===C.AUTO_TUMBLE&&W&&W.stopOnCameraInput,this._state===A.SCROLL&&(this._state=A.NONE)),V?(Oe=!0,V.update()):this.cameraObject.lookAt(this.cameraObject.target),Oe},this.playPath=()=>{H=C.PATH},this.stopPath=()=>{H=C.DEFAULT},this.isPlayingPath=()=>H===C.PATH,this.enableDirectionalLightUpdateWithPath=re=>{B=re},this.enableDeviceOrientation=()=>{V||(V=new x(this.cameraObject))},this.disableDeviceOrientation=()=>{V&&(V.dispose(),V=void 0)},this.isDeviceOrientationEnabled=()=>!!V,this.resetView=()=>{var re=de[G];this.cameraObject.near=re.nearPlane,this.cameraObject.far=re.farPlane,this.cameraObject.position.set(re.eyePosition[0],re.eyePosition[1],re.eyePosition[2]),this.cameraObject.target.set(re.targetPosition[0],re.targetPosition[1],re.targetPosition[2]),this.cameraObject.up.set(re.upVector[0],re.upVector[1],re.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=re=>{re.nearPlane&&(this.cameraObject.near=re.nearPlane),re.farPlane&&(this.cameraObject.far=re.farPlane),re.eyePosition&&this.cameraObject.position.set(re.eyePosition[0],re.eyePosition[1],re.eyePosition[2]),re.targetPosition&&this.cameraObject.target.set(re.targetPosition[0],re.targetPosition[1],re.targetPosition[2]),re.upVector&&this.cameraObject.up.set(re.upVector[0],re.upVector[1],re.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.getViewportFromCentreAndRadius=(re,Me,Ee,Oe,Je,it)=>{var ut=this.cameraObject.position.x-this.cameraObject.target.x,rt=this.cameraObject.position.y-this.cameraObject.target.y,Tt=this.cameraObject.position.z-this.cameraObject.target.z,qt=1/Math.sqrt(ut*ut+rt*rt+Tt*Tt);ut*=qt,rt*=qt,Tt*=qt;var q=[re,Me,Ee],pe=Oe/Math.tan(Je*Math.PI/360),fe=[re+ut*pe,Me+rt*pe,Ee+Tt*pe],ve=pe+it,Te=0,ze=.95;Te=it>ze*pe?(1-ze)*pe:pe-it;var ce=new h;return ce.nearPlane=Te,ce.farPlane=ve,ce.eyePosition=fe,ce.targetPosition=q,ce.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],ce},this.getViewportFromBoundingBox=(re,Me)=>{var Ee=re.min.distanceTo(re.max)/2*Me,Oe=(re.min.x+re.max.x)/2,Je=(re.min.y+re.max.y)/2,it=(re.min.z+re.max.z)/2,ut=4,rt=this.getViewportFromCentreAndRadius(Oe,Je,it,Ee,40,Ee*ut);return rt},this.getCurrentViewport=()=>{var re=new h;return re.nearPlane=this.cameraObject.near,re.farPlane=this.cameraObject.far,re.eyePosition[0]=this.cameraObject.position.x,re.eyePosition[1]=this.cameraObject.position.y,re.eyePosition[2]=this.cameraObject.position.z,re.targetPosition[0]=this.cameraObject.target.x,re.targetPosition[1]=this.cameraObject.target.y,re.targetPosition[2]=this.cameraObject.target.z,re.upVector[0]=this.cameraObject.up.x,re.upVector[1]=this.cameraObject.up.y,re.upVector[2]=this.cameraObject.up.z,re},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(re,Me,Ee)=>{te==null&&(K=new y(re,Me,this,Ee))},this.rotateCameraTransition=(re,Me,Ee)=>{K==null&&(te=new p(re,Me,this,Ee))},this.enableCameraTransition=()=>{K&&(H=C.SMOOTH_CAMERA_TRANSITION),te&&(H=C.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{H=C.DEFAULT},this.stopCameraTransition=()=>{H=C.DEFAULT,K=void 0,te=void 0},this.isTransitioningCamera=()=>H===C.SMOOTH_CAMERA_TRANSITION||H===C.ROTATE_CAMERA_TRANSITION,this.autoTumble=(re,Me,Ee)=>{W=new b(re,Me,Ee,this)},this.enableAutoTumble=()=>{H=C.AUTO_TUMBLE},this.stopAutoTumble=()=>{H=C.DEFAULT,W=void 0},this.updateAutoTumble=()=>{W&&(W.requireUpdate=!0)},this.isAutoTumble=()=>H===C.AUTO_TUMBLE,this.enableRaycaster=(re,Me,Ee)=>{Z==null&&(Z=new d(re,this.scene,Me,Ee,this.renderer))},this.disableRaycaster=()=>{Z.disable(),Z=void 0},this.isSyncControl=()=>currentMpde===C.SYNC_CONTROL,this.enableSyncControl=()=>(H=C.SYNC_CONTROL,ae||(ae=new T),ae.setCurrentCameraSettings(this.cameraObject,de[G]),ae),this.disableSyncControl=()=>{H=C.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},y=function(_,M,S,C){var A=_.eyePosition,R=_.targetPosition,P=_.upVector,I=M.eyePosition,O=M.targetPosition,N=M.upVector,w=S,L=C,B=0,D=!1;w.near=Math.min(_.nearPlane,M.nearPlane),w.far=Math.max(_.farPlane,M.farPlane),w.cameraObject.up.set(M.upVector[0],M.upVector[1],M.upVector[2]),this.setDuration=H=>{L=H};var V=H=>{var K=B+H;K>L&&(K=L),B=K},G=()=>{var H=B/L,K=[A[0]*(1-H)+I[0]*H,A[1]*(1-H)+I[1]*H,A[2]*(1-H)+I[2]*H],te=[R[0]*(1-H)+O[0]*H,R[1]*(1-H)+O[1]*H,R[2]*(1-H)+O[2]*H];P[0]*(1-H)+N[0]*H,P[1]*(1-H)+N[1]*H,P[2]*(1-H)+N[2]*H,w.cameraObject.position.set(K[0],K[1],K[2]),w.cameraObject.target.set(te[0],te[1],te[2])};this.update=H=>{this.enabled===!1||(V(H),G(),B==L&&(D=!0))},this.isTransitionCompleted=()=>D},p=function(_,M,S,C){var A=_,R=M,P=S,I=C,O=0,N=!1;this.setDuration=L=>{I=L};var w=L=>{var B=O,D=O+L;D>I&&(D=I),O=D;var V=O-B,G=V/I,H=G*R;P.rotateAboutLookAtpoint(A,H)};this.update=L=>{this.enabled===!1||(w(L),O==I&&(N=!0))},this.isTransitionCompleted=()=>N},d=function(_,M,S,C,A){var R=_,P=M,I=A,O=S,N=C,w=new c.Raycaster;w.params.Line.threshold=.1,w.params.Points.threshold=1;var L=new c.Vector2,B=!1,D=new Date,V=!1,G=0,H=[],K={zincCamera:void 0,x:-1,y:-1},te=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=j=>{if(P!==R){var Z=R.getThreeJSScene();I.render(Z,j.cameraObject)}var Q=te||R.getPickableThreeJSObjects();return H.length=0,w.intersectObjects(Q,!0,H)},this.setPickableObjects=j=>{j===void 0?te=void 0:(te=[],j.forEach(Z=>{Z.getGroup()&&Z.getGroup().visible&&te.push(Z.getGroup())}))},this.getIntersectsObjectWithOrigin=(j,Z,Q)=>(w.set(Z,Q),this.getIntersectsObject(j)),this.getIntersectsObjectWithCamera=(j,Z,Q)=>(j.getNDCFromDocumentCoords(Z,Q,L),w.setFromCamera(L,j.cameraObject),this.getIntersectsObject(j)),this.pick=(j,Z,Q)=>{if(I&&R&&j&&O){this.getIntersectsObjectWithCamera(j,Z,Q);for(var ee,ie=H.length,Y=0;Y<ie;Y++)if(ee=H[Y].object?H[Y].object.userData:void 0,ee&&ee.isMarkerCluster&&ee.visible&&ee.clusterIsVisible(H[Y].object.clusterIndex)&&ee.zoomToCluster(H[Y].object.clusterIndex))return;O(H,Z,Q)}};var W=(j,Z,Q)=>{if(I&&R&&j&&N){if(this.getIntersectsObjectWithCamera(j,Z,Q),D.setTime(Date.now()),H.length===0){if(V)return;V=!0}else V=!1;N(H,Z,Q)}};this.move=(j,Z,Q)=>{I&&R&&j&&N&&(R.displayMarkers?W(j,Z,Q):(K.zincCamera=j,K.x=Z,K.y=Q,!B&&(G=D?Date.now()-D.getTime():250,250<=G?W(j,Z,Q):(B=!0,setTimeout(z(K),G)))))};var z=j=>function(){B=!1,W(j.zincCamera,j.x,j.y)}},b=function(_,M,S,C){var A=new c.Vector3,R=-M,P=C,I=_;this.stopOnCameraInput=S,this.requireUpdate=!0;var O=new c.Vector3,N=new c.Vector3,w=L=>{var B=Math.sqrt(L[0]*L[0]+L[1]*L[1]),D=4*Math.abs(L[0]),V=4*Math.abs(L[1]),G=.25*(D+V),H=-L[1]/B,K=L[0]/B,te=H*L[0]+K*-L[1];te>G?te=G:te<-G&&(te=-G);var W=Math.acos(te/G)-.5*Math.PI;A.copy(P.cameraObject.position).sub(P.cameraObject.target).normalize(),O.copy(P.cameraObject.up).normalize(),N.crossVectors(O,A).normalize().multiplyScalar(H),O.multiplyScalar(K),O.add(N).multiplyScalar(Math.cos(W)),A.multiplyScalar(Math.sin(W)).add(O)};this.update=L=>{this.enabled===!1||(this.requireUpdate&&(w(I),this.requireUpdate=!1),P.rotateAboutLookAtpoint(A,R*L/1e3))}},v=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(v.prototype,{update:(()=>{var E,_,M,S,C,A,R=new c.Matrix4,P=new c.Matrix4;return function(O){var N=E!==O.focus||_!==O.fov||M!==O.aspect*this.aspect||S!==O.near||C!==O.far||A!==O.zoom;if(N){E=O.focus,_=O.fov,M=O.aspect*this.aspect,S=O.near,C=O.far,A=O.zoom;var w,L,B=O.projectionMatrix.clone(),D=.064/2,V=D*S/E,G=S*Math.tan(.5*(c.Math.DEG2RAD*_))/O.zoom;P.elements[12]=-D,R.elements[12]=D,w=-G*M+V,L=G*M+V,B.elements[0]=2*S/(L-w),B.elements[8]=(L+w)/(L-w),this.cameraL.projectionMatrix.copy(B),w=-G*M-V,L=G*M-V,B.elements[0]=2*S/(L-w),B.elements[8]=(L+w)/(L-w),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(O.matrixWorld).multiply(P),this.cameraR.matrixWorld.copy(O.matrixWorld).multiply(R)}})()});var g=function(_){var M=new v;M.aspect=.5,this.setSize=(S,C)=>{_.setSize(S,C)},this.render=(S,C)=>{S.updateMatrixWorld(),C.parent===null&&C.updateMatrixWorld(),M.update(C);var A=_.getSize();_.setScissorTest(!0),_.clear(),_.setScissor(0,0,A.width/2,A.height),_.setViewport(0,0,A.width/2,A.height),_.render(S,M.cameraL),_.setScissor(A.width/2,0,A.width/2,A.height),_.setViewport(A.width/2,0,A.width/2,A.height),_.render(S,M.cameraR),_.setScissorTest(!1)}},x=function(_){var M=this;this.object=_,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var S=R=>{M.deviceOrientation=R},C=()=>{typeof window<"u"&&(M.screenOrientation=window.orientation||0)},A=(()=>{var R=new c.Vector3(0,0,1),P=new c.Euler,I=new c.Quaternion,O=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(N,w,L,B,D)=>{var V=new c.Vector3(0,0,1);V.subVectors(N.target,N.position),P.set(L,w,-B,"YXZ");var G=new c.Quaternion;G.setFromEuler(P),G.multiply(O),G.multiply(I.setFromAxisAngle(R,-D)),V.applyQuaternion(G),V.addVectors(N.position,V),N.lookAt(V)}})();this.connect=()=>{C(),typeof window<"u"&&(window.addEventListener("orientationchange",C,!1),window.addEventListener("deviceorientation",S,!1)),M.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",C,!1),window.removeEventListener("deviceorientation",S,!1)),M.enabled=!1},this.update=()=>{if(M.enabled!==!1){var R=M.deviceOrientation.alpha?c.Math.degToRad(M.deviceOrientation.alpha):0,P=M.deviceOrientation.beta?c.Math.degToRad(M.deviceOrientation.beta):0,I=M.deviceOrientation.gamma?c.Math.degToRad(M.deviceOrientation.gamma):0,O=M.screenOrientation?c.Math.degToRad(M.screenOrientation):0;A(M.object,R,P,I,O)}},this.dispose=function(){this.disconnect()},this.connect()},T=function(){var _=void 0,M=void 0,S=void 0,C=new c.Vector3,A=new c.Vector3,R=new c.Vector3,P=new c.Vector3,I=void 0;this.setCurrentCameraSettings=(O,N)=>{_=O.clone(),M=O,S=N,_.near=S.nearPlane,S.farPlane&&(_.far=S.farPlane),S.eyePosition&&_.position.set(S.eyePosition[0],S.eyePosition[1],S.eyePosition[2]),S.upVector&&_.up.set(S.upVector[0],S.upVector[1],S.upVector[2]),S.targetPosition&&(_.target=new c.Vector3(S.targetPosition[0],S.targetPosition[1],S.targetPosition[2]),_.lookAt(_.target)),_.updateProjectionMatrix(),C.copy(_.position).project(_),A.copy(_.target).project(_)},this.getCurrentPosition=()=>(A.copy(M.target).project(_),[A.x,A.y]),this.zoom=O=>{var N=.002*O,w=Math.max(M.zoom-N,1);M.zoom=w,M.updateProjectionMatrix()},this.zoomToBox=(O,N)=>{O.getCenter(R),R.project(_),this.setCenterZoom([R.x,R.y],N)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:M.zoom}),this.setCenterZoom=(O,N)=>{R.set(O[0],O[1],A.z).unproject(_),P.copy(R).sub(M.target),M.target.copy(R),M.lookAt(M.target),M.position.add(P),M.zoom=N,M.updateProjectionMatrix()},this.setEventCallback=O=>{(O===void 0||typeof O=="function")&&(I=O)},this.triggerCallback=()=>{I!==void 0&&typeof I=="function"&&I()}};l.Viewport=h,l.CameraControls=m,l.SmoothCameraTransition=y,l.RotateCameraTransition=p,l.RayCaster=d,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=T},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),h=u(22).Pointset;u(24).Lines;var m=u(45).Lines2,y=u(3).Geometry,p=u(4),d=0,b=function(){return"re"+d++},v=function(g,x){var T=g,E=new c;E.matrixAutoUpdate=!1,E.userData=this;var _=[],M="",S=[],C=x,A=new f,R=3e3;A.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{_.forEach(P=>P.hideAllPrimitives()),S.forEach(P=>P.setVisibility(!1))},this.showAllPrimitives=()=>{_.forEach(P=>P.showAllPrimitives()),S.forEach(P=>P.setVisibility(!0))},this.setVisibility=P=>{P!=E.visible&&(E.visible=P,this.pickableUpdateRequired=!0)},this.getVisibility=()=>E.visible,this.getGroup=()=>E,this.setTransformation=P=>{A.set(...P),E.matrix.copy(A),E.updateMatrixWorld()},this.setName=P=>{P&&P!==""&&(M=P)},this.getName=()=>M,this.getParent=()=>T,this.getFullSeparatedPath=()=>{var P=[];if(M!==""){P.push(M);for(var I,O=T;O!==void 0;)I=O.getName(),I!==""&&P.unshift(I),O=O.getParent()}return P},this.getFullPath=()=>{var P=this.getFullSeparatedPath();if(0<P.length){var I=P.shift();return P.forEach(O=>{I=I.concat("/",O)}),I}return""},this.createChild=P=>{var I=new v(this,C);return I.setName(P),_.push(I),E.add(I.getGroup()),I},this.getChildWithName=P=>{if(P){for(var I=P.toLowerCase(),O=0;O<_.length;O++)if(_[O].getName().toLowerCase()===I)return _[O]}},this.findChildFromSeparatedPath=P=>{if(P&&0<P.length&&P[0]===""&&P.shift(),P&&0<P.length){var I=this.getChildWithName(P[0]);return I?(P.shift(),I.findChildFromSeparatedPath(P)):void 0}return this},this.findChildFromPath=P=>{var I=P.split("/");return this.findChildFromSeparatedPath(I)},this.createChildFromSeparatedPath=P=>{if(0<P.length&&P[0]===""&&P.shift(),0<P.length){var I=this.getChildWithName(P[0]);return I||(I=this.createChild(P[0])),P.shift(),I.createChildFromSeparatedPath(P)}return this},this.createChildFromPath=P=>{var I=P.split("/");return this.createChildFromSeparatedPath(I)},this.findOrCreateChildFromPath=P=>{var I=this.findChildFromPath(P);return I||(I=this.createChildFromPath(P)),I},this.addZincObject=P=>{P&&(P.setRegion(this),E.add(P.getGroup()),S.push(P),this.pickableUpdateRequired=!0,C&&C.triggerObjectAddedCallback(P))},this.removeZincObject=P=>{for(var I=0;I<S.length;I++)if(P===S[I])return E.remove(P.getGroup()),S.splice(I,1),C&&C.triggerObjectRemovedCallback(P),P.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=P=>{if(this.pickableUpdateRequired)return!0;if(P){for(var I=!1,O=0;O<_.length;O++)if(I=_[O].checkPickableUpdateRequred(P),I)return!0}return!1},this.getPickableThreeJSObjects=(P,I)=>(E.visible&&(S.forEach(O=>{if(O.getGroup()&&O.getGroup().visible){var N=O.marker;N&&N.isEnabled()&&P.push(N.getMorph()),P.push(O.getGroup())}}),I&&_.forEach(O=>{O.getPickableThreeJSObjects(P,I)}),this.pickableUpdateRequired=!1),P),this.setDuration=P=>{R=P,S.forEach(I=>I.setDuration(P)),_.forEach(I=>I.setDuration(P))},this.getDuration=()=>R,this.getBoundingBox=P=>{var I,O;return S.forEach(N=>{O=N.getBoundingBox(),O&&(I==null?I=O.clone():I.union(O))}),P&&_.forEach(N=>{O=N.getBoundingBox(P),O&&(I==null?I=O.clone():I.union(O))}),I},this.clear=P=>{P&&_.forEach(I=>I.clear(P)),S.forEach(I=>{E.remove(I.getGroup()),I.dispose()}),_=[],S=[]},this.objectIsInRegion=(P,I)=>{for(var O=0;O<S.length;O++)if(P===S[O])return!0;if(I){for(var N=0;N<_.length;N++)if(_[N].objectIsInRegion(P,I))return!0}return!1},this.forEachGeometry=(P,I)=>{S.forEach(O=>{O.isGeometry&&P(O)}),I&&_.forEach(O=>O.forEachGeometry(P,I))},this.forEachGlyphset=(P,I)=>{S.forEach(O=>{O.isGlyphset&&P(O)}),I&&_.forEach(O=>O.forEachGlyphset(P,I))},this.forEachPointset=(P,I)=>{S.forEach(O=>{O.isPointset&&P(O)}),I&&_.forEach(O=>O.forEachPointset(P,I))},this.forEachLine=(P,I)=>{S.forEach(O=>{O.isLines&&P(O)}),I&&_.forEach(O=>O.forEachLine(P,I))},this.findObjectsWithAnatomicalId=(P,I)=>(S.forEach(O=>{O.anatomicalId===P&&objectsArray.push(O)}),I&&_.forEach(O=>{var N=O.findObjectsWithAnatomicalId(P,I);objectsArray.push(...N)}),objectsArray),this.findObjectsWithGroupName=(P,I)=>{var O=[];return S.forEach(N=>{var w=N.groupName?N.groupName.toLowerCase():N.groupName,L=P&&P.toLowerCase();w===L&&O.push(N)}),I&&_.forEach(N=>{var w=N.findObjectsWithGroupName(P,I);O.push(...w)}),O},this.findGeometriesWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isGeometry);return N},this.findPointsetsWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isPointset);return N},this.findGlyphsetsWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isGlyphset);return N},this.findLinesWithGroupName=(P,I)=>{var O=this.findObjectsWithGroupName(P,I),N=O.filter(w=>w.isLines);return N},this.getAllObjects=P=>{var I=[...S];return P&&_.forEach(O=>{var N=O.getAllObjects(P);I.push(...N)}),I},this.getChildRegions=P=>{var I=[..._];return P&&_.forEach(O=>{var N=O.getChildRegions(P);I.push(...N)}),I},this.getCurrentTime=()=>{if(S[0]!=null)return S[0].getCurrentTime();for(var P,I=0;I<_.length;I++)if(P=_[I].getCurrentTime(),P!==-1)return P;return-1},this.setMorphTime=(P,I)=>{S.forEach(O=>{O.setMorphTime(P)}),I&&_.forEach(O=>{O.setMorphTime(P)})},this.isTimeVarying=()=>{for(var P=0;P<S.length;P++)if(S[P].isTimeVarying())return!0;for(var I=0;I<_.length;I++)if(_[I].isTimeVarying())return!0;return!1},this.renderGeometries=(P,I,O,N,w,L)=>{var B,D=this.getAllObjects(L);D.forEach(V=>{V.render(P*I,O,N,w)}),w&&O===!1&&(B=w.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&w.markerCluster.calculate()},this.createPoints=(P,I,O,N)=>{var w=!1,L=this.findObjectsWithGroupName(P,!1),B=L.findIndex(V=>V.isPointset),D=-1<B?L[B]:new h;return D.addPoints(I,O,N),B===-1?(D.setName(P),this.addZincObject(D),w=!0):this.pickableUpdateRequired=!0,{zincObject:D,isNew:w}},this.createLines=(P,I,O)=>{var N=!1,w=this.findObjectsWithGroupName(P,!1),L=w.findIndex(D=>D.isLines),B=-1<L?w[L]:new m;return B.addLines(I,O),L===-1?(B.setName(P),this.addZincObject(B),N=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:N}},this.createGeometryFromThreeJSGeometry=(P,I,O,N,w,L)=>{var B=new y,D=new p.MeshPhongMaterial({color:O,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:N,side:p.DoubleSide});return B.createMesh(I,D,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(P),B.setRenderOrder(L),this.addZincObject(B),B):void 0}};l.Region=v},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(46).LineSegments2,f=u(48).LineMaterial,h=u(47).LineSegmentsGeometry,m=function(){u(24).Lines.call(this),this.isLines2=!0;var y=Array(300);this.createLineSegment=(p,d,b)=>{if(p&&d){var v=new h;v.setPositions(p),v.colorsNeedUpdate=!0;var g=new c(v,d);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addVertices=function(p){if(p&&p.length){var d=this.getMorph();d||(this.drawRange=0);var b=3*this.drawRange;if(p.forEach(v=>{y[b++]=v[0],y[b++]=v[1],y[b++]=v[2],this.drawRange++}),!d)for(;300>b;)y[b++]=p[0][0],y[b++]=p[0][1],y[b++]=p[0][2];d&&(d.geometry.setPositions(y),d.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return y},this.getVerticesByFaceIndex=function(p){var d=3*(2*p),b=this.getMorph();if(b&&3*this.drawRange>d){var v=b.geometry.getAttribute("instanceStart");return[[v.data.array[d],v.data.array[++d],v.data.array[++d]],[v.data.array[++d],v.data.array[++d],v.data.array[++d]]]}return[]},this.editVertices=function(p,d){if(p&&p.length){var b=this.getMorph(),v=d+p.length-1;if(!b||0>d||v>=this.drawRange)return;var g=3*d;for(p.forEach(x=>{y[g++]=x[0],y[g++]=x[1],y[g++]=x[2]}),g=3*this.drawRange;300>g;)y[g++]=p[0][0],y[g++]=p[0][1],y[g++]=p[0][2];b.geometry.setPositions(y),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return y},this.addLines=(p,d)=>{if(p&&0<p.length){this.addVertices(p);var b=this.getMorph();if(!b){var v=new f({color:d,linewidth:1,vertexColors:!1,worldUnits:!1});v.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(y,v,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var p=this.getMorph().material;p.resolution.set(window.innerWidth,window.innerHeight)}};m.prototype=Object.create(u(24).Lines.prototype),m.prototype.constructor=m,l.Lines2=m},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>S});var c=u(4),f=u(47),h=u(48),m=new c.Vector3,y=new c.Vector3,p=new c.Vector4,d=new c.Vector4,b=new c.Vector4,v=new c.Vector3,g=new c.Matrix4,x=new c.Line3,T=new c.Vector3,E=new c.Box3,_=new c.Sphere,M=new c.Vector4;class S extends c.Mesh{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,R=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new h.LineMaterial({color:16777215*Math.random()});super(A,R),this.type="LineSegments2"}computeLineDistances(){for(var A=this.geometry,R=A.attributes.instanceStart,P=A.attributes.instanceEnd,I=new Float32Array(2*R.count),O=0,N=0,w=R.count;O<w;O++,N+=2)m.fromBufferAttribute(R,O),y.fromBufferAttribute(P,O),I[N]=N==0?0:I[N-1],I[N+1]=I[N]+m.distanceTo(y);var L=new c.InstancedInterleavedBuffer(I,2,1);return A.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(L,1,0)),A.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(L,1,1)),this}raycast(A,R){A.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var P=A.params.Line2===void 0?0:A.params.Line2.threshold||0,I=A.ray,O=A.camera,N=O.projectionMatrix,w=this.matrixWorld,L=this.geometry,B=this.material,D=B.resolution,V=B.linewidth+P,G=L.attributes.instanceStart,H=L.attributes.instanceEnd,K=-O.near,te=2*Math.max(V/D.width,V/D.height);L.boundingSphere===null&&L.computeBoundingSphere(),_.copy(L.boundingSphere).applyMatrix4(w);var W=Math.max(O.near,_.distanceToPoint(I.origin));M.set(0,0,-W,1).applyMatrix4(O.projectionMatrix),M.multiplyScalar(1/M.w),M.applyMatrix4(O.projectionMatrixInverse);var z=.5*Math.abs(te/M.w);if(_.radius+=z,A.ray.intersectsSphere(_)!==!1){L.boundingBox===null&&L.computeBoundingBox(),E.copy(L.boundingBox).applyMatrix4(w);var j=Math.max(O.near,E.distanceToPoint(I.origin));M.set(0,0,-j,1).applyMatrix4(O.projectionMatrix),M.multiplyScalar(1/M.w),M.applyMatrix4(O.projectionMatrixInverse);var Z=.5*Math.abs(te/M.w);if(E.max.x+=Z,E.max.y+=Z,E.max.z+=Z,E.min.x-=Z,E.min.y-=Z,E.min.z-=Z,A.ray.intersectsBox(E)!==!1){I.at(1,b),b.w=1,b.applyMatrix4(O.matrixWorldInverse),b.applyMatrix4(N),b.multiplyScalar(1/b.w),b.x*=D.x/2,b.y*=D.y/2,b.z=0,v.copy(b),g.multiplyMatrices(O.matrixWorldInverse,w);for(var Q=0,ee=G.count;Q<ee;Q++){p.fromBufferAttribute(G,Q),d.fromBufferAttribute(H,Q),p.w=1,d.w=1,p.applyMatrix4(g),d.applyMatrix4(g);var ie=p.z>K&&d.z>K;if(!ie){if(p.z>K){var Y=p.z-d.z,ne=(p.z-K)/Y;p.lerp(d,ne)}else if(d.z>K){var F=d.z-p.z,$=(d.z-K)/F;d.lerp(p,$)}p.applyMatrix4(N),d.applyMatrix4(N),p.multiplyScalar(1/p.w),d.multiplyScalar(1/d.w),p.x*=D.x/2,p.y*=D.y/2,d.x*=D.x/2,d.y*=D.y/2,x.start.copy(p),x.start.z=0,x.end.copy(d),x.end.z=0;var J=x.closestPointToPointParameter(v,!0);x.at(J,T);var k=c.MathUtils.lerp(p.z,d.z,J),U=-1<=k&&1>=k,oe=v.distanceTo(T)<.5*V;if(U&&oe){x.start.fromBufferAttribute(G,Q),x.end.fromBufferAttribute(H,Q),x.start.applyMatrix4(w),x.end.applyMatrix4(w);var ae=new c.Vector3,le=new c.Vector3;I.distanceSqToSegment(x.start,x.end,le,ae),R.push({point:le,pointOnLine:ae,distance:I.origin.distanceTo(le),object:this,face:null,faceIndex:Q,uv:null,uv2:null})}}}}}}}S.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>m});var c=u(4),f=new c.Box3,h=new c.Vector3;class m extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(p){var d=this.attributes.instanceStart,b=this.attributes.instanceEnd;return d!==void 0&&(d.applyMatrix4(p),b.applyMatrix4(p),d.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(p){var d;p instanceof Float32Array?d=p:Array.isArray(p)&&(d=new Float32Array(p));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(p){var d;p instanceof Float32Array?d=p:Array.isArray(p)&&(d=new Float32Array(p));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(p){return this.setPositions(p.attributes.position.array),this}fromEdgesGeometry(p){return this.setPositions(p.attributes.position.array),this}fromMesh(p){return this.fromWireframeGeometry(new c.WireframeGeometry(p.geometry)),this}fromLineSegments(p){var d=p.geometry;return d.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(d.isBufferGeometry&&this.setPositions(d.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var p=this.attributes.instanceStart,d=this.attributes.instanceEnd;p!==void 0&&d!==void 0&&(this.boundingBox.setFromBufferAttribute(p),f.setFromBufferAttribute(d),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var p=this.attributes.instanceStart,d=this.attributes.instanceEnd;if(p!==void 0&&d!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var v=0,g=0,x=p.count;g<x;g++)h.fromBufferAttribute(p,g),v=Math.max(v,b.distanceToSquared(h)),h.fromBufferAttribute(d,g),v=Math.max(v,b.distanceToSquared(h));this.boundingSphere.radius=Math.sqrt(v),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(p){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(p)}}m.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3232
3232
  #include <common>
3233
3233
  #include <color_pars_vertex>
3234
3234
  #include <fog_pars_vertex>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,7 +55,7 @@
55
55
  "vue": "^3.4.15",
56
56
  "vue-router": "^4.2.5",
57
57
  "vue3-component-svg-sprite": "^0.0.1",
58
- "zincjs": "^1.10.0"
58
+ "zincjs": "^1.10.2"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@vitejs/plugin-vue": "^4.6.2",