@abi-software/scaffoldvuer 1.8.0-beta.0 → 1.8.0-beta.2

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.
@@ -3179,9 +3179,9 @@ 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 Ae().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 kB{constructor(){this.name=tt.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 Sf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Ae(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 Ae(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Ae(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 Sf(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=ir,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 zB{constructor(){this.name=tt.KHR_MESH_QUANTIZATION}}class Ao extends ii{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}}Ao.prototype.beforeStart_=Ao.prototype.copySampleValue_,Ao.prototype.afterEnd_=Ao.prototype.copySampleValue_,Ao.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,p=h*f,y=n*u,m=y-u,d=-2*p+3*h,b=p-h,v=1-d,g=b-h+f;for(let w=0;w!==o;w++){const S=s[m+w+o],E=s[m+w+l]*c,M=s[y+w+o],_=s[y+w]*c;r[w]=v*S+g*E+d*M+b*_}return r};const Di={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},za={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hx={9728:St,9729:gt,9984:Qo,9985:kl,9986:ea,9987:Mi},fx={33071:zt,33648:Os,10497:nr},px={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_f={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},wr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},UB={CUBICSPLINE:void 0,LINEAR:Fr,STEP:Bs},Tf={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function mx(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 GB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Kr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Qi})),n.DefaultMaterial}function Ua(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 ls(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 HB(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 WB(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 jB(n){const e=n.extensions&&n.extensions[tt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+gx(e.attributes):t=n.indices+":"+gx(n.attributes)+":"+n.mode,t}function gx(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 Ef(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 $B{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new AB,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 af(this.options.manager):this.textureLoader=new Kh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new bn(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:{}};Ua(s,l,r),ls(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[tt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(mx(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=px[r.type],c=za[r.componentType],f=c.BYTES_PER_ELEMENT,h=f*u,p=r.byteOffset||0,y=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let d,b;if(y&&y!==h){const v=Math.floor(p/y),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let w=t.cache.get(g);w||(d=new c(l,v*y,r.count*y/f),w=new pr(d,y/f),t.cache.add(g,w)),b=new Oi(w,u,p%y/f,m)}else l===null?d=new c(r.count*u):d=new c(l,p,r.count*u),b=new je(d,u,m);if(r.sparse!==void 0){const v=px.SCALAR,g=za[r.sparse.indices.componentType],w=r.sparse.indices.byteOffset||0,S=r.sparse.values.byteOffset||0,E=new g(o[1],w,r.sparse.count*v),M=new c(o[2],S,r.sparse.count*u);l!==null&&(b=new je(b.array.slice(),b.itemSize,b.normalized));for(let _=0,C=E.length;_<C;_++){const I=E[_];if(b.setX(I,M[_*u]),u>=2&&b.setY(I,M[_*u+1]),u>=3&&b.setZ(I,M[_*u+2]),u>=4&&b.setW(I,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,p=!0;const y=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||y)&&(p=!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);p=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 m=Promise.resolve(f).then(function(d){return new Promise(function(b,v){let g=b;i.isImageBitmapLoader===!0&&(g=function(w){const S=new _t(w);S.needsUpdate=!0,b(S)}),i.load(mx(d,o.path),g,void 0,v)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),p||(d.format=_i);const v=(s.samplers||{})[l.sampler]||{};return d.magFilter=hx[v.magFilter]||gt,d.minFilter=hx[v.minFilter]||Mi,d.wrapS=fx[v.wrapS]||nr,d.wrapT=fx[v.wrapT]||nr,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]=m,m}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[tt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[tt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[tt.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 mr,It.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 Ft,It.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[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[tt.KHR_MATERIALS_UNLIT]){const h=r[tt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Ae(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;l.color.fromArray(p),l.opacity=p[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(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=er);const f=s.alphaMode||Tf.OPAQUE;return f===Tf.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===Tf.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(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!==dn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(l.emissive=new Ae().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===Sf?h=r[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=zr),h.emissiveMap&&(h.emissiveMap.encoding=zr),ls(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&Ua(r,h,s),h})}createUniqueName(e){const t=et.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[tt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return vx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=jB(c),h=r[f];if(h)o.push(h.promise);else{let p;c.extensions&&c.extensions[tt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=vx(new ke,c,t),r[f]={primitive:c,promise:p},o.push(p)}}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?GB(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,m=f.length;y<m;y++){const d=f[y],b=o[y];let v;const g=c[y];if(b.mode===Di.TRIANGLES||b.mode===Di.TRIANGLE_STRIP||b.mode===Di.TRIANGLE_FAN||b.mode===void 0)v=s.isSkinnedMesh===!0?new wa(d,g):new Et(d,g),v.isSkinnedMesh===!0&&!v.geometry.attributes.skinWeight.normalized&&v.normalizeSkinWeights(),b.mode===Di.TRIANGLE_STRIP?v.geometry=bx(v.geometry,My):b.mode===Di.TRIANGLE_FAN&&(v.geometry=bx(v.geometry,Fd));else if(b.mode===Di.LINES)v=new on(d,g);else if(b.mode===Di.LINE_STRIP)v=new ei(d,g);else if(b.mode===Di.LINE_LOOP)v=new Mc(d,g);else if(b.mode===Di.POINTS)v=new oo(d,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(v.geometry.morphAttributes).length>0&&WB(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),ls(v,s),b.extensions&&Ua(r,v,b),t.assignFinalMaterial(v),h.push(v)}if(h.length===1)return h[0];const p=new Qn;for(let y=0,m=h.length;y<m;y++)p.add(h[y]);return p})}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 Bt(Wd.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new So(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),ls(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],p=i.samplers[h.sampler],y=h.target,m=y.node!==void 0?y.node:y.id,d=i.parameters!==void 0?i.parameters[p.input]:p.input,b=i.parameters!==void 0?i.parameters[p.output]:p.output;r.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",d)),o.push(this.getDependency("accessor",b)),l.push(p),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],p=c[2],y=c[3],m=c[4],d=[];for(let v=0,g=f.length;v<g;v++){const w=f[v],S=h[v],E=p[v],M=y[v],_=m[v];if(w===void 0)continue;w.updateMatrix(),w.matrixAutoUpdate=!0;let C;switch(wr[_.path]){case wr.weights:C=xo;break;case wr.rotation:C=Qr;break;case wr.position:case wr.scale:default:C=wo;break}const I=w.name?w.name:w.uuid,T=M.interpolation!==void 0?UB[M.interpolation]:Fr,P=[];wr[_.path]===wr.weights?w.traverse(function(R){R.isMesh===!0&&R.morphTargetInfluences&&P.push(R.name?R.name:R.uuid)}):P.push(I);let A=E.array;if(E.normalized){const R=Ef(A.constructor),L=new Float32Array(A.length);for(let N=0,x=A.length;N<x;N++)L[N]=A[N]*R;A=L}for(let R=0,L=P.length;R<L;R++){const N=new C(P[R]+"."+wr[_.path],S.array,A,T);M.interpolation==="CUBICSPLINE"&&(N.createInterpolant=function(O){return new Ao(this.times,this.values,this.getValueSize()/3,O)},N.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),d.push(N)}}const b=i.name?i.name:"animation_"+e;return new Mo(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 Ma:l.length>1?u=new Qn:l.length===1?u=l[0]:u=new Ze,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),ls(u,s),s.extensions&&Ua(i,u,s),s.matrix!==void 0){const c=new Ne;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 Qn;r.name&&(o.name=s.createUniqueName(r.name)),ls(o,r),r.extensions&&Ua(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(yx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function yx(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,p=l.length;h<p;h++){const y=l[h];if(y){c.push(y);const m=new Ne;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,h*16),f.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}u.bind(new Sa(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(yx(f,s,t,i))}}return Promise.all(o)})}function ZB(n,e,t){const i=e.attributes,r=new un;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 q(u[0],u[1],u[2]),new q(c[0],c[1],c[2])),l.normalized){const f=Ef(za[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 q,u=new q;for(let c=0,f=s.length;c<f;c++){const h=s[c];if(h.POSITION!==void 0){const p=t.json.accessors[h.POSITION],y=p.min,m=p.max;if(y!==void 0&&m!==void 0){if(u.setX(Math.max(Math.abs(y[0]),Math.abs(m[0]))),u.setY(Math.max(Math.abs(y[1]),Math.abs(m[1]))),u.setZ(Math.max(Math.abs(y[2]),Math.abs(m[2]))),p.normalized){const d=Ef(za[p.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 Ei;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function vx(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=_f[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 ls(n,e),ZB(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?HB(n,e.targets,t):n})}function bx(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===Fd)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 XB=Rl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:CB},Symbol.toStringTag,{value:"Module"})));var Cf={exports:{}},xx;function YB(){return xx||(xx=1,function(n){function e(c){var f={};function h(y){if(f[y])return f[y].exports;var m=f[y]={i:y,l:!1,exports:{}};return c[y].call(m.exports,m,m.exports,h),m.l=!0,m.exports}h.m=c,h.c=f,h.i=function(y){return y},h.d=function(y,m,d){h.o(y,m)||Object.defineProperty(y,m,{configurable:!1,enumerable:!0,get:d})},h.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},h.n=function(y){var m=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(m,"a",m),m},h.o=function(y,m){return Object.prototype.hasOwnProperty.call(y,m)},h.p="/",h.oe=function(y){throw console.error(y),y};var p=h(h.s=ENTRY_MODULE);return p.default||p}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 p={};p[h]=[];var y=f.toString(),m=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return p;for(var d=m[1],b=new RegExp("(\\\\n|\\W)"+r(d)+i,"g"),v;v=b.exec(y);)v[3]!=="dll-reference"&&p[h].push(v[3]);for(b=new RegExp("\\("+r(d)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");v=b.exec(y);)c[v[2]]||(p[h].push(v[1]),c[v[2]]=__webpack_require__(v[1]).m),p[v[2]]=p[v[2]]||[],p[v[2]].push(v[4]);for(var g=Object.keys(p),w=0;w<g.length;w++)for(var S=0;S<p[g[w]].length;S++)s(p[g[w]][S])&&(p[g[w]][S]=1*p[g[w]][S]);return p}function l(c){var f=Object.keys(c);return f.reduce(function(h,p){return h||c[p].length>0},!1)}function u(c,f){for(var h={main:[f]},p={main:[]},y={main:{}};l(h);)for(var m=Object.keys(h),d=0;d<m.length;d++){var b=m[d],v=h[b],g=v.pop();if(y[b]=y[b]||{},!(y[b][g]||!c[b][g])){y[b][g]=!0,p[b]=p[b]||[],p[b].push(g);for(var w=o(c,c[b][g],b),S=Object.keys(w),E=0;E<S.length;E++)h[S[E]]=h[S[E]]||[],h[S[E]]=h[S[E]].concat(w[S[E]])}}return p}n.exports=function(c,f){f=f||{};var h={main:__webpack_modules__},p=f.all?{main:Object.keys(h.main)}:u(h,c),y="";Object.keys(p).filter(function(g){return g!=="main"}).forEach(function(g){for(var w=0;p[g][w];)w++;p[g].push(w),h[g][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+p[g].map(function(S){return""+JSON.stringify(S)+": "+h[g][S].toString()}).join(",")+`});
3182
- `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(Cf)),Cf.exports}function JB(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 KB(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 wx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}wx.prototype=Error.prototype;function qB(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 wx(s,"All promises were rejected"))})}catch(l){i(l)}})}var QB=setTimeout;function Mx(n){return!!(n&&typeof n.length<"u")}function eF(){}function tF(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))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=[],_x(n,this)}function Sx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Af:Ga)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ga(e.promise,r);return}Af(e.promise,i)})}function Af(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 pt){n._state=3,n._value=e,Rf(n);return}else if(typeof t=="function"){_x(tF(t,e),n);return}}n._state=1,n._value=e,Rf(n)}catch(i){Ga(n,i)}}function Ga(n,e){n._state=2,n._value=e,Rf(n)}function Rf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Sx(n,n._deferreds[e]);n._deferreds=null}function nF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function _x(n,e){var t=!1;try{n(function(i){t||(t=!0,Af(e,i))},function(i){t||(t=!0,Ga(e,i))})}catch(i){if(t)return;t=!0,Ga(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(eF);return Sx(this,new nF(n,e,t)),t},pt.prototype.finally=JB,pt.all=function(n){return new pt(function(e,t){if(!Mx(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])})},pt.any=qB,pt.allSettled=KB,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!Mx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){QB(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const iF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},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=JR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.12.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,m,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,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 S=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:S,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,m,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.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],w=this.geometry.vertices[this.geometry.faces[v].b],S=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((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((S.x+d.x)/b.x,(S.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,m){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var v=3*m;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}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=cB},(o,l,u)=>{function c(C){throw new TypeError('"'+C+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function y(C){var I=C,T=u(0).modelPrefix;return T&&(T[T.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(C)||(I=T+C)),I}function m(C,I){var T=(A,R)=>{try{var L=new URL(A,R).href;if(A&&2>A.split("?").length){var N=R.split("?");N.length===2&&(L=L+"?"+N[1])}return L}catch{console.error("There is an issue creating the url link with: ".concat(A,"."))}};if(!Array.isArray(C))return T(C,I);var P=[];return C.forEach(A=>{P.push(T(A,I))}),P}function d(C,I,T,P,A){var R=C.morphTargetInfluences,L=void 0;C.geometry&&(L=C.geometry.morphAttributes);var N=!1;if(R&&L&&L.position){P.set(0,0,0),A.set(0,0,0);for(var x=0;x<R.length;x++)0<R[x]&&(N=!0,T.setFromArray(L.position[x].array),P.add(T.min.multiplyScalar(R[x])),A.add(T.max.multiplyScalar(R[x])));N&&I.set(P,A)}N||I.setFromBufferAttribute(C.geometry.attributes.position),C.updateWorldMatrix(!0,!0),I.applyMatrix4(C.matrixWorld)}function b(C,I,T,P){var A=new XMLHttpRequest;A.open("GET",y(C),!0),A.onreadystatechange=()=>{A.readyState==4&&(A.status==200?T(A.responseText,I):P(C))},A.send(null)}function v(C,I,T){function P(x,O){L[O]=x,R++,R==A&&I(L)}for(var A=C.length,R=0,L=[],N=0;N<A;N++)b(C[N],N,P,T)}l.getColorsRGB=(C,I)=>{var T=Math.floor(I/3),P=I%3,A=0;P==0?A=C[T].r:P==1?A=C[T].g:P==2&&(A=C[T].b);var R=new f.Color(A);return[R.r,R.g,R.b]},l.updateMorphColorAttribute=function(C,I){if(I&&C&&C.morphAttributes&&C.morphAttributes.color){var T=C.morphAttributes.color,P=I.morphTargetInfluences,A=P.length;C.deleteAttribute("morphColor0"),C.deleteAttribute("morphColor1");for(var R=0,L=[],N=0;1>R||N<A;N++)0<P[N]&&(R++,L.push([N,P[N]]));L.length==2?(C.setAttribute("morphColor0",T[L[0][0]]),C.setAttribute("morphColor1",T[L[1][0]])):L.length==1&&(C.setAttribute("morphColor0",T[L[0][0]]),C.setAttribute("morphColor1",T[L[0][0]]))}},l.toBufferGeometry=(C,I)=>{var T;return C instanceof h?(I.localTimeEnabled&&!C.morphNormalsReady&&(C.morphNormals==null||C.morphNormals.length==0)&&C.computeMorphNormals(),T=C.toIndexedBufferGeometry(),I.localMorphColour&&g(C,T)):C instanceof f.BufferGeometry&&(T=C.clone()),T.colorsNeedUpdate=!0,T.computeBoundingBox(),T.computeBoundingSphere(),C._video&&(T._video=C._video),T},l.copyMorphColorsToBufferGeometry=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var T=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N=P[R],x=[],O=0;O<C.faces.length;O++){var B=C.faces[O],D=A(N.colors,B.a);x.push(D[0],D[1],D[2]),D=A(N.colors,B.b),x.push(D[0],D[1],D[2]),D=A(N.colors,B.c),x.push(D[0],D[1],D[2])}var z=new f.Float32BufferAttribute(3*(3*C.faces.length),3);z.name=N.name,T.push(z.copyArray(x))}I.morphAttributes.color=T}};var g=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var T=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N,x=P[R],O=[],B=0;B<3*x.colors.length;B++)N=A(x.colors,B),O.push(N[0],N[1],N[2]);var D=new f.Float32BufferAttribute(O,3);D.name=x.name,T.push(D)}I.morphAttributes.color=T}};l.mergeVertices=function(C){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;I=Math.max(I,Number.EPSILON);for(var T,P={},A=C.getIndex(),R=C.getAttribute("position"),L=A?A.count:R.count,N=0,x=Object.keys(C.attributes),O={},B={},fe=[],D=["getX","getY","getZ","getW"],z=0,U=x.length;z<U;z++){T=x[z],O[T]=[];var H=C.morphAttributes[T];H&&(B[T]=Array(H.length).fill().map(()=>[]))}for(var Y=Math.log10(1/I),ie=Math.pow(10,Y),z=0;z<L;z++){for(var ae=A?A.getX(z):z,ee="",oe=0,U=x.length;oe<U;oe++)for(var T=x[oe],j=C.getAttribute(T),K=j.itemSize,$=0;$<K;$++)ee+="".concat(~~(j[D[$]](ae)*ie),",");if(ee in P)fe.push(P[ee]);else{for(var oe=0,U=x.length;oe<U;oe++)for(var re,T=x[oe],j=C.getAttribute(T),H=C.morphAttributes[T],K=j.itemSize,G=O[T],W=B[T],$=0;$<K;$++)if(re=D[$],G.push(j[re](ae)),H)for(var F=0,X=H.length;F<X;F++)W[F].push(H[F][re](ae));P[ee]=N,fe.push(N),N++}}for(var J=C.clone(),z=0,U=x.length;z<U;z++){var j,T=x[z],V=C.getAttribute(T),k=new V.array.constructor(O[T]);if(V.isInterleavedBufferAttribute?j=new f.BufferAttribute(k,V.itemSize,V.itemSize):(j=C.getAttribute(T).clone(),j.setArray(k)),J.setAttribute(T,j),T in B)for(var te,oe=0;oe<B[T].length;oe++)te=C.morphAttributes[T][oe].clone(),te.setArray(new te.array.constructor(B[T][oe])),J.morphAttributes[T][oe]=te}var se=Uint8Array;fe.length>=Math.pow(2,8)&&(se=Uint16Array),fe.length>=Math.pow(2,16)&&(se=Uint32Array);var le=new se(fe),fe=null;return A===null?fe=new f.BufferAttribute(le,1):(fe=C.getIndex().clone(),fe.setArray(le)),J.setIndex(fe),J};function w(C){if(C.isMeshPhongMaterial){var I=new f.MeshToonMaterial({color:C.color.clone(),morphTargets:C.morphTargets,morphNormals:C.morphNormals,vertexColors:C.vertexColors,transparent:C.transparent,opacity:C.opacity,side:C.side});return C.map&&(I.map=C.map),I}return C}function S(C,I){if(I&&C>=I.length){var T=new f.BufferGeometry,P=new Float32Array(3*C),A=0;return I.forEach(R=>{P[A++]=R[0],P[A++]=R[1],P[A++]=R[2]}),T.setAttribute("position",new f.BufferAttribute(P,3)),T.setDrawRange(0,I.length),T}}function E(){var C=new Image;C.src=u(8);var I=new f.Texture;return I.image=C,I.needsUpdate=!0,I}function M(C,I,T,P,A,R){var L=new p(C,I,T,P,A,R);return L.fontFace=P,L.fontSize=A,L.fontWeight=R,L.material.map.generateMipmaps=!1,L.material.map.anisotropy=4,L.material.sizeAttenuation=!1,L.material.alphaTest=.5,L.material.transparent=!0,L.material.depthWrite=!1,L.material.depthTest=!1,L.center.set(.5,-1.2),L.renderOrder=1e4,L}function _(C,I,T){if(T){var P=C||"",A=I||"",R=T.lastIndexOf("/");if(-1<R){var L=void 0,N=void 0;if(L=T.substring(0,R),N=T.substring(R+1),(L==="*"||L==="**"||L.toLowerCase()===P.toLowerCase())&&(N==="*"||N==="**"||N.toLowerCase()===A.toLowerCase()))return!0}else if(P.toLowerCase()===T.toLowerCase()||A.toLowerCase()===T.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=w,l.createNewSpriteText=M,l.isRegionGroup=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,y=new c.Vector3;function m(){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}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,S=new c.Matrix3().getNormalMatrix(g),E=0,M=this.vertices.length;E<M;E++)w=this.vertices[E],w.applyMatrix4(g);for(var _,C=0,I=this.faces.length;C<I;C++){_=this.faces[C],_.normal.applyMatrix3(S).normalize();for(var T=0,P=_.vertexNormals.length;T<P;T++)_.vertexNormals[T].applyMatrix3(S).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,w,S){return f.makeTranslation(g,w,S),this.applyMatrix4(f),this},scale:function(g,w,S){return f.makeScale(g,w,S),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(H,Y,ie,ae){var ee=I===void 0?[]:[S.colors[H].clone(),S.colors[Y].clone(),S.colors[ie].clone()],oe=C===void 0?[]:[new c.Vector3().fromBufferAttribute(C,H),new c.Vector3().fromBufferAttribute(C,Y),new c.Vector3().fromBufferAttribute(C,ie)],j=new b(H,Y,ie,oe,ee,ae);S.faces.push(j),T!==void 0&&S.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(T,H),new c.Vector2().fromBufferAttribute(T,Y),new c.Vector2().fromBufferAttribute(T,ie)]),P!==void 0&&S.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(P,H),new c.Vector2().fromBufferAttribute(P,Y),new c.Vector2().fromBufferAttribute(P,ie)])}var S=this,E=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var _=M.position,C=M.normal,I=M.color,T=M.uv,P=M.uv2;P!==void 0&&(this.faceVertexUvs[1]=[]);for(var A=0;A<_.count;A++)S.vertices.push(new c.Vector3().fromBufferAttribute(_,A)),I!==void 0&&S.colors.push(new c.Color().fromBufferAttribute(I,A));var R=g.groups;if(0<R.length)for(var L=0;L<R.length;L++)for(var N=R[L],x=N.start,O=N.count,B=x,D=x+O;B<D;B+=3)E===void 0?w(B,B+1,B+2,N.materialIndex):w(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var z=0;z<E.count;z+=3)w(E.getX(z),E.getX(z+1),E.getX(z+2));else for(var U=0;U<_.count;U+=3)w(U,U+1,U+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(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,S=w===0?1:1/w,E=new c.Matrix4;return E.set(S,0,0,-S*g.x,0,S,0,-S*g.y,0,0,S,-S*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,S=0,E=this.faces.length;S<E;S++){var M=this.faces[S],_=this.vertices[M.a],C=this.vertices[M.b],I=this.vertices[M.c];g.subVectors(I,C),w.subVectors(_,C),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),S=0,E=this.vertices.length;S<E;S++)w[S]=new c.Vector3;if(g)for(var M=new c.Vector3,_=new c.Vector3,C=0,I=this.faces.length;C<I;C++){var T=this.faces[C],P=this.vertices[T.a],A=this.vertices[T.b],R=this.vertices[T.c];M.subVectors(R,A),_.subVectors(P,A),M.cross(_),w[T.a].add(M),w[T.b].add(M),w[T.c].add(M)}else{this.computeFaceNormals();for(var L,N=0,x=this.faces.length;N<x;N++)L=this.faces[N],w[L.a].add(L.normal),w[L.b].add(L.normal),w[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)w[O].normalize();for(var D=0,z=this.faces.length;D<z;D++){var U=this.faces[D],H=U.vertexNormals;H.length===3?(H[0].copy(w[U.a]),H[1].copy(w[U.b]),H[2].copy(w[U.c])):(H[0]=w[U.a].clone(),H[1]=w[U.b].clone(),H[2]=w[U.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var S=this.faces[g],E=S.vertexNormals;E.length===3?(E[0].copy(S.normal),E[1].copy(S.normal),E[2].copy(S.normal)):(E[0]=S.normal.clone(),E[1]=S.normal.clone(),E[2]=S.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,S=this.faces.length;w<S;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,M=g.vertexNormals.length;E<M;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var _=new m;_.faces=this.faces;for(var C=0,I=this.morphTargets.length;C<I;C++){if(!this.morphNormals[C]){this.morphNormals[C]={},this.morphNormals[C].faceNormals=[],this.morphNormals[C].vertexNormals=[];for(var T=this.morphNormals[C].faceNormals,P=this.morphNormals[C].vertexNormals,A=0,R=this.faces.length;A<R;A++){var L=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};T.push(L),P.push(N)}}var x=this.morphNormals[C];_.vertices=this.morphTargets[C].vertices,_.computeFaceNormals();var O=_.computeVertexNormals();if(O&&0<O.length){this.morphTargets[C].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[C].normals[B]=O[B].clone()}for(var D=0,z=this.faces.length;D<z;D++){var U=this.faces[D],H=x.faceNormals[D],Y=x.vertexNormals[D];H.copy(U.normal),Y.a.copy(U.vertexNormals[0]),Y.b.copy(U.vertexNormals[1]),Y.c.copy(U.vertexNormals[2])}}for(var ie,ae=0,ee=this.faces.length;ae<ee;ae++)ie=this.faces[ae],ie.normal=ie.__originalFaceNormal,ie.vertexNormals=ie.__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,w){var S=this.morphTargets.length,E=this.morphTargets,M=g.morphTargets,_=this.morphColors.length,C=this.morphColors,I=g.morphColors;if(0<S&&S==M.length)for(var T=0,P=E.length;T<P;T++){for(var A=E[T],R=M[T],L=0,N=R.vertices.length;L<N;L++){var x=R.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),A.vertices.push(O)}if(A.normals&&R.normals)for(var B=0;B<R.normals.length;B+=3)y.set(R.normals2[B],R.normals2[B+1],R.normals2[B+2]),w!==void 0&&y.applyMatrix4(w),A.normals.push(y.x,y.y,y.z)}if(0<_&&_==I.length)for(var D=0,z=C.length;D<z;D++)for(var U=C[D],H=I[D],Y=0,ie=H.colors;Y<ie;Y++)U.colors.push(H.colors[Y].clone())},merge:function(g,w){var S=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,M=this.vertices.length,_=this.vertices,C=g.vertices,I=g.normals,T=this.faces,P=g.faces,A=this.colors,R=g.colors;w!==void 0&&(E=new c.Matrix3().getNormalMatrix(w));for(var L=0,N=C.length;L<N;L++){var x=C[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),_.push(O)}for(var B=0;B<I.length;B+=3)y.set(I[B],I[B+1],I[B+2]),w!==void 0&&y.applyMatrix4(w),this.normals.push(y.x,y.y,y.z);for(var D=0,z=R.length;D<z;D++)typeof R[D]=="number"?A.push(R[D]):A.push(R[D].clone());for(var U=0,H=P.length;U<H;U++){var Y=P[U],ie=void 0,ae=void 0,ee=Y.vertexNormals,oe=Y.vertexColors,j=new b(Y.a+M,Y.b+M,Y.c+M);j.normal.copy(Y.normal),E!==void 0&&j.normal.applyMatrix3(E).normalize();for(var K=0,$=ee.length;K<$;K++)ie=ee[K].clone(),E!==void 0&&ie.applyMatrix3(E).normalize(),j.vertexNormals.push(ie);j.color.copy(Y.color);for(var re=0,G=oe.length;re<G;re++)ae=oe[re],j.vertexColors.push(ae.clone());j.materialIndex=Y.materialIndex+S,T.push(j)}for(var W,F=0,X=g.faceVertexUvs.length;F<X;F++){W=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var J=0,V=W.length;J<V;J++){for(var k=W[J],te=[],se=0,le=k.length;se<le;se++)te.push(k[se].clone());this.faceVertexUvs[F].push(te)}}this.mergeMorph(g,w)},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,w={},S=[],E=[],M=Math.pow(10,g),_=0,C=this.vertices.length;_<C;_++){var I=this.vertices[_],T=Math.round(I.x*M)+"_"+Math.round(I.y*M)+"_"+Math.round(I.z*M);w[T]===void 0?(w[T]=_,S.push(this.vertices[_]),E[_]=S.length-1):E[_]=E[w[T]]}for(var P,A=[],R=0,L=this.faces.length;R<L;R++){P=this.faces[R],P.a=E[P.a],P.b=E[P.b],P.c=E[P.c];for(var N=[P.a,P.b,P.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){A.push(R);break}}for(var O,B=A.length-1;0<=B;B--){O=A[B],this.faces.splice(O,1);for(var D=0,z=this.faceVertexUvs.length;D<z;D++)this.faceVertexUvs[D].splice(O,1)}var U=this.vertices.length-S.length;return this.vertices=S,U},setFromPoints:function(g){this.vertices=[];for(var w,S=0,E=g.length;S<E;S++)w=g[S],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,S=0;S<w;S++)g[S]._id=S;g.sort(function(P,A){return P.materialIndex-A.materialIndex});var E,M,_=this.faceVertexUvs[0],C=this.faceVertexUvs[1];_&&_.length===w&&(E=[]),C&&C.length===w&&(M=[]);for(var I,T=0;T<w;T++)I=g[T]._id,E&&E.push(_[I]),M&&M.push(C[I]);E&&(this.faceVertexUvs[0]=E),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(G,W,F){return F?G|1<<W:G&~(1<<W)}function w(G){var W=G.x.toString()+G.y.toString()+G.z.toString();return L[W]===void 0&&(L[W]=R.length/3,R.push(G.x,G.y,G.z)),L[W]}function S(G){var W=G.r.toString()+G.g.toString()+G.b.toString();return x[W]===void 0&&(x[W]=N.length,N.push(G.getHex())),x[W]}function E(G){var W=G.x.toString()+G.y.toString();return B[W]===void 0&&(B[W]=O.length/2,O.push(G.x,G.y)),B[W]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var _=this.parameters;for(var C in _)_[C]!==void 0&&(M[C]=_[C]);return M}for(var I,T=[],P=0;P<this.vertices.length;P++)I=this.vertices[P],T.push(I.x,I.y,I.z);for(var A=[],R=[],L={},N=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var z=this.faces[D],U=!0,H=!1,Y=this.faceVertexUvs[0][D]!==void 0,ie=0<z.normal.length(),ae=0<z.vertexNormals.length,ee=z.color.r!==1||z.color.g!==1||z.color.b!==1,oe=0<z.vertexColors.length,j=0;if(j=g(j,0,0),j=g(j,1,U),j=g(j,2,H),j=g(j,3,Y),j=g(j,4,ie),j=g(j,5,ae),j=g(j,6,ee),j=g(j,7,oe),A.push(j),A.push(z.a,z.b,z.c),A.push(z.materialIndex),Y){var K=this.faceVertexUvs[0][D];A.push(E(K[0]),E(K[1]),E(K[2]))}if(ie&&A.push(w(z.normal)),ae){var $=z.vertexNormals;A.push(w($[0]),w($[1]),w($[2]))}if(ee&&A.push(S(z.color)),oe){var re=z.vertexColors;A.push(S(re[0]),S(re[1]),S(re[2]))}}return M.data={},M.data.vertices=T,M.data.normals=R,0<N.length&&(M.data.colors=N),0<O.length&&(M.data.uvs=[O]),M.data.faces=A,M},clone:function(){return new m().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 w=g.vertices,S=0,E=w.length;S<E;S++)this.vertices.push(w[S].clone());for(var M=g.colors,_=0,C=M.length;_<C;_++)this.colors.push(M[_].clone());for(var I=g.faces,T=0,P=I.length;T<P;T++)this.faces.push(I[T].clone());for(var A,R=0,L=g.faceVertexUvs.length;R<L;R++){A=g.faceVertexUvs[R],this.faceVertexUvs[R]===void 0&&(this.faceVertexUvs[R]=[]);for(var N=0,x=A.length;N<x;N++){for(var O,B=A[N],D=[],z=0,U=B.length;z<U;z++)O=B[z],D.push(O.clone());this.faceVertexUvs[R].push(D)}}for(var H,Y=g.morphTargets,ie=0,ae=Y.length;ie<ae;ie++){if(H={},H.name=Y[ie].name,Y[ie].vertices!==void 0){H.vertices=[];for(var ee=0,oe=Y[ie].vertices.length;ee<oe;ee++)H.vertices.push(Y[ie].vertices[ee].clone())}if(Y[ie].normals!==void 0){H.normals=[];for(var j=0,K=Y[ie].normals.length;j<K;j++)H.normals.push(Y[ie].normals[j].clone())}this.morphTargets.push(H)}for(var $,re=g.morphNormals,G=0,W=re.length;G<W;G++){if($={},re[G].vertexNormals!==void 0){$.vertexNormals=[];for(var F=0,X=re[G].vertexNormals.length;F<X;F++){var J=re[G].vertexNormals[F],V={};V.a=J.a.clone(),V.b=J.b.clone(),V.c=J.c.clone(),$.vertexNormals.push(V)}}if(re[G].faceNormals!==void 0){$.faceNormals=[];for(var k=0,te=re[G].faceNormals.length;k<te;k++)$.faceNormals.push(re[G].faceNormals[k].clone())}this.morphNormals.push($)}for(var se=g.skinWeights,le=0,fe=se.length;le<fe;le++)this.skinWeights.push(se[le].clone());for(var we=g.skinIndices,be=0,de=we.length;be<de;be++)this.skinIndices.push(we[be].clone());for(var ye=g.lineDistances,ne=0,he=ye.length;ne<he;ne++)this.lineDistances.push(ye[ne]);var me=g.boundingBox;me!==null&&(this.boundingBox=me.clone());var Re=g.boundingSphere;return Re!==null&&(this.boundingSphere=Re.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,w=[],S=void 0,E=this.faces;for(g=0;g<E.length;g++){var M=E[g];M.materialIndex!==S&&(S=M.materialIndex,v!==void 0&&(v.count=3*g-v.start,w.push(v)),v={start:3*g,materialIndex:S})}return v!==void 0&&(v.count=3*g-v.start,w.push(v)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,S=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(S,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var _=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(_,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var C=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(C,2).copyVector2sArray(g.uvs2))}for(var I in w.groups=g.groups,g.morphTargets){for(var T=[],P=g.morphTargets[I],A=0,R=P.length;A<R;A++){var L=P[A],N=new c.Float32BufferAttribute(3*L.data.length,3);N.name=L.name,T.push(N.copyVector3sArray(L.data))}w.morphAttributes[I]=T}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var S=new Float32Array(this.normals.length),E=new c.BufferAttribute(S,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var _=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(_,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var C=[],I=0;I<this.colors.length;I++)C.push(new c.Color(this.colors[I]));var T=new Float32Array(3*C.length);g.setAttribute("color",new c.BufferAttribute(T,3).copyColorsArray(C))}else{for(var P=new Float32Array(3*this.vertices.length),A=0;A<3*this.vertices.length;A++)P[A]=1;g.setAttribute("color",new c.BufferAttribute(P,3))}if(0<this.faces.length){for(var R=[],L=[],N=0;N<this.faces.length;N++){L.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)R.push(x[0],x[1],x[2]);else{var O=this.faces[N].color;R.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],z=0,U=this.morphTargets.length;z<U;z++){var H=this.morphTargets[z],Y=new c.Float32BufferAttribute(3*H.vertices.length,3);if(Y.name=H.name,B.push(Y.copyVector3sArray(H.vertices)),H.normals){var ie=new c.Float32BufferAttribute(3*H.normals.length,3);ie.name=H.name,D.push(ie.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var ae=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",ae.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ee=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ee.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"})}}),m.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,w=v.geometry;if(v.isPoints||v.isLine){var S=new c.Float32BufferAttribute(3*w.vertices.length,3),E=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",S.copyVector3sArray(w.vertices)),g.setAttribute("color",E.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else v.isMesh&&(g=w.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 w,S,E=[],M=void 0,_=g.faces;for(S=0;S<_.length;S++){var C=_[S];C.materialIndex!==M&&(M=C.materialIndex,w!==void 0&&(w.count=3*S-w.start,E.push(w)),w={start:3*S,materialIndex:M})}w!==void 0&&(w.count=3*S-w.start,E.push(w)),this.groups=E}fromGeometry(g){var w,S=g.faces,E=g.vertices,M=g.faceVertexUvs,_=M[0]&&0<M[0].length,C=M[1]&&0<M[1].length,I=g.morphTargets,T=I.length;if(0<T){w=[];for(var P=0;P<T;P++)w[P]={name:I[P].name,data:[]};this.morphTargets.position=w}var A,R=g.morphNormals,L=R.length;if(0<L){A=[];for(var N=0;N<L;N++)A[N]={name:R[N].name,data:[]};this.morphTargets.normal=A}var x=g.skinIndices,O=g.skinWeights,B=x.length===E.length,D=O.length===E.length;0<E.length&&S.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var z,U=0;U<S.length;U++){z=S[U],this.vertices.push(E[z.a],E[z.b],E[z.c]);var H=z.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var Y=z.normal;this.normals.push(Y,Y,Y)}var ie=z.vertexColors;if(ie.length===3)this.colors.push(ie[0],ie[1],ie[2]);else{var ae=z.color;this.colors.push(ae,ae,ae)}if(_===!0){var ee=M[0][U];ee===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",U),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ee[0],ee[1],ee[2])}if(C===!0){var oe=M[1][U];oe===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",U),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(oe[0],oe[1],oe[2])}for(var j,K=0;K<T;K++)j=I[K].vertices,w[K].data.push(j[z.a],j[z.b],j[z.c]);for(var $,re=0;re<L;re++)$=R[re].vertexNormals[U],A[re].data.push($.a,$.b,$.c);B&&this.skinIndices.push(x[z.a],x[z.b],x[z.c]),D&&this.skinWeights.push(O[z.a],O[z.b],O[z.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,w,S,E,M){var _=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=S,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=_}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 w=0,S=g.vertexNormals.length;w<S;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var E=0,M=g.vertexColors.length;E<M;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=TB},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))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(Cf)),Cf.exports}function JB(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 KB(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 wx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}wx.prototype=Error.prototype;function qB(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 wx(s,"All promises were rejected"))})}catch(l){i(l)}})}var QB=setTimeout;function Mx(n){return!!(n&&typeof n.length<"u")}function eF(){}function tF(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))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=[],_x(n,this)}function Sx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Af:Ga)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ga(e.promise,r);return}Af(e.promise,i)})}function Af(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 pt){n._state=3,n._value=e,Rf(n);return}else if(typeof t=="function"){_x(tF(t,e),n);return}}n._state=1,n._value=e,Rf(n)}catch(i){Ga(n,i)}}function Ga(n,e){n._state=2,n._value=e,Rf(n)}function Rf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Sx(n,n._deferreds[e]);n._deferreds=null}function nF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function _x(n,e){var t=!1;try{n(function(i){t||(t=!0,Af(e,i))},function(i){t||(t=!0,Ga(e,i))})}catch(i){if(t)return;t=!0,Ga(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(eF);return Sx(this,new nF(n,e,t)),t},pt.prototype.finally=JB,pt.all=function(n){return new pt(function(e,t){if(!Mx(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])})},pt.any=qB,pt.allSettled=KB,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!Mx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){QB(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const iF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},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=JR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.12.1","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,m,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,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 S=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:S,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,m,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.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],w=this.geometry.vertices[this.geometry.faces[v].b],S=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((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((S.x+d.x)/b.x,(S.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,m){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var v=3*m;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}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=cB},(o,l,u)=>{function c(C){throw new TypeError('"'+C+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function y(C){var I=C,T=u(0).modelPrefix;return T&&(T[T.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(C)||(I=T+C)),I}function m(C,I){var T=(A,R)=>{try{var L=new URL(A,R).href;if(A&&2>A.split("?").length){var N=R.split("?");N.length===2&&(L=L+"?"+N[1])}return L}catch{console.error("There is an issue creating the url link with: ".concat(A,"."))}};if(!Array.isArray(C))return T(C,I);var P=[];return C.forEach(A=>{P.push(T(A,I))}),P}function d(C,I,T,P,A){var R=C.morphTargetInfluences,L=void 0;C.geometry&&(L=C.geometry.morphAttributes);var N=!1;if(R&&L&&L.position){P.set(0,0,0),A.set(0,0,0);for(var x=0;x<R.length;x++)0<R[x]&&(N=!0,T.setFromArray(L.position[x].array),P.add(T.min.multiplyScalar(R[x])),A.add(T.max.multiplyScalar(R[x])));N&&I.set(P,A)}N||I.setFromBufferAttribute(C.geometry.attributes.position),C.updateWorldMatrix(!0,!0),I.applyMatrix4(C.matrixWorld)}function b(C,I,T,P){var A=new XMLHttpRequest;A.open("GET",y(C),!0),A.onreadystatechange=()=>{A.readyState==4&&(A.status==200?T(A.responseText,I):P(C))},A.send(null)}function v(C,I,T){function P(x,O){L[O]=x,R++,R==A&&I(L)}for(var A=C.length,R=0,L=[],N=0;N<A;N++)b(C[N],N,P,T)}l.getColorsRGB=(C,I)=>{var T=Math.floor(I/3),P=I%3,A=0;P==0?A=C[T].r:P==1?A=C[T].g:P==2&&(A=C[T].b);var R=new f.Color(A);return[R.r,R.g,R.b]},l.updateMorphColorAttribute=function(C,I){if(I&&C&&C.morphAttributes&&C.morphAttributes.color){var T=C.morphAttributes.color,P=I.morphTargetInfluences,A=P.length;C.deleteAttribute("morphColor0"),C.deleteAttribute("morphColor1");for(var R=0,L=[],N=0;1>R||N<A;N++)0<P[N]&&(R++,L.push([N,P[N]]));L.length==2?(C.setAttribute("morphColor0",T[L[0][0]]),C.setAttribute("morphColor1",T[L[1][0]])):L.length==1&&(C.setAttribute("morphColor0",T[L[0][0]]),C.setAttribute("morphColor1",T[L[0][0]]))}},l.toBufferGeometry=(C,I)=>{var T;return C instanceof h?(I.localTimeEnabled&&!C.morphNormalsReady&&(C.morphNormals==null||C.morphNormals.length==0)&&C.computeMorphNormals(),T=C.toIndexedBufferGeometry(),I.localMorphColour&&g(C,T)):C instanceof f.BufferGeometry&&(T=C.clone()),T.colorsNeedUpdate=!0,T.computeBoundingBox(),T.computeBoundingSphere(),C._video&&(T._video=C._video),T},l.copyMorphColorsToBufferGeometry=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var T=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N=P[R],x=[],O=0;O<C.faces.length;O++){var B=C.faces[O],D=A(N.colors,B.a);x.push(D[0],D[1],D[2]),D=A(N.colors,B.b),x.push(D[0],D[1],D[2]),D=A(N.colors,B.c),x.push(D[0],D[1],D[2])}var z=new f.Float32BufferAttribute(3*(3*C.faces.length),3);z.name=N.name,T.push(z.copyArray(x))}I.morphAttributes.color=T}};var g=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var T=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N,x=P[R],O=[],B=0;B<3*x.colors.length;B++)N=A(x.colors,B),O.push(N[0],N[1],N[2]);var D=new f.Float32BufferAttribute(O,3);D.name=x.name,T.push(D)}I.morphAttributes.color=T}};l.mergeVertices=function(C){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;I=Math.max(I,Number.EPSILON);for(var T,P={},A=C.getIndex(),R=C.getAttribute("position"),L=A?A.count:R.count,N=0,x=Object.keys(C.attributes),O={},B={},fe=[],D=["getX","getY","getZ","getW"],z=0,U=x.length;z<U;z++){T=x[z],O[T]=[];var H=C.morphAttributes[T];H&&(B[T]=Array(H.length).fill().map(()=>[]))}for(var Y=Math.log10(1/I),ie=Math.pow(10,Y),z=0;z<L;z++){for(var ae=A?A.getX(z):z,ee="",oe=0,U=x.length;oe<U;oe++)for(var T=x[oe],j=C.getAttribute(T),K=j.itemSize,$=0;$<K;$++)ee+="".concat(~~(j[D[$]](ae)*ie),",");if(ee in P)fe.push(P[ee]);else{for(var oe=0,U=x.length;oe<U;oe++)for(var re,T=x[oe],j=C.getAttribute(T),H=C.morphAttributes[T],K=j.itemSize,G=O[T],W=B[T],$=0;$<K;$++)if(re=D[$],G.push(j[re](ae)),H)for(var F=0,X=H.length;F<X;F++)W[F].push(H[F][re](ae));P[ee]=N,fe.push(N),N++}}for(var J=C.clone(),z=0,U=x.length;z<U;z++){var j,T=x[z],V=C.getAttribute(T),k=new V.array.constructor(O[T]);if(V.isInterleavedBufferAttribute?j=new f.BufferAttribute(k,V.itemSize,V.itemSize):(j=C.getAttribute(T).clone(),j.setArray(k)),J.setAttribute(T,j),T in B)for(var te,oe=0;oe<B[T].length;oe++)te=C.morphAttributes[T][oe].clone(),te.setArray(new te.array.constructor(B[T][oe])),J.morphAttributes[T][oe]=te}var se=Uint8Array;fe.length>=Math.pow(2,8)&&(se=Uint16Array),fe.length>=Math.pow(2,16)&&(se=Uint32Array);var le=new se(fe),fe=null;return A===null?fe=new f.BufferAttribute(le,1):(fe=C.getIndex().clone(),fe.setArray(le)),J.setIndex(fe),J};function w(C){if(C.isMeshPhongMaterial){var I=new f.MeshToonMaterial({color:C.color.clone(),morphTargets:C.morphTargets,morphNormals:C.morphNormals,vertexColors:C.vertexColors,transparent:C.transparent,opacity:C.opacity,side:C.side});return C.map&&(I.map=C.map),I}return C}function S(C,I){if(I&&C>=I.length){var T=new f.BufferGeometry,P=new Float32Array(3*C),A=0;return I.forEach(R=>{P[A++]=R[0],P[A++]=R[1],P[A++]=R[2]}),T.setAttribute("position",new f.BufferAttribute(P,3)),T.setDrawRange(0,I.length),T}}function E(){var C=new Image;C.src=u(8);var I=new f.Texture;return I.image=C,I.needsUpdate=!0,I}function M(C,I,T,P,A,R){var L=new p(C,I,T,P,A,R);return L.fontFace=P,L.fontSize=A,L.fontWeight=R,L.material.map.generateMipmaps=!1,L.material.map.anisotropy=4,L.material.sizeAttenuation=!1,L.material.alphaTest=.5,L.material.transparent=!0,L.material.depthWrite=!1,L.material.depthTest=!1,L.center.set(.5,-1.2),L.renderOrder=1e4,L}function _(C,I,T){if(T){var P=C||"",A=I||"",R=T.lastIndexOf("/");if(-1<R){var L=void 0,N=void 0;if(L=T.substring(0,R),N=T.substring(R+1),(L==="*"||L==="**"||L.toLowerCase()===P.toLowerCase())&&(N==="*"||N==="**"||N.toLowerCase()===A.toLowerCase()))return!0}else if(P.toLowerCase()===T.toLowerCase()||A.toLowerCase()===T.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=w,l.createNewSpriteText=M,l.isRegionGroup=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,y=new c.Vector3;function m(){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}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,S=new c.Matrix3().getNormalMatrix(g),E=0,M=this.vertices.length;E<M;E++)w=this.vertices[E],w.applyMatrix4(g);for(var _,C=0,I=this.faces.length;C<I;C++){_=this.faces[C],_.normal.applyMatrix3(S).normalize();for(var T=0,P=_.vertexNormals.length;T<P;T++)_.vertexNormals[T].applyMatrix3(S).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,w,S){return f.makeTranslation(g,w,S),this.applyMatrix4(f),this},scale:function(g,w,S){return f.makeScale(g,w,S),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(H,Y,ie,ae){var ee=I===void 0?[]:[S.colors[H].clone(),S.colors[Y].clone(),S.colors[ie].clone()],oe=C===void 0?[]:[new c.Vector3().fromBufferAttribute(C,H),new c.Vector3().fromBufferAttribute(C,Y),new c.Vector3().fromBufferAttribute(C,ie)],j=new b(H,Y,ie,oe,ee,ae);S.faces.push(j),T!==void 0&&S.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(T,H),new c.Vector2().fromBufferAttribute(T,Y),new c.Vector2().fromBufferAttribute(T,ie)]),P!==void 0&&S.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(P,H),new c.Vector2().fromBufferAttribute(P,Y),new c.Vector2().fromBufferAttribute(P,ie)])}var S=this,E=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var _=M.position,C=M.normal,I=M.color,T=M.uv,P=M.uv2;P!==void 0&&(this.faceVertexUvs[1]=[]);for(var A=0;A<_.count;A++)S.vertices.push(new c.Vector3().fromBufferAttribute(_,A)),I!==void 0&&S.colors.push(new c.Color().fromBufferAttribute(I,A));var R=g.groups;if(0<R.length)for(var L=0;L<R.length;L++)for(var N=R[L],x=N.start,O=N.count,B=x,D=x+O;B<D;B+=3)E===void 0?w(B,B+1,B+2,N.materialIndex):w(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var z=0;z<E.count;z+=3)w(E.getX(z),E.getX(z+1),E.getX(z+2));else for(var U=0;U<_.count;U+=3)w(U,U+1,U+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(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,S=w===0?1:1/w,E=new c.Matrix4;return E.set(S,0,0,-S*g.x,0,S,0,-S*g.y,0,0,S,-S*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,S=0,E=this.faces.length;S<E;S++){var M=this.faces[S],_=this.vertices[M.a],C=this.vertices[M.b],I=this.vertices[M.c];g.subVectors(I,C),w.subVectors(_,C),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),S=0,E=this.vertices.length;S<E;S++)w[S]=new c.Vector3;if(g)for(var M=new c.Vector3,_=new c.Vector3,C=0,I=this.faces.length;C<I;C++){var T=this.faces[C],P=this.vertices[T.a],A=this.vertices[T.b],R=this.vertices[T.c];M.subVectors(R,A),_.subVectors(P,A),M.cross(_),w[T.a].add(M),w[T.b].add(M),w[T.c].add(M)}else{this.computeFaceNormals();for(var L,N=0,x=this.faces.length;N<x;N++)L=this.faces[N],w[L.a].add(L.normal),w[L.b].add(L.normal),w[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)w[O].normalize();for(var D=0,z=this.faces.length;D<z;D++){var U=this.faces[D],H=U.vertexNormals;H.length===3?(H[0].copy(w[U.a]),H[1].copy(w[U.b]),H[2].copy(w[U.c])):(H[0]=w[U.a].clone(),H[1]=w[U.b].clone(),H[2]=w[U.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var S=this.faces[g],E=S.vertexNormals;E.length===3?(E[0].copy(S.normal),E[1].copy(S.normal),E[2].copy(S.normal)):(E[0]=S.normal.clone(),E[1]=S.normal.clone(),E[2]=S.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,S=this.faces.length;w<S;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,M=g.vertexNormals.length;E<M;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var _=new m;_.faces=this.faces;for(var C=0,I=this.morphTargets.length;C<I;C++){if(!this.morphNormals[C]){this.morphNormals[C]={},this.morphNormals[C].faceNormals=[],this.morphNormals[C].vertexNormals=[];for(var T=this.morphNormals[C].faceNormals,P=this.morphNormals[C].vertexNormals,A=0,R=this.faces.length;A<R;A++){var L=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};T.push(L),P.push(N)}}var x=this.morphNormals[C];_.vertices=this.morphTargets[C].vertices,_.computeFaceNormals();var O=_.computeVertexNormals();if(O&&0<O.length){this.morphTargets[C].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[C].normals[B]=O[B].clone()}for(var D=0,z=this.faces.length;D<z;D++){var U=this.faces[D],H=x.faceNormals[D],Y=x.vertexNormals[D];H.copy(U.normal),Y.a.copy(U.vertexNormals[0]),Y.b.copy(U.vertexNormals[1]),Y.c.copy(U.vertexNormals[2])}}for(var ie,ae=0,ee=this.faces.length;ae<ee;ae++)ie=this.faces[ae],ie.normal=ie.__originalFaceNormal,ie.vertexNormals=ie.__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,w){var S=this.morphTargets.length,E=this.morphTargets,M=g.morphTargets,_=this.morphColors.length,C=this.morphColors,I=g.morphColors;if(0<S&&S==M.length)for(var T=0,P=E.length;T<P;T++){for(var A=E[T],R=M[T],L=0,N=R.vertices.length;L<N;L++){var x=R.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),A.vertices.push(O)}if(A.normals&&R.normals)for(var B=0;B<R.normals.length;B+=3)y.set(R.normals2[B],R.normals2[B+1],R.normals2[B+2]),w!==void 0&&y.applyMatrix4(w),A.normals.push(y.x,y.y,y.z)}if(0<_&&_==I.length)for(var D=0,z=C.length;D<z;D++)for(var U=C[D],H=I[D],Y=0,ie=H.colors;Y<ie;Y++)U.colors.push(H.colors[Y].clone())},merge:function(g,w){var S=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,M=this.vertices.length,_=this.vertices,C=g.vertices,I=g.normals,T=this.faces,P=g.faces,A=this.colors,R=g.colors;w!==void 0&&(E=new c.Matrix3().getNormalMatrix(w));for(var L=0,N=C.length;L<N;L++){var x=C[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),_.push(O)}for(var B=0;B<I.length;B+=3)y.set(I[B],I[B+1],I[B+2]),w!==void 0&&y.applyMatrix4(w),this.normals.push(y.x,y.y,y.z);for(var D=0,z=R.length;D<z;D++)typeof R[D]=="number"?A.push(R[D]):A.push(R[D].clone());for(var U=0,H=P.length;U<H;U++){var Y=P[U],ie=void 0,ae=void 0,ee=Y.vertexNormals,oe=Y.vertexColors,j=new b(Y.a+M,Y.b+M,Y.c+M);j.normal.copy(Y.normal),E!==void 0&&j.normal.applyMatrix3(E).normalize();for(var K=0,$=ee.length;K<$;K++)ie=ee[K].clone(),E!==void 0&&ie.applyMatrix3(E).normalize(),j.vertexNormals.push(ie);j.color.copy(Y.color);for(var re=0,G=oe.length;re<G;re++)ae=oe[re],j.vertexColors.push(ae.clone());j.materialIndex=Y.materialIndex+S,T.push(j)}for(var W,F=0,X=g.faceVertexUvs.length;F<X;F++){W=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var J=0,V=W.length;J<V;J++){for(var k=W[J],te=[],se=0,le=k.length;se<le;se++)te.push(k[se].clone());this.faceVertexUvs[F].push(te)}}this.mergeMorph(g,w)},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,w={},S=[],E=[],M=Math.pow(10,g),_=0,C=this.vertices.length;_<C;_++){var I=this.vertices[_],T=Math.round(I.x*M)+"_"+Math.round(I.y*M)+"_"+Math.round(I.z*M);w[T]===void 0?(w[T]=_,S.push(this.vertices[_]),E[_]=S.length-1):E[_]=E[w[T]]}for(var P,A=[],R=0,L=this.faces.length;R<L;R++){P=this.faces[R],P.a=E[P.a],P.b=E[P.b],P.c=E[P.c];for(var N=[P.a,P.b,P.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){A.push(R);break}}for(var O,B=A.length-1;0<=B;B--){O=A[B],this.faces.splice(O,1);for(var D=0,z=this.faceVertexUvs.length;D<z;D++)this.faceVertexUvs[D].splice(O,1)}var U=this.vertices.length-S.length;return this.vertices=S,U},setFromPoints:function(g){this.vertices=[];for(var w,S=0,E=g.length;S<E;S++)w=g[S],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,S=0;S<w;S++)g[S]._id=S;g.sort(function(P,A){return P.materialIndex-A.materialIndex});var E,M,_=this.faceVertexUvs[0],C=this.faceVertexUvs[1];_&&_.length===w&&(E=[]),C&&C.length===w&&(M=[]);for(var I,T=0;T<w;T++)I=g[T]._id,E&&E.push(_[I]),M&&M.push(C[I]);E&&(this.faceVertexUvs[0]=E),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(G,W,F){return F?G|1<<W:G&~(1<<W)}function w(G){var W=G.x.toString()+G.y.toString()+G.z.toString();return L[W]===void 0&&(L[W]=R.length/3,R.push(G.x,G.y,G.z)),L[W]}function S(G){var W=G.r.toString()+G.g.toString()+G.b.toString();return x[W]===void 0&&(x[W]=N.length,N.push(G.getHex())),x[W]}function E(G){var W=G.x.toString()+G.y.toString();return B[W]===void 0&&(B[W]=O.length/2,O.push(G.x,G.y)),B[W]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var _=this.parameters;for(var C in _)_[C]!==void 0&&(M[C]=_[C]);return M}for(var I,T=[],P=0;P<this.vertices.length;P++)I=this.vertices[P],T.push(I.x,I.y,I.z);for(var A=[],R=[],L={},N=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var z=this.faces[D],U=!0,H=!1,Y=this.faceVertexUvs[0][D]!==void 0,ie=0<z.normal.length(),ae=0<z.vertexNormals.length,ee=z.color.r!==1||z.color.g!==1||z.color.b!==1,oe=0<z.vertexColors.length,j=0;if(j=g(j,0,0),j=g(j,1,U),j=g(j,2,H),j=g(j,3,Y),j=g(j,4,ie),j=g(j,5,ae),j=g(j,6,ee),j=g(j,7,oe),A.push(j),A.push(z.a,z.b,z.c),A.push(z.materialIndex),Y){var K=this.faceVertexUvs[0][D];A.push(E(K[0]),E(K[1]),E(K[2]))}if(ie&&A.push(w(z.normal)),ae){var $=z.vertexNormals;A.push(w($[0]),w($[1]),w($[2]))}if(ee&&A.push(S(z.color)),oe){var re=z.vertexColors;A.push(S(re[0]),S(re[1]),S(re[2]))}}return M.data={},M.data.vertices=T,M.data.normals=R,0<N.length&&(M.data.colors=N),0<O.length&&(M.data.uvs=[O]),M.data.faces=A,M},clone:function(){return new m().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 w=g.vertices,S=0,E=w.length;S<E;S++)this.vertices.push(w[S].clone());for(var M=g.colors,_=0,C=M.length;_<C;_++)this.colors.push(M[_].clone());for(var I=g.faces,T=0,P=I.length;T<P;T++)this.faces.push(I[T].clone());for(var A,R=0,L=g.faceVertexUvs.length;R<L;R++){A=g.faceVertexUvs[R],this.faceVertexUvs[R]===void 0&&(this.faceVertexUvs[R]=[]);for(var N=0,x=A.length;N<x;N++){for(var O,B=A[N],D=[],z=0,U=B.length;z<U;z++)O=B[z],D.push(O.clone());this.faceVertexUvs[R].push(D)}}for(var H,Y=g.morphTargets,ie=0,ae=Y.length;ie<ae;ie++){if(H={},H.name=Y[ie].name,Y[ie].vertices!==void 0){H.vertices=[];for(var ee=0,oe=Y[ie].vertices.length;ee<oe;ee++)H.vertices.push(Y[ie].vertices[ee].clone())}if(Y[ie].normals!==void 0){H.normals=[];for(var j=0,K=Y[ie].normals.length;j<K;j++)H.normals.push(Y[ie].normals[j].clone())}this.morphTargets.push(H)}for(var $,re=g.morphNormals,G=0,W=re.length;G<W;G++){if($={},re[G].vertexNormals!==void 0){$.vertexNormals=[];for(var F=0,X=re[G].vertexNormals.length;F<X;F++){var J=re[G].vertexNormals[F],V={};V.a=J.a.clone(),V.b=J.b.clone(),V.c=J.c.clone(),$.vertexNormals.push(V)}}if(re[G].faceNormals!==void 0){$.faceNormals=[];for(var k=0,te=re[G].faceNormals.length;k<te;k++)$.faceNormals.push(re[G].faceNormals[k].clone())}this.morphNormals.push($)}for(var se=g.skinWeights,le=0,fe=se.length;le<fe;le++)this.skinWeights.push(se[le].clone());for(var we=g.skinIndices,be=0,de=we.length;be<de;be++)this.skinIndices.push(we[be].clone());for(var ye=g.lineDistances,ne=0,he=ye.length;ne<he;ne++)this.lineDistances.push(ye[ne]);var me=g.boundingBox;me!==null&&(this.boundingBox=me.clone());var Re=g.boundingSphere;return Re!==null&&(this.boundingSphere=Re.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,w=[],S=void 0,E=this.faces;for(g=0;g<E.length;g++){var M=E[g];M.materialIndex!==S&&(S=M.materialIndex,v!==void 0&&(v.count=3*g-v.start,w.push(v)),v={start:3*g,materialIndex:S})}return v!==void 0&&(v.count=3*g-v.start,w.push(v)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,S=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(S,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var _=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(_,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var C=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(C,2).copyVector2sArray(g.uvs2))}for(var I in w.groups=g.groups,g.morphTargets){for(var T=[],P=g.morphTargets[I],A=0,R=P.length;A<R;A++){var L=P[A],N=new c.Float32BufferAttribute(3*L.data.length,3);N.name=L.name,T.push(N.copyVector3sArray(L.data))}w.morphAttributes[I]=T}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var S=new Float32Array(this.normals.length),E=new c.BufferAttribute(S,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var _=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(_,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var C=[],I=0;I<this.colors.length;I++)C.push(new c.Color(this.colors[I]));var T=new Float32Array(3*C.length);g.setAttribute("color",new c.BufferAttribute(T,3).copyColorsArray(C))}else{for(var P=new Float32Array(3*this.vertices.length),A=0;A<3*this.vertices.length;A++)P[A]=1;g.setAttribute("color",new c.BufferAttribute(P,3))}if(0<this.faces.length){for(var R=[],L=[],N=0;N<this.faces.length;N++){L.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)R.push(x[0],x[1],x[2]);else{var O=this.faces[N].color;R.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],z=0,U=this.morphTargets.length;z<U;z++){var H=this.morphTargets[z],Y=new c.Float32BufferAttribute(3*H.vertices.length,3);if(Y.name=H.name,B.push(Y.copyVector3sArray(H.vertices)),H.normals){var ie=new c.Float32BufferAttribute(3*H.normals.length,3);ie.name=H.name,D.push(ie.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var ae=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",ae.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ee=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ee.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"})}}),m.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,w=v.geometry;if(v.isPoints||v.isLine){var S=new c.Float32BufferAttribute(3*w.vertices.length,3),E=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",S.copyVector3sArray(w.vertices)),g.setAttribute("color",E.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else v.isMesh&&(g=w.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 w,S,E=[],M=void 0,_=g.faces;for(S=0;S<_.length;S++){var C=_[S];C.materialIndex!==M&&(M=C.materialIndex,w!==void 0&&(w.count=3*S-w.start,E.push(w)),w={start:3*S,materialIndex:M})}w!==void 0&&(w.count=3*S-w.start,E.push(w)),this.groups=E}fromGeometry(g){var w,S=g.faces,E=g.vertices,M=g.faceVertexUvs,_=M[0]&&0<M[0].length,C=M[1]&&0<M[1].length,I=g.morphTargets,T=I.length;if(0<T){w=[];for(var P=0;P<T;P++)w[P]={name:I[P].name,data:[]};this.morphTargets.position=w}var A,R=g.morphNormals,L=R.length;if(0<L){A=[];for(var N=0;N<L;N++)A[N]={name:R[N].name,data:[]};this.morphTargets.normal=A}var x=g.skinIndices,O=g.skinWeights,B=x.length===E.length,D=O.length===E.length;0<E.length&&S.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var z,U=0;U<S.length;U++){z=S[U],this.vertices.push(E[z.a],E[z.b],E[z.c]);var H=z.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var Y=z.normal;this.normals.push(Y,Y,Y)}var ie=z.vertexColors;if(ie.length===3)this.colors.push(ie[0],ie[1],ie[2]);else{var ae=z.color;this.colors.push(ae,ae,ae)}if(_===!0){var ee=M[0][U];ee===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",U),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ee[0],ee[1],ee[2])}if(C===!0){var oe=M[1][U];oe===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",U),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(oe[0],oe[1],oe[2])}for(var j,K=0;K<T;K++)j=I[K].vertices,w[K].data.push(j[z.a],j[z.b],j[z.c]);for(var $,re=0;re<L;re++)$=R[re].vertexNormals[U],A[re].data.push($.a,$.b,$.c);B&&this.skinIndices.push(x[z.a],x[z.b],x[z.c]),D&&this.skinWeights.push(O[z.a],O[z.b],O[z.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,w,S,E,M){var _=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=S,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=_}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 w=0,S=g.vertexNormals.length;w<S;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var E=0,M=g.vertexColors.length;E<M;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=TB},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
- `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,y=function(){return"pr"+p++},m=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};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.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)},m.prototype.checkTransparentMesh=function(){},m.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 w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,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},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,w=v*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var S=d;S=d>this.duration?this.duration:0>d?0:d,S!=this.inbuildTime&&(this.inbuildTime=S,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.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)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.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,w=0,S=0;S<v.count;S++)this._v2.fromArray(v.array,3*S),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=S)}return d},m.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,w=v.geometry.morphAttributes;if(g&&w&&w.position){for(var S=!1,E=0;E<g.length;E++)0<g[E]&&(S=!0,this._v1.fromArray(w.position[E].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[E])));if(S)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},m.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}},m.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},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.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),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),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},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.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}}},m.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,this.markerImgURL=b.imgURL)},m.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 w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,v,g,w){this._lod.addLevelFromURL(d,b,v,g,w)},m.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(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[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},m.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.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))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=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,w)=>{this._loader=d;var S,E=this.calculateDistance(b);for(S=0;S<this.levels.length&&!(E<this.levels[S].distance);S++);this.levels.splice(S,0,{distance:E,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),w&&this.loadLevel(S)},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},w=h(b,g),S=void 0;this._parent.isGeometry?S=new c.Mesh(w,v):this._parent.isLines&&(S=new(u(12)).LineSegments(w,v)),S.userData=this._parent,S.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(S,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),m()},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,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,w,S=d.cameraObject.position.distanceTo(b),E=-1,M=-1;for(g=0,w=v.length;g<w&&S>=v[g].distance;g++)v[g].morph?(-1<E&&v[E].morph&&(v[E].morph.visible=!1),E=g,v[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;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 m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,p=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,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(p);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:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,y=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,_=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=_,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var _=M.attributes.position,C=[0],I=1,T=_.count;I<T;I++)f.fromBufferAttribute(_,I-1),h.fromBufferAttribute(_,I),C[I]=C[I-1],C[I]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(C,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,_){var C=this.geometry,I=this.matrixWorld,T=M.params.Line.threshold,P=C.drawRange,A=C.morphAttributes.position;if(C.boundingSphere===null&&C.computeBoundingSphere(),m.copy(C.boundingSphere),m.applyMatrix4(I),m.radius+=T,M.ray.intersectsSphere(m)!==!1){p.copy(I).invert(),y.copy(M.ray).applyMatrix4(p);var R=T/((this.scale.x+this.scale.y+this.scale.z)/3),L=R*R,N=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(C.isBufferGeometry){var z=C.index,U=C.attributes,H=U.position;if(z!==null)for(var Y=Math.max(0,P.start),ie=Math.min(z.count,P.start+P.count),ae=Y;ae<ie-1;ae+=D){var ee=z.getX(ae),oe=z.getX(ae+1);S(N,x,this,H,A,ee,oe);var j=y.distanceSqToSegment(N,x,B,O);if(!(j>L)){B.applyMatrix4(this.matrixWorld);var K=M.ray.origin.distanceTo(B);K<M.near||K>M.far||_.push({distance:K,point:O.clone().applyMatrix4(this.matrixWorld),index:ae,face:null,faceIndex:null,object:this})}}else for(var $=Math.max(0,P.start),re=Math.min(H.count,P.start+P.count),G=$;G<re-1;G+=D){S(N,x,this,H,A,G,G+1);var W=y.distanceSqToSegment(N,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var F=M.ray.origin.distanceTo(B);F<M.near||F>M.far||_.push({distance:F,point:O.clone().applyMatrix4(this.matrixWorld),index:G,face:null,faceIndex:null,object:this})}}}else C.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var _=M.morphAttributes,C=Object.keys(_);if(0<C.length){var I=_[C[0]];if(I!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var T,P=0,A=I.length;P<A;P++)T=I[P].name||P+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[T]=P}}}else{var R=M.morphTargets;R!==void 0&&0<R.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function S(E,M,_,C,I,T,P){E.fromBufferAttribute(C,T),M.fromBufferAttribute(C,P);var A=_.morphTargetInfluences;if(_.material.morphTargets&&I&&A){d.set(0,0,0),b.set(0,0,0);for(var R=0,L=I.length;R<L;R++){var N=A[R],x=I[R];N!==0&&(v.fromBufferAttribute(x,T),g.fromBufferAttribute(x,P),d.addScaledVector(v.sub(E),N),b.addScaledVector(g.sub(M),N))}E.add(d),M.add(b)}}w.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 p=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v=void 0,g=void 0,w=void 0,S=void 0,E=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var _=!1;this.ndc=new c.Vector3;var C=void 0,I=void 0,T=()=>{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(p[0],p[1],p[2]),v.userData=this};this.updateVisual=(P,A)=>{var R=1,L=0;P!==A&&(L=1-(this.ndc.z-P)/(A-P),R=.6+.4*L),this.setSpriteSize(R)},this.updateNDC=P=>(this.ndc.copy(this.morph.position),this.ndc.project(P),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(P,A,R)=>{this.morph.position.set(P,A,R)},this.setSpriteSize=P=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(P)},this.setUserSprite=()=>{S&&(this.morph.add(S),M&&(this.morph.remove(v),I&&this.morph.remove(I),M=!1))},this.setImageForUserSprite=(P,A)=>{S&&(this.morph.remove(S),S=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=P,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),A||(A=[.05,.05,1]),S=new c.Sprite(w),S.center.set(.5,0),S.scale.set(A[0],A[1],A[2]),S.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(v),S&&this.morph.remove(S),I&&this.morph.add(I))},this.loadUserSprite=(P,A)=>{if(P)if(P!==E){E=P;var R=new Image(128,128);R.crossOrigin="anonymous",R.onload=()=>{this.setImageForUserSprite(R,A)},R.src=P}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),I&&(I.material.map.dispose(),I.material.dispose(),I=void 0)},this.isEnabled=()=>_,this.setNumber=P=>{(!P||C!=P)&&I&&(this.morph.remove(I),I.material.map.dispose(),I.material.dispose(),I=void 0),!I&&P&&(I=m(P,.012,"black","Asap",120,700),this.morph.add(I)),C=P},this.getNumber=()=>C||1,this.setVisibility=function(P){P!==this.visible&&(this.visible=P,this.group.visible=P,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{_=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{_=!1,this.morph.visible=!1,this.visible=!1},T()};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,p,y,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(v=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)&&(b=new(u(17)).Label(v,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(w,S,E,M)=>{this.morph&&(this.morph.matrix.elements[0]=S[0],this.morph.matrix.elements[1]=S[1],this.morph.matrix.elements[2]=S[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=E[0],this.morph.matrix.elements[5]=E[1],this.morph.matrix.elements[6]=E[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(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 p=f,y=void 0;y=h?new c(p,.015,h.getStyle()):new c(p,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,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=(m,d,b)=>{y&&y.position.set(m,d,b)},this.setColour=m=>{y.color=m.getStyle()},this.setScale=m=>{y&&0<m&&y.scale.set(m,m,1)},this.dispose=()=>{y.dispose()},this.getSprite=()=>y,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,w=void 0,S=0,E=0,M=[0,0,0],_=[0,0,0],C=[0,0,0],I="NONE";this.ready=!1;var T=!1,P=!1;this.isGlyphset=!0;var A=new c.Matrix4,R=new c.Color,L=new c.Color,N=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],D=[],z=[],U=[],H=[],Y=[],ie=[];this.globalScale=1;for(var ae=0;8>ae;ae++)new c.Vector3;this.load=(G,W,F,X,J)=>{y=G.axis1,m=G.axis2,d=G.axis3,b=G.positions,v=G.scale,g=G.colors,w=G.label,T=G.metadata.MorphColours,P=G.metadata.MorphVertices,S=G.metadata.number_of_time_steps,I=G.metadata.repeat_mode,E=G.metadata.number_of_vertices,I=="AXES_2D"||I=="MIRROR"?E*=2:I=="AXES_3D"&&(E*=3),M=G.metadata.base_size,_=G.metadata.offset,C=G.metadata.scale_factors;var V=new f;this.geometry=new c.BufferGeometry;var k=new c.InstancedMesh(this.geometry,void 0,E);if(this.setMorph(k),X){var te=V.parse(W);re(F,J)(te.geometry,te.materials),te.geometry.dispose()}else V.crossOrigin="Anonymous",V.load(W,re(F,J))};var ee=(G,W,F,X,J,V)=>{if(I=="NONE"||I=="MIRROR"){for(var k,te=[0,0,0],se=[0,0,0],le=[0,0,0],fe=[0,0,0],we=[0,0,0],be=[0,0,0],de=[0,0,0],ye=[0,0,0],ne=[0,0,0],he=0;3>he;he++)k=0>J[he]?-1:1,te[he]=(k*M[he]+J[he]*C[he])*this.globalScale;for(var he=0;3>he;he++)se[he]=W[he]*te[0],le[he]=F[he]*te[1],fe[he]=X[he]*te[2],we[he]=G[he]+_[0]*se[he]+_[1]*le[he]+_[2]*fe[he],I=="MIRROR"&&(be[he]=-se[he],de[he]=-le[he],ye[he]=-fe[he],ne[he]=we[he],0>J[0]&&(we[he]-=se[he],ne[he]-=be[he]));0>fe[0]*(se[1]*le[2]-se[2]*le[1])+fe[1]*(se[2]*le[0]-se[0]*le[2])+fe[2]*(se[0]*le[1]-se[1]*le[0])&&(fe[0]=-fe[0],fe[1]=-fe[1],fe[2]=-fe[2]),V[0]=[we,se,le,fe],I=="MIRROR"&&(0>ye[0]*(be[1]*de[2]-be[2]*de[1])+ye[1]*(be[2]*de[0]-be[0]*de[2])+ye[2]*(be[0]*de[1]-be[1]*de[0])&&(ye[0]=-ye[0],ye[1]=-ye[1],ye[2]=-ye[2]),V[1]=[ne,be,de,ye])}else if(I=="AXES_2D"||I=="AXES_3D"){for(var k,me=[0,0,0],Re=[0,0,0],he=0;3>he;he++)k=0>J[he]?-1:1,me[he]=(k*M[0]+J[he]*C[0])*this.globalScale;for(var he=0;3>he;he++)Re[he]=G[he]+_[0]*me[0]*W[he]+_[1]*me[1]*F[he]+_[2]*me[2]*X[he];for(var Te=glyph_repeat_mode=="AXES_2D"?2:3,De=0;De<Te;De++){var Ye=void 0,ze=void 0,st=J[De],Ce=[0,0,0],He=[0,0,0],Ge=[0,0,0];De==0?(Ye=W,ze=F):De==1?(Ye=F,ze=glyph_repeat_mode=="AXES_2D"?W:X):(Ye=X,ze=W);var Ot=(M[0]+st*C[0])*this.globalScale;Ce[0]=Ye[0]*Ot,Ce[1]=Ye[1]*Ot,Ce[2]=Ye[2]*Ot,Ge[0]=Ce[1]*ze[2]-ze[1]*Ce[2],Ge[1]=Ce[2]*ze[0]-ze[2]*Ce[0],Ge[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var Nt=Math.sqrt(Ge[0]*Ge[0]+Ge[1]*Ge[1]+Ge[2]*Ge[2]);if(0<Nt){var mt=(M[2]+st*C[2])*this.globalScale/Nt;I=="AXES_2D"&&0<De&&(mt*=-1),Ge[0]*=mt,Ge[1]*=mt,Ge[2]*=mt}if(He[0]=Ge[1]*Ce[2]-Ce[1]*Ge[2],He[1]=Ge[2]*Ce[0]-Ce[2]*Ge[0],He[2]=Ge[0]*Ce[1]-Ge[1]*Ce[0],Nt=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]),0<Nt){var xt=(M[1]+st*C[1])*this.globalScale/Nt;He[0]*=xt,He[1]*=xt,He[2]*=xt}V[De]=[Re,Ce,He,Ge]}}return V},oe=(G,W,F,X,J)=>{var V=1;I=="AXES_2D"||I=="MIRROR"?V=2:I=="AXES_3D"&&(V=3);var k=G.length/3,te=0;ie.length=V;for(var se=0;se<k;se++){var le=3*se,fe=[G[le],G[le+1],G[le+2]],we=[W[le],W[le+1],W[le+2]],be=[F[le],F[le+1],F[le+2]],de=[X[le],X[le+1],X[le+2]],ye=[J[le],J[le+1],J[le+2]],ne=ee(fe,we,be,de,ye,ie);if(ne.length==V)for(var he=0;he<V;he++){A.elements[0]=ne[he][1][0],A.elements[1]=ne[he][1][1],A.elements[2]=ne[he][1][2],A.elements[3]=0,A.elements[4]=ne[he][2][0],A.elements[5]=ne[he][2][1],A.elements[6]=ne[he][2][2],A.elements[7]=0,A.elements[8]=ne[he][3][0],A.elements[9]=ne[he][3][1],A.elements[10]=ne[he][3][2],A.elements[11]=0,A.elements[12]=ne[he][0][0],A.elements[13]=ne[he][0][1],A.elements[14]=ne[he][0][2],A.elements[15]=1,this.morph.setMatrixAt(te,A);var me=p[te];me&&me.setTransformation(ne[he][0],ne[he][1],ne[he][2],ne[he][3]),te++}}this.morph.instanceMatrix.needsUpdate=!0},j=G=>{var W=1;I=="AXES_2D"||I=="MIRROR"?W=2:I=="AXES_3D"&&(W=3);for(var F,X=G.length,J=0,V=0;V<X;V++){F=G[V];for(var k=0;k<W;k++){R.setHex(F),this.morph.setColorAt(J,R);var te=p[J];te&&te.setColour(R),J++}}this.morph.instanceColor.needsUpdate=!0},K=()=>{var G=B,W=D,F=z,X=U,J=H,V=Y,k=this.inbuildTime/this.duration*(S-1),te=Math.floor(k),se=1-(k-te),le=Math.ceil(k);if(P){var fe=b[te.toString()],we=b[le.toString()],be=y[te.toString()],de=y[le.toString()],ye=m[te.toString()],ne=m[le.toString()],he=d[te.toString()],me=d[le.toString()],Re=v[te.toString()],Te=v[le.toString()];B.length=fe.length,D.length=fe.length,z.length=fe.length,U.length=fe.length,H.length=fe.length;for(var De=0;De<fe.length;De++)G[De]=se*fe[De]+(1-se)*we[De],W[De]=se*be[De]+(1-se)*de[De],F[De]=se*ye[De]+(1-se)*ne[De],X[De]=se*he[De]+(1-se)*me[De],J[De]=se*Re[De]+(1-se)*Te[De]}else G=b[0],W=y[0],F=m[0],X=d[0],J=v[0];if(oe(G,W,F,X,J),this.boundingBoxUpdateRequired=!0,g!=null){if(T){var Ye=g[te.toString()],ze=g[le.toString()];V.length=Ye.length;for(var st=0;st<Ye.length;st++)R.setHex(Ye[st]),L.setHex(ze[st]),R.setRGB(R.r*se+L.r*(1-se),R.g*se+L.g*(1-se),R.b*se+L.b*(1-se)),V[st]=R.getHex()}else V=g[0];j(V)}};this.showLabel=()=>{for(var G=0;G<p.length;G++)p[G].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var G=0;G<p.length;G++)p[G].hideLabel()};var $=G=>{for(var W=0;W<E;W++){var F=new(u(16)).Glyph(void 0,void 0,W,this),X=w?w[W]:void 0;X=X||this.groupName,X&&F.setLabel(X),0<S&&F.setFrustumCulled(!1),p[W]=F,this.morph.add(F.getGroup())}G&&this.showLabel(),oe(b[0],y[0],m[0],d[0],v[0]),g!=null&&j(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=G=>{G.isGlyph&&p.push(G),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(G,W)=>{if(G.isMesh){var F=new(u(16)).Glyph(void 0,void 0,W,this);return F.fromMesh(G),p.push(F),this.morph.add(F.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,F}},this.forEachGlyph=G=>{for(var W=0;W<p.length;W++)G(p[W])};var re=(G,W)=>(F,X)=>{var J=F.toBufferGeometry();this.geometry.copy(J),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),J.dispose(),X&&X[0]&&(this.morph.material=X[0]),$(W),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),F.dispose(),G!=null&&typeof G=="function"&&G(this)};this.getClosestVertexIndex=function(){var G=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var W,F=b[0],X=F.length/3,J=-1,V=0,k=0;k<X;k++)W=3*k,this._v2.set(F[W],F[W+1],F[W+2]),V=this._v1.distanceTo(this._v2),(J==-1||J>V)&&(J=V,G=k)}return G},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var G=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,A),G.setFromMatrixPosition(A),G}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){N.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var G=0;G<E;G++)this.morph.getMatrixAt(G,A),x.copy(N).applyMatrix4(A),G==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=G=>{this.inbuildTime=G>this.duration?this.duration:0>G?0:G,(T||P)&&(K(),P&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<S)&&(T||P)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(G){this.globalScale=G,K()},this.dispose=()=>{for(var G=p.length-1;0<=G;G--)p[G].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(G,W,F)=>{if(W==!0){var X=this.inbuildTime+G;X>this.duration&&(X-=this.duration),this.inbuildTime=X,(T||P)&&K()}this.updateMarker(W,F)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,y=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,S=c.DefaultLoadingManager,E=u(21).VideoHandler;function M(_){typeof _=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),_=void 0),this.manager=_===void 0?S:_,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(C,I,T,P){var A=this,R=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(C),L=new w(this.manager);C.split("?"),this.paramsString=C.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(C,function(N){var x;try{x=JSON.parse(N)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),P)return void P({responseURL:C})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+C+" should be loaded with THREE.ObjectLoader instead.")}if(A&&A.parse){var D=A.parse(x,R);I(D.geometry,D.materials)}},T,P)},setTexturePath:function(C){this.texturePath=C},parse:function(){function _(P,A){function R(he,me){return he&1<<me}var L,N,x,O,B,D,z,U,H,Y,ie,ae,ee,oe,j,K,$,re,G,W,F,X,J,V,k,te,se,le=P.faces,fe=P.vertices,we=P.normals,be=P.colors,de=P.scale,ye=0;if(P.uvs!==void 0){for(L=0;L<P.uvs.length;L++)P.uvs[L].length&&ye++;for(L=0;L<ye;L++)A.faceVertexUvs[L]=[]}for(O=0,B=fe.length;O<B;)re=new y,re.x=fe[O++]*de,re.y=fe[O++]*de,re.z=fe[O++]*de,A.vertices.push(re);if(O=0,B=le.length,P.uvs)for(L=0;L<P.uvs.length;L++){A.uvs[L]=[];for(var ne=0;ne<P.uvs[L].length;ne++)A.uvs[L][ne]=P.uvs[L][ne]}if(we)for(L=0;L<we.length;L++)A.normals[L]=we[L];if(be)for(L=0;L<be.length;L++)A.colors[L]=be[L];for(;O<B;)if(Y=le[O++],ie=R(Y,0),ae=R(Y,1),ee=R(Y,3),oe=R(Y,4),j=R(Y,5),K=R(Y,6),$=R(Y,7),ie){if(W=new v,W.a=le[O],W.b=le[O+1],W.c=le[O+3],F=new v,F.a=le[O+1],F.b=le[O+2],F.c=le[O+3],O+=4,ae&&(H=le[O++],W.materialIndex=H,F.materialIndex=H),x=A.faces.length,ee)for(L=0;L<ye;L++)for(V=P.uvs[L],A.faceVertexUvs[L][x]=[],A.faceVertexUvs[L][x+1]=[],N=0;4>N;N++)U=le[O++],te=V[2*U],se=V[2*U+1],k=new b(te,se),N!==2&&A.faceVertexUvs[L][x].push(k),N!==0&&A.faceVertexUvs[L][x+1].push(k);if(oe&&(z=3*le[O++],W.normal.set(we[z++],we[z++],we[z]),F.normal.copy(W.normal)),j)for(L=0;4>L;L++)z=3*le[O++],J=new y(we[z++],we[z++],we[z]),L!==2&&W.vertexNormals.push(J),L!==0&&F.vertexNormals.push(J);if(K&&(D=le[O++],X=be[D],W.color.setHex(X),F.color.setHex(X)),$)for(L=0;4>L;L++)D=le[O++],X=be[D],L!==2&&W.vertexColors.push(new d(X)),L!==0&&F.vertexColors.push(new d(X));A.faces.push(W),A.faces.push(F)}else{if(G=new v,G.a=le[O++],G.b=le[O++],G.c=le[O++],ae&&(H=le[O++],G.materialIndex=H),x=A.faces.length,ee)for(L=0;L<ye;L++)for(V=P.uvs[L],A.faceVertexUvs[L][x]=[],N=0;3>N;N++)U=le[O++],te=V[2*U],se=V[2*U+1],k=new b(te,se),A.faceVertexUvs[L][x].push(k);if(oe&&(z=3*le[O++],G.normal.set(we[z++],we[z++],we[z])),j)for(L=0;3>L;L++)z=3*le[O++],J=new y(we[z++],we[z++],we[z]),G.vertexNormals.push(J);if(K&&(D=le[O++],G.color.setHex(be[D])),$)for(L=0;3>L;L++)D=le[O++],G.vertexColors.push(new d(be[D]));A.faces.push(G)}}function C(P,A){var R=P.influencesPerVertex===void 0?2:P.influencesPerVertex;if(P.skinWeights)for(var L=0,N=P.skinWeights.length;L<N;L+=R){var x=P.skinWeights[L],O=1<R?P.skinWeights[L+1]:0,B=2<R?P.skinWeights[L+2]:0,D=3<R?P.skinWeights[L+3]:0;A.skinWeights.push(new m(x,O,B,D))}if(P.skinIndices)for(var L=0,N=P.skinIndices.length;L<N;L+=R){var z=P.skinIndices[L],U=1<R?P.skinIndices[L+1]:0,H=2<R?P.skinIndices[L+2]:0,Y=3<R?P.skinIndices[L+3]:0;A.skinIndices.push(new m(z,U,H,Y))}A.bones=P.bones,A.bones&&0<A.bones.length&&(A.skinWeights.length!==A.skinIndices.length||A.skinIndices.length!==A.vertices.length)&&console.warn("When skinning, number of vertices ("+A.vertices.length+"), skinIndices ("+A.skinIndices.length+"), and skinWeights ("+A.skinWeights.length+") should match.")}function I(P,A){var R=P.scale;if(P.morphTargets!==void 0)for(var L=0,N=P.morphTargets.length;L<N;L++){A.morphTargets[L]={},A.morphTargets[L].name=P.morphTargets[L].name,A.morphTargets[L].vertices=[];for(var x,O=A.morphTargets[L].vertices,B=P.morphTargets[L].vertices,D=0,z=B.length;D<z;D+=3)x=new y,x.x=B[D]*R,x.y=B[D+1]*R,x.z=B[D+2]*R,O.push(x)}if(P.morphNormals!==void 0){for(var L=0,N=P.morphNormals.length;L<N;L++)if(A.morphTargets[L]){A.morphTargets[L].normals=[];for(var U,H=A.morphTargets[L].normals,Y=P.morphNormals[L].normals,D=0,z=Y.length;D<z;D+=3)U=new y,U.x=Y[D],U.y=Y[D+1],U.z=Y[D+2],H.push(U);A.morphNormalsReady=!0}}if(P.morphColors!==void 0){var L,N,ie,ae,ee,oe,j;for(L=0,N=P.morphColors.length;L<N;L++)for(A.morphColors[L]={},A.morphColors[L].name=P.morphColors[L].name,A.morphColors[L].colors=[],ee=A.morphColors[L].colors,oe=P.morphColors[L].colors,ie=0,ae=oe.length;ie<ae;ie+=3)j=new c.Color(16755200),j.setRGB(oe[ie],oe[ie+1],oe[ie+2]),ee.push(j)}}function T(P,A){var R=[],L=[];P.animation!==void 0&&L.push(P.animation),P.animations!==void 0&&(P.animations.length?L=L.concat(P.animations):L.push(P.animations));for(var N,x=0;x<L.length;x++)N=p.parseAnimation(L[x],A.bones),N&&R.push(N);if(A.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(A.morphTargets,10);R=R.concat(O)}0<R.length&&(A.animations=R)}return function(P,A){P.data!==void 0&&(P=P.data),P.scale=P.scale===void 0?1:1/P.scale;var R=new g;if(R.morphColors=[],_(P,R),C(P,R),I(P,R),T(P,R),R.computeFaceNormals(),R.computeBoundingSphere(),P.materials===void 0||P.materials.length===0)return{geometry:R};var L=f.prototype.initMaterials(P.materials,A,"Anonymous");if(P.materials[0].video){var N=A+P.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var x=new E(N);R._video=x}return L&&0<L.length&&(L[0].side=P.materials[0].singleSided?c.FrontSide:P.materials[0].flipSided?c.BackSide:c.DoubleSide,P.materials[0].specularCoef&&(L[0].shininess=Math.floor(P.materials[0].specularCoef/3))),{geometry:R,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,y){this.handlers.push(p,y)},get:function(p){for(var y=this.handlers,m=0,d=y.length;m<d;m+=2){var b=y[m],v=y[m+1];if(b.test(p))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,y,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],y,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,y=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,v){function g(_,C,I,T,P){var A,R=b+_,L=f.Handlers.get(R);L===null?(y.setCrossOrigin(v),A=y.load(R)):A=L.load(R),C!==void 0&&(A.repeat.fromArray(C),C[0]!==1&&(A.wrapS=c.RepeatWrapping),C[1]!==1&&(A.wrapT=c.RepeatWrapping)),I!==void 0&&A.offset.fromArray(I),T!==void 0&&(T[0]==="repeat"&&(A.wrapS=c.RepeatWrapping),T[0]==="mirror"&&(A.wrapS=c.MirroredRepeatWrapping),T[1]==="repeat"&&(A.wrapT=c.RepeatWrapping),T[1]==="mirror"&&(A.wrapT=c.MirroredRepeatWrapping)),P!==void 0&&(A.anisotropy=P);var N=c.MathUtils.generateUUID();return w[N]=A,N}var w={},S={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var E in d){var M=d[E];switch(E){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":S.name=M;break;case"blending":S.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",E,"is no longer supported.");break;case"colorDiffuse":S.color=p.fromArray(M).getHex();break;case"colorSpecular":S.specular=p.fromArray(M).getHex();break;case"colorEmissive":S.emissive=p.fromArray(M).getHex();break;case"specularCoef":S.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(S.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(S.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(S.type="MeshStandardMaterial");break;case"mapDiffuse":S.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":S.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":S.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":S.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":S.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":S.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":S.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":S.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":S.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":S.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":S.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":S.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":S.side=c.BackSide;break;case"doubleSided":S.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),S.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":S[E]=M;break;case"vertexColors":M===!0&&(S.vertexColors=c.VertexColors),M==="face"&&(S.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",E,M)}}return S.type==="MeshBasicMaterial"&&delete S.emissive,S.type!=="MeshPhongMaterial"&&delete S.specular,1>S.opacity&&(S.transparent=!0),m.setTextures(w),m.parse(S)}}()})},(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(p,y){var m=p/y*h.video.duration;h.video.currentTime=m},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(p){return h.video?p*(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,p=u(5).getCircularTexture,y=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,w)=>{if(v&&g){var S=h(v,w),E=p();g.map=E;var M=new f(S,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(v,g,w,S)=>{if(w){var E=new c.Color(S),M=new y(w,E);M.setPosition(g[0],g[1],g[2]);var _=M.getSprite();_.material.sizeAttenuation=!1,_.material.alphaTest=.5,_.material.transparent=!0,_.material.depthWrite=!1,_.material.depthTest=!1,this.group.add(_),d[v]=M}};this.addPoints=(v,g,w)=>{if(v&&0<v.length){var S=this.drawRange-1,E=this.addVertices(v),M=this.getMorph();if(!M){var _=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});E.colorsNeedUpdate=!0,this.createMesh(E,_,{localTimeEnabled:!1,localMorphColour:!1})}var C=S+v.length,I=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(S;S+I<C;){var T=typeof g=="string"?g:g[I];b(I,v[I],T,w),I++}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 w=this.getMorph(),S=g+v.length-1;if(!w||0>g||S>=this.drawRange)return;var E=w.geometry.getAttribute("position"),M=g;v.forEach(_=>{var C=d[M];C&&C.setPosition(_[0],_[1],_[2]),E.setXYZ(M++,_[0],_[1],_[2])}),E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,w,S)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,v,g,w,S)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,y=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var S=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=S,this.material=E,this.sizePerPixel=1,this.updateMorphTargets()}copy(S){return super.copy(S),this.material=S.material,this.geometry=S.geometry,this}raycast(S,E){var M=this.geometry,_=this.matrixWorld,C=S.params.Points.threshold,I=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(_),p.radius+=C,S.ray.intersectsSphere(p)!==!1){f.copy(_).invert(),h.copy(S.ray).applyMatrix4(f);var T=C/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,P=T*T;if(M.isBufferGeometry){var A=M.index,R=M.attributes,L=R.position,N=M.morphAttributes.position;if(A!==null)for(var x,O=Math.max(0,I.start),B=Math.min(A.count,I.start+I.count),D=O;D<B;D++)x=A.getX(D),g(this,L,N,x),v(y,x,P,_,S,E,this);else for(var z=Math.max(0,I.start),U=Math.min(L.count,I.start+I.count),H=z;H<U;H++)g(this,L,N,H),v(y,H,P,_,S,E,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var E=S.morphAttributes,M=Object.keys(E);if(0<M.length){var _=E[M[0]];if(_!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var C,I=0,T=_.length;I<T;I++)C=_[I].name||I+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[C]=I}}}else{var P=S.morphTargets;P!==void 0&&0<P.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(w,S,E,M,_,C,I){var T=h.distanceSqToPoint(w);if(T<E){var P=new c.Vector3;h.closestPointToPoint(w,P),P.applyMatrix4(M);var A=_.ray.origin.distanceTo(P);if(A<_.near||A>_.far)return;C.push({distance:A,distanceToRay:Math.sqrt(T),point:P,index:S,face:null,object:I})}}function g(w,S,E,M){y.fromBufferAttribute(S,M);var _=w.morphTargetInfluences;if(w.material.morphTargets&&E&&_){m.set(0,0,0);for(var C=0,I=E.length;C<I;C++){var T=_[C],P=E[C];T!==0&&(d.fromBufferAttribute(P,M),m.addScaledVector(d.sub(y),T))}y.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,y,m)=>{if(p&&y){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,y)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});m.colorsNeedUpdate=!0,this.createLineSegment(m,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,m,d,b,v,g,w){try{var S=y[g](w),E=S.value}catch(M){return void d(M)}S.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(S,b,v,g,w,"next",E)}function w(E){c(S,b,v,g,w,"throw",E)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var S,E=document.createElement("canvas"),M=0,_=Array(d.length),C=0;C<d.length;C++)S=yield y.imageToUint8Array(y,w,d[C],E),S&&S.array&&(b=S.width,v=S.height,_[g]=S.array,M+=_[g].length,g++);var I=new Uint8Array(M);M=0,_.forEach(T=>{I.set(T,M),M+=T.length}),y.impl=new h.DataTexture2DArray(I,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;m.transparent&&(b=m.transparent);var v=h.FrontSide;m.side&&(v=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:v}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(y,m,d,b,v,g,w){try{var S=y[g](w),E=S.value}catch(M){return void d(M)}S.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(S,b,v,g,w,"next",E)}function w(E){c(S,b,v,g,w,"throw",E)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(y,m){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=m})},p.prototype.imageToUint8Array=function(){var y=f(function*(m,d,b,v){yield m.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)}}(),p.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.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=p},(o,l,u)=>{function c(v,g){var w=Object.keys(v);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(v);g&&(S=S.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),w.push.apply(w,S)}return w}function f(v){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(S){h(v,S,g[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(S){Object.defineProperty(v,S,Object.getOwnPropertyDescriptor(g,S))});return v}function h(v,g,w){return g=p(g),g in v?Object.defineProperty(v,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[g]=w,v}function p(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var S=w.call(v,g||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var m=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var S=!0;this.createSlides=_=>{_.forEach(C=>this.createSlide(C))};var E=(_,C)=>{var I=_.material,T=I.uniforms;switch(_.rotation.x=0,_.rotation.y=0,_.rotation.z=0,_.position.x=0,_.position.y=0,_.position.z=0,C.direction){case"x":var P=S?-Math.PI/2:Math.PI/2;_.rotation.y=P,T.direction.value=1,T.slide.value.set(C.value,0,0),_.position.x=C.value;break;case"y":_.rotation.x=Math.PI/2,T.direction.value=2,T.slide.value.set(0,C.value,0),_.position.y=C.value;break;case"z":T.direction.value=3,T.slide.value.set(0,0,C.value),_.position.z=C.value;break}I.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=_=>{_&&_.id&&_.id in w&&w[_.id]&&E(w[_.id],_)},this.createSlide=_=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&_&&_.direction&&_.value!==void 0){var C=new m.PlaneGeometry(1,1);C.translate(.5,.5,0);var I=d.getUniforms();I.diffuse.value=this.texture.impl,I.depth.value=this.texture.size.depth,I.flipY.value=S;var T={fs:d.fs,vs:d.vs,uniforms:I,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},P=this.texture.getMaterial(T);P.needsUpdate=!0;var A=new m.Mesh(C,P);A.name=this.groupName,A.userData=this;var R={value:_.value,direction:_.direction,id:A.id};return g.push(R),E(A,R),w[A.id]=A,this.morph.add(A),this.boundingBoxUpdateRequired=!0,R}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=_=>{for(var C=0;C<g.length;C++)if(_===g[C].id)return f({},g[C])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=_=>{_&&this.removeSlideWithId(_.id)},this.removeSlideWithId=_=>{if(this.morph&&_ in w&&w[_]){if(this.morph.getObjectById(_)){var C=w[_];this.morph.remove(C),C.clear(),C.geometry&&C.geometry.dispose(),C.material&&C.material.dispose(),this.boundingBoxUpdateRequired=!0}var I=g.findIndex(T=>T.id===_);-1<I&&g.splice(I,1)}},this.dispose=()=>{this.morph.children.forEach(_=>{_.geometry&&_.geometry.dispose(),_.material&&_.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var M=(_,C,I)=>{switch(C.direction.value){case 1:I.copy(C.slide.value),_.expandByPoint(I),I.setY(1),I.setZ(1),_.expandByPoint(I);break;case 2:I.copy(C.slide.value),_.expandByPoint(I),I.setX(1),I.setZ(1),_.expandByPoint(I);break;case 3:I.copy(C.slide.value),_.expandByPoint(I),I.setX(1),I.setY(1),_.expandByPoint(I);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var _=new m.Vector3(0,0,0);this.morph.children.forEach(C=>{M(this.cachedBoundingBox,C.material.uniforms,_)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(_,C,I)=>{var T=new m.Matrix4;T.set(_[0],_[1],_[2],0,_[3],_[4],_[5],0,_[6],_[7],_[8],0,0,0,0,0);var P=new m.Quaternion().setFromRotationMatrix(T);this.morph.position.set(...C),this.morph.quaternion.copy(P),this.morph.scale.set(...I),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(_,C)=>{if(_){var I=_.locations;I&&0<I.length&&(this.applyTransformation(I[0].orientation,I[0].position,I[0].scale),"flipY"in I[0]&&(S=I[0].flipY)),this.createSlides(_.settings.slides),C!=null&&typeof C=="function"&&C(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=`
3184
+ `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,y=function(){return"pr"+p++},m=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};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.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)},m.prototype.checkTransparentMesh=function(){},m.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 w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,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},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,w=v*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var S=d;S=d>this.duration?this.duration:0>d?0:d,S!=this.inbuildTime&&(this.inbuildTime=S,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.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)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.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,w=0,S=0;S<v.count;S++)this._v2.fromArray(v.array,3*S),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=S)}return d},m.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,w=v.geometry.morphAttributes;if(g&&w&&w.position){for(var S=!1,E=0;E<g.length;E++)0<g[E]&&(S=!0,this._v1.fromArray(w.position[E].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[E])));if(S)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},m.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}},m.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},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.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),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),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},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.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}}},m.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,this.markerImgURL=b.imgURL)},m.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 w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,v,g,w){this._lod.addLevelFromURL(d,b,v,g,w)},m.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(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[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},m.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.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))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=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,w)=>{this._loader=d;var S,E=this.calculateDistance(b);for(S=0;S<this.levels.length&&!(E<this.levels[S].distance);S++);this.levels.splice(S,0,{distance:E,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),w&&this.loadLevel(S)},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},w=h(b,g),S=void 0;this._parent.isGeometry?S=new c.Mesh(w,v):this._parent.isLines&&(S=new(u(12)).LineSegments(w,v)),S.userData=this._parent,S.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(S,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),m()},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,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,w,S=d.cameraObject.position.distanceTo(b),E=-1,M=-1;for(g=0,w=v.length;g<w&&S>=v[g].distance;g++)v[g].morph?(-1<E&&v[E].morph&&(v[E].morph.visible=!1),E=g,v[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;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 m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,p=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,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(p);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:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,y=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,_=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=_,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var _=M.attributes.position,C=[0],I=1,T=_.count;I<T;I++)f.fromBufferAttribute(_,I-1),h.fromBufferAttribute(_,I),C[I]=C[I-1],C[I]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(C,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,_){var C=this.geometry,I=this.matrixWorld,T=M.params.Line.threshold,P=C.drawRange,A=C.morphAttributes.position;if(C.boundingSphere===null&&C.computeBoundingSphere(),m.copy(C.boundingSphere),m.applyMatrix4(I),m.radius+=T,M.ray.intersectsSphere(m)!==!1){p.copy(I).invert(),y.copy(M.ray).applyMatrix4(p);var R=T/((this.scale.x+this.scale.y+this.scale.z)/3),L=R*R,N=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(C.isBufferGeometry){var z=C.index,U=C.attributes,H=U.position;if(z!==null)for(var Y=Math.max(0,P.start),ie=Math.min(z.count,P.start+P.count),ae=Y;ae<ie-1;ae+=D){var ee=z.getX(ae),oe=z.getX(ae+1);S(N,x,this,H,A,ee,oe);var j=y.distanceSqToSegment(N,x,B,O);if(!(j>L)){B.applyMatrix4(this.matrixWorld);var K=M.ray.origin.distanceTo(B);K<M.near||K>M.far||_.push({distance:K,point:O.clone().applyMatrix4(this.matrixWorld),index:ae,face:null,faceIndex:null,object:this})}}else for(var $=Math.max(0,P.start),re=Math.min(H.count,P.start+P.count),G=$;G<re-1;G+=D){S(N,x,this,H,A,G,G+1);var W=y.distanceSqToSegment(N,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var F=M.ray.origin.distanceTo(B);F<M.near||F>M.far||_.push({distance:F,point:O.clone().applyMatrix4(this.matrixWorld),index:G,face:null,faceIndex:null,object:this})}}}else C.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var _=M.morphAttributes,C=Object.keys(_);if(0<C.length){var I=_[C[0]];if(I!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var T,P=0,A=I.length;P<A;P++)T=I[P].name||P+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[T]=P}}}else{var R=M.morphTargets;R!==void 0&&0<R.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function S(E,M,_,C,I,T,P){E.fromBufferAttribute(C,T),M.fromBufferAttribute(C,P);var A=_.morphTargetInfluences;if(_.material.morphTargets&&I&&A){d.set(0,0,0),b.set(0,0,0);for(var R=0,L=I.length;R<L;R++){var N=A[R],x=I[R];N!==0&&(v.fromBufferAttribute(x,T),g.fromBufferAttribute(x,P),d.addScaledVector(v.sub(E),N),b.addScaledVector(g.sub(M),N))}E.add(d),M.add(b)}}w.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 p=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v=void 0,g=void 0,w=void 0,S=void 0,E=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var _=!1;this.ndc=new c.Vector3;var C=void 0,I=void 0,T=()=>{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(p[0],p[1],p[2]),v.userData=this};this.updateVisual=(P,A)=>{var R=1,L=0;P!==A&&(L=1-(this.ndc.z-P)/(A-P),R=.6+.4*L),this.setSpriteSize(R)},this.updateNDC=P=>(this.ndc.copy(this.morph.position),this.ndc.project(P),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(P,A,R)=>{this.morph.position.set(P,A,R)},this.setSpriteSize=P=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(P)},this.setUserSprite=()=>{S&&(this.morph.add(S),M&&(this.morph.remove(v),I&&this.morph.remove(I),M=!1))},this.setImageForUserSprite=(P,A)=>{S&&(this.morph.remove(S),S=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=P,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),A||(A=[.05,.05,1]),S=new c.Sprite(w),S.center.set(.5,0),S.scale.set(A[0],A[1],A[2]),S.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(v),S&&this.morph.remove(S),I&&this.morph.add(I))},this.loadUserSprite=(P,A)=>{if(P)if(P!==E){E=P;var R=new Image(128,128);R.crossOrigin="anonymous",R.onload=()=>{this.setImageForUserSprite(R,A)},R.src=P}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),I&&(I.material.map.dispose(),I.material.dispose(),I=void 0)},this.isEnabled=()=>_,this.setNumber=P=>{(!P||C!=P)&&I&&(this.morph.remove(I),I.material.map.dispose(),I.material.dispose(),I=void 0),!I&&P&&(I=m(P,.012,"black","Asap",120,700),this.morph.add(I)),C=P},this.getNumber=()=>C||1,this.setVisibility=function(P){P!==this.visible&&(this.visible=P,this.group.visible=P,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{_=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{_=!1,this.morph.visible=!1,this.visible=!1},T()};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,p,y,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(v=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)&&(b=new(u(17)).Label(v,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(w,S,E,M)=>{this.morph&&(this.morph.matrix.elements[0]=S[0],this.morph.matrix.elements[1]=S[1],this.morph.matrix.elements[2]=S[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=E[0],this.morph.matrix.elements[5]=E[1],this.morph.matrix.elements[6]=E[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(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 p=f,y=void 0;y=h?new c(p,.015,h.getStyle()):new c(p,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,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=(m,d,b)=>{y&&y.position.set(m,d,b)},this.setColour=m=>{y.color=m.getStyle()},this.setScale=m=>{y&&0<m&&y.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>y,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,w=void 0,S=0,E=0,M=[0,0,0],_=[0,0,0],C=[0,0,0],I="NONE";this.ready=!1;var T=!1,P=!1;this.isGlyphset=!0;var A=new c.Matrix4,R=new c.Color,L=new c.Color,N=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],D=[],z=[],U=[],H=[],Y=[],ie=[];this.globalScale=1;for(var ae=0;8>ae;ae++)new c.Vector3;this.load=(G,W,F,X,J)=>{y=G.axis1,m=G.axis2,d=G.axis3,b=G.positions,v=G.scale,g=G.colors,w=G.label,T=G.metadata.MorphColours,P=G.metadata.MorphVertices,S=G.metadata.number_of_time_steps,I=G.metadata.repeat_mode,E=G.metadata.number_of_vertices,I=="AXES_2D"||I=="MIRROR"?E*=2:I=="AXES_3D"&&(E*=3),M=G.metadata.base_size,_=G.metadata.offset,C=G.metadata.scale_factors;var V=new f;this.geometry=new c.BufferGeometry;var k=new c.InstancedMesh(this.geometry,void 0,E);if(this.setMorph(k),X){var te=V.parse(W);re(F,J)(te.geometry,te.materials),te.geometry.dispose()}else V.crossOrigin="Anonymous",V.load(W,re(F,J))};var ee=(G,W,F,X,J,V)=>{if(I=="NONE"||I=="MIRROR"){for(var k,te=[0,0,0],se=[0,0,0],le=[0,0,0],fe=[0,0,0],we=[0,0,0],be=[0,0,0],de=[0,0,0],ye=[0,0,0],ne=[0,0,0],he=0;3>he;he++)k=0>J[he]?-1:1,te[he]=(k*M[he]+J[he]*C[he])*this.globalScale;for(var he=0;3>he;he++)se[he]=W[he]*te[0],le[he]=F[he]*te[1],fe[he]=X[he]*te[2],we[he]=G[he]+_[0]*se[he]+_[1]*le[he]+_[2]*fe[he],I=="MIRROR"&&(be[he]=-se[he],de[he]=-le[he],ye[he]=-fe[he],ne[he]=we[he],0>J[0]&&(we[he]-=se[he],ne[he]-=be[he]));0>fe[0]*(se[1]*le[2]-se[2]*le[1])+fe[1]*(se[2]*le[0]-se[0]*le[2])+fe[2]*(se[0]*le[1]-se[1]*le[0])&&(fe[0]=-fe[0],fe[1]=-fe[1],fe[2]=-fe[2]),V[0]=[we,se,le,fe],I=="MIRROR"&&(0>ye[0]*(be[1]*de[2]-be[2]*de[1])+ye[1]*(be[2]*de[0]-be[0]*de[2])+ye[2]*(be[0]*de[1]-be[1]*de[0])&&(ye[0]=-ye[0],ye[1]=-ye[1],ye[2]=-ye[2]),V[1]=[ne,be,de,ye])}else if(I=="AXES_2D"||I=="AXES_3D"){for(var k,me=[0,0,0],Re=[0,0,0],he=0;3>he;he++)k=0>J[he]?-1:1,me[he]=(k*M[0]+J[he]*C[0])*this.globalScale;for(var he=0;3>he;he++)Re[he]=G[he]+_[0]*me[0]*W[he]+_[1]*me[1]*F[he]+_[2]*me[2]*X[he];for(var Te=glyph_repeat_mode=="AXES_2D"?2:3,De=0;De<Te;De++){var Ye=void 0,ze=void 0,st=J[De],Ce=[0,0,0],He=[0,0,0],Ge=[0,0,0];De==0?(Ye=W,ze=F):De==1?(Ye=F,ze=glyph_repeat_mode=="AXES_2D"?W:X):(Ye=X,ze=W);var Ot=(M[0]+st*C[0])*this.globalScale;Ce[0]=Ye[0]*Ot,Ce[1]=Ye[1]*Ot,Ce[2]=Ye[2]*Ot,Ge[0]=Ce[1]*ze[2]-ze[1]*Ce[2],Ge[1]=Ce[2]*ze[0]-ze[2]*Ce[0],Ge[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var Nt=Math.sqrt(Ge[0]*Ge[0]+Ge[1]*Ge[1]+Ge[2]*Ge[2]);if(0<Nt){var mt=(M[2]+st*C[2])*this.globalScale/Nt;I=="AXES_2D"&&0<De&&(mt*=-1),Ge[0]*=mt,Ge[1]*=mt,Ge[2]*=mt}if(He[0]=Ge[1]*Ce[2]-Ce[1]*Ge[2],He[1]=Ge[2]*Ce[0]-Ce[2]*Ge[0],He[2]=Ge[0]*Ce[1]-Ge[1]*Ce[0],Nt=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]),0<Nt){var xt=(M[1]+st*C[1])*this.globalScale/Nt;He[0]*=xt,He[1]*=xt,He[2]*=xt}V[De]=[Re,Ce,He,Ge]}}return V},oe=(G,W,F,X,J)=>{var V=1;I=="AXES_2D"||I=="MIRROR"?V=2:I=="AXES_3D"&&(V=3);var k=G.length/3,te=0;ie.length=V;for(var se=0;se<k;se++){var le=3*se,fe=[G[le],G[le+1],G[le+2]],we=[W[le],W[le+1],W[le+2]],be=[F[le],F[le+1],F[le+2]],de=[X[le],X[le+1],X[le+2]],ye=[J[le],J[le+1],J[le+2]],ne=ee(fe,we,be,de,ye,ie);if(ne.length==V)for(var he=0;he<V;he++){A.elements[0]=ne[he][1][0],A.elements[1]=ne[he][1][1],A.elements[2]=ne[he][1][2],A.elements[3]=0,A.elements[4]=ne[he][2][0],A.elements[5]=ne[he][2][1],A.elements[6]=ne[he][2][2],A.elements[7]=0,A.elements[8]=ne[he][3][0],A.elements[9]=ne[he][3][1],A.elements[10]=ne[he][3][2],A.elements[11]=0,A.elements[12]=ne[he][0][0],A.elements[13]=ne[he][0][1],A.elements[14]=ne[he][0][2],A.elements[15]=1,this.morph.setMatrixAt(te,A);var me=p[te];me&&me.setTransformation(ne[he][0],ne[he][1],ne[he][2],ne[he][3]),te++}}this.morph.instanceMatrix.needsUpdate=!0},j=G=>{var W=1;I=="AXES_2D"||I=="MIRROR"?W=2:I=="AXES_3D"&&(W=3);for(var F,X=G.length,J=0,V=0;V<X;V++){F=G[V];for(var k=0;k<W;k++){R.setHex(F),this.morph.setColorAt(J,R);var te=p[J];te&&te.setColour(R),J++}}this.morph.instanceColor.needsUpdate=!0},K=()=>{var G=B,W=D,F=z,X=U,J=H,V=Y,k=this.inbuildTime/this.duration*(S-1),te=Math.floor(k),se=1-(k-te),le=Math.ceil(k);if(P){var fe=b[te.toString()],we=b[le.toString()],be=y[te.toString()],de=y[le.toString()],ye=m[te.toString()],ne=m[le.toString()],he=d[te.toString()],me=d[le.toString()],Re=v[te.toString()],Te=v[le.toString()];B.length=fe.length,D.length=fe.length,z.length=fe.length,U.length=fe.length,H.length=fe.length;for(var De=0;De<fe.length;De++)G[De]=se*fe[De]+(1-se)*we[De],W[De]=se*be[De]+(1-se)*de[De],F[De]=se*ye[De]+(1-se)*ne[De],X[De]=se*he[De]+(1-se)*me[De],J[De]=se*Re[De]+(1-se)*Te[De]}else G=b[0],W=y[0],F=m[0],X=d[0],J=v[0];if(oe(G,W,F,X,J),this.boundingBoxUpdateRequired=!0,g!=null){if(T){var Ye=g[te.toString()],ze=g[le.toString()];V.length=Ye.length;for(var st=0;st<Ye.length;st++)R.setHex(Ye[st]),L.setHex(ze[st]),R.setRGB(R.r*se+L.r*(1-se),R.g*se+L.g*(1-se),R.b*se+L.b*(1-se)),V[st]=R.getHex()}else V=g[0];j(V)}};this.showLabel=()=>{for(var G=0;G<p.length;G++)p[G].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var G=0;G<p.length;G++)p[G].hideLabel()};var $=G=>{for(var W=0;W<E;W++){var F=new(u(16)).Glyph(void 0,void 0,W,this),X=w?w[W]:void 0;X=X||this.groupName,X&&F.setLabel(X),0<S&&F.setFrustumCulled(!1),p[W]=F,this.morph.add(F.getGroup())}G&&this.showLabel(),oe(b[0],y[0],m[0],d[0],v[0]),g!=null&&j(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=G=>{G.isGlyph&&p.push(G),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(G,W)=>{if(G.isMesh){var F=new(u(16)).Glyph(void 0,void 0,W,this);return F.fromMesh(G),p.push(F),this.morph.add(F.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,F}},this.forEachGlyph=G=>{for(var W=0;W<p.length;W++)G(p[W])};var re=(G,W)=>(F,X)=>{var J=F.toBufferGeometry();this.geometry.copy(J),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),J.dispose(),X&&X[0]&&(this.morph.material=X[0]),$(W),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),F.dispose(),G!=null&&typeof G=="function"&&G(this)};this.getClosestVertexIndex=function(){var G=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var W,F=b[0],X=F.length/3,J=-1,V=0,k=0;k<X;k++)W=3*k,this._v2.set(F[W],F[W+1],F[W+2]),V=this._v1.distanceTo(this._v2),(J==-1||J>V)&&(J=V,G=k)}return G},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var G=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,A),G.setFromMatrixPosition(A),G}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){N.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var G=0;G<E;G++)this.morph.getMatrixAt(G,A),x.copy(N).applyMatrix4(A),G==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=G=>{this.inbuildTime=G>this.duration?this.duration:0>G?0:G,(T||P)&&(K(),P&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<S)&&(T||P)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(G){this.globalScale=G,K()},this.dispose=()=>{for(var G=p.length-1;0<=G;G--)p[G].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(G,W,F)=>{if(W==!0){var X=this.inbuildTime+G;X>this.duration&&(X-=this.duration),this.inbuildTime=X,(T||P)&&K()}this.updateMarker(W,F)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,y=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,S=c.DefaultLoadingManager,E=u(21).VideoHandler;function M(_){typeof _=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),_=void 0),this.manager=_===void 0?S:_,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(C,I,T,P){var A=this,R=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(C),L=new w(this.manager);C.split("?"),this.paramsString=C.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(C,function(N){var x;try{x=JSON.parse(N)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),P)return void P({responseURL:C})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+C+" should be loaded with THREE.ObjectLoader instead.")}if(A&&A.parse){var D=A.parse(x,R);I(D.geometry,D.materials)}},T,P)},setTexturePath:function(C){this.texturePath=C},parse:function(){function _(P,A){function R(he,me){return he&1<<me}var L,N,x,O,B,D,z,U,H,Y,ie,ae,ee,oe,j,K,$,re,G,W,F,X,J,V,k,te,se,le=P.faces,fe=P.vertices,we=P.normals,be=P.colors,de=P.scale,ye=0;if(P.uvs!==void 0){for(L=0;L<P.uvs.length;L++)P.uvs[L].length&&ye++;for(L=0;L<ye;L++)A.faceVertexUvs[L]=[]}for(O=0,B=fe.length;O<B;)re=new y,re.x=fe[O++]*de,re.y=fe[O++]*de,re.z=fe[O++]*de,A.vertices.push(re);if(O=0,B=le.length,P.uvs)for(L=0;L<P.uvs.length;L++){A.uvs[L]=[];for(var ne=0;ne<P.uvs[L].length;ne++)A.uvs[L][ne]=P.uvs[L][ne]}if(we)for(L=0;L<we.length;L++)A.normals[L]=we[L];if(be)for(L=0;L<be.length;L++)A.colors[L]=be[L];for(;O<B;)if(Y=le[O++],ie=R(Y,0),ae=R(Y,1),ee=R(Y,3),oe=R(Y,4),j=R(Y,5),K=R(Y,6),$=R(Y,7),ie){if(W=new v,W.a=le[O],W.b=le[O+1],W.c=le[O+3],F=new v,F.a=le[O+1],F.b=le[O+2],F.c=le[O+3],O+=4,ae&&(H=le[O++],W.materialIndex=H,F.materialIndex=H),x=A.faces.length,ee)for(L=0;L<ye;L++)for(V=P.uvs[L],A.faceVertexUvs[L][x]=[],A.faceVertexUvs[L][x+1]=[],N=0;4>N;N++)U=le[O++],te=V[2*U],se=V[2*U+1],k=new b(te,se),N!==2&&A.faceVertexUvs[L][x].push(k),N!==0&&A.faceVertexUvs[L][x+1].push(k);if(oe&&(z=3*le[O++],W.normal.set(we[z++],we[z++],we[z]),F.normal.copy(W.normal)),j)for(L=0;4>L;L++)z=3*le[O++],J=new y(we[z++],we[z++],we[z]),L!==2&&W.vertexNormals.push(J),L!==0&&F.vertexNormals.push(J);if(K&&(D=le[O++],X=be[D],W.color.setHex(X),F.color.setHex(X)),$)for(L=0;4>L;L++)D=le[O++],X=be[D],L!==2&&W.vertexColors.push(new d(X)),L!==0&&F.vertexColors.push(new d(X));A.faces.push(W),A.faces.push(F)}else{if(G=new v,G.a=le[O++],G.b=le[O++],G.c=le[O++],ae&&(H=le[O++],G.materialIndex=H),x=A.faces.length,ee)for(L=0;L<ye;L++)for(V=P.uvs[L],A.faceVertexUvs[L][x]=[],N=0;3>N;N++)U=le[O++],te=V[2*U],se=V[2*U+1],k=new b(te,se),A.faceVertexUvs[L][x].push(k);if(oe&&(z=3*le[O++],G.normal.set(we[z++],we[z++],we[z])),j)for(L=0;3>L;L++)z=3*le[O++],J=new y(we[z++],we[z++],we[z]),G.vertexNormals.push(J);if(K&&(D=le[O++],G.color.setHex(be[D])),$)for(L=0;3>L;L++)D=le[O++],G.vertexColors.push(new d(be[D]));A.faces.push(G)}}function C(P,A){var R=P.influencesPerVertex===void 0?2:P.influencesPerVertex;if(P.skinWeights)for(var L=0,N=P.skinWeights.length;L<N;L+=R){var x=P.skinWeights[L],O=1<R?P.skinWeights[L+1]:0,B=2<R?P.skinWeights[L+2]:0,D=3<R?P.skinWeights[L+3]:0;A.skinWeights.push(new m(x,O,B,D))}if(P.skinIndices)for(var L=0,N=P.skinIndices.length;L<N;L+=R){var z=P.skinIndices[L],U=1<R?P.skinIndices[L+1]:0,H=2<R?P.skinIndices[L+2]:0,Y=3<R?P.skinIndices[L+3]:0;A.skinIndices.push(new m(z,U,H,Y))}A.bones=P.bones,A.bones&&0<A.bones.length&&(A.skinWeights.length!==A.skinIndices.length||A.skinIndices.length!==A.vertices.length)&&console.warn("When skinning, number of vertices ("+A.vertices.length+"), skinIndices ("+A.skinIndices.length+"), and skinWeights ("+A.skinWeights.length+") should match.")}function I(P,A){var R=P.scale;if(P.morphTargets!==void 0)for(var L=0,N=P.morphTargets.length;L<N;L++){A.morphTargets[L]={},A.morphTargets[L].name=P.morphTargets[L].name,A.morphTargets[L].vertices=[];for(var x,O=A.morphTargets[L].vertices,B=P.morphTargets[L].vertices,D=0,z=B.length;D<z;D+=3)x=new y,x.x=B[D]*R,x.y=B[D+1]*R,x.z=B[D+2]*R,O.push(x)}if(P.morphNormals!==void 0){for(var L=0,N=P.morphNormals.length;L<N;L++)if(A.morphTargets[L]){A.morphTargets[L].normals=[];for(var U,H=A.morphTargets[L].normals,Y=P.morphNormals[L].normals,D=0,z=Y.length;D<z;D+=3)U=new y,U.x=Y[D],U.y=Y[D+1],U.z=Y[D+2],H.push(U);A.morphNormalsReady=!0}}if(P.morphColors!==void 0){var L,N,ie,ae,ee,oe,j;for(L=0,N=P.morphColors.length;L<N;L++)for(A.morphColors[L]={},A.morphColors[L].name=P.morphColors[L].name,A.morphColors[L].colors=[],ee=A.morphColors[L].colors,oe=P.morphColors[L].colors,ie=0,ae=oe.length;ie<ae;ie+=3)j=new c.Color(16755200),j.setRGB(oe[ie],oe[ie+1],oe[ie+2]),ee.push(j)}}function T(P,A){var R=[],L=[];P.animation!==void 0&&L.push(P.animation),P.animations!==void 0&&(P.animations.length?L=L.concat(P.animations):L.push(P.animations));for(var N,x=0;x<L.length;x++)N=p.parseAnimation(L[x],A.bones),N&&R.push(N);if(A.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(A.morphTargets,10);R=R.concat(O)}0<R.length&&(A.animations=R)}return function(P,A){P.data!==void 0&&(P=P.data),P.scale=P.scale===void 0?1:1/P.scale;var R=new g;if(R.morphColors=[],_(P,R),C(P,R),I(P,R),T(P,R),R.computeFaceNormals(),R.computeBoundingSphere(),P.materials===void 0||P.materials.length===0)return{geometry:R};var L=f.prototype.initMaterials(P.materials,A,"Anonymous");if(P.materials[0].video){var N=A+P.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var x=new E(N);R._video=x}return L&&0<L.length&&(L[0].side=P.materials[0].singleSided?c.FrontSide:P.materials[0].flipSided?c.BackSide:c.DoubleSide,P.materials[0].specularCoef&&(L[0].shininess=Math.floor(P.materials[0].specularCoef/3))),{geometry:R,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,y){this.handlers.push(p,y)},get:function(p){for(var y=this.handlers,m=0,d=y.length;m<d;m+=2){var b=y[m],v=y[m+1];if(b.test(p))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,y,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],y,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,y=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,v){function g(_,C,I,T,P){var A,R=b+_,L=f.Handlers.get(R);L===null?(y.setCrossOrigin(v),A=y.load(R)):A=L.load(R),C!==void 0&&(A.repeat.fromArray(C),C[0]!==1&&(A.wrapS=c.RepeatWrapping),C[1]!==1&&(A.wrapT=c.RepeatWrapping)),I!==void 0&&A.offset.fromArray(I),T!==void 0&&(T[0]==="repeat"&&(A.wrapS=c.RepeatWrapping),T[0]==="mirror"&&(A.wrapS=c.MirroredRepeatWrapping),T[1]==="repeat"&&(A.wrapT=c.RepeatWrapping),T[1]==="mirror"&&(A.wrapT=c.MirroredRepeatWrapping)),P!==void 0&&(A.anisotropy=P);var N=c.MathUtils.generateUUID();return w[N]=A,N}var w={},S={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var E in d){var M=d[E];switch(E){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":S.name=M;break;case"blending":S.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",E,"is no longer supported.");break;case"colorDiffuse":S.color=p.fromArray(M).getHex();break;case"colorSpecular":S.specular=p.fromArray(M).getHex();break;case"colorEmissive":S.emissive=p.fromArray(M).getHex();break;case"specularCoef":S.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(S.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(S.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(S.type="MeshStandardMaterial");break;case"mapDiffuse":S.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":S.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":S.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":S.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":S.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":S.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":S.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":S.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":S.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":S.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":S.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":S.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":S.side=c.BackSide;break;case"doubleSided":S.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),S.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":S[E]=M;break;case"vertexColors":M===!0&&(S.vertexColors=c.VertexColors),M==="face"&&(S.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",E,M)}}return S.type==="MeshBasicMaterial"&&delete S.emissive,S.type!=="MeshPhongMaterial"&&delete S.specular,1>S.opacity&&(S.transparent=!0),m.setTextures(w),m.parse(S)}}()})},(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(p,y){var m=p/y*h.video.duration;h.video.currentTime=m},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(p){return h.video?p*(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,p=u(5).getCircularTexture,y=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,w)=>{if(v&&g){var S=h(v,w),E=p();g.map=E;var M=new f(S,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(v,g,w,S)=>{if(w){var E=new c.Color(S),M=new y(w,E);M.setPosition(g[0],g[1],g[2]);var _=M.getSprite();_.material.sizeAttenuation=!1,_.material.alphaTest=.5,_.material.transparent=!0,_.material.depthWrite=!1,_.material.depthTest=!1,this.group.add(_),d[v]=M}};this.addPoints=(v,g,w)=>{if(v&&0<v.length){var S=this.drawRange-1,E=this.addVertices(v),M=this.getMorph();if(!M){var _=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});E.colorsNeedUpdate=!0,this.createMesh(E,_,{localTimeEnabled:!1,localMorphColour:!1})}var C=S+v.length,I=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(S;S+I<C;){var T=typeof g=="string"?g:g[I];b(I,v[I],T,w),I++}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 w=this.getMorph(),S=g+v.length-1;if(!w||0>g||S>=this.drawRange)return;var E=w.geometry.getAttribute("position"),M=g;v.forEach(_=>{var C=d[M];C&&C.setPosition(_[0],_[1],_[2]),E.setXYZ(M++,_[0],_[1],_[2])}),E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,w,S)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,v,g,w,S)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,y=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var S=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=S,this.material=E,this.sizePerPixel=1,this.updateMorphTargets()}copy(S){return super.copy(S),this.material=S.material,this.geometry=S.geometry,this}raycast(S,E){var M=this.geometry,_=this.matrixWorld,C=S.params.Points.threshold,I=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(_),p.radius+=C,S.ray.intersectsSphere(p)!==!1){f.copy(_).invert(),h.copy(S.ray).applyMatrix4(f);var T=C/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,P=T*T;if(M.isBufferGeometry){var A=M.index,R=M.attributes,L=R.position,N=M.morphAttributes.position;if(A!==null)for(var x,O=Math.max(0,I.start),B=Math.min(A.count,I.start+I.count),D=O;D<B;D++)x=A.getX(D),g(this,L,N,x),v(y,x,P,_,S,E,this);else for(var z=Math.max(0,I.start),U=Math.min(L.count,I.start+I.count),H=z;H<U;H++)g(this,L,N,H),v(y,H,P,_,S,E,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var E=S.morphAttributes,M=Object.keys(E);if(0<M.length){var _=E[M[0]];if(_!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var C,I=0,T=_.length;I<T;I++)C=_[I].name||I+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[C]=I}}}else{var P=S.morphTargets;P!==void 0&&0<P.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(w,S,E,M,_,C,I){var T=h.distanceSqToPoint(w);if(T<E){var P=new c.Vector3;h.closestPointToPoint(w,P),P.applyMatrix4(M);var A=_.ray.origin.distanceTo(P);if(A<_.near||A>_.far)return;C.push({distance:A,distanceToRay:Math.sqrt(T),point:P,index:S,face:null,object:I})}}function g(w,S,E,M){y.fromBufferAttribute(S,M);var _=w.morphTargetInfluences;if(w.material.morphTargets&&E&&_){m.set(0,0,0);for(var C=0,I=E.length;C<I;C++){var T=_[C],P=E[C];T!==0&&(d.fromBufferAttribute(P,M),m.addScaledVector(d.sub(y),T))}y.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,y,m)=>{if(p&&y){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,y)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});m.colorsNeedUpdate=!0,this.createLineSegment(m,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,m,d,b,v,g,w){try{var S=y[g](w),E=S.value}catch(M){return void d(M)}S.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(S,b,v,g,w,"next",E)}function w(E){c(S,b,v,g,w,"throw",E)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var S,E=document.createElement("canvas"),M=0,_=Array(d.length),C=0;C<d.length;C++)S=yield y.imageToUint8Array(y,w,d[C],E),S&&S.array&&(b=S.width,v=S.height,_[g]=S.array,M+=_[g].length,g++);var I=new Uint8Array(M);M=0,_.forEach(T=>{I.set(T,M),M+=T.length}),y.impl=new h.DataTexture2DArray(I,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;m.transparent&&(b=m.transparent);var v=h.FrontSide;m.side&&(v=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:v}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(y,m,d,b,v,g,w){try{var S=y[g](w),E=S.value}catch(M){return void d(M)}S.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(S,b,v,g,w,"next",E)}function w(E){c(S,b,v,g,w,"throw",E)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(y,m){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=m})},p.prototype.imageToUint8Array=function(){var y=f(function*(m,d,b,v){yield m.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)}}(),p.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.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=p},(o,l,u)=>{function c(v,g){var w=Object.keys(v);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(v);g&&(S=S.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),w.push.apply(w,S)}return w}function f(v){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(S){h(v,S,g[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(S){Object.defineProperty(v,S,Object.getOwnPropertyDescriptor(g,S))});return v}function h(v,g,w){return g=p(g),g in v?Object.defineProperty(v,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[g]=w,v}function p(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var S=w.call(v,g||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var m=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var S=!0;this.createSlides=_=>{_.forEach(C=>this.createSlide(C))};var E=(_,C)=>{var I=_.material,T=I.uniforms;switch(_.rotation.x=0,_.rotation.y=0,_.rotation.z=0,_.position.x=0,_.position.y=0,_.position.z=0,C.direction){case"x":var P=S?-Math.PI/2:Math.PI/2;_.rotation.y=P,T.direction.value=1,T.slide.value.set(C.value,0,0),_.position.x=C.value;break;case"y":_.rotation.x=Math.PI/2,T.direction.value=2,T.slide.value.set(0,C.value,0),_.position.y=C.value;break;case"z":T.direction.value=3,T.slide.value.set(0,0,C.value),_.position.z=C.value;break}I.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=_=>{_&&_.id&&_.id in w&&w[_.id]&&E(w[_.id],_)},this.createSlide=_=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&_&&_.direction&&_.value!==void 0){var C=new m.PlaneGeometry(1,1);C.translate(.5,.5,0);var I=d.getUniforms();I.diffuse.value=this.texture.impl,I.depth.value=this.texture.size.depth,I.flipY.value=S;var T={fs:d.fs,vs:d.vs,uniforms:I,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},P=this.texture.getMaterial(T);P.needsUpdate=!0;var A=new m.Mesh(C,P);A.name=this.groupName,A.userData=this;var R={value:_.value,direction:_.direction,id:A.id};return g.push(R),E(A,R),w[A.id]=A,this.morph.add(A),this.boundingBoxUpdateRequired=!0,R}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=_=>{for(var C=0;C<g.length;C++)if(_===g[C].id)return f({},g[C])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=_=>{_&&this.removeSlideWithId(_.id)},this.removeSlideWithId=_=>{if(this.morph&&_ in w&&w[_]){if(this.morph.getObjectById(_)){var C=w[_];this.morph.remove(C),C.clear(),C.geometry&&C.geometry.dispose(),C.material&&C.material.dispose(),this.boundingBoxUpdateRequired=!0}var I=g.findIndex(T=>T.id===_);-1<I&&g.splice(I,1)}},this.dispose=()=>{this.morph.children.forEach(_=>{_.geometry&&_.geometry.dispose(),_.material&&_.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var M=(_,C,I)=>{switch(C.direction.value){case 1:I.copy(C.slide.value),_.expandByPoint(I),I.setY(1),I.setZ(1),_.expandByPoint(I);break;case 2:I.copy(C.slide.value),_.expandByPoint(I),I.setX(1),I.setZ(1),_.expandByPoint(I);break;case 3:I.copy(C.slide.value),_.expandByPoint(I),I.setX(1),I.setY(1),_.expandByPoint(I);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var _=new m.Vector3(0,0,0);this.morph.children.forEach(C=>{M(this.cachedBoundingBox,C.material.uniforms,_)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(_,C,I)=>{var T=new m.Matrix4;T.set(_[0],_[1],_[2],0,_[3],_[4],_[5],0,_[6],_[7],_[8],0,0,0,0,0);var P=new m.Quaternion().setFromRotationMatrix(T);this.morph.position.set(...C),this.morph.quaternion.copy(P),this.morph.scale.set(...I),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(_,C)=>{if(_){var I=_.locations;I&&0<I.length&&(this.applyTransformation(I[0].orientation,I[0].position,I[0].scale),"flipY"in I[0]&&(S=I[0].flipY)),this.createSlides(_.settings.slides),C!=null&&typeof C=="function"&&C(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;
3186
3186
  precision highp int;
3187
3187
  precision highp sampler2DArray;
@@ -3455,4 +3455,4 @@ void main() {
3455
3455
  state: () => new MyClass()
3456
3456
  Found in store "${_.$id}".`),m&&s&&t.hydrate&&t.hydrate(_.$state,m),c=!0,f=!0,_}function DF(n,e,t){let i,r;const s=typeof e=="function";i=n,r=s?t:e;function o(l,u){const c=a.hasInjectionContext();if(l=(process.env.NODE_ENV==="test"&&Ha&&Ha._testing?null:l)||(c?a.inject(PF,null):null),l&&tu(l),process.env.NODE_ENV!=="production"&&!Ha)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
3457
3457
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
3458
- This will fail in production.`);l=Ha,l._s.has(i)||(s?Ff(i,e,r,l):Gx(i,r,l),process.env.NODE_ENV!=="production"&&(o._pinia=l));const f=l._s.get(i);if(process.env.NODE_ENV!=="production"&&u){const h="__hot:"+i,p=s?Ff(h,e,r,l,!0):Gx(h,Cn({},r),l,!0);u._hotUpdate(p),delete l.state.value[h],l._s.delete(h)}if(process.env.NODE_ENV!=="production"&&ja){const h=a.getCurrentInstance();if(h&&h.proxy&&!u){const p=h.proxy,y="_pStores"in p?p._pStores:p._pStores={};y[i]=f}}return f}return o.$id=i,o}function Hx(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=function(){return n(this.$pinia)[i]},t),{}):Object.keys(e).reduce((t,i)=>(t[i]=function(){const r=n(this.$pinia),s=e[i];return typeof s=="function"?s.call(this,r):r[s]},t),{})}const Wx=DF("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),BF={name:"ScaffoldTooltip",components:{Col:On,CreateTooltipContent:Ja.CreateTooltipContent,ElIconDelete:cl,Icon:ht,Popover:Pl,Row:Jn,Tooltip:Ja.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:{},ElIconDelete:a.shallowRef(cl)}},computed:{...Hx(Wx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry={featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl}}}else this.display=!1,this.annotationEntry={}},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},FF={class:"tooltip-text"},VF={key:0,class:"tooltip-text"},kF={key:1,class:"delete-container"};function zF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=On,c=Cs,f=Jn,h=Pl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",FF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",VF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",kF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>[a.createTextVNode("Delete this feature?")]),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[2]||(e[2]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>[a.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[3]||(e[3]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>[a.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const jx=Bi(BF,[["render",zF],["__scopeId","data-v-e665391a"]]);/*! js-cookie v3.0.5 | MIT */function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)n[i]=t[i]}return n}var UF={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Vf(n,e){function t(r,s,o){if(!(typeof document>"u")){o=nu({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=r+"="+n.write(s,r)+l}}function i(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l<s.length;l++){var u=s[l].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(o[f]=n.read(c,f),r===f)break}catch{}}return r?o[r]:o}}return Object.create({set:t,get:i,remove:function(r,s){t(r,"",nu({},s,{expires:-1}))},withAttributes:function(r){return Vf(this.converter,nu({},this.attributes,r))},withConverter:function(r){return Vf(nu({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(n)}})}var kf=Vf(UF,{path:"/"}),oi=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},vt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},Fi,$a,ai,Qt,Sr;const GF=1e4;class HF{constructor(e){Fi.add(this),$a.set(this,void 0),ai.set(this,null),Qt.set(this,null),e.slice(-1)==="/"?oi(this,$a,e.slice(0,-1),"f"):oi(this,$a,e,"f")}get currentUser(){return vt(this,ai,"f")}get currentError(){return vt(this,Qt,"f")}async authenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"authenticate");return"error"in t?(kf.remove("annotation-key"),Promise.resolve(vt(this,Qt,"f"))):(kf.set("annotation-key",t.session,{secure:!0,expires:1}),oi(this,ai,t.data,"f"),Promise.resolve(vt(this,ai,"f")))}async unauthenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(vt(this,Qt,"f"))}async annotatedItemIds(e,t,i,r){const s={resource:t};i!==void 0&&(s.user=i),r!==void 0&&(s.participated=r);const o=await vt(this,Fi,"m",Sr).call(this,e,"items/","GET",s);return"error"in o?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(o)}async drawnFeatures(e,t,i){const r={resource:t};i!==void 0&&(r.items=i);const s=await vt(this,Fi,"m",Sr).call(this,e,"features/","GET",r);return"error"in s?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(s)}async itemAnnotations(e,t,i){const r=await vt(this,Fi,"m",Sr).call(this,e,"annotations/","GET",{resource:t,item:i});return"error"in r?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(r)}async annotation(e,t){const i=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","GET",{annotation:t});return"error"in i?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(i)}async addAnnotation(e,t){if(vt(this,ai,"f")&&vt(this,ai,"f").canUpdate){const i=Object.assign({creator:vt(this,ai,"f"),created:new Date().toISOString()},t),r=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","POST",{data:i});if(!("error"in r))return Promise.resolve(r);oi(this,Qt,r,"f")}else oi(this,Qt,{error:"user cannot add annotation"},"f");return Promise.resolve(vt(this,Qt,"f"))}}$a=new WeakMap,ai=new WeakMap,Qt=new WeakMap,Fi=new WeakSet,Sr=async function(e,t,i="GET",r={}){let s=!0;const o=new AbortController;setTimeout(()=>{s&&(console.log("Annotation server timeout..."),o.abort())},GF);const l={method:i,signal:o.signal};let u=`${vt(this,$a,"f")}/${t}`;const c=kf.get("annotation-key")||"";if(i==="GET"){const h=[];for(const[p,y]of Object.entries(r))h.push(`${p}=${encodeURIComponent(JSON.stringify(y))}`);h.push(`key=${encodeURIComponent(e)}`),h.push(`session=${encodeURIComponent(c)}`),u+="?"+h.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(i==="POST"){const h=Object.assign({key:e,session:c},r);l.body=JSON.stringify(h),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const f=await fetch(u,l);return s=!1,f.ok?Promise.resolve(await f.json()):(oi(this,Qt,{error:`${f.status} ${f.statusText}`},"f"),Promise.resolve(vt(this,Qt,"f")))};const Za={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},WF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},jF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Za.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Za.ALL||s.targetEventType===l)){const f=new WF(l,u,c);r(f)}}},$F=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new jF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},$x={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},zf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},xn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};xn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,zf.NAME_CHANGED)}},xn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.SETTINGS_CHANGED)},xn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},xn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},xn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},xn.prototype.getName=function(){return this.instanceName},xn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.DESTROYED);delete this},xn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},xn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},xn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const iu=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=Mr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},ZF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),h=l(f);return iu(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return iu(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);iu(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);iu(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},Uf=qc.THREE,XF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",$x.isWebGLAvailable())e=new qc.Renderer(n,window),qc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=$x.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:qc,renderer:e,container:n}},bt=function(){xn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new ZF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new Uf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};bt.prototype=Object.create(xn.prototype),bt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return 2}return 0});let t=e.indexOf(1);return t=t>-1?t:e.indexOf(2),n[t]}},bt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},bt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Za.MOVE;r&&(o=Za.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},bt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},bt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Uf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},bt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},bt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Za.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},bt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},bt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},bt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},bt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},bt.prototype.changeBackgroundColour=function(n){const e=new Uf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},bt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},bt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},bt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},bt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},bt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},bt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=XF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},bt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),xn.prototype.destroy.call(this)};const YF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},JF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Zx=function(n){bt.call(this);const e=this;let t;this.sceneData=new JF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(T){let P=6e3;e.scene&&(P=e.scene.getDuration());const A=T/100*P;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(A),e.sceneData.currentTime=T};const f=function(){let T=3e3;e.scene&&(T=e.scene.getDuration());const P=e.zincRenderer.getCurrentTime();for(let A=0;A<i.length;A++)i[A](P);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(P),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(P/T),e.sceneData.currentTime=P/T*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(T,P)=>{let A=this.scene.getZincCameraControls();T?(A.resetView(),this.NDCCameraControl=A.enableSyncControl(),A.setRotationMode(P)):(A.disableSyncControl(),this.NDCCameraControl=void 0,A.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=T=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(T,2)},this.setSyncControlCallback=T=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(T)},this.setSyncControlCenterZoom=(T,P)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(T,P)};const h=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const T=new Mr.THREE.Vector3;T.copy(e.selectedCenter);const P=e.scene.vectorToScreenXY(T);e.selectedScreenCoordinates.x=P.x,e.selectedScreenCoordinates.y=P.y}},p=function(){return function(){f()}},y=function(){return function(){h()}};this.addTimeChangedCallback=function(T){i.push(T)},this.setTexturePos=function(T){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(T)},this.addSceneChangedCallback=function(T){r.push(T)},this.addOrganPartAddedCallback=function(T){s.push(T)},this.addOrganPartRemovedCallback=function(T){o.push(T)},this.setFinishDownloadCallback=function(T){l=T},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(T){u=T},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(T,P){const A=new Mr.THREE.Vector3;A.setFromMatrixPosition(obj.matrixWorld);const R=width/2,L=height/2;return A.project(P),A.x=A.x*R+R,A.y=-(A.y*L)+L,A};const m=function(T){let P,A;if(T!==void 0){let R=!1;T.object.userData&&T.object.userData.isMarker?(R=!0,A=T.object.userData.parent.getMorph()):A=T.object;try{A.userData.userData.annotation.data.lastActionOnMarker=R}finally{}if(A)if(A.name)P=A.name;else{const L=e.getAnnotationsFromObjects([A]);L&&L[0]&&(P=L[0].data.group)}}return{id:P,object:A}},d=function(){return function(T,P,A){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0],intersected:R,intersects:T},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,L.object.userData.isGlyph?L.object.name?e.setSelectedByObjects([L.object],x,N,!0):e.setSelectedByZincObjects(L.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([L.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(T,P,A){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0]},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([L.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(T,P,A,R){if(R=="all"||R=="geometries"){const L=T.findGeometriesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="glyphsets"){const L=T.findGlyphsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="pointsets"){const L=T.findPointsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="lines"){const L=T.findLinesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}};this.changeGeometriesVisibility=function(T,P){v(e.scene,T,P,"geometries")},this.changeGlyphsetsVisibility=function(T,P){v(e.scene,T,P,"glyphsets")},this.changeLinesVisibility=function(T,P){v(e.scene,T,P,"lines")},this.changePointsetsVisibility=function(T,P){v(e.scene,T,P,"pointsets")},this.changeOrganPartsVisibility=function(T,P,A){let R="all";A!==void 0&&(R=A),v(e.scene,T,P,R)},this.changeOrganPartsVisibilityCallback=function(T){return function(P){e.changeOrganPartsVisibility(T,P)}},this.changeBackgroundColour=function(T){const P=new Mr.THREE.Color(T);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(P,1)};const g=function(T,P,A,R){for(let x=0;x<s.length;x++)s[x](R,e.scene.isTimeVarying());const L=new YF,N=R.region.getFullPath();L.data={species:e.sceneData.currentSpecies,system:T,part:P,group:R.groupName,region:N,uuid:R.uuid,lastActionOnMarker:!1},R.userData.annotation=L},w=function(T,P,A,R){for(let L=0;L<o.length;L++)o[L](R)},S=function(T,P,A){return function(R){g(T,P,A,R)}},E=function(T,P,A){return function(R){w(T,P,A,R)}},M=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},_=function(){return function(T){if((T==null?void 0:T.type)==="Error"&&u){const P={xhr:T.xhr,type:"download-error"};u(P)}}};this.updateFieldvisibility=function(T,P){for(let A=0;A<T.length;A++)if(P!=A){const R=T[A].PartName;e.changeOrganPartsVisibility(R,!1)}if(P>-1){const A=T[P].PartName;if(e.scene.findGeometriesWithGroupName(A).length>0||e.scene.findGlyphsetsWithGroupName(A).length>0)e.changeOrganPartsVisibility(A,!0);else{const R=getOrganDetails(T[P].SystemName,A);R!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+R.meta)}}},this.getAvailableSpecies=function(T,P,A){const R=new Array;R.push("none");const L=Object.keys(organsFileMap);for(index in L){const N=L[index];N!=T&&organsFileMap[N].hasOwnProperty(P)&&organsFileMap[N][P].hasOwnProperty(A)&&R.push(N)}return R},this.getCentreAndSize=function(){const T=new Mr.THREE.Vector3,P=this.scene.getBoundingBox();P.getCenter(T);const A=[T.x,T.y,T.z];P.getSize(T);const R=[T.x,T.y,T.z];return{centre:A,size:R}};const C=function(T,P,A,R){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=T,e.sceneData.currentSystem=P,e.sceneData.currentPart=A,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let L="";T&&(L=T+"/"),P&&(L=P+"/"),A&&(L=A),e.sceneData.currentName=L};this.loadOrgansFromURL=function(T,P,A,R,L,N){if(e.zincRenderer&&R&&e.sceneData.metaURL!==T){C(P,A,R);const x=e.sceneData.currentName;let O=e.zincRenderer.getSceneByName(x);O?N&&O.clearAll():O=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let D=0;D<r.length;D++)r[D](e.sceneData);L&&L!=""?(e.sceneData.viewURL=L,O.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,O.addZincObjectAddedCallbacks(S(A,R,!1)),O.addZincObjectRemovedCallbacks(E(void 0,R,!1)),O.loadMetadataURL(T,_(),M()),e.scene=O,e.zincRenderer.setCurrentScene(O),e.graphicsHighlight.reset();const B=O.getZincCameraControls();B.enableRaycaster(O,d(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(T,P,A){if(e.zincRenderer&&P&&e.sceneData.metaURL!==T){C(void 0,void 0,P);const R=e.sceneData.currentName;let L=e.zincRenderer.getSceneByName(R);L?A&&L.clearAll():L=e.zincRenderer.createScene(R);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,L.addZincObjectAddedCallbacks(S(void 0,P,!1)),L.addZincObjectRemovedCallbacks(E(void 0,P,!1)),L.loadGLTF(T,void 0,M()),e.scene=L,e.zincRenderer.setCurrentScene(L),e.graphicsHighlight.reset();const N=L.getZincCameraControls();N.enableRaycaster(L,d(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(T){const P=e.graphicsHighlight.getSelected();P&&P[0]&&P[0].userData&&e.scene.alignObjectToCameraView(P[0].userData,T)},this.exportSettings=function(){const T={};return T.name=e.instanceName,e.sceneData.currentSystem&&(T.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(T.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(T.part=e.sceneData.currentPart),T.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(T.viewURL=e.sceneData.viewURL),T.dialog="Organ Viewer",T},this.importSettings=function(T){return T&&T.dialog==this.typeName?(e.setName(T.name),T.metaURL!==void 0&&T.metaURL!=""?e.loadOrgansFromURL(T.metaURL,T.species,T.system,T.part,T.viewURL,!0):e.loadOrgans(T.species,T.system,T.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};Zx.prototype=Object.create(bt.prototype);var at=function(){return at=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},at.apply(this,arguments)};function KF(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function qF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xe(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var QF="ENTRIES",Xx="KEYS",Yx="VALUES",Yt="",Gf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Po(this._path),t=e.node,i=e.keys;if(Po(i)===Yt)return{done:!1,value:this.result()};var r=t.get(Po(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Po(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Po(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return Po(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Yx:return this.value();case Xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Po=function(n){return n[n.length-1]},eV=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Jx(n,e,t,i,o,1,r,""),i},Jx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Xe(n.keys()),p=h.next();!p.done;p=h.next()){var y=p.value;if(y===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var d=s,b=0;b<y.length;++b,++d){for(var v=y[b],g=o*d,w=g-o,S=r[g],E=Math.max(0,d-t-1),M=Math.min(o-1,d+t),_=E;_<M;++_){var C=v!==e[_],I=r[w+_]+ +C,T=r[w+_+1]+1,P=r[g+_]+1,A=r[g+_+1]=Math.min(I,T,P);A<S&&(S=A)}if(S>t)continue e}Jx(n.get(y),e,t,i,r,d,o,l+y)}}}catch(R){u={error:R}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},Hf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Rt(ru(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Rt($f(o),2),u=l[0],c=l[1];try{for(var f=Xe(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Yt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,tV(this._tree,e)},n.prototype.entries=function(){return new Gf(this,QF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Xe(this),s=r.next();!s.done;s=r.next()){var o=Rt(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return eV(this._tree,e,t)},n.prototype.get=function(e){var t=Wf(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=Wf(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Gf(this,Xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Gf(this,Yx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=Rt(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),ru=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Xe(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),ru(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),ru(void 0,"",t)},Wf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Xe(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return Wf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},jf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Xe(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},tV=function(n,e){var t=Rt(ru(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Kx(r);else if(i.size===1){var s=Rt(i.entries().next().value,2),o=s[0],l=s[1];qx(r,o,l)}}},Kx=function(n){if(n.length!==0){var e=Rt($f(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Kx(n.slice(0,-1));else if(t.size===1){var r=Rt(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&qx(n.slice(0,-1),s,o)}}},qx=function(n,e,t){if(n.length!==0){var i=Rt($f(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},$f=function(n){return n[n.length-1]},Xa,Zf="or",Qx="and",nV="and_not",iV=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?qf:e.autoVacuum;this._options=at(at(at({},Yf),e),{autoVacuum:t,searchOptions:at(at({},ew),e.searchOptions||{}),autoSuggestOptions:at(at({},lV),e.autoSuggestOptions||{})}),this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Kf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=c(e,g);if(w!=null){var S=f(w.toString(),g),E=this._fieldIds[g],M=new Set(S).size;this.addFieldLength(d,E,this._documentCount-1,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,T=h(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Xe(T)),A=P.next();!A.done;A=P.next()){var R=A.value;this.addTerm(E,d,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.addTerm(E,d,T)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var y=f.chunk,m=f.promise;return y.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,y=u.idField,m=h(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=h(e,g);if(w!=null){var S=c(w.toString(),g),E=this._fieldIds[g],M=new Set(S).size;this.removeFieldLength(d,E,this._documentCount,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,T=f(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Xe(T)),A=P.next();!A.done;A=P.next()){var R=A.value;this.removeTerm(E,d,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.removeTerm(E,d,T)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Kf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return KF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,y,m,d,b,v,g,w,S,E,M,_,C,I,T,P;return qF(this,function(A){switch(A.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Jf.batchSize,s=e.batchWait||Jf.batchWait,o=1,A.label=1;case 1:A.trys.push([1,7,8,9]),l=Xe(this._index),u=l.next(),A.label=2;case 2:if(u.done)return[3,6];c=Rt(u.value,2),f=c[0],h=c[1];try{for(p=(C=void 0,Xe(h)),y=p.next();!y.done;y=p.next()){m=Rt(y.value,2),d=m[0],b=m[1];try{for(v=(T=void 0,Xe(b)),g=v.next();!g.done;g=v.next())w=Rt(g.value,1),S=w[0],!this._documentIds.has(S)&&(b.size<=1?h.delete(d):b.delete(S))}catch(R){T={error:R}}finally{try{g&&!g.done&&(P=v.return)&&P.call(v)}finally{if(T)throw T.error}}}}catch(R){C={error:R}}finally{try{y&&!y.done&&(I=p.return)&&I.call(p)}finally{if(C)throw C.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(R){return setTimeout(R,s)})];case 3:A.sent(),A.label=4;case 4:o+=1,A.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return E=A.sent(),M={error:E},[3,9];case 8:try{u&&!u.done&&(_=l.return)&&_.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,A.label=10;case 10:return[4,null];case 11:return A.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||qf.minDirtCount,i=i||qf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Xe(s),u=l.next();!u.done;u=l.next()){var c=Rt(u.value,2),f=c[0],h=c[1],p=h.score,y=h.terms,m=h.match,d=y.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(nw),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=at(at({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Xe(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=h,m.count+=1):l.set(y,{score:h,terms:p,count:1})}}catch(E){i={error:E}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Xe(l),v=b.next();!v.done;v=b.next()){var g=Rt(v.value,2),m=g[0],w=g[1],h=w.score,p=w.terms,S=w.count;d.push({suggestion:m,terms:p,score:h/S})}}catch(E){s={error:E}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(nw),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Yf.hasOwnProperty(e))return Xf(Yf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=h,w._documentIds=su(p),w._idToShortId=new Map,w._fieldIds=y,w._fieldLength=su(m),w._avgFieldLength=d,w._storedFields=su(b),w._dirtCount=v||0,w._index=new Hf;try{for(var S=Xe(w._documentIds),E=S.next();!E.done;E=S.next()){var M=Rt(E.value,2),_=M[0],C=M[1];w._idToShortId.set(C,_)}}catch(D){i={error:D}}finally{try{E&&!E.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}try{for(var I=Xe(c),T=I.next();!T.done;T=I.next()){var P=Rt(T.value,2),A=P[0],R=P[1],L=new Map;try{for(var N=(l=void 0,Xe(Object.keys(R))),x=N.next();!x.done;x=N.next()){var O=x.value,B=R[O];g===1&&(B=B.ds),L.set(parseInt(O,10),su(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}w._index.set(A,L)}}catch(D){s={error:D}}finally{try{T&&!T.done&&(o=I.return)&&o.call(I)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=at(at(at({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=at(at({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,y=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(aV(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=at(at({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var D;return at(at({},O),(D={},D[B]=Xf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,y=at(at({},ew.weights),f),m=y.fuzzy,d=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var S=e.fuzzy===!0?.2:e.fuzzy,E=S<1?Math.min(h,Math.round(e.term.length*S)):S;E&&(w=this._index.fuzzyGet(e.term,E))}if(g)try{for(var M=Xe(g),_=M.next();!_.done;_=M.next()){var C=Rt(_.value,2),I=C[0],T=C[1],P=I.length-e.term.length;if(P){w==null||w.delete(I);var A=d*I.length/(I.length+.3*P);this.termResults(e.term,I,A,T,u,c,p,v)}}}catch(O){i={error:O}}finally{try{_&&!_.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var R=Xe(w.keys()),L=R.next();!L.done;L=R.next()){var I=L.value,N=Rt(w.get(I),2),x=N[0],P=N[1];if(P){var A=m*I.length/(I.length+P);this.termResults(e.term,I,A,x,u,c,p,v)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=R.return)&&o.call(R)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=at(at({},this._options.searchOptions),e);try{for(var o=Xe(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Zf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(rV[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Xe(this._index),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Xe(f)),y=p.next();!y.done;y=p.next()){var m=Rt(y.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Xe(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,v=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var S=w.size,E=this._avgFieldLength[g];try{for(var M=(h=void 0,Xe(w.keys())),_=M.next();!_.done;_=M.next()){var C=_.value;if(!this._documentIds.has(C)){this.removeTerm(g,C,t),S-=1;continue}var I=o?o(this._documentIds.get(C),t,this._storedFields.get(C)):1;if(I){var T=w.get(C),P=this._fieldLength.get(C)[g],A=oV(T,S,this._documentCount,P,E,l),R=i*v*I*A,L=u.get(C);if(L){L.score+=R,cV(L.terms,e);var N=Xf(L.match,t);N?N.push(b):L.match[t]=[b]}else u.set(C,{score:R,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){h={error:x}}finally{try{_&&!_.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,iw),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,iw),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Xe(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Xe(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Xf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},rV=(Xa={},Xa[Zf]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),tw(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa[Qx]=function(n,e){var t,i,r=new Map;try{for(var s=Xe(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;tw(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Xa[nV]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa),sV={k:1.2,b:.7,d:.5},oV=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},aV=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Yf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(uV)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},ew={combineWith:Zf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:sV},lV={combineWith:Qx,prefix:function(n,e,t){return e===t.length-1}},Jf={batchSize:1e3,batchWait:10},Kf={minDirtFactor:.1,minDirtCount:20},qf=at(at({},Jf),Kf),cV=function(n,e){n.includes(e)||n.push(e)},tw=function(n,e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},nw=function(n,e){var t=n.score,i=e.score;return i-t},iw=function(){return new Map},su=function(n){var e,t,i=new Map;try{for(var r=Xe(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},uV=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class dV{constructor(){this._searchEngine=new iV({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=cF(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const hV={name:"ScaffoldVuer",components:{Button:Cs,Col:On,Loading:YR,Option:Rs,Popover:Pl,Row:Jn,Select:As,Slider:Tn,TabPane:jg,Tabs:Wg,MapSvgIcon:ep.MapSvgIcon,MapSvgSpriteColor:ep.MapSvgSpriteColor,PrimitiveControls:Dx,ScaffoldTooltip:jx,ElIconWarningFilled:lm,ElIconArrowDown:Ru,ElIconArrowLeft:Hi,DrawToolbar:Ja.DrawToolbar,ScaffoldTreeControls:Bx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new HF(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},enableLocalAnnotations:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,userInformation:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],activeDrawTool:void 0,activeDrawMode:void 0,localAnnotationsList:a.markRaw([]),boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Zx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new dV},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new $F;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Hx(Wx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?n[1]:n[0]:n}},methods:{addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromLocalAnnotationList:function(n,e){for(let t=0;t<this.localAnnotationsList.length;t++){const i=this.localAnnotationsList[t];if(i.region===n&&i.group===e){this.localAnnotationsList.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.region.getFullPath(),t=n.groupName;n.region.findObjectsWithGroupName(t,!1).length===0&&(this.$_searchIndex.removeZincObject(n,n.uuid),this.removeFromLocalAnnotationList(e,t))}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=Ax(this.annotator,this.userToken,t,n,e,this.url,i);if(this.enableLocalAnnotations){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.removeFromLocalAnnotationList(s,e),this.localAnnotationsList.push(r)}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName;Ax(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted")&&this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject)}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(aF(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){if(this.createData.toBeDeleted=!1,n==="mode")this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0;else if(n==="tool"){if(this.annotationDisplay)return;this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1}},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ro(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.userInformation||this.enableLocalAnnotations)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=rF(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=sF(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)this.viewingMode==="Annotation"?(this.tData.label=i,this.tData.region=r,this.activateAnnotationMode(e,n)):(this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers));else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ro(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=Cx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url};this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},changeViewingMode:function(n){if(this.$module){if(n&&(this.viewingMode=n),this.viewingMode==="Annotation"){let e=!1;this.userInformation&&(e=!0),this.userInformation=void 0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate&&(this.userInformation=t,e||(Rx(this.annotator,this.userToken,this.url).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)}),Rx(this.annotator,this.userToken,encodeURIComponent(this.url)).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)})))})}else this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape="");this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate()}},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ro(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=Cx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.localAnnotationsList.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:this.viewingMode,search:n.search}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getLocalAnnotations:function(){return[...this.localAnnotationsList]},importLocalAnnotations:function(n){if(this.enableLocalAnnotations){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Of(this.$module.scene,e),n.forEach(t=>{this.localAnnotationsList.push({...t})})}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},Qf=n=>(a.pushScopeId("data-v-3f6a68de"),n=n(),a.popScopeId(),n),fV={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},pV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"Beta",-1)),mV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"What's new?",-1)),gV={class:"primitive-controls-box"},yV={class:"animation-data"},vV={class:"purple"},bV={class:"animation-data"},xV={class:"purple"},wV={class:"animation-data"},MV={class:"bottom-right-control"},SV=Qf(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),_V={style:{"margin-bottom":"2px"}},TV={key:0,class:"viewing-mode-title"},EV=["onClick"],CV=["onClick"];function AV(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=jx,u=a.resolveComponent("DrawToolbar"),c=lm,f=ht,h=Pl,p=Bx,y=Dx,m=a.resolveComponent("map-svg-icon"),d=Tn,b=Jn,v=jg,g=Rs,w=As,S=Wg,E=Cs,M=pd;return a.withDirectives((a.openBlock(),a.createElementBlock("div",fV,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,onConfirmCreate:e[0]||(e[0]=_=>s.confirmCreate(_)),onCancelCreate:e[1]||(e[1]=_=>s.cancelCreate()),onConfirmDelete:e[2]||(e[2]=_=>s.confirmDelete()),onTooltipHide:e[3]||(e[3]=_=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[4]||(e[4]=a.withKeys((..._)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(..._),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.userInformation||t.enableLocalAnnotations)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[5]||(e[5]=_=>s.showHelpText(7)),onMouseout:e[6]||(e[6]=_=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),pV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[7]||(e[7]=_=>s.showHelpText(8)),onMouseout:e[8]||(e[8]=_=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),mV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",gV,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(S,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[9]||(e[9]=_=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[10]||(e[10]=_=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[11]||(e[11]=_=>s.timeChange(_))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",yV,[a.createTextVNode(" Original duration: "),a.createElementVNode("div",vV,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",bV,[a.createTextVNode(" Animation duration: "),a.createElementVNode("div",xV,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",wV,[a.createTextVNode(" Playback speed "),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[12]||(e[12]=_=>s.speedChanged(_))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,_=>(a.openBlock(),a.createBlock(g,{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",MV,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[13]||(e[13]=_=>s.zoomIn()),onMouseover:e[14]||(e[14]=_=>s.showHelpText(0)),onMouseout:e[15]||(e[15]=_=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[16]||(e[16]=_=>s.zoomOut()),onMouseover:e[17]||(e[17]=_=>s.showHelpText(1)),onMouseout:e[18]||(e[18]=_=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[19]||(e[19]=_=>s.fitWindow()),onMouseover:e[20]||(e[20]=_=>s.showHelpText(2)),onMouseout:e[21]||(e[21]=_=>s.hideHelpText(2))})]),default:a.withCtx(()=>[SV]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,_=>(a.openBlock(),a.createBlock(b,{key:_.key},{default:a.withCtx(()=>[a.createVNode(E,{type:"primary",plain:"",onClick:C=>n.$emit("open-map",_.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(_.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",_V,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(_,C,I)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:C},[C===n.viewingMode?(a.openBlock(),a.createElementBlock("span",TV,[a.createElementVNode("b",null,a.toDisplayString(C),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:T=>s.changeViewingMode(C)},a.toDisplayString(C),9,EV))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1})]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode(" Change background ")]),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,_=>(a.openBlock(),a.createElementBlock("div",{key:_,class:a.normalizeClass(["backgroundChoice",_,_==n.currentBackground?"active":""]),onClick:C=>s.backgroundChangeCallback(_)},null,10,CV))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[22]||(e[22]=_=>s.showHelpText(3)),onMouseout:e[23]||(e[23]=_=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[24]||(e[24]=_=>s.showHelpText(4)),onMouseout:e[25]||(e[25]=_=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[M,n.loading]])}const RV=Bi(hV,[["render",AV],["__scopeId","data-v-3f6a68de"]]);Ht.ScaffoldVuer=RV,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});
3458
+ This will fail in production.`);l=Ha,l._s.has(i)||(s?Ff(i,e,r,l):Gx(i,r,l),process.env.NODE_ENV!=="production"&&(o._pinia=l));const f=l._s.get(i);if(process.env.NODE_ENV!=="production"&&u){const h="__hot:"+i,p=s?Ff(h,e,r,l,!0):Gx(h,Cn({},r),l,!0);u._hotUpdate(p),delete l.state.value[h],l._s.delete(h)}if(process.env.NODE_ENV!=="production"&&ja){const h=a.getCurrentInstance();if(h&&h.proxy&&!u){const p=h.proxy,y="_pStores"in p?p._pStores:p._pStores={};y[i]=f}}return f}return o.$id=i,o}function Hx(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=function(){return n(this.$pinia)[i]},t),{}):Object.keys(e).reduce((t,i)=>(t[i]=function(){const r=n(this.$pinia),s=e[i];return typeof s=="function"?s.call(this,r):r[s]},t),{})}const Wx=DF("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),BF={name:"ScaffoldTooltip",components:{Col:On,CreateTooltipContent:Ja.CreateTooltipContent,ElIconDelete:cl,Icon:ht,Popover:Pl,Row:Jn,Tooltip:Ja.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:{},ElIconDelete:a.shallowRef(cl)}},computed:{...Hx(Wx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry={featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl}}}else this.display=!1,this.annotationEntry={}},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},FF={class:"tooltip-text"},VF={key:0,class:"tooltip-text"},kF={key:1,class:"delete-container"};function zF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=On,c=Cs,f=Jn,h=Pl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",FF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",VF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",kF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>[a.createTextVNode("Delete this feature?")]),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[2]||(e[2]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>[a.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[3]||(e[3]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>[a.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const jx=Bi(BF,[["render",zF],["__scopeId","data-v-e665391a"]]);/*! js-cookie v3.0.5 | MIT */function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)n[i]=t[i]}return n}var UF={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Vf(n,e){function t(r,s,o){if(!(typeof document>"u")){o=nu({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=r+"="+n.write(s,r)+l}}function i(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l<s.length;l++){var u=s[l].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(o[f]=n.read(c,f),r===f)break}catch{}}return r?o[r]:o}}return Object.create({set:t,get:i,remove:function(r,s){t(r,"",nu({},s,{expires:-1}))},withAttributes:function(r){return Vf(this.converter,nu({},this.attributes,r))},withConverter:function(r){return Vf(nu({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(n)}})}var kf=Vf(UF,{path:"/"}),oi=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},vt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},Fi,$a,ai,Qt,Sr;const GF=1e4;class HF{constructor(e){Fi.add(this),$a.set(this,void 0),ai.set(this,null),Qt.set(this,null),e.slice(-1)==="/"?oi(this,$a,e.slice(0,-1),"f"):oi(this,$a,e,"f")}get currentUser(){return vt(this,ai,"f")}get currentError(){return vt(this,Qt,"f")}async authenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"authenticate");return"error"in t?(kf.remove("annotation-key"),Promise.resolve(vt(this,Qt,"f"))):(kf.set("annotation-key",t.session,{secure:!0,expires:1}),oi(this,ai,t.data,"f"),Promise.resolve(vt(this,ai,"f")))}async unauthenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(vt(this,Qt,"f"))}async annotatedItemIds(e,t,i,r){const s={resource:t};i!==void 0&&(s.user=i),r!==void 0&&(s.participated=r);const o=await vt(this,Fi,"m",Sr).call(this,e,"items/","GET",s);return"error"in o?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(o)}async drawnFeatures(e,t,i){const r={resource:t};i!==void 0&&(r.items=i);const s=await vt(this,Fi,"m",Sr).call(this,e,"features/","GET",r);return"error"in s?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(s)}async itemAnnotations(e,t,i){const r=await vt(this,Fi,"m",Sr).call(this,e,"annotations/","GET",{resource:t,item:i});return"error"in r?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(r)}async annotation(e,t){const i=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","GET",{annotation:t});return"error"in i?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(i)}async addAnnotation(e,t){if(vt(this,ai,"f")&&vt(this,ai,"f").canUpdate){const i=Object.assign({creator:vt(this,ai,"f"),created:new Date().toISOString()},t),r=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","POST",{data:i});if(!("error"in r))return Promise.resolve(r);oi(this,Qt,r,"f")}else oi(this,Qt,{error:"user cannot add annotation"},"f");return Promise.resolve(vt(this,Qt,"f"))}}$a=new WeakMap,ai=new WeakMap,Qt=new WeakMap,Fi=new WeakSet,Sr=async function(e,t,i="GET",r={}){let s=!0;const o=new AbortController;setTimeout(()=>{s&&(console.log("Annotation server timeout..."),o.abort())},GF);const l={method:i,signal:o.signal};let u=`${vt(this,$a,"f")}/${t}`;const c=kf.get("annotation-key")||"";if(i==="GET"){const h=[];for(const[p,y]of Object.entries(r))h.push(`${p}=${encodeURIComponent(JSON.stringify(y))}`);h.push(`key=${encodeURIComponent(e)}`),h.push(`session=${encodeURIComponent(c)}`),u+="?"+h.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(i==="POST"){const h=Object.assign({key:e,session:c},r);l.body=JSON.stringify(h),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const f=await fetch(u,l);return s=!1,f.ok?Promise.resolve(await f.json()):(oi(this,Qt,{error:`${f.status} ${f.statusText}`},"f"),Promise.resolve(vt(this,Qt,"f")))};const Za={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},WF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},jF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Za.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Za.ALL||s.targetEventType===l)){const f=new WF(l,u,c);r(f)}}},$F=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new jF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},$x={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},zf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},xn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};xn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,zf.NAME_CHANGED)}},xn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.SETTINGS_CHANGED)},xn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},xn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},xn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},xn.prototype.getName=function(){return this.instanceName},xn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.DESTROYED);delete this},xn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},xn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},xn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const iu=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=Mr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},ZF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),h=l(f);return iu(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return iu(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);iu(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);iu(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},Uf=qc.THREE,XF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",$x.isWebGLAvailable())e=new qc.Renderer(n,window),qc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=$x.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:qc,renderer:e,container:n}},bt=function(){xn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new ZF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new Uf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};bt.prototype=Object.create(xn.prototype),bt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},bt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},bt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Za.MOVE;r&&(o=Za.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},bt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},bt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Uf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},bt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},bt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Za.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},bt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},bt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},bt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},bt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},bt.prototype.changeBackgroundColour=function(n){const e=new Uf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},bt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},bt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},bt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},bt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},bt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},bt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=XF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},bt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),xn.prototype.destroy.call(this)};const YF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},JF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Zx=function(n){bt.call(this);const e=this;let t;this.sceneData=new JF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(T){let P=6e3;e.scene&&(P=e.scene.getDuration());const A=T/100*P;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(A),e.sceneData.currentTime=T};const f=function(){let T=3e3;e.scene&&(T=e.scene.getDuration());const P=e.zincRenderer.getCurrentTime();for(let A=0;A<i.length;A++)i[A](P);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(P),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(P/T),e.sceneData.currentTime=P/T*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(T,P)=>{let A=this.scene.getZincCameraControls();T?(A.resetView(),this.NDCCameraControl=A.enableSyncControl(),A.setRotationMode(P)):(A.disableSyncControl(),this.NDCCameraControl=void 0,A.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=T=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(T,2)},this.setSyncControlCallback=T=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(T)},this.setSyncControlCenterZoom=(T,P)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(T,P)};const h=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const T=new Mr.THREE.Vector3;T.copy(e.selectedCenter);const P=e.scene.vectorToScreenXY(T);e.selectedScreenCoordinates.x=P.x,e.selectedScreenCoordinates.y=P.y}},p=function(){return function(){f()}},y=function(){return function(){h()}};this.addTimeChangedCallback=function(T){i.push(T)},this.setTexturePos=function(T){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(T)},this.addSceneChangedCallback=function(T){r.push(T)},this.addOrganPartAddedCallback=function(T){s.push(T)},this.addOrganPartRemovedCallback=function(T){o.push(T)},this.setFinishDownloadCallback=function(T){l=T},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(T){u=T},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(T,P){const A=new Mr.THREE.Vector3;A.setFromMatrixPosition(obj.matrixWorld);const R=width/2,L=height/2;return A.project(P),A.x=A.x*R+R,A.y=-(A.y*L)+L,A};const m=function(T){let P,A;if(T!==void 0){let R=!1;T.object.userData&&T.object.userData.isMarker?(R=!0,A=T.object.userData.parent.getMorph()):A=T.object;try{A.userData.userData.annotation.data.lastActionOnMarker=R}finally{}if(A)if(A.name)P=A.name;else{const L=e.getAnnotationsFromObjects([A]);L&&L[0]&&(P=L[0].data.group)}}return{id:P,object:A}},d=function(){return function(T,P,A){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0],intersected:R,intersects:T},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,L.object.userData.isGlyph?L.object.name?e.setSelectedByObjects([L.object],x,N,!0):e.setSelectedByZincObjects(L.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([L.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(T,P,A){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0]},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([L.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(T,P,A,R){if(R=="all"||R=="geometries"){const L=T.findGeometriesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="glyphsets"){const L=T.findGlyphsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="pointsets"){const L=T.findPointsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="lines"){const L=T.findLinesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}};this.changeGeometriesVisibility=function(T,P){v(e.scene,T,P,"geometries")},this.changeGlyphsetsVisibility=function(T,P){v(e.scene,T,P,"glyphsets")},this.changeLinesVisibility=function(T,P){v(e.scene,T,P,"lines")},this.changePointsetsVisibility=function(T,P){v(e.scene,T,P,"pointsets")},this.changeOrganPartsVisibility=function(T,P,A){let R="all";A!==void 0&&(R=A),v(e.scene,T,P,R)},this.changeOrganPartsVisibilityCallback=function(T){return function(P){e.changeOrganPartsVisibility(T,P)}},this.changeBackgroundColour=function(T){const P=new Mr.THREE.Color(T);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(P,1)};const g=function(T,P,A,R){for(let x=0;x<s.length;x++)s[x](R,e.scene.isTimeVarying());const L=new YF,N=R.region.getFullPath();L.data={species:e.sceneData.currentSpecies,system:T,part:P,group:R.groupName,region:N,uuid:R.uuid,lastActionOnMarker:!1},R.userData.annotation=L},w=function(T,P,A,R){for(let L=0;L<o.length;L++)o[L](R)},S=function(T,P,A){return function(R){g(T,P,A,R)}},E=function(T,P,A){return function(R){w(T,P,A,R)}},M=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},_=function(){return function(T){if((T==null?void 0:T.type)==="Error"&&u){const P={xhr:T.xhr,type:"download-error"};u(P)}}};this.updateFieldvisibility=function(T,P){for(let A=0;A<T.length;A++)if(P!=A){const R=T[A].PartName;e.changeOrganPartsVisibility(R,!1)}if(P>-1){const A=T[P].PartName;if(e.scene.findGeometriesWithGroupName(A).length>0||e.scene.findGlyphsetsWithGroupName(A).length>0)e.changeOrganPartsVisibility(A,!0);else{const R=getOrganDetails(T[P].SystemName,A);R!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+R.meta)}}},this.getAvailableSpecies=function(T,P,A){const R=new Array;R.push("none");const L=Object.keys(organsFileMap);for(index in L){const N=L[index];N!=T&&organsFileMap[N].hasOwnProperty(P)&&organsFileMap[N][P].hasOwnProperty(A)&&R.push(N)}return R},this.getCentreAndSize=function(){const T=new Mr.THREE.Vector3,P=this.scene.getBoundingBox();P.getCenter(T);const A=[T.x,T.y,T.z];P.getSize(T);const R=[T.x,T.y,T.z];return{centre:A,size:R}};const C=function(T,P,A,R){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=T,e.sceneData.currentSystem=P,e.sceneData.currentPart=A,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let L="";T&&(L=T+"/"),P&&(L=P+"/"),A&&(L=A),e.sceneData.currentName=L};this.loadOrgansFromURL=function(T,P,A,R,L,N){if(e.zincRenderer&&R&&e.sceneData.metaURL!==T){C(P,A,R);const x=e.sceneData.currentName;let O=e.zincRenderer.getSceneByName(x);O?N&&O.clearAll():O=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let D=0;D<r.length;D++)r[D](e.sceneData);L&&L!=""?(e.sceneData.viewURL=L,O.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,O.addZincObjectAddedCallbacks(S(A,R,!1)),O.addZincObjectRemovedCallbacks(E(void 0,R,!1)),O.loadMetadataURL(T,_(),M()),e.scene=O,e.zincRenderer.setCurrentScene(O),e.graphicsHighlight.reset();const B=O.getZincCameraControls();B.enableRaycaster(O,d(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(T,P,A){if(e.zincRenderer&&P&&e.sceneData.metaURL!==T){C(void 0,void 0,P);const R=e.sceneData.currentName;let L=e.zincRenderer.getSceneByName(R);L?A&&L.clearAll():L=e.zincRenderer.createScene(R);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,L.addZincObjectAddedCallbacks(S(void 0,P,!1)),L.addZincObjectRemovedCallbacks(E(void 0,P,!1)),L.loadGLTF(T,void 0,M()),e.scene=L,e.zincRenderer.setCurrentScene(L),e.graphicsHighlight.reset();const N=L.getZincCameraControls();N.enableRaycaster(L,d(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(T){const P=e.graphicsHighlight.getSelected();P&&P[0]&&P[0].userData&&e.scene.alignObjectToCameraView(P[0].userData,T)},this.exportSettings=function(){const T={};return T.name=e.instanceName,e.sceneData.currentSystem&&(T.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(T.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(T.part=e.sceneData.currentPart),T.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(T.viewURL=e.sceneData.viewURL),T.dialog="Organ Viewer",T},this.importSettings=function(T){return T&&T.dialog==this.typeName?(e.setName(T.name),T.metaURL!==void 0&&T.metaURL!=""?e.loadOrgansFromURL(T.metaURL,T.species,T.system,T.part,T.viewURL,!0):e.loadOrgans(T.species,T.system,T.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};Zx.prototype=Object.create(bt.prototype);var at=function(){return at=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},at.apply(this,arguments)};function KF(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function qF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xe(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var QF="ENTRIES",Xx="KEYS",Yx="VALUES",Yt="",Gf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Po(this._path),t=e.node,i=e.keys;if(Po(i)===Yt)return{done:!1,value:this.result()};var r=t.get(Po(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Po(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Po(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return Po(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Yx:return this.value();case Xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Po=function(n){return n[n.length-1]},eV=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Jx(n,e,t,i,o,1,r,""),i},Jx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Xe(n.keys()),p=h.next();!p.done;p=h.next()){var y=p.value;if(y===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var d=s,b=0;b<y.length;++b,++d){for(var v=y[b],g=o*d,w=g-o,S=r[g],E=Math.max(0,d-t-1),M=Math.min(o-1,d+t),_=E;_<M;++_){var C=v!==e[_],I=r[w+_]+ +C,T=r[w+_+1]+1,P=r[g+_]+1,A=r[g+_+1]=Math.min(I,T,P);A<S&&(S=A)}if(S>t)continue e}Jx(n.get(y),e,t,i,r,d,o,l+y)}}}catch(R){u={error:R}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},Hf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Rt(ru(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Rt($f(o),2),u=l[0],c=l[1];try{for(var f=Xe(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Yt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,tV(this._tree,e)},n.prototype.entries=function(){return new Gf(this,QF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Xe(this),s=r.next();!s.done;s=r.next()){var o=Rt(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return eV(this._tree,e,t)},n.prototype.get=function(e){var t=Wf(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=Wf(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Gf(this,Xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Gf(this,Yx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=Rt(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),ru=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Xe(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),ru(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),ru(void 0,"",t)},Wf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Xe(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return Wf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},jf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Xe(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},tV=function(n,e){var t=Rt(ru(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Kx(r);else if(i.size===1){var s=Rt(i.entries().next().value,2),o=s[0],l=s[1];qx(r,o,l)}}},Kx=function(n){if(n.length!==0){var e=Rt($f(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Kx(n.slice(0,-1));else if(t.size===1){var r=Rt(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&qx(n.slice(0,-1),s,o)}}},qx=function(n,e,t){if(n.length!==0){var i=Rt($f(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},$f=function(n){return n[n.length-1]},Xa,Zf="or",Qx="and",nV="and_not",iV=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?qf:e.autoVacuum;this._options=at(at(at({},Yf),e),{autoVacuum:t,searchOptions:at(at({},ew),e.searchOptions||{}),autoSuggestOptions:at(at({},lV),e.autoSuggestOptions||{})}),this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Kf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=c(e,g);if(w!=null){var S=f(w.toString(),g),E=this._fieldIds[g],M=new Set(S).size;this.addFieldLength(d,E,this._documentCount-1,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,T=h(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Xe(T)),A=P.next();!A.done;A=P.next()){var R=A.value;this.addTerm(E,d,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.addTerm(E,d,T)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var y=f.chunk,m=f.promise;return y.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,y=u.idField,m=h(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=h(e,g);if(w!=null){var S=c(w.toString(),g),E=this._fieldIds[g],M=new Set(S).size;this.removeFieldLength(d,E,this._documentCount,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,T=f(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Xe(T)),A=P.next();!A.done;A=P.next()){var R=A.value;this.removeTerm(E,d,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.removeTerm(E,d,T)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Kf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return KF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,y,m,d,b,v,g,w,S,E,M,_,C,I,T,P;return qF(this,function(A){switch(A.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Jf.batchSize,s=e.batchWait||Jf.batchWait,o=1,A.label=1;case 1:A.trys.push([1,7,8,9]),l=Xe(this._index),u=l.next(),A.label=2;case 2:if(u.done)return[3,6];c=Rt(u.value,2),f=c[0],h=c[1];try{for(p=(C=void 0,Xe(h)),y=p.next();!y.done;y=p.next()){m=Rt(y.value,2),d=m[0],b=m[1];try{for(v=(T=void 0,Xe(b)),g=v.next();!g.done;g=v.next())w=Rt(g.value,1),S=w[0],!this._documentIds.has(S)&&(b.size<=1?h.delete(d):b.delete(S))}catch(R){T={error:R}}finally{try{g&&!g.done&&(P=v.return)&&P.call(v)}finally{if(T)throw T.error}}}}catch(R){C={error:R}}finally{try{y&&!y.done&&(I=p.return)&&I.call(p)}finally{if(C)throw C.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(R){return setTimeout(R,s)})];case 3:A.sent(),A.label=4;case 4:o+=1,A.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return E=A.sent(),M={error:E},[3,9];case 8:try{u&&!u.done&&(_=l.return)&&_.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,A.label=10;case 10:return[4,null];case 11:return A.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||qf.minDirtCount,i=i||qf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Xe(s),u=l.next();!u.done;u=l.next()){var c=Rt(u.value,2),f=c[0],h=c[1],p=h.score,y=h.terms,m=h.match,d=y.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(nw),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=at(at({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Xe(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=h,m.count+=1):l.set(y,{score:h,terms:p,count:1})}}catch(E){i={error:E}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Xe(l),v=b.next();!v.done;v=b.next()){var g=Rt(v.value,2),m=g[0],w=g[1],h=w.score,p=w.terms,S=w.count;d.push({suggestion:m,terms:p,score:h/S})}}catch(E){s={error:E}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(nw),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Yf.hasOwnProperty(e))return Xf(Yf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=h,w._documentIds=su(p),w._idToShortId=new Map,w._fieldIds=y,w._fieldLength=su(m),w._avgFieldLength=d,w._storedFields=su(b),w._dirtCount=v||0,w._index=new Hf;try{for(var S=Xe(w._documentIds),E=S.next();!E.done;E=S.next()){var M=Rt(E.value,2),_=M[0],C=M[1];w._idToShortId.set(C,_)}}catch(D){i={error:D}}finally{try{E&&!E.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}try{for(var I=Xe(c),T=I.next();!T.done;T=I.next()){var P=Rt(T.value,2),A=P[0],R=P[1],L=new Map;try{for(var N=(l=void 0,Xe(Object.keys(R))),x=N.next();!x.done;x=N.next()){var O=x.value,B=R[O];g===1&&(B=B.ds),L.set(parseInt(O,10),su(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}w._index.set(A,L)}}catch(D){s={error:D}}finally{try{T&&!T.done&&(o=I.return)&&o.call(I)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=at(at(at({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=at(at({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,y=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(aV(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=at(at({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var D;return at(at({},O),(D={},D[B]=Xf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,y=at(at({},ew.weights),f),m=y.fuzzy,d=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var S=e.fuzzy===!0?.2:e.fuzzy,E=S<1?Math.min(h,Math.round(e.term.length*S)):S;E&&(w=this._index.fuzzyGet(e.term,E))}if(g)try{for(var M=Xe(g),_=M.next();!_.done;_=M.next()){var C=Rt(_.value,2),I=C[0],T=C[1],P=I.length-e.term.length;if(P){w==null||w.delete(I);var A=d*I.length/(I.length+.3*P);this.termResults(e.term,I,A,T,u,c,p,v)}}}catch(O){i={error:O}}finally{try{_&&!_.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var R=Xe(w.keys()),L=R.next();!L.done;L=R.next()){var I=L.value,N=Rt(w.get(I),2),x=N[0],P=N[1];if(P){var A=m*I.length/(I.length+P);this.termResults(e.term,I,A,x,u,c,p,v)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=R.return)&&o.call(R)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=at(at({},this._options.searchOptions),e);try{for(var o=Xe(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Zf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(rV[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Xe(this._index),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Xe(f)),y=p.next();!y.done;y=p.next()){var m=Rt(y.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Xe(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,v=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var S=w.size,E=this._avgFieldLength[g];try{for(var M=(h=void 0,Xe(w.keys())),_=M.next();!_.done;_=M.next()){var C=_.value;if(!this._documentIds.has(C)){this.removeTerm(g,C,t),S-=1;continue}var I=o?o(this._documentIds.get(C),t,this._storedFields.get(C)):1;if(I){var T=w.get(C),P=this._fieldLength.get(C)[g],A=oV(T,S,this._documentCount,P,E,l),R=i*v*I*A,L=u.get(C);if(L){L.score+=R,cV(L.terms,e);var N=Xf(L.match,t);N?N.push(b):L.match[t]=[b]}else u.set(C,{score:R,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){h={error:x}}finally{try{_&&!_.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,iw),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,iw),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Xe(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Xe(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Xf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},rV=(Xa={},Xa[Zf]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),tw(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa[Qx]=function(n,e){var t,i,r=new Map;try{for(var s=Xe(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;tw(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Xa[nV]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa),sV={k:1.2,b:.7,d:.5},oV=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},aV=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Yf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(uV)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},ew={combineWith:Zf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:sV},lV={combineWith:Qx,prefix:function(n,e,t){return e===t.length-1}},Jf={batchSize:1e3,batchWait:10},Kf={minDirtFactor:.1,minDirtCount:20},qf=at(at({},Jf),Kf),cV=function(n,e){n.includes(e)||n.push(e)},tw=function(n,e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},nw=function(n,e){var t=n.score,i=e.score;return i-t},iw=function(){return new Map},su=function(n){var e,t,i=new Map;try{for(var r=Xe(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},uV=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class dV{constructor(){this._searchEngine=new iV({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=cF(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const hV={name:"ScaffoldVuer",components:{Button:Cs,Col:On,Loading:YR,Option:Rs,Popover:Pl,Row:Jn,Select:As,Slider:Tn,TabPane:jg,Tabs:Wg,MapSvgIcon:ep.MapSvgIcon,MapSvgSpriteColor:ep.MapSvgSpriteColor,PrimitiveControls:Dx,ScaffoldTooltip:jx,ElIconWarningFilled:lm,ElIconArrowDown:Ru,ElIconArrowLeft:Hi,DrawToolbar:Ja.DrawToolbar,ScaffoldTreeControls:Bx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new HF(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},enableLocalAnnotations:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,userInformation:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],activeDrawTool:void 0,activeDrawMode:void 0,localAnnotationsList:a.markRaw([]),boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Zx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new dV},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new $F;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Hx(Wx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?n[1]:n[0]:n}},methods:{addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromLocalAnnotationList:function(n,e){for(let t=0;t<this.localAnnotationsList.length;t++){const i=this.localAnnotationsList[t];if(i.region===n&&i.group===e){this.localAnnotationsList.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.region.getFullPath(),t=n.groupName;n.region.findObjectsWithGroupName(t,!1).length===0&&(this.$_searchIndex.removeZincObject(n,n.uuid),this.removeFromLocalAnnotationList(e,t))}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=Ax(this.annotator,this.userToken,t,n,e,this.url,i);if(this.enableLocalAnnotations){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.removeFromLocalAnnotationList(s,e),this.localAnnotationsList.push(r)}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName;Ax(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted")&&this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject)}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(aF(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){if(this.createData.toBeDeleted=!1,n==="mode")this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0;else if(n==="tool"){if(this.annotationDisplay)return;this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1}},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ro(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.userInformation||this.enableLocalAnnotations)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=rF(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=sF(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)this.viewingMode==="Annotation"?(this.tData.label=i,this.tData.region=r,this.activateAnnotationMode(e,n)):(this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers));else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ro(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=Cx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url};this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},changeViewingMode:function(n){if(this.$module){if(n&&(this.viewingMode=n),this.viewingMode==="Annotation"){let e=!1;this.userInformation&&(e=!0),this.userInformation=void 0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate&&(this.userInformation=t,e||(Rx(this.annotator,this.userToken,this.url).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)}),Rx(this.annotator,this.userToken,encodeURIComponent(this.url)).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)})))})}else this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape="");this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate()}},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ro(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=Cx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.localAnnotationsList.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:this.viewingMode,search:n.search}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getLocalAnnotations:function(){return[...this.localAnnotationsList]},importLocalAnnotations:function(n){if(this.enableLocalAnnotations){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Of(this.$module.scene,e),n.forEach(t=>{this.localAnnotationsList.push({...t})})}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},Qf=n=>(a.pushScopeId("data-v-3f6a68de"),n=n(),a.popScopeId(),n),fV={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},pV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"Beta",-1)),mV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"What's new?",-1)),gV={class:"primitive-controls-box"},yV={class:"animation-data"},vV={class:"purple"},bV={class:"animation-data"},xV={class:"purple"},wV={class:"animation-data"},MV={class:"bottom-right-control"},SV=Qf(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),_V={style:{"margin-bottom":"2px"}},TV={key:0,class:"viewing-mode-title"},EV=["onClick"],CV=["onClick"];function AV(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=jx,u=a.resolveComponent("DrawToolbar"),c=lm,f=ht,h=Pl,p=Bx,y=Dx,m=a.resolveComponent("map-svg-icon"),d=Tn,b=Jn,v=jg,g=Rs,w=As,S=Wg,E=Cs,M=pd;return a.withDirectives((a.openBlock(),a.createElementBlock("div",fV,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,onConfirmCreate:e[0]||(e[0]=_=>s.confirmCreate(_)),onCancelCreate:e[1]||(e[1]=_=>s.cancelCreate()),onConfirmDelete:e[2]||(e[2]=_=>s.confirmDelete()),onTooltipHide:e[3]||(e[3]=_=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[4]||(e[4]=a.withKeys((..._)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(..._),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.userInformation||t.enableLocalAnnotations)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[5]||(e[5]=_=>s.showHelpText(7)),onMouseout:e[6]||(e[6]=_=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),pV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[7]||(e[7]=_=>s.showHelpText(8)),onMouseout:e[8]||(e[8]=_=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),mV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",gV,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(S,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[9]||(e[9]=_=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[10]||(e[10]=_=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[11]||(e[11]=_=>s.timeChange(_))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",yV,[a.createTextVNode(" Original duration: "),a.createElementVNode("div",vV,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",bV,[a.createTextVNode(" Animation duration: "),a.createElementVNode("div",xV,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",wV,[a.createTextVNode(" Playback speed "),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[12]||(e[12]=_=>s.speedChanged(_))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,_=>(a.openBlock(),a.createBlock(g,{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",MV,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[13]||(e[13]=_=>s.zoomIn()),onMouseover:e[14]||(e[14]=_=>s.showHelpText(0)),onMouseout:e[15]||(e[15]=_=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[16]||(e[16]=_=>s.zoomOut()),onMouseover:e[17]||(e[17]=_=>s.showHelpText(1)),onMouseout:e[18]||(e[18]=_=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[19]||(e[19]=_=>s.fitWindow()),onMouseover:e[20]||(e[20]=_=>s.showHelpText(2)),onMouseout:e[21]||(e[21]=_=>s.hideHelpText(2))})]),default:a.withCtx(()=>[SV]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,_=>(a.openBlock(),a.createBlock(b,{key:_.key},{default:a.withCtx(()=>[a.createVNode(E,{type:"primary",plain:"",onClick:C=>n.$emit("open-map",_.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(_.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",_V,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(_,C,I)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:C},[C===n.viewingMode?(a.openBlock(),a.createElementBlock("span",TV,[a.createElementVNode("b",null,a.toDisplayString(C),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:T=>s.changeViewingMode(C)},a.toDisplayString(C),9,EV))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1})]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode(" Change background ")]),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,_=>(a.openBlock(),a.createElementBlock("div",{key:_,class:a.normalizeClass(["backgroundChoice",_,_==n.currentBackground?"active":""]),onClick:C=>s.backgroundChangeCallback(_)},null,10,CV))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[22]||(e[22]=_=>s.showHelpText(3)),onMouseout:e[23]||(e[23]=_=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[24]||(e[24]=_=>s.showHelpText(4)),onMouseout:e[25]||(e[25]=_=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[M,n.loading]])}const RV=Bi(hV,[["render",AV],["__scopeId","data-v-3f6a68de"]]);Ht.ScaffoldVuer=RV,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});