three-low-poly 0.9.18 → 0.9.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +121 -9
- package/dist/index.es.js +1185 -1068
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +10 -10
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +10 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ct=Object.defineProperty;var Rt=(t,e,o)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var v=(t,e,o)=>Rt(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("three");function Vt(t,e,o,r){const a=t.position.clone(),s=a.clone().add(t.getWorldDirection(new n.Vector3).multiplyScalar(-e));let i=null;function c(l){i===null&&(i=l);const h=(l-i)/o;if(h>=1){t.position.copy(s),r&&r();return}t.position.lerpVectors(a,s,h),requestAnimationFrame(c)}requestAnimationFrame(c)}function Ut(t,e,o,r){const a=e.length-1;let s=null;function i(c){s===null&&(s=c);const u=(c-s)/o;if(u>=1){t.position.copy(e[e.length-1]),r&&r();return}const h=u*a,m=Math.floor(h),d=h-m,f=e[m],M=e[m+1];t.position.lerpVectors(f,M,d),t.lookAt(M),requestAnimationFrame(i)}requestAnimationFrame(i)}function Nt(t,e,o,r,a){let s=null;function i(c){s||(s=c);const u=(c-s)/r;if(u>=1){a&&a();return}const h=u*Math.PI*2,m=e.x+o*Math.cos(h),d=e.z+o*Math.sin(h);t.position.set(m,t.position.y,d),t.lookAt(e),requestAnimationFrame(i)}requestAnimationFrame(i)}function Ot(t,e,o,r,a,s){let i=null,c=0;function l(u){i===null&&(i=u);const h=u-i,m=r/a,d=h%m/m,f=Math.sin(d*Math.PI*2)*Math.PI/6,M=e.x+o*Math.sin(f),p=e.z+o*Math.cos(f);if(t.position.set(M,t.position.y,p),t.lookAt(e),h>=(c+1)*m&&c++,c>=a){s&&s();return}requestAnimationFrame(l)}requestAnimationFrame(l)}function _t(t,e,o,r,a,s,i){let c=null;function l(u){c===null&&(c=u);const m=(u-c)/s;if(m>=1){i&&i();return}const d=m*Math.PI*2*a,f=e.x+o*Math.cos(d),M=e.z+o*Math.sin(d),p=e.y+r*m;t.position.set(f,p,M),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}function Lt(t,e,o,r){const a=t.position.clone();let s=null;function i(c){if(s===null&&(s=c),(c-s)/o>=1){t.position.copy(a),r&&r();return}const h=new n.Vector3((Math.random()-.5)*e,(Math.random()-.5)*e,(Math.random()-.5)*e);t.position.copy(a).add(h),requestAnimationFrame(i)}requestAnimationFrame(i)}function Ft(t,e,o,r,a,s){const i=t.fov;t.fov=o,t.updateProjectionMatrix();let c=null;function l(u){c===null&&(c=u);const m=(u-c)/a;if(m>=1){t.fov=r,t.updateProjectionMatrix(),t.lookAt(e),t.fov=i,t.updateProjectionMatrix(),s&&s();return}t.fov=n.MathUtils.lerp(o,r,m),t.updateProjectionMatrix(),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}class kt{constructor(e){v(this,"speed");v(this,"maxIntensity");v(this,"minIntensity");v(this,"material");const{speed:o=2,maxIntensity:r=.8,minIntensity:a=.2}=e;this.speed=o,this.maxIntensity=r,this.minIntensity=a,this.material=e.material}update(e=0){this.material.emissiveIntensity=this.minIntensity+Math.abs(Math.sin(e*this.speed))*(this.maxIntensity-this.minIntensity)}}function q(t=0,e=1){return Math.random()*(e-t)+t}function Dt(t=0,e=1){return Math.floor(Math.random()*(e-t+1))+t}function K(t=.5,e=0,o=1){return e+(o-e)*Math.pow(Math.random(),t)}function W(t=.5,e=0,o=1){return e+(o-e)*Math.pow(1-Math.random(),t)}function J(t,e,o){const r=e+Math.random()*(o-e);return setTimeout(t,r)}function zt(t,e,o){let r;function a(){const s=e+Math.random()*(o-e);r=setTimeout(()=>{t(),a()},s)}return a(),()=>clearTimeout(r)}class qt{constructor({light:e,minIntensity:o=15,maxIntensity:r=20,minDuration:a=50,maxDuration:s=250}={}){v(this,"light");v(this,"minIntensity");v(this,"maxIntensity");v(this,"minDuration");v(this,"maxDuration");this.light=e,this.minIntensity=o,this.maxIntensity=r,this.minDuration=a,this.maxDuration=s}triggerLightning(){this.light&&(this.light.intensity=q(this.minIntensity,this.maxIntensity)),J(()=>{this.light&&(this.light.intensity=0)},this.minDuration,this.maxDuration)}update(){Math.random()>.98&&this.triggerLightning()}}const U={UP:new n.Vector3(0,1,0),DOWN:new n.Vector3(0,-1,0),LEFT:new n.Vector3(-1,0,0),RIGHT:new n.Vector3(1,0,0),FORWARD:new n.Vector3(0,0,1),BACKWARD:new n.Vector3(0,0,-1)},C={LINEAR:(t,e)=>1-t/e,QUADRATIC:(t,e)=>Math.pow(1-t/e,2),SQUARE_ROOT:(t,e)=>Math.pow(1-t/e,.5),LOGARITHMIC:(t,e)=>Math.log(1+(e-t))/Math.log(1+e),SINE:(t,e)=>Math.cos(t/e*Math.PI/2),EXPONENTIAL:(t,e)=>Math.exp(-t/e),CUBIC:(t,e)=>Math.pow(1-t/e,3),GAUSSIAN:(t,e)=>Math.exp(-Math.pow(t,2)/(2*Math.pow(e/3,2))),INVERSE:(t,e)=>e/(e+t),SMOOTHSTEP:(t,e)=>{const o=Math.max(0,Math.min(1,1-t/e));return o*o*(3-2*o)}},Ht=(t,e,o,r,a=U.UP,s=C.LINEAR)=>{const i=t.attributes.position;for(let c=0;c<i.count;c++){const l=new n.Vector3;l.fromBufferAttribute(i,c);const u=l.distanceTo(e);if(u<o){const m=s(u,o)*r;l.add(a.clone().multiplyScalar(m)),i.setXYZ(c,l.x,l.y,l.z)}}i.needsUpdate=!0},Yt=(t,e,o,r,a,s=U.UP,i=C.LINEAR)=>{const c=t.attributes.position;for(let l=0;l<c.count;l++){const u=new n.Vector3;u.fromBufferAttribute(c,l);const h=u.distanceTo(e);if(h<o){const d=i(h,o)*a,f=u.dot(s.normalize()),M=r-f;u.add(s.clone().multiplyScalar(M*d)),c.setXYZ(l,u.x,u.y,u.z)}}c.needsUpdate=!0},Xt=(t,e,o,r,a=U.UP,s=C.LINEAR)=>{const i=t.attributes.position;for(let c=0;c<i.count;c++){const l=new n.Vector3;l.fromBufferAttribute(i,c);const u=l.distanceTo(e);if(u<o){const h=s(u,o),m=r*h,d=a.clone().normalize();l.x+=n.MathUtils.randFloatSpread(m)*d.x,l.y+=n.MathUtils.randFloatSpread(m)*d.y,l.z+=n.MathUtils.randFloatSpread(m)*d.z,i.setXYZ(c,l.x,l.y,l.z)}}i.needsUpdate=!0},Zt=(t,e,o,r)=>{const a=t.attributes.position,s=new n.Vector3;for(let i=0;i<a.count;i++){const c=new n.Vector3;if(c.fromBufferAttribute(a,i),c.distanceTo(e)<o){let u=new n.Vector3,h=0;for(let m=0;m<a.count;m++)s.fromBufferAttribute(a,m),s.distanceTo(c)<o&&(u.add(s),h++);h>0&&(u.divideScalar(h),c.lerp(u,r),a.setXYZ(i,c.x,c.y,c.z))}}a.needsUpdate=!0},jt=(t,e,o,r,a=!1,s=C.LINEAR)=>{const i=t.attributes.position;for(let c=0;c<i.count;c++){const l=new n.Vector3;l.fromBufferAttribute(i,c);const u=l.distanceTo(e);if(u<o){const m=s(u,o)*r*(a?-1:1),d=l.clone().sub(e).normalize();l.add(d.multiplyScalar(m)),i.setXYZ(c,l.x,l.y,l.z)}}i.needsUpdate=!0},Qt=(t,e,o,r,a=U.UP,s=C.LINEAR)=>{const i=t.attributes.position,c=new n.Quaternion;for(let l=0;l<i.count;l++){const u=new n.Vector3;u.fromBufferAttribute(i,l);const h=u.distanceTo(e);if(h<o){const d=s(h,o)*r;c.setFromAxisAngle(a,d),u.sub(e).applyQuaternion(c).add(e),i.setXYZ(l,u.x,u.y,u.z)}}i.needsUpdate=!0},k={X:new n.Vector3(1,0,0),Y:new n.Vector3(0,1,0),Z:new n.Vector3(0,0,1),XY:new n.Vector3(1,1,0).normalize(),XZ:new n.Vector3(1,0,1).normalize(),YZ:new n.Vector3(0,1,1).normalize(),XYZ:new n.Vector3(1,1,1).normalize()},L={CADMIUM_RED:15073318,CARDINAL_RED:12981270,CHERRY_RED:14165028,CRIMSON:12986408,ALIZARIN_CRIMSON:11674146,RUST:12731693,DARK_RED:9109504,TANGERINE:16733440,ORANGE_PEEL:16737792,CADMIUM_ORANGE:16744228,ORANGE:16753920,AMBER:16755200,CADMIUM_YELLOW:16766720,GOLD:16766720,YELLOW:16776960,LIME_GREEN:10798080,SPRING_GREEN:8965205,MOSS_GREEN:8956467,FERN_GREEN:4950843,FOREST_GREEN:2263842,SAP_GREEN:5274922,OLIVE_DRAB:5597999,VIRIDIAN_GREEN:43115,MINT_GREEN:8965290,AQUAMARINE:65450,PHTHALO_BLUE:3977,SKY_BLUE:8965375,CERULEAN_BLUE:6139362,AZURE:30719,OCEAN_BLUE:30654,ROYAL_BLUE:5592575,MIDNIGHT_BLUE:51,ULTRAMARINE_BLUE:4149685,COBALT_VIOLET:6950317,DEEP_VIOLET:11141375,CORAL_PINK:16724838,VIVID_MAGENTA:16720639,MAGENTA:16711935,HOT_PINK:16711850,PINK_SHERBET:16751052,SOFT_PINK:16762823,BURNT_SIENNA:15299665,BURNT_UMBER:9057060,SIENNA:9132587,SADDLE_BROWN:9127187,COFFEE_BROWN:6045747,DARK_UMBER:4929057,RAW_UMBER:8545860,YELLOW_OCHRE:12951919,RAW_SIENNA:13808780,TAUPE:9141627,ONYX:197379,CARBON:3026478,CHARCOAL:3355443,SLATE_GRAY:4210752,ASH_GRAY:4473924,GRAPHITE:5263440,STEEL_GRAY:5592405,DIM_GRAY:6908265,IRON:7829367,GRAY:8421504,STONE:8947848,SILVER:11184810,LIGHT_GRAY:13421772,PALE_GRAY:15658734,WHITE_SMOKE:16119285,TITANIUM_WHITE:16777215},$=t=>1-Math.cos(t*Math.PI/2),ee=t=>Math.sin(t*Math.PI/2),te=t=>-.5*(Math.cos(Math.PI*t)-1),oe=t=>t*t,ne=t=>1-Math.pow(1-t,2),re=t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,se=t=>t*t*t,ae=t=>1-Math.pow(1-t,3),ie=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,ce=t=>t*t*t*t,le=t=>1-Math.pow(1-t,4),ue=t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,he=t=>t*t*t*t*t,me=t=>1-Math.pow(1-t,5),de=t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,fe=t=>t===0?0:Math.pow(2,10*t-10),Me=t=>t===1?1:1-Math.pow(2,-10*t),pe=t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,ye=t=>1-Math.sqrt(1-Math.pow(t,2)),xe=t=>Math.sqrt(1-Math.pow(t-1,2)),we=t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,ve=t=>t,ge=t=>t*t*(3-2*t),Se=t=>1-Math.pow(1-t,.3),Ge=t=>Math.pow(t,.3),Ee=t=>Math.log(Math.max(.01,t))/Math.log(2),be=t=>Math.sqrt(t),Ie=t=>1-t,Ae=t=>Math.exp(-Math.pow(t-.5,2)/(2*.5)),Kt={SINE_EASE_IN:$,SINE_EASE_OUT:ee,SINE_EASE_IN_OUT:te,QUADRATIC_EASE_IN:oe,QUADRATIC_EASE_OUT:ne,QUADRATIC_EASE_IN_OUT:re,CUBIC_EASE_IN:se,CUBIC_EASE_OUT:ae,CUBIC_EASE_IN_OUT:ie,QUARTIC_EASE_IN:ce,QUARTIC_EASE_OUT:le,QUARTIC_EASE_IN_OUT:ue,QUINTIC_EASE_IN:he,QUINTIC_EASE_OUT:me,QUINTIC_EASE_IN_OUT:de,EXPONENTIAL_EASE_IN:fe,EXPONENTIAL_EASE_OUT:Me,EXPONENTIAL_EASE_IN_OUT:pe,CIRCULAR_EASE_IN:ye,CIRCULAR_EASE_OUT:xe,CIRCULAR_EASE_IN_OUT:we,LINEAR:ve,SMOOTHSTEP:ge,CONCAVE:Se,CONVEX:Ge,LOGARITHMIC:Ee,SQUARE_ROOT:be,INVERSE:Ie,GAUSSIAN:Ae},Be=(t,e,o,r,a)=>{const s=Math.max(0,Math.min(1,t)),i=1-s;return i*i*i*e+3*i*i*s*o+3*i*s*s*r+s*s*s*a},Pe=(t,e=1)=>{const o=Math.max(.001,e);return(1-Math.exp(-o*t))/(1-Math.exp(-o))},Te=(t,e=1,o=1)=>{const r=Math.max(0,Math.min(1,t));return e*Math.pow(r,o)},Ce=(t,e=1,o=1)=>{const r=Math.max(.001,Math.min(1,t));return e*Math.log(o*r+1)},Re=(t,e=1,o=0,r=0)=>{const a=Math.max(0,Math.min(1,t));return e*a*a+o*a+r},Ve=(t,e,o,r)=>{const a=Math.max(0,Math.min(1,t)),s=1-a;return s*s*e+2*s*a*o+a*a*r},Ue=(t,e=10)=>{const o=Math.max(0,Math.min(1,t));return 1/(1+Math.exp(-e*(o-.5)))},Wt=t=>Math.sin(t*Math.PI*.5),P={CUBIC:Be,DAMPED:Pe,EXPONENTIAL:Te,LOGARITHMIC:Ce,PARABOLIC:Re,QUADRATIC:Ve,SIGMOID:Ue,SINUSOIDAL:Wt};class Jt extends n.InstancedMesh{constructor(o={}){const{count:r=20,width:a=1.5,height:s=3,depth:i=1.5,geometry:c=new n.SphereGeometry(.1,6,6),material:l=new n.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3})}=o;super(c,l,r);v(this,"bubblePositions",[]);v(this,"velocities",[]);v(this,"width");v(this,"height");v(this,"depth");this.height=s,this.width=a,this.depth=i;for(let u=0;u<this.count;u++){const h=new n.Vector3((Math.random()-.5)*a,Math.random()*(s-1)+.5,(Math.random()-.5)*i);this.bubblePositions.push(h),this.velocities.push(.01+Math.random()*.02),this.updateInstanceMatrix(u)}}updateInstanceMatrix(o){const r=this.bubblePositions[o],a=new n.Matrix4().setPosition(r);this.setMatrixAt(o,a),this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const r=this.bubblePositions[o];r.y+=this.velocities[o],r.y>this.height&&(r.x=(Math.random()-.5)*this.width,r.y=0,r.z=(Math.random()-.5)*this.depth),this.updateInstanceMatrix(o)}}}class Ne extends n.BufferGeometry{constructor(e=.1){super();const o=[],r=[],a=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let i=0;i<a.length;i++){const[c,l]=a[i];o.push(c*e,l*e,0)}for(let i=1;i<a.length-1;i++)r.push(0,i,i+1);r.push(0,a.length-1,1);const s=new n.Float32BufferAttribute(o,3);this.setAttribute("position",s),this.setIndex(r),this.computeVertexNormals()}}class $t extends n.InstancedMesh{constructor(o={}){const{count:r=200,width:a=20,height:s=10,depth:i=20,geometry:c=new Ne,material:l=new n.MeshStandardMaterial({color:8956467,metalness:.1,roughness:.8,flatShading:!0,side:n.DoubleSide})}=o;super(c,l,r);v(this,"dummyMatrix");v(this,"velocities");v(this,"width");v(this,"height");v(this,"depth");this.dummyMatrix=new n.Matrix4,this.velocities=[],this.width=a,this.height=s,this.depth=i;for(let u=0;u<r;u++){const h=(Math.random()-.5)*a,m=Math.random()*(s-1)+.5,d=(Math.random()-.5)*i,f=(Math.random()-.5)*Math.PI,M=(Math.random()-.5)*Math.PI,p=(Math.random()-.5)*Math.PI;this.dummyMatrix.makeRotationFromEuler(new n.Euler(f,M,p)),this.dummyMatrix.setPosition(h,m,d),this.setMatrixAt(u,this.dummyMatrix);const y=new n.Vector3((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01);this.velocities.push(y)}this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const r=new n.Matrix4;this.getMatrixAt(o,r);const a=new n.Vector3;a.setFromMatrixPosition(r);const s=this.velocities[o];a.add(s),a.y<0&&(a.set((Math.random()-.5)*this.width,Math.random()*(this.height-1)+.5,(Math.random()-.5)*this.depth),s.set((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01)),r.setPosition(a),this.setMatrixAt(o,r)}this.instanceMatrix.needsUpdate=!0}}const g=(t,e)=>{const o=t[0].index!==null,r=new Set(Object.keys(t[0].attributes)),a=new Set(Object.keys(t[0].morphAttributes)),s={},i={},c=t[0].morphTargetsRelative,l=new n.BufferGeometry;let u=0;if(t.forEach((h,m)=>{let d=0;if(o!==(h.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let f in h.attributes){if(!r.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;s[f]===void 0&&(s[f]=[]),s[f].push(h.attributes[f]),d++}if(d!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". Make sure all geometries have the same number of attributes."),null;if(c!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let f in h.morphAttributes){if(!a.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". .morphAttributes must be consistent throughout all geometries."),null;i[f]===void 0&&(i[f]=[]),i[f].push(h.morphAttributes[f])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(h.userData),e){let f;if(h.index)f=h.index.count;else if(h.attributes.position!==void 0)f=h.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". The geometry must have either an index or a position attribute"),null;l.addGroup(u,f,m),u+=f}}),o){let h=0;const m=[];t.forEach(d=>{const f=d.index;for(let M=0;M<f.count;++M)m.push(f.getX(M)+h);h+=d.attributes.position.count}),l.setIndex(m)}for(let h in s){const m=Q(s[h]);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,m)}for(let h in i){const m=i[h][0].length;if(m===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let d=0;d<m;++d){const f=[];for(let p=0;p<i[h].length;++p)f.push(i[h][p][d]);const M=Q(f);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(M)}}return l},Q=t=>{let e,o,r,a=0;if(t.forEach(s=>{if(e===void 0&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(o===void 0&&(o=s.itemSize),o!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=s.normalized),r!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;a+=s.array.length}),e&&o){const s=new e(a);let i=0;return t.forEach(c=>{s.set(c.array,i),i+=c.array.length}),new n.BufferAttribute(s,o,r)}};function eo(t,e=1e-4){e=Math.max(e,Number.EPSILON);const o={},r=t.getIndex(),a=t.getAttribute("position"),s=r?r.count:a.count;let i=0;const c=Object.keys(t.attributes),l={},u={},h=[],m=["getX","getY","getZ","getW"];for(let p=0,y=c.length;p<y;p++){const x=c[p];l[x]=[];const w=t.morphAttributes[x];w&&(u[x]=new Array(w.length).fill(0).map(()=>[]))}const d=Math.log10(1/e),f=Math.pow(10,d);for(let p=0;p<s;p++){const y=r?r.getX(p):p;let x="";for(let w=0,I=c.length;w<I;w++){const b=c[w],S=t.getAttribute(b),G=S.itemSize;for(let A=0;A<G;A++)x+=`${~~(S[m[A]](y)*f)},`}if(x in o)h.push(o[x]);else{for(let w=0,I=c.length;w<I;w++){const b=c[w],S=t.getAttribute(b),G=t.morphAttributes[b],A=S.itemSize,B=l[b],D=u[b];for(let R=0;R<A;R++){const V=m[R];if(B.push(S[V](y)),G)for(let E=0,Tt=G.length;E<Tt;E++)D[E].push(G[E][V](y))}}o[x]=i,h.push(i),i++}}const M=t.clone();for(let p=0,y=c.length;p<y;p++){const x=c[p],w=t.getAttribute(x),I=new w.array.constructor(l[x]),b=new n.BufferAttribute(I,w.itemSize,w.normalized);if(M.setAttribute(x,b),x in u)for(let S=0;S<u[x].length;S++){const G=t.morphAttributes[x][S],A=new G.array.constructor(u[x][S]),B=new n.BufferAttribute(A,G.itemSize,G.normalized);M.morphAttributes[x][S]=B}}return M.setIndex(h),M}class H extends n.BufferGeometry{constructor(e=1,o=1.5,r=.5,a=.05,s=.05){super();const i=e,c=o,l=r,u=a,h=s,m=[0,0,0,i,0,0,i,c,0,0,c,0,i,0,-l,0,0,-l,0,c,-l,i,c,-l,0,0,-l,0,0,0,0,c,0,0,c,-l,i,0,-u,u,0,-u,u,c,-u,i,c,-u,u,0,-l+u,i,0,-l+u,i,c,-l+u,u,c,-l+u,u,0,-u,u,0,-l+u,u,c,-l+u,u,c,-u,0,c,0,i,c,0,i,c,-u,u,c,-u,0,c,-l,u,c,-l+u,i,c,-l+u,i,c,-l,0,c,0,u,c,-u,u,c,-l+u,0,c,-l,0,0,0,u,0,-u,i,0,-u,i,0,0,0,0,-l,i,0,-l,i,0,-l+u,u,0,-l+u,0,0,0,0,0,-l,u,0,-l+u,u,0,-u,i,0,0,i,0,-u,i,c,-u,i,c,0,i,0,-l,i,c,-l,i,c,-l+u,i,0,-l+u],d=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0],f=e/(e*2+r),M=(e+r)/(e*2+r),p=[M,0,1,0,1,1,M,1,0,0,f,0,f,1,0,1,f,0,M,0,M,1,f,1,1,0,M,0,M,1,1,1,f,0,0,0,0,1,f,1,M,0,f,0,f,1,M,1,M,0,1,0,1,1,M,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1],y=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23,24,25,26,24,26,27,28,29,30,28,30,31,32,33,34,32,34,35,36,37,38,36,38,39,40,41,42,40,42,43,44,45,46,44,46,47,48,49,50,48,50,51,52,53,54,52,54,55],x=new Float32Array(m),w=new Float32Array(d),I=new Float32Array(p),b=new Uint16Array(y),S=new n.BufferGeometry;S.setAttribute("position",new n.BufferAttribute(x,3)),S.setAttribute("normal",new n.BufferAttribute(w,3)),S.setAttribute("uv",new n.BufferAttribute(I,2)),S.setIndex(new n.BufferAttribute(b,1));const G=new n.BoxGeometry(e-u-h,c-h*2,l-u*2);G.translate((e-u-h)/2+u,c/2,-l/2),this.copy(g([S,G],!0))}}function Oe({scaleXMin:t=.4,scaleXMax:e=.7,scaleYMin:o=.3,scaleYMax:r=.95,scaleZMin:a=.1,scaleZMax:s=.5}={}){return new n.Vector3(q(t,e),K(.25,o,r),W(.8,a,s))}function Y({coverMaterial:t,pagesMaterial:e,scales:o}){const r=new H,a=new n.InstancedMesh(r,[t,e],o.length),s=new n.Matrix4;let i=0;for(let c=0;c<o.length;c++){const l=o[c],u=new n.Matrix4;u.makeScale(l.x,l.y,l.z),s.identity(),s.multiply(u),s.setPosition(.01+Math.random()*.1,0,i+l.z*.5),a.setMatrixAt(c,s),i+=l.z*.5}return a}function to({coverMaterial:t,pagesMaterial:e,count:o=10,scaleXMin:r=.4,scaleXMax:a=.7,scaleYMin:s=.3,scaleYMax:i=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=Array.from({length:o},()=>Oe({scaleXMin:r,scaleXMax:a,scaleYMin:s,scaleYMax:i,scaleZMin:c,scaleZMax:l}));return Y({coverMaterial:t,pagesMaterial:e,scales:u})}function oo({coverMaterial:t,pagesMaterial:e,length:o=10,scaleXMin:r=.4,scaleXMax:a=.7,scaleYMin:s=.3,scaleYMax:i=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=[];let h=o;for(;h>0;){const m=Oe({scaleXMin:r,scaleXMax:a,scaleYMin:s,scaleYMax:i,scaleZMin:c,scaleZMax:l});m.z=Math.min(m.z,h),u.push(m),h-=m.z}return Y({coverMaterial:t,pagesMaterial:e,scales:u})}class no extends n.BufferGeometry{constructor(e=2,o=.3,r=.6,a=5,s=5,i=Math.PI/4){super();const c=[],l=[];for(let f=0;f<a;f++){const M=f*o,p=M+o,y=f*r,x=y+r;c.push(-e/2,M,y,e/2,M,y,e/2,p,y,-e/2,p,y,-e/2,p,y,e/2,p,y,e/2,p,x,-e/2,p,x);const w=f*8;l.push(w,w+1,w+2,w,w+2,w+3),l.push(w+4,w+5,w+6,w+4,w+6,w+7)}const u=a*o,h=a*r,m=e*2;c.push(-m/2,u,h,m/2,u,h,m/2,u,h+r,-m/2,u,h+r);const d=a*8;l.push(d,d+1,d+2,d,d+2,d+3);for(let f=0;f<2;f++){const M=f===0?1:-1;for(let p=0;p<s;p++){const y=u+p*o,x=y+o,w=M*(m/4),I=h+r,b=p*r*Math.cos(i),S=p*r*Math.sin(i),G=w+M*b-e/2*Math.cos(i),A=w+M*b+e/2*Math.cos(i),B=I+S,D=G+M*r*Math.cos(i),R=A+M*r*Math.cos(i),V=B+r*Math.sin(i);c.push(G,y,B,A,y,B,A,x,B,G,x,B,G,x,B,A,x,B,R,x,V,D,x,V);const E=d+4+f*s*8+p*8;l.push(E,E+1,E+2,E,E+2,E+3),l.push(E+4,E+5,E+6,E+4,E+6,E+7)}}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class ro extends n.BufferGeometry{constructor(e=5,o=3,r=5,a=.2){super();const s=[-e/2,0,-r/2,e/2,0,-r/2,e/2,0,r/2,-e/2,0,r/2,-e/2,0,-r/2,e/2,0,-r/2,e/2,o,-r/2,-e/2,o,-r/2,-e/2,0,-r/2,-e/2,0,r/2,-e/2,o,r/2,-e/2,o,-r/2],i=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11];this.setIndex(i),this.setAttribute("position",new n.Float32BufferAttribute(s,3)),this.computeVertexNormals()}}class so extends n.BufferGeometry{constructor(e=2,o=.3,r=.5,a=5,s=2){super();const i=[],c=[];for(let m=0;m<a;m++){const d=m*o,f=d+o,M=m*r,p=M+r;i.push(-e/2,d,M,e/2,d,M,e/2,f,M,-e/2,f,M,-e/2,f,M,e/2,f,M,e/2,f,p,-e/2,f,p);const y=m*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}const l=a*o,u=a*r;i.push(-e/2,l,u,e/2,l,u,e/2,l,u+s,-e/2,l,u+s);const h=a*8;c.push(h,h+1,h+2,h,h+2,h+3);for(let m=0;m<a;m++){const d=l+m*o,f=d+o,M=-e/2-m*r,p=M-r;i.push(M,d,u+s,M,d,u+s-e,M,f,u+s-e,M,f,u+s,M,f,u+s,M,f,u+s-e,p,f,u+s-e,p,f,u+s);const y=h+4+m*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}this.setIndex(c),this.setAttribute("position",new n.Float32BufferAttribute(i,3)),this.computeVertexNormals()}}class ao extends n.BufferGeometry{constructor(e=1,o=.4,r=.2,a=20,s=2,i=Math.PI/8){super();const c=[],l=[];let u=0;for(let h=0;h<a;h++){const m=s*Math.cos(u),d=s*Math.sin(u),f=h*r,M=f+r;c.push(m-e/2*Math.cos(u),f,d-e/2*Math.sin(u),m+e/2*Math.cos(u),f,d+e/2*Math.sin(u),m+e/2*Math.cos(u),M,d+e/2*Math.sin(u),m-e/2*Math.cos(u),M,d-e/2*Math.sin(u)),c.push(m-e/2*Math.cos(u),M,d-e/2*Math.sin(u),m+e/2*Math.cos(u),M,d+e/2*Math.sin(u),m+e/2*Math.cos(u)-o*Math.sin(u),M,d+e/2*Math.sin(u)+o*Math.cos(u),m-e/2*Math.cos(u)-o*Math.sin(u),M,d-e/2*Math.sin(u)+o*Math.cos(u));const p=h*8;l.push(p,p+1,p+2,p,p+2,p+3),l.push(p+4,p+5,p+6,p+4,p+6,p+7),u+=i}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class io extends n.BufferGeometry{constructor(e=2,o=.3,r=.5,a=10){super();const s=[],i=[];for(let c=0;c<a;c++){const l=c*o,u=l+o,h=c*r,m=h+r;s.push(-e/2,l,h,e/2,l,h,e/2,u,h,-e/2,u,h,-e/2,u,h,e/2,u,h,e/2,u,m,-e/2,u,m);const d=c*8;i.push(d,d+1,d+2,d,d+2,d+3),i.push(d+4,d+6,d+5,d+4,d+7,d+6)}this.setIndex(i),this.setAttribute("position",new n.Float32BufferAttribute(s,3)),this.computeVertexNormals()}}class _e extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(1.2,0),new n.Vector2(1.5,1.5),new n.Vector2(1,3),new n.Vector2(.6,3.5),new n.Vector2(.5,3.5)],o=new n.LatheGeometry(e,10),r=new n.CylinderGeometry(.6,.5,.3,10);r.translate(0,3.5,0),this.copy(g([o,r],!0))}}function X(t,e,o,r,a){const s=(r-e)/(o-t);return t+(a-e)/s}function Le(t,e,o,r,a){const s=(r-e)/(o-t);return e+s*(a-t)}const co={calculateXFromSlopeIntercept:X,calculateYFromSlopeIntercept:Le};class Fe extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(1,1.5),new n.Vector2(.5,2.2),new n.Vector2(.6,2.5),new n.Vector2(.5,2.5)],o=new n.LatheGeometry(e,10),r=new n.CylinderGeometry(.55,.45,.2,10);r.translate(0,2.5,0);const a=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(X(.8,0,1,1.5,1),1),new n.Vector2(0,1)],s=new n.LatheGeometry(a,10);s.translate(0,.1,0),s.scale(.9,.9,.9),this.copy(g([o,r,s],!0))}}class ke extends n.BufferGeometry{constructor({radius:e=.5,neckRadius:o=.2,height:r=3,neckHeight:a=1,segments:s=16}={}){super();const i=r-a,c=new n.CylinderGeometry(e,e,i,s);c.translate(0,i/2,0);const l=.3,u=new n.CylinderGeometry(o,e,l,s);u.translate(0,i+l/2,0);const h=new n.CylinderGeometry(o,o,a,s);h.translate(0,i+l+a/2,0),this.copy(g([c,u,h],!1))}}class De extends n.BufferGeometry{constructor(e=.4,o=1.2,r=.2){super();const a=o*.6,s=new n.BoxGeometry(e/2,a,r);s.translate(0,a/2,0);const i=e*1.5,c=new n.BoxGeometry(i,e/4,r);c.translate(0,a*.75,0),this.copy(g([s,c],!1)),this.computeVertexNormals()}}class ze extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,1,5);e.translate(0,.5,0);const o=new n.BoxGeometry(4,3,4);o.translate(0,2.5,0);const r=[[-1.8,2.3,-2.2],[1.8,2.3,-2.2],[-1.8,2.3,2.2],[1.8,2.3,2.2]],a=[];r.forEach(u=>{const h=new n.CylinderGeometry(.2,.2,3.5,16);h.translate(u[0],u[1],u[2]),a.push(h)});const s=new n.ConeGeometry(3.5,2,4);s.rotateY(Math.PI/4),s.translate(0,5,0);const i=new n.Shape;i.moveTo(-1,0),i.lineTo(-1,2),i.absarc(0,2,1,Math.PI,0,!0),i.lineTo(1,0);const c={depth:.5,bevelEnabled:!1},l=new n.ExtrudeGeometry(i,c);l.translate(0,.5,1.7),l.setIndex([...Array(l.attributes.position.count).keys()]),this.copy(g([e,g([o,...a],!1),s,l],!0)),this.computeVertexNormals()}}class qe extends n.BufferGeometry{constructor(e=1.75,o=.75){super();const r=e*.05,a=e*.15,s=e*.15,i=e*.75;let c=0;const l=new n.BoxGeometry(o,r,o);l.translate(0,c+r/2,0),c+=r;const u=new n.BoxGeometry(o*.8,a,o*.8);u.translate(0,c+a/2,0),c+=a;const h=new n.BoxGeometry(o*.6,s,o*.6);h.translate(0,c+s/2,0),c+=s;const m=new n.BoxGeometry(o*.4,i,o*.4);m.translate(0,c+i/2,0),c+=i;const d=new n.ConeGeometry(o*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);d.translate(0,c+.1/2,0),this.copy(g([l,u,h,m,d],!1)),this.computeVertexNormals()}}class He extends n.BufferGeometry{constructor(e=.6,o=1,r=.2,a=.6){super();const s=o-a/2,i=new n.BoxGeometry(e,s,r);i.translate(0,s/2,0);const c=new n.CylinderGeometry(a/2,a/2,r,16,1,!1,0,Math.PI);c.rotateY(Math.PI/2),c.rotateX(Math.PI/2),c.translate(0,s,0),this.copy(g([i,c],!1)),this.computeVertexNormals()}}class Ye extends n.BufferGeometry{constructor(e=.5,o=.8,r=.15){super();const a=new n.BoxGeometry(e,o,r);a.translate(0,o/2,0),this.copy(a)}}class Xe extends n.BufferGeometry{constructor({height:e=2.25}={}){super();const o=new n.BoxGeometry(1.2,.5,1.2);o.translate(0,.25,0);const r=new n.BoxGeometry(1,e,1);r.translate(0,.5+e/2,0);const a=new n.BoxGeometry(1.4,.3,1.4);a.translate(0,.5+e+.15,0),this.copy(g([o,r,a],!1))}}class Z extends n.BufferGeometry{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:r=.3,spikeRadius:a=.075,spikeScaleZ:s=1,radialSegments:i=8}={}){super();const c=new n.CylinderGeometry(o,o,e,i);c.translate(0,e/2,0);const l=new n.ConeGeometry(a,r,i);l.translate(0,e+r/2,0),l.scale(1,1,s),this.copy(g([c,l],!1))}}class Ze extends n.BufferGeometry{constructor({count:e=20,spacing:o=.4,barHeight:r=2,barRadius:a=.05,spikeHeight:s=.3,spikeRadius:i=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:h=0,radialSegments:m=8}={}){super();const d=[],f=new Z({barHeight:r,barRadius:a,spikeHeight:s,spikeRadius:i,spikeScaleZ:c,radialSegments:m}),M=new n.BoxGeometry(e*o,l,u);for(let x=0;x<e;x++){const w=f.clone();w.translate(x*o,0,0),d.push(w)}const p=M.clone();p.translate(o*(e-1)/2,r-h-l/2,0),d.push(p);const y=M.clone();y.translate(o*(e-1)/2,l/2,0),d.push(y),this.copy(g(d))}}class je extends n.BufferGeometry{constructor({width:e=5,height:o=8,depth:r=1,shelves:a=4,frameThickness:s=.1,open:i=!1}={}){super();const c=o,l=e,u=r,h=new n.BoxGeometry(s,c,u),m=new n.BoxGeometry(l-2*s,s,u),d=h.clone();d.translate(-l/2+s/2,c/2,0);const f=h.clone();f.translate(l/2-s/2,c/2,0);const M=m.clone();M.translate(0,c-s/2,0);const p=m.clone();p.translate(0,s/2,0);const y=new n.BoxGeometry(l,c,s);y.translate(0,c/2,-u/2+s/2);const x=[],w=(c-s)/(a+1);for(let I=1;I<=a;I++){const b=m.clone();b.translate(0,s/2+I*w,0),x.push(b)}this.copy(g([d,f,M,p,...i?[]:[y],...x],!1))}}class Qe extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,.3,3);e.translate(0,3.15,0);const o=[new n.Vector2(.2,0),new n.Vector2(.25,.5),new n.Vector2(.15,1.5),new n.Vector2(.3,3)],r=new n.LatheGeometry(o,32),s=g([[2.1,0,1.1],[-2.1,0,1.1],[2.1,0,-1.1],[-2.1,0,-1.1]].map(i=>{const c=r.clone();return c.translate(i[0],i[1],i[2]),c}));this.copy(g([e,s],!0))}}class Ke extends n.BufferGeometry{constructor(){super();const e=[],o=[];for(let r=0;r<5;r++){const a=.8+Math.random()*.4,s=.8+Math.random()*.4,i=.8+Math.random()*.4,c=Math.random()*Math.PI,l=Math.random()*Math.PI,u=Math.random()*Math.PI,h=(Math.random()-.5)*4,m=0,d=(Math.random()-.5)*4,f=new n.DodecahedronGeometry(1,0);f.scale(a,s,i),f.rotateX(c),f.rotateY(l),f.rotateZ(u),f.translate(h,m,d),e.push(f);const M=new n.DodecahedronGeometry(1,0);M.scale(a*.9,s*.5,i*.9),M.rotateX(c),M.rotateY(l),M.rotateZ(u),M.translate(h,m+.3,d),o.push(M)}this.copy(g([g(e),g(o)],!0))}}function We(t,e=k.XYZ,o=.5,r=2){t.deleteAttribute("uv"),t.deleteAttribute("normal"),t=eo(t),t.computeVertexNormals();const a=t.getAttribute("position");for(let s=0;s<a.count;s++){const i=new n.Vector3().fromBufferAttribute(a,s),c=Math.random()*(r-o)+o,l=e.clone().multiplyScalar(c);i.add(l),a.setXYZ(s,i.x,i.y,i.z)}return a.needsUpdate=!0,t.computeVertexNormals(),t}class Je extends n.BufferGeometry{constructor(e=1,o=4,r=4){super();const a=new n.SphereGeometry(e,o,r);this.copy(We(a,k.XYZ,.5,1)),this.computeVertexNormals(),this.center()}}class $e extends n.BufferGeometry{constructor(){super();const e=[];for(let o=0;o<5;o++){const r=new n.DodecahedronGeometry(1,0);r.scale(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),r.rotateX(Math.random()*Math.PI),r.rotateY(Math.random()*Math.PI),r.rotateZ(Math.random()*Math.PI),r.translate((Math.random()-.5)*4,0,(Math.random()-.5)*4),e.push(r)}this.copy(g(e))}}class et extends n.BufferGeometry{constructor(e=.1,o=.1,r=.4,a=8){super();const s=new n.CylinderGeometry(e*.6,o*.6,r,a);s.translate(0,0,0);const i=new n.SphereGeometry(e,a,a),c=i.clone(),l=i.clone(),u=i.clone(),h=i.clone();c.translate(0,r/2+e*.6,-e*.6),l.translate(0,r/2+e*.6,e*.6),u.translate(0,-r/2-o*.6,-o*.6),h.translate(0,-r/2-o*.6,o*.6),this.copy(g([s,c,l,u,h],!1))}}class tt extends n.BufferGeometry{constructor({flaskRadius:e=1,neckRadius:o=.3,height:r=2.5,neckHeight:a=1,radialSegments:s=16}={}){super();const i=[new n.Vector2(0,0),new n.Vector2(e*.875,0),new n.Vector2(e,.1),new n.Vector2(o,r),new n.Vector2(o,r+a),new n.Vector2(o*1.1,r+a+.3)],c=new n.LatheGeometry(i,s);this.copy(g([c],!1))}}const lo=(t,e)=>t/(1-Math.cos(e)),j=(t,e)=>t/(2*Math.sin(e)),ot=(t,e)=>t*(1-Math.cos(e)),uo=(t,e)=>2*t*Math.sin(e),z=(t,e)=>{const o=2*e;return Math.asin(o/(2*t))},ho=(t,e,o)=>({x:t*Math.sin(o)*Math.cos(e),y:t*Math.sin(o)*Math.sin(e),z:t*Math.cos(o)}),mo=(t,e,o)=>{const r=Math.sqrt(t*t+e*e+o*o),a=Math.atan2(e,t),s=Math.acos(o/r);return{radius:r,theta:a,phi:s}};function nt(t,e,o,r=0,a=0,s=32){const i=r?z(t,r):0,c=a?Math.PI-z(t,a):Math.PI,l=[];for(let u=0;u<=s;u++){const h=c-(c-i)/s*u,m=t*Math.sin(h),d=e*Math.cos(h)+o;l.push(new n.Vector2(m,d))}return[...l]}class rt extends n.BufferGeometry{constructor(){super();const e=[...nt(1,1,.5,.2,0,32),new n.Vector2(.2,3)],o=new n.LatheGeometry(e,32);this.copy(o)}}class st extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(1,0),new n.Vector2(1.2,.5),new n.Vector2(1.4,1.5),new n.Vector2(1.3,1.8),new n.Vector2(.8,1.8)],o=new n.LatheGeometry(e,12),r=new n.CircleGeometry(1,12);r.rotateX(-Math.PI/2),r.translate(0,0,0),this.copy(g([o,r],!1))}}class at extends n.BufferGeometry{constructor({radius:e=.3,height:o=.4,count:r=3,thickness:a=.03,radialSegments:s=16}={}){super();const i=new n.TorusGeometry(e,a,8,s);i.rotateX(Math.PI/2),i.translate(0,o,0);const c=new n.CylinderGeometry(a*.6,a*.6,o,s),l=[];for(let u=0;u<r;u++){const h=u/r*Math.PI*2,m=c.clone();m.translate(Math.cos(h)*e,o/2,Math.sin(h)*e),l.push(m)}this.copy(g([i,...l],!1))}}class it extends n.BufferGeometry{constructor(){super();const e=new n.CylinderGeometry(.5,.6,.3,16);e.translate(0,.15,0);const o=new n.CylinderGeometry(.15,.15,2,12,1,!0);o.translate(0,1.3,0);const r=new n.SphereGeometry(.3,16,16);r.translate(0,2.4,0),this.copy(g([e,g([o,r])],!0))}}class F extends n.BufferGeometry{constructor(e=.2,o=.2,r=3,a=32,s=!0){super();const i=new n.CylinderGeometry(e,o,r,a,1,s),c=new n.SphereGeometry(o,a,a/2,0,Math.PI*2,Math.PI/2,Math.PI/2);c.translate(0,-(r/2),0),this.copy(g([i,c],!1))}}class ct extends n.BufferGeometry{constructor({radius:e=3,height:o=.6,widthSegments:r=64,heightSegments:a=16,phiStart:s=0,phiLength:i=Math.PI*2}={}){super(),this.copy(new n.SphereGeometry(e,r,a,s,i,0,Math.PI/2)),this.scale(1,o/e,1)}}class lt extends n.BufferGeometry{constructor({radius:e=j(5,Math.PI/10),widthSegments:o=64,heightSegments:r=32,phiStart:a=0,phiLength:s=Math.PI*2,thetaLength:i=Math.PI/10}={}){super(),this.copy(new n.SphereGeometry(e,o,r,a,s,0,i));const c=ot(e,i);this.translate(0,-e+c,0)}}class ut extends n.BufferGeometry{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:r=2.5,trunkSegments:a=14,leafSize:s=.8,leafCount:i=6,leafDetail:c=0,leafSpreadRadius:l=1.5}={}){super();const u=new n.CylinderGeometry(e,o,r,a);u.translate(0,r/2,0);const h=[];for(let m=0;m<i;m++){const d=new n.DodecahedronGeometry(s,c);d.translate((Math.random()-.5)*l,(Math.random()-.5)*s+r,(Math.random()-.5)*l),h.push(d)}this.copy(g([u.toNonIndexed(),g(h,!1)],!0)),this.computeVertexNormals()}}const ht={uniforms:{time:{value:0}},vertexShader:`
|
|
1
|
+
"use strict";var Rt=Object.defineProperty;var Ut=(t,e,o)=>e in t?Rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var v=(t,e,o)=>Ut(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("three");function Nt(t,e,o,r){const s=t.position.clone(),a=s.clone().add(t.getWorldDirection(new n.Vector3).multiplyScalar(-e));let i=null;function c(l){i===null&&(i=l);const m=(l-i)/o;if(m>=1){t.position.copy(a),r&&r();return}t.position.lerpVectors(s,a,m),requestAnimationFrame(c)}requestAnimationFrame(c)}function Ot(t,e,o,r){const s=e.length-1;let a=null;function i(c){a===null&&(a=c);const u=(c-a)/o;if(u>=1){t.position.copy(e[e.length-1]),r&&r();return}const m=u*s,h=Math.floor(m),f=m-h,d=e[h],M=e[h+1];t.position.lerpVectors(d,M,f),t.lookAt(M),requestAnimationFrame(i)}requestAnimationFrame(i)}function _t(t,e,o,r,s){let a=null;function i(c){a||(a=c);const u=(c-a)/r;if(u>=1){s&&s();return}const m=u*Math.PI*2,h=e.x+o*Math.cos(m),f=e.z+o*Math.sin(m);t.position.set(h,t.position.y,f),t.lookAt(e),requestAnimationFrame(i)}requestAnimationFrame(i)}function Ft(t,e,o,r,s,a){let i=null,c=0;function l(u){i===null&&(i=u);const m=u-i,h=r/s,f=m%h/h,d=Math.sin(f*Math.PI*2)*Math.PI/6,M=e.x+o*Math.sin(d),p=e.z+o*Math.cos(d);if(t.position.set(M,t.position.y,p),t.lookAt(e),m>=(c+1)*h&&c++,c>=s){a&&a();return}requestAnimationFrame(l)}requestAnimationFrame(l)}function Lt(t,e,o,r,s,a,i){let c=null;function l(u){c===null&&(c=u);const h=(u-c)/a;if(h>=1){i&&i();return}const f=h*Math.PI*2*s,d=e.x+o*Math.cos(f),M=e.z+o*Math.sin(f),p=e.y+r*h;t.position.set(d,p,M),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}function kt(t,e,o,r){const s=t.position.clone();let a=null;function i(c){if(a===null&&(a=c),(c-a)/o>=1){t.position.copy(s),r&&r();return}const m=new n.Vector3((Math.random()-.5)*e,(Math.random()-.5)*e,(Math.random()-.5)*e);t.position.copy(s).add(m),requestAnimationFrame(i)}requestAnimationFrame(i)}function Dt(t,e,o,r,s,a){const i=t.fov;t.fov=o,t.updateProjectionMatrix();let c=null;function l(u){c===null&&(c=u);const h=(u-c)/s;if(h>=1){t.fov=r,t.updateProjectionMatrix(),t.lookAt(e),t.fov=i,t.updateProjectionMatrix(),a&&a();return}t.fov=n.MathUtils.lerp(o,r,h),t.updateProjectionMatrix(),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}class zt{constructor(e){v(this,"speed");v(this,"maxIntensity");v(this,"minIntensity");v(this,"material");const{speed:o=2,maxIntensity:r=.8,minIntensity:s=.2}=e;this.speed=o,this.maxIntensity=r,this.minIntensity=s,this.material=e.material}update(e=0){this.material.emissiveIntensity=this.minIntensity+Math.abs(Math.sin(e*this.speed))*(this.maxIntensity-this.minIntensity)}}function k(t=0,e=1){return Math.random()*(e-t)+t}function qt(t=0,e=1){return Math.floor(Math.random()*(e-t+1))+t}function W(t=.5,e=0,o=1){return e+(o-e)*Math.pow(Math.random(),t)}function J(t=.5,e=0,o=1){return e+(o-e)*Math.pow(1-Math.random(),t)}class Ht{constructor({light:e,minIntensity:o=.8,maxIntensity:r=1.2,x:s=0,y:a=0,z:i=0,jitterX:c=.02,jitterY:l=0,jitterZ:u=.02}={}){v(this,"light");v(this,"minIntensity");v(this,"maxIntensity");v(this,"x");v(this,"y");v(this,"z");v(this,"jitterX");v(this,"jitterY");v(this,"jitterZ");this.light=e,this.minIntensity=o,this.maxIntensity=r,this.x=s,this.y=a,this.z=i,this.jitterX=c,this.jitterY=l,this.jitterZ=u}update(){this.light&&(this.light.intensity=k(this.minIntensity,this.maxIntensity),this.light.position.x=Math.random()*this.jitterX-this.jitterX/2+this.x,this.light.position.y=Math.random()*this.jitterY-this.jitterY/2+this.y,this.light.position.z=Math.random()*this.jitterZ-this.jitterZ/2+this.z)}}function $(t,e,o){const r=e+Math.random()*(o-e);return setTimeout(t,r)}function Yt(t,e,o){let r;function s(){const a=e+Math.random()*(o-e);r=setTimeout(()=>{t(),s()},a)}return s(),()=>clearTimeout(r)}class Xt{constructor({light:e,minIntensity:o=15,maxIntensity:r=20,minDuration:s=50,maxDuration:a=250}={}){v(this,"light");v(this,"minIntensity");v(this,"maxIntensity");v(this,"minDuration");v(this,"maxDuration");this.light=e,this.minIntensity=o,this.maxIntensity=r,this.minDuration=s,this.maxDuration=a}triggerLightning(){this.light&&(this.light.intensity=k(this.minIntensity,this.maxIntensity)),$(()=>{this.light&&(this.light.intensity=0)},this.minDuration,this.maxDuration)}update(){Math.random()>.98&&this.triggerLightning()}}const U={UP:new n.Vector3(0,1,0),DOWN:new n.Vector3(0,-1,0),LEFT:new n.Vector3(-1,0,0),RIGHT:new n.Vector3(1,0,0),FORWARD:new n.Vector3(0,0,1),BACKWARD:new n.Vector3(0,0,-1)},C={LINEAR:(t,e)=>1-t/e,QUADRATIC:(t,e)=>Math.pow(1-t/e,2),SQUARE_ROOT:(t,e)=>Math.pow(1-t/e,.5),LOGARITHMIC:(t,e)=>Math.log(1+(e-t))/Math.log(1+e),SINE:(t,e)=>Math.cos(t/e*Math.PI/2),EXPONENTIAL:(t,e)=>Math.exp(-t/e),CUBIC:(t,e)=>Math.pow(1-t/e,3),GAUSSIAN:(t,e)=>Math.exp(-Math.pow(t,2)/(2*Math.pow(e/3,2))),INVERSE:(t,e)=>e/(e+t),SMOOTHSTEP:(t,e)=>{const o=Math.max(0,Math.min(1,1-t/e));return o*o*(3-2*o)}},Zt=(t,e,o,r,s=U.UP,a=C.LINEAR)=>{const i=t.attributes.position;for(let c=0;c<i.count;c++){const l=new n.Vector3;l.fromBufferAttribute(i,c);const u=l.distanceTo(e);if(u<o){const h=a(u,o)*r;l.add(s.clone().multiplyScalar(h)),i.setXYZ(c,l.x,l.y,l.z)}}i.needsUpdate=!0},jt=(t,e,o,r,s,a=U.UP,i=C.LINEAR)=>{const c=t.attributes.position;for(let l=0;l<c.count;l++){const u=new n.Vector3;u.fromBufferAttribute(c,l);const m=u.distanceTo(e);if(m<o){const f=i(m,o)*s,d=u.dot(a.normalize()),M=r-d;u.add(a.clone().multiplyScalar(M*f)),c.setXYZ(l,u.x,u.y,u.z)}}c.needsUpdate=!0},Qt=(t,e,o,r,s=U.UP,a=C.LINEAR)=>{const i=t.attributes.position;for(let c=0;c<i.count;c++){const l=new n.Vector3;l.fromBufferAttribute(i,c);const u=l.distanceTo(e);if(u<o){const m=a(u,o),h=r*m,f=s.clone().normalize();l.x+=n.MathUtils.randFloatSpread(h)*f.x,l.y+=n.MathUtils.randFloatSpread(h)*f.y,l.z+=n.MathUtils.randFloatSpread(h)*f.z,i.setXYZ(c,l.x,l.y,l.z)}}i.needsUpdate=!0},Kt=(t,e,o,r)=>{const s=t.attributes.position,a=new n.Vector3;for(let i=0;i<s.count;i++){const c=new n.Vector3;if(c.fromBufferAttribute(s,i),c.distanceTo(e)<o){let u=new n.Vector3,m=0;for(let h=0;h<s.count;h++)a.fromBufferAttribute(s,h),a.distanceTo(c)<o&&(u.add(a),m++);m>0&&(u.divideScalar(m),c.lerp(u,r),s.setXYZ(i,c.x,c.y,c.z))}}s.needsUpdate=!0},Wt=(t,e,o,r,s=!1,a=C.LINEAR)=>{const i=t.attributes.position;for(let c=0;c<i.count;c++){const l=new n.Vector3;l.fromBufferAttribute(i,c);const u=l.distanceTo(e);if(u<o){const h=a(u,o)*r*(s?-1:1),f=l.clone().sub(e).normalize();l.add(f.multiplyScalar(h)),i.setXYZ(c,l.x,l.y,l.z)}}i.needsUpdate=!0},Jt=(t,e,o,r,s=U.UP,a=C.LINEAR)=>{const i=t.attributes.position,c=new n.Quaternion;for(let l=0;l<i.count;l++){const u=new n.Vector3;u.fromBufferAttribute(i,l);const m=u.distanceTo(e);if(m<o){const f=a(m,o)*r;c.setFromAxisAngle(s,f),u.sub(e).applyQuaternion(c).add(e),i.setXYZ(l,u.x,u.y,u.z)}}i.needsUpdate=!0},D={X:new n.Vector3(1,0,0),Y:new n.Vector3(0,1,0),Z:new n.Vector3(0,0,1),XY:new n.Vector3(1,1,0).normalize(),XZ:new n.Vector3(1,0,1).normalize(),YZ:new n.Vector3(0,1,1).normalize(),XYZ:new n.Vector3(1,1,1).normalize()},F={CADMIUM_RED:15073318,CARDINAL_RED:12981270,CHERRY_RED:14165028,CRIMSON:12986408,ALIZARIN_CRIMSON:11674146,RUST:12731693,DARK_RED:9109504,TANGERINE:16733440,ORANGE_PEEL:16737792,CADMIUM_ORANGE:16744228,ORANGE:16753920,AMBER:16755200,CADMIUM_YELLOW:16766720,GOLD:16766720,YELLOW:16776960,LIME_GREEN:10798080,SPRING_GREEN:8965205,MOSS_GREEN:8956467,FERN_GREEN:4950843,FOREST_GREEN:2263842,SAP_GREEN:5274922,OLIVE_DRAB:5597999,VIRIDIAN_GREEN:43115,MINT_GREEN:8965290,AQUAMARINE:65450,PHTHALO_BLUE:3977,SKY_BLUE:8965375,CERULEAN_BLUE:6139362,AZURE:30719,OCEAN_BLUE:30654,ROYAL_BLUE:5592575,MIDNIGHT_BLUE:51,ULTRAMARINE_BLUE:4149685,COBALT_VIOLET:6950317,DEEP_VIOLET:11141375,CORAL_PINK:16724838,VIVID_MAGENTA:16720639,MAGENTA:16711935,HOT_PINK:16711850,PINK_SHERBET:16751052,SOFT_PINK:16762823,BURNT_SIENNA:15299665,BURNT_UMBER:9057060,SIENNA:9132587,SADDLE_BROWN:9127187,COFFEE_BROWN:6045747,DARK_UMBER:4929057,RAW_UMBER:8545860,YELLOW_OCHRE:12951919,RAW_SIENNA:13808780,TAUPE:9141627,ONYX:197379,CARBON:3026478,CHARCOAL:3355443,SLATE_GRAY:4210752,ASH_GRAY:4473924,GRAPHITE:5263440,STEEL_GRAY:5592405,DIM_GRAY:6908265,IRON:7829367,GRAY:8421504,STONE:8947848,SILVER:11184810,LIGHT_GRAY:13421772,PALE_GRAY:15658734,WHITE_SMOKE:16119285,TITANIUM_WHITE:16777215},ee=t=>1-Math.cos(t*Math.PI/2),te=t=>Math.sin(t*Math.PI/2),oe=t=>-.5*(Math.cos(Math.PI*t)-1),ne=t=>t*t,re=t=>1-Math.pow(1-t,2),se=t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,ae=t=>t*t*t,ie=t=>1-Math.pow(1-t,3),ce=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,le=t=>t*t*t*t,ue=t=>1-Math.pow(1-t,4),me=t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,he=t=>t*t*t*t*t,fe=t=>1-Math.pow(1-t,5),de=t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,Me=t=>t===0?0:Math.pow(2,10*t-10),pe=t=>t===1?1:1-Math.pow(2,-10*t),ye=t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,xe=t=>1-Math.sqrt(1-Math.pow(t,2)),we=t=>Math.sqrt(1-Math.pow(t-1,2)),ve=t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,ge=t=>t,Se=t=>t*t*(3-2*t),Ge=t=>1-Math.pow(1-t,.3),be=t=>Math.pow(t,.3),Ie=t=>Math.log(Math.max(.01,t))/Math.log(2),Ae=t=>Math.sqrt(t),Ee=t=>1-t,Be=t=>Math.exp(-Math.pow(t-.5,2)/(2*.5)),$t={SINE_EASE_IN:ee,SINE_EASE_OUT:te,SINE_EASE_IN_OUT:oe,QUADRATIC_EASE_IN:ne,QUADRATIC_EASE_OUT:re,QUADRATIC_EASE_IN_OUT:se,CUBIC_EASE_IN:ae,CUBIC_EASE_OUT:ie,CUBIC_EASE_IN_OUT:ce,QUARTIC_EASE_IN:le,QUARTIC_EASE_OUT:ue,QUARTIC_EASE_IN_OUT:me,QUINTIC_EASE_IN:he,QUINTIC_EASE_OUT:fe,QUINTIC_EASE_IN_OUT:de,EXPONENTIAL_EASE_IN:Me,EXPONENTIAL_EASE_OUT:pe,EXPONENTIAL_EASE_IN_OUT:ye,CIRCULAR_EASE_IN:xe,CIRCULAR_EASE_OUT:we,CIRCULAR_EASE_IN_OUT:ve,LINEAR:ge,SMOOTHSTEP:Se,CONCAVE:Ge,CONVEX:be,LOGARITHMIC:Ie,SQUARE_ROOT:Ae,INVERSE:Ee,GAUSSIAN:Be},Pe=(t,e,o,r,s)=>{const a=Math.max(0,Math.min(1,t)),i=1-a;return i*i*i*e+3*i*i*a*o+3*i*a*a*r+a*a*a*s},Te=(t,e=1)=>{const o=Math.max(.001,e);return(1-Math.exp(-o*t))/(1-Math.exp(-o))},Ce=(t,e=1,o=1)=>{const r=Math.max(0,Math.min(1,t));return e*Math.pow(r,o)},Ve=(t,e=1,o=1)=>{const r=Math.max(.001,Math.min(1,t));return e*Math.log(o*r+1)},Re=(t,e=1,o=0,r=0)=>{const s=Math.max(0,Math.min(1,t));return e*s*s+o*s+r},Ue=(t,e,o,r)=>{const s=Math.max(0,Math.min(1,t)),a=1-s;return a*a*e+2*a*s*o+s*s*r},Ne=(t,e=10)=>{const o=Math.max(0,Math.min(1,t));return 1/(1+Math.exp(-e*(o-.5)))},eo=t=>Math.sin(t*Math.PI*.5),P={CUBIC:Pe,DAMPED:Te,EXPONENTIAL:Ce,LOGARITHMIC:Ve,PARABOLIC:Re,QUADRATIC:Ue,SIGMOID:Ne,SINUSOIDAL:eo};class to extends n.InstancedMesh{constructor(o={}){const{count:r=20,width:s=1.5,height:a=3,depth:i=1.5,geometry:c=new n.SphereGeometry(.1,6,6),material:l=new n.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3})}=o;super(c,l,r);v(this,"bubblePositions",[]);v(this,"velocities",[]);v(this,"width");v(this,"height");v(this,"depth");this.height=a,this.width=s,this.depth=i;for(let u=0;u<this.count;u++){const m=new n.Vector3((Math.random()-.5)*s,Math.random()*(a-1)+.5,(Math.random()-.5)*i);this.bubblePositions.push(m),this.velocities.push(.01+Math.random()*.02),this.updateInstanceMatrix(u)}}updateInstanceMatrix(o){const r=this.bubblePositions[o],s=new n.Matrix4().setPosition(r);this.setMatrixAt(o,s),this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const r=this.bubblePositions[o];r.y+=this.velocities[o],r.y>this.height&&(r.x=(Math.random()-.5)*this.width,r.y=0,r.z=(Math.random()-.5)*this.depth),this.updateInstanceMatrix(o)}}}class Oe extends n.BufferGeometry{constructor(e=.1){super();const o=[],r=[],s=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let i=0;i<s.length;i++){const[c,l]=s[i];o.push(c*e,l*e,0)}for(let i=1;i<s.length-1;i++)r.push(0,i,i+1);r.push(0,s.length-1,1);const a=new n.Float32BufferAttribute(o,3);this.setAttribute("position",a),this.setIndex(r),this.computeVertexNormals()}}class oo extends n.InstancedMesh{constructor(o={}){const{count:r=200,width:s=20,height:a=10,depth:i=20,geometry:c=new Oe,material:l=new n.MeshStandardMaterial({color:8956467,metalness:.1,roughness:.8,flatShading:!0,side:n.DoubleSide})}=o;super(c,l,r);v(this,"dummyMatrix");v(this,"velocities");v(this,"width");v(this,"height");v(this,"depth");this.dummyMatrix=new n.Matrix4,this.velocities=[],this.width=s,this.height=a,this.depth=i;for(let u=0;u<r;u++){const m=(Math.random()-.5)*s,h=Math.random()*(a-1)+.5,f=(Math.random()-.5)*i,d=(Math.random()-.5)*Math.PI,M=(Math.random()-.5)*Math.PI,p=(Math.random()-.5)*Math.PI;this.dummyMatrix.makeRotationFromEuler(new n.Euler(d,M,p)),this.dummyMatrix.setPosition(m,h,f),this.setMatrixAt(u,this.dummyMatrix);const y=new n.Vector3((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01);this.velocities.push(y)}this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const r=new n.Matrix4;this.getMatrixAt(o,r);const s=new n.Vector3;s.setFromMatrixPosition(r);const a=this.velocities[o];s.add(a),s.y<0&&(s.set((Math.random()-.5)*this.width,Math.random()*(this.height-1)+.5,(Math.random()-.5)*this.depth),a.set((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01)),r.setPosition(s),this.setMatrixAt(o,r)}this.instanceMatrix.needsUpdate=!0}}const g=(t,e)=>{const o=t[0].index!==null,r=new Set(Object.keys(t[0].attributes)),s=new Set(Object.keys(t[0].morphAttributes)),a={},i={},c=t[0].morphTargetsRelative,l=new n.BufferGeometry;let u=0;if(t.forEach((m,h)=>{let f=0;if(o!==(m.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let d in m.attributes){if(!r.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;a[d]===void 0&&(a[d]=[]),a[d].push(m.attributes[d]),f++}if(f!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(c!==m.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let d in m.morphAttributes){if(!s.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;i[d]===void 0&&(i[d]=[]),i[d].push(m.morphAttributes[d])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(m.userData),e){let d;if(m.index)d=m.index.count;else if(m.attributes.position!==void 0)d=m.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(u,d,h),u+=d}}),o){let m=0;const h=[];t.forEach(f=>{const d=f.index;for(let M=0;M<d.count;++M)h.push(d.getX(M)+m);m+=f.attributes.position.count}),l.setIndex(h)}for(let m in a){const h=K(a[m]);if(!h)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+m+" attribute."),null;l.setAttribute(m,h)}for(let m in i){const h=i[m][0].length;if(h===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[m]=[];for(let f=0;f<h;++f){const d=[];for(let p=0;p<i[m].length;++p)d.push(i[m][p][f]);const M=K(d);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+m+" morphAttribute."),null;l.morphAttributes[m].push(M)}}return l},K=t=>{let e,o,r,s=0;if(t.forEach(a=>{if(e===void 0&&(e=a.array.constructor),e!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(o===void 0&&(o=a.itemSize),o!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=a.normalized),r!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;s+=a.array.length}),e&&o){const a=new e(s);let i=0;return t.forEach(c=>{a.set(c.array,i),i+=c.array.length}),new n.BufferAttribute(a,o,r)}};function no(t,e=1e-4){e=Math.max(e,Number.EPSILON);const o={},r=t.getIndex(),s=t.getAttribute("position"),a=r?r.count:s.count;let i=0;const c=Object.keys(t.attributes),l={},u={},m=[],h=["getX","getY","getZ","getW"];for(let p=0,y=c.length;p<y;p++){const w=c[p];l[w]=[];const x=t.morphAttributes[w];x&&(u[w]=new Array(x.length).fill(0).map(()=>[]))}const f=Math.log10(1/e),d=Math.pow(10,f);for(let p=0;p<a;p++){const y=r?r.getX(p):p;let w="";for(let x=0,A=c.length;x<A;x++){const S=c[x],G=t.getAttribute(S),b=G.itemSize;for(let E=0;E<b;E++)w+=`${~~(G[h[E]](y)*d)},`}if(w in o)m.push(o[w]);else{for(let x=0,A=c.length;x<A;x++){const S=c[x],G=t.getAttribute(S),b=t.morphAttributes[S],E=G.itemSize,B=l[S],z=u[S];for(let V=0;V<E;V++){const R=h[V];if(B.push(G[R](y)),b)for(let I=0,Vt=b.length;I<Vt;I++)z[I].push(b[I][R](y))}}o[w]=i,m.push(i),i++}}const M=t.clone();for(let p=0,y=c.length;p<y;p++){const w=c[p],x=t.getAttribute(w),A=new x.array.constructor(l[w]),S=new n.BufferAttribute(A,x.itemSize,x.normalized);if(M.setAttribute(w,S),w in u)for(let G=0;G<u[w].length;G++){const b=t.morphAttributes[w][G],E=new b.array.constructor(u[w][G]),B=new n.BufferAttribute(E,b.itemSize,b.normalized);M.morphAttributes[w][G]=B}}return M.setIndex(m),M}class ro extends n.BufferGeometry{constructor(e=(s,a,i)=>i.set(s,a,Math.cos(s)*Math.sin(a)),o=8,r=8){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:o,stacks:r};const s=[],a=[],i=[],c=[],l=1e-5,u=new n.Vector3,m=new n.Vector3,h=new n.Vector3,f=new n.Vector3,d=new n.Vector3,M=o+1;for(let p=0;p<=r;p++){const y=p/r;for(let w=0;w<=o;w++){const x=w/o;e(x,y,m),a.push(m.x,m.y,m.z),x-l>=0?(e(x-l,y,h),f.subVectors(m,h)):(e(x+l,y,h),f.subVectors(h,m)),y-l>=0?(e(x,y-l,h),d.subVectors(m,h)):(e(x,y+l,h),d.subVectors(h,m)),u.crossVectors(f,d).normalize(),i.push(u.x,u.y,u.z),c.push(x,y)}}for(let p=0;p<r;p++)for(let y=0;y<o;y++){const w=p*M+y,x=p*M+y+1,A=(p+1)*M+y+1,S=(p+1)*M+y;s.push(w,x,S),s.push(x,A,S)}this.setIndex(s),this.setAttribute("position",new n.Float32BufferAttribute(a,3)),this.setAttribute("normal",new n.Float32BufferAttribute(i,3)),this.setAttribute("uv",new n.Float32BufferAttribute(c,2))}}class H extends n.BufferGeometry{constructor(e=1,o=1.5,r=.5,s=.05,a=.05){super();const i=e,c=o,l=r,u=s,m=a,h=[0,0,0,i,0,0,i,c,0,0,c,0,i,0,-l,0,0,-l,0,c,-l,i,c,-l,0,0,-l,0,0,0,0,c,0,0,c,-l,i,0,-u,u,0,-u,u,c,-u,i,c,-u,u,0,-l+u,i,0,-l+u,i,c,-l+u,u,c,-l+u,u,0,-u,u,0,-l+u,u,c,-l+u,u,c,-u,0,c,0,i,c,0,i,c,-u,u,c,-u,0,c,-l,u,c,-l+u,i,c,-l+u,i,c,-l,0,c,0,u,c,-u,u,c,-l+u,0,c,-l,0,0,0,u,0,-u,i,0,-u,i,0,0,0,0,-l,i,0,-l,i,0,-l+u,u,0,-l+u,0,0,0,0,0,-l,u,0,-l+u,u,0,-u,i,0,0,i,0,-u,i,c,-u,i,c,0,i,0,-l,i,c,-l,i,c,-l+u,i,0,-l+u],f=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0],d=e/(e*2+r),M=(e+r)/(e*2+r),p=[M,0,1,0,1,1,M,1,0,0,d,0,d,1,0,1,d,0,M,0,M,1,d,1,1,0,M,0,M,1,1,1,d,0,0,0,0,1,d,1,M,0,d,0,d,1,M,1,M,0,1,0,1,1,M,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1],y=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23,24,25,26,24,26,27,28,29,30,28,30,31,32,33,34,32,34,35,36,37,38,36,38,39,40,41,42,40,42,43,44,45,46,44,46,47,48,49,50,48,50,51,52,53,54,52,54,55],w=new Float32Array(h),x=new Float32Array(f),A=new Float32Array(p),S=new Uint16Array(y),G=new n.BufferGeometry;G.setAttribute("position",new n.BufferAttribute(w,3)),G.setAttribute("normal",new n.BufferAttribute(x,3)),G.setAttribute("uv",new n.BufferAttribute(A,2)),G.setIndex(new n.BufferAttribute(S,1));const b=new n.BoxGeometry(e-u-m,c-m*2,l-u*2);b.translate((e-u-m)/2+u,c/2,-l/2),this.copy(g([G,b],!0))}}function _e({scaleXMin:t=.4,scaleXMax:e=.7,scaleYMin:o=.3,scaleYMax:r=.95,scaleZMin:s=.1,scaleZMax:a=.5}={}){return new n.Vector3(k(t,e),W(.25,o,r),J(.8,s,a))}function Y({coverMaterial:t,pagesMaterial:e,scales:o}){const r=new H,s=new n.InstancedMesh(r,[t,e],o.length),a=new n.Matrix4;let i=0;for(let c=0;c<o.length;c++){const l=o[c],u=new n.Matrix4;u.makeScale(l.x,l.y,l.z),a.identity(),a.multiply(u),a.setPosition(.01+Math.random()*.1,0,i+l.z*.5),s.setMatrixAt(c,a),i+=l.z*.5}return s}function so({coverMaterial:t,pagesMaterial:e,count:o=10,scaleXMin:r=.4,scaleXMax:s=.7,scaleYMin:a=.3,scaleYMax:i=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=Array.from({length:o},()=>_e({scaleXMin:r,scaleXMax:s,scaleYMin:a,scaleYMax:i,scaleZMin:c,scaleZMax:l}));return Y({coverMaterial:t,pagesMaterial:e,scales:u})}function ao({coverMaterial:t,pagesMaterial:e,length:o=10,scaleXMin:r=.4,scaleXMax:s=.7,scaleYMin:a=.3,scaleYMax:i=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=[];let m=o;for(;m>0;){const h=_e({scaleXMin:r,scaleXMax:s,scaleYMin:a,scaleYMax:i,scaleZMin:c,scaleZMax:l});h.z=Math.min(h.z,m),u.push(h),m-=h.z}return Y({coverMaterial:t,pagesMaterial:e,scales:u})}class io extends n.BufferGeometry{constructor(e=2,o=.3,r=.6,s=5,a=5,i=Math.PI/4){super();const c=[],l=[];for(let d=0;d<s;d++){const M=d*o,p=M+o,y=d*r,w=y+r;c.push(-e/2,M,y,e/2,M,y,e/2,p,y,-e/2,p,y,-e/2,p,y,e/2,p,y,e/2,p,w,-e/2,p,w);const x=d*8;l.push(x,x+1,x+2,x,x+2,x+3),l.push(x+4,x+5,x+6,x+4,x+6,x+7)}const u=s*o,m=s*r,h=e*2;c.push(-h/2,u,m,h/2,u,m,h/2,u,m+r,-h/2,u,m+r);const f=s*8;l.push(f,f+1,f+2,f,f+2,f+3);for(let d=0;d<2;d++){const M=d===0?1:-1;for(let p=0;p<a;p++){const y=u+p*o,w=y+o,x=M*(h/4),A=m+r,S=p*r*Math.cos(i),G=p*r*Math.sin(i),b=x+M*S-e/2*Math.cos(i),E=x+M*S+e/2*Math.cos(i),B=A+G,z=b+M*r*Math.cos(i),V=E+M*r*Math.cos(i),R=B+r*Math.sin(i);c.push(b,y,B,E,y,B,E,w,B,b,w,B,b,w,B,E,w,B,V,w,R,z,w,R);const I=f+4+d*a*8+p*8;l.push(I,I+1,I+2,I,I+2,I+3),l.push(I+4,I+5,I+6,I+4,I+6,I+7)}}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class co extends n.BufferGeometry{constructor(e=5,o=3,r=5,s=.2){super();const a=[-e/2,0,-r/2,e/2,0,-r/2,e/2,0,r/2,-e/2,0,r/2,-e/2,0,-r/2,e/2,0,-r/2,e/2,o,-r/2,-e/2,o,-r/2,-e/2,0,-r/2,-e/2,0,r/2,-e/2,o,r/2,-e/2,o,-r/2],i=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11];this.setIndex(i),this.setAttribute("position",new n.Float32BufferAttribute(a,3)),this.computeVertexNormals()}}class lo extends n.BufferGeometry{constructor(e=2,o=.3,r=.5,s=5,a=2){super();const i=[],c=[];for(let h=0;h<s;h++){const f=h*o,d=f+o,M=h*r,p=M+r;i.push(-e/2,f,M,e/2,f,M,e/2,d,M,-e/2,d,M,-e/2,d,M,e/2,d,M,e/2,d,p,-e/2,d,p);const y=h*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}const l=s*o,u=s*r;i.push(-e/2,l,u,e/2,l,u,e/2,l,u+a,-e/2,l,u+a);const m=s*8;c.push(m,m+1,m+2,m,m+2,m+3);for(let h=0;h<s;h++){const f=l+h*o,d=f+o,M=-e/2-h*r,p=M-r;i.push(M,f,u+a,M,f,u+a-e,M,d,u+a-e,M,d,u+a,M,d,u+a,M,d,u+a-e,p,d,u+a-e,p,d,u+a);const y=m+4+h*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}this.setIndex(c),this.setAttribute("position",new n.Float32BufferAttribute(i,3)),this.computeVertexNormals()}}class uo extends n.BufferGeometry{constructor(e=1,o=.4,r=.2,s=20,a=2,i=Math.PI/8){super();const c=[],l=[];let u=0;for(let m=0;m<s;m++){const h=a*Math.cos(u),f=a*Math.sin(u),d=m*r,M=d+r;c.push(h-e/2*Math.cos(u),d,f-e/2*Math.sin(u),h+e/2*Math.cos(u),d,f+e/2*Math.sin(u),h+e/2*Math.cos(u),M,f+e/2*Math.sin(u),h-e/2*Math.cos(u),M,f-e/2*Math.sin(u)),c.push(h-e/2*Math.cos(u),M,f-e/2*Math.sin(u),h+e/2*Math.cos(u),M,f+e/2*Math.sin(u),h+e/2*Math.cos(u)-o*Math.sin(u),M,f+e/2*Math.sin(u)+o*Math.cos(u),h-e/2*Math.cos(u)-o*Math.sin(u),M,f-e/2*Math.sin(u)+o*Math.cos(u));const p=m*8;l.push(p,p+1,p+2,p,p+2,p+3),l.push(p+4,p+5,p+6,p+4,p+6,p+7),u+=i}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class mo extends n.BufferGeometry{constructor(e=2,o=.3,r=.5,s=10){super();const a=[],i=[];for(let c=0;c<s;c++){const l=c*o,u=l+o,m=c*r,h=m+r;a.push(-e/2,l,m,e/2,l,m,e/2,u,m,-e/2,u,m,-e/2,u,m,e/2,u,m,e/2,u,h,-e/2,u,h);const f=c*8;i.push(f,f+1,f+2,f,f+2,f+3),i.push(f+4,f+6,f+5,f+4,f+7,f+6)}this.setIndex(i),this.setAttribute("position",new n.Float32BufferAttribute(a,3)),this.computeVertexNormals()}}class Fe extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(1.2,0),new n.Vector2(1.5,1.5),new n.Vector2(1,3),new n.Vector2(.6,3.5),new n.Vector2(.5,3.5)],o=new n.LatheGeometry(e,10),r=new n.CylinderGeometry(.6,.5,.3,10);r.translate(0,3.5,0),this.copy(g([o,r],!0))}}function X(t,e,o,r,s){const a=(r-e)/(o-t);return t+(s-e)/a}function Le(t,e,o,r,s){const a=(r-e)/(o-t);return e+a*(s-t)}const ho={calculateXFromSlopeIntercept:X,calculateYFromSlopeIntercept:Le};class ke extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(1,1.5),new n.Vector2(.5,2.2),new n.Vector2(.6,2.5),new n.Vector2(.5,2.5)],o=new n.LatheGeometry(e,10),r=new n.CylinderGeometry(.55,.45,.2,10);r.translate(0,2.5,0);const s=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(X(.8,0,1,1.5,1),1),new n.Vector2(0,1)],a=new n.LatheGeometry(s,10);a.translate(0,.1,0),a.scale(.9,.9,.9),this.copy(g([o,r,a],!0))}}class De extends n.BufferGeometry{constructor({radius:e=.5,neckRadius:o=.2,height:r=3,neckHeight:s=1,segments:a=16}={}){super();const i=r-s,c=new n.CylinderGeometry(e,e,i,a);c.translate(0,i/2,0);const l=.3,u=new n.CylinderGeometry(o,e,l,a);u.translate(0,i+l/2,0);const m=new n.CylinderGeometry(o,o,s,a);m.translate(0,i+l+s/2,0),this.copy(g([c,u,m],!1))}}class ze extends n.BufferGeometry{constructor(e=.4,o=1.2,r=.2){super();const s=o*.6,a=new n.BoxGeometry(e/2,s,r);a.translate(0,s/2,0);const i=e*1.5,c=new n.BoxGeometry(i,e/4,r);c.translate(0,s*.75,0),this.copy(g([a,c],!1)),this.computeVertexNormals()}}class qe extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,1,5);e.translate(0,.5,0);const o=new n.BoxGeometry(4,3,4);o.translate(0,2.5,0);const r=[[-1.8,2.3,-2.2],[1.8,2.3,-2.2],[-1.8,2.3,2.2],[1.8,2.3,2.2]],s=[];r.forEach(u=>{const m=new n.CylinderGeometry(.2,.2,3.5,16);m.translate(u[0],u[1],u[2]),s.push(m)});const a=new n.ConeGeometry(3.5,2,4);a.rotateY(Math.PI/4),a.translate(0,5,0);const i=new n.Shape;i.moveTo(-1,0),i.lineTo(-1,2),i.absarc(0,2,1,Math.PI,0,!0),i.lineTo(1,0);const c={depth:.5,bevelEnabled:!1},l=new n.ExtrudeGeometry(i,c);l.translate(0,.5,1.7),l.setIndex([...Array(l.attributes.position.count).keys()]),this.copy(g([e,g([o,...s],!1),a,l],!0)),this.computeVertexNormals()}}class He extends n.BufferGeometry{constructor(e=1.75,o=.75){super();const r=e*.05,s=e*.15,a=e*.15,i=e*.75;let c=0;const l=new n.BoxGeometry(o,r,o);l.translate(0,c+r/2,0),c+=r;const u=new n.BoxGeometry(o*.8,s,o*.8);u.translate(0,c+s/2,0),c+=s;const m=new n.BoxGeometry(o*.6,a,o*.6);m.translate(0,c+a/2,0),c+=a;const h=new n.BoxGeometry(o*.4,i,o*.4);h.translate(0,c+i/2,0),c+=i;const f=new n.ConeGeometry(o*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);f.translate(0,c+.1/2,0),this.copy(g([l,u,m,h,f],!1)),this.computeVertexNormals()}}class Ye extends n.BufferGeometry{constructor(e=.6,o=1,r=.2,s=.6){super();const a=o-s/2,i=new n.BoxGeometry(e,a,r);i.translate(0,a/2,0);const c=new n.CylinderGeometry(s/2,s/2,r,16,1,!1,0,Math.PI);c.rotateY(Math.PI/2),c.rotateX(Math.PI/2),c.translate(0,a,0),this.copy(g([i,c],!1)),this.computeVertexNormals()}}class Xe extends n.BufferGeometry{constructor(e=.5,o=.8,r=.15){super();const s=new n.BoxGeometry(e,o,r);s.translate(0,o/2,0),this.copy(s)}}class Ze extends n.BufferGeometry{constructor({height:e=2.25}={}){super();const o=new n.BoxGeometry(1.2,.5,1.2);o.translate(0,.25,0);const r=new n.BoxGeometry(1,e,1);r.translate(0,.5+e/2,0);const s=new n.BoxGeometry(1.4,.3,1.4);s.translate(0,.5+e+.15,0),this.copy(g([o,r,s],!1))}}class Z extends n.BufferGeometry{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:r=.3,spikeRadius:s=.075,spikeScaleZ:a=1,radialSegments:i=8}={}){super();const c=new n.CylinderGeometry(o,o,e,i);c.translate(0,e/2,0);const l=new n.ConeGeometry(s,r,i);l.translate(0,e+r/2,0),l.scale(1,1,a),this.copy(g([c,l],!1))}}class je extends n.BufferGeometry{constructor({count:e=20,spacing:o=.4,barHeight:r=2,barRadius:s=.05,spikeHeight:a=.3,spikeRadius:i=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:m=0,radialSegments:h=8}={}){super();const f=[],d=new Z({barHeight:r,barRadius:s,spikeHeight:a,spikeRadius:i,spikeScaleZ:c,radialSegments:h}),M=new n.BoxGeometry(e*o,l,u);for(let w=0;w<e;w++){const x=d.clone();x.translate(w*o,0,0),f.push(x)}const p=M.clone();p.translate(o*(e-1)/2,r-m-l/2,0),f.push(p);const y=M.clone();y.translate(o*(e-1)/2,l/2,0),f.push(y),this.copy(g(f))}}class Qe extends n.BufferGeometry{constructor({width:e=5,height:o=8,depth:r=1,shelves:s=4,frameThickness:a=.1,open:i=!1}={}){super();const c=o,l=e,u=r,m=new n.BoxGeometry(a,c,u),h=new n.BoxGeometry(l-2*a,a,u),f=m.clone();f.translate(-l/2+a/2,c/2,0);const d=m.clone();d.translate(l/2-a/2,c/2,0);const M=h.clone();M.translate(0,c-a/2,0);const p=h.clone();p.translate(0,a/2,0);const y=new n.BoxGeometry(l,c,a);y.translate(0,c/2,-u/2+a/2);const w=[],x=(c-a)/(s+1);for(let A=1;A<=s;A++){const S=h.clone();S.translate(0,a/2+A*x,0),w.push(S)}this.copy(g([f,d,M,p,...i?[]:[y],...w],!1))}}class Ke extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,.3,3);e.translate(0,3.15,0);const o=[new n.Vector2(.2,0),new n.Vector2(.25,.5),new n.Vector2(.15,1.5),new n.Vector2(.3,3)],r=new n.LatheGeometry(o,32),a=g([[2.1,0,1.1],[-2.1,0,1.1],[2.1,0,-1.1],[-2.1,0,-1.1]].map(i=>{const c=r.clone();return c.translate(i[0],i[1],i[2]),c}));this.copy(g([e,a],!0))}}class j extends ro{constructor({height:e=.25,radius:o=.05,segmentsU:r=16,segmentsV:s=16}={}){super((a,i,c)=>{const l=a*Math.PI*2,u=Math.sin(i*Math.PI),m=o*u*Math.cos(l),h=i*e,f=o*u*Math.sin(l);c.set(m,h,-f)},r,s)}}class We extends n.BufferGeometry{constructor({radiusTop:e=.2,radiusBottom:o=.2,height:r=1,flameHeight:s=.25,flameRadius:a=.05,segments:i=16}={}){super();const c=new n.CylinderGeometry(e,o,r,i);c.translate(0,r/2,0);const l=new j({segmentsU:i,segmentsV:i,height:s,radius:a});l.translate(0,r,0),this.copy(g([c,l],!0))}}class Je extends n.BufferGeometry{constructor(){super();const e=[],o=[];for(let r=0;r<5;r++){const s=.8+Math.random()*.4,a=.8+Math.random()*.4,i=.8+Math.random()*.4,c=Math.random()*Math.PI,l=Math.random()*Math.PI,u=Math.random()*Math.PI,m=(Math.random()-.5)*4,h=0,f=(Math.random()-.5)*4,d=new n.DodecahedronGeometry(1,0);d.scale(s,a,i),d.rotateX(c),d.rotateY(l),d.rotateZ(u),d.translate(m,h,f),e.push(d);const M=new n.DodecahedronGeometry(1,0);M.scale(s*.9,a*.5,i*.9),M.rotateX(c),M.rotateY(l),M.rotateZ(u),M.translate(m,h+.3,f),o.push(M)}this.copy(g([g(e),g(o)],!0))}}function $e(t,e=D.XYZ,o=.5,r=2){t.deleteAttribute("uv"),t.deleteAttribute("normal"),t=no(t),t.computeVertexNormals();const s=t.getAttribute("position");for(let a=0;a<s.count;a++){const i=new n.Vector3().fromBufferAttribute(s,a),c=Math.random()*(r-o)+o,l=e.clone().multiplyScalar(c);i.add(l),s.setXYZ(a,i.x,i.y,i.z)}return s.needsUpdate=!0,t.computeVertexNormals(),t}class et extends n.BufferGeometry{constructor(e=1,o=4,r=4){super();const s=new n.SphereGeometry(e,o,r);this.copy($e(s,D.XYZ,.5,1)),this.computeVertexNormals(),this.center()}}class tt extends n.BufferGeometry{constructor(){super();const e=[];for(let o=0;o<5;o++){const r=new n.DodecahedronGeometry(1,0);r.scale(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),r.rotateX(Math.random()*Math.PI),r.rotateY(Math.random()*Math.PI),r.rotateZ(Math.random()*Math.PI),r.translate((Math.random()-.5)*4,0,(Math.random()-.5)*4),e.push(r)}this.copy(g(e))}}class ot extends n.BufferGeometry{constructor(e=.1,o=.1,r=.4,s=8){super();const a=new n.CylinderGeometry(e*.6,o*.6,r,s);a.translate(0,0,0);const i=new n.SphereGeometry(e,s,s),c=i.clone(),l=i.clone(),u=i.clone(),m=i.clone();c.translate(0,r/2+e*.6,-e*.6),l.translate(0,r/2+e*.6,e*.6),u.translate(0,-r/2-o*.6,-o*.6),m.translate(0,-r/2-o*.6,o*.6),this.copy(g([a,c,l,u,m],!1))}}class nt extends n.BufferGeometry{constructor({flaskRadius:e=1,neckRadius:o=.3,height:r=2.5,neckHeight:s=1,radialSegments:a=16}={}){super();const i=[new n.Vector2(0,0),new n.Vector2(e*.875,0),new n.Vector2(e,.1),new n.Vector2(o,r),new n.Vector2(o,r+s),new n.Vector2(o*1.1,r+s+.3)],c=new n.LatheGeometry(i,a);this.copy(g([c],!1))}}const fo=(t,e)=>t/(1-Math.cos(e)),Q=(t,e)=>t/(2*Math.sin(e)),rt=(t,e)=>t*(1-Math.cos(e)),Mo=(t,e)=>2*t*Math.sin(e),q=(t,e)=>{const o=2*e;return Math.asin(o/(2*t))},po=(t,e,o)=>({x:t*Math.sin(o)*Math.cos(e),y:t*Math.sin(o)*Math.sin(e),z:t*Math.cos(o)}),yo=(t,e,o)=>{const r=Math.sqrt(t*t+e*e+o*o),s=Math.atan2(e,t),a=Math.acos(o/r);return{radius:r,theta:s,phi:a}};function st(t,e,o,r=0,s=0,a=32){const i=r?q(t,r):0,c=s?Math.PI-q(t,s):Math.PI,l=[];for(let u=0;u<=a;u++){const m=c-(c-i)/a*u,h=t*Math.sin(m),f=e*Math.cos(m)+o;l.push(new n.Vector2(h,f))}return[...l]}class at extends n.BufferGeometry{constructor(){super();const e=[...st(1,1,.5,.2,0,32),new n.Vector2(.2,3)],o=new n.LatheGeometry(e,32);this.copy(o)}}class it extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(1,0),new n.Vector2(1.2,.5),new n.Vector2(1.4,1.5),new n.Vector2(1.3,1.8),new n.Vector2(.8,1.8)],o=new n.LatheGeometry(e,12),r=new n.CircleGeometry(1,12);r.rotateX(-Math.PI/2),r.translate(0,0,0),this.copy(g([o,r],!1))}}class ct extends n.BufferGeometry{constructor({radius:e=.3,height:o=.4,count:r=3,thickness:s=.03,radialSegments:a=16}={}){super();const i=new n.TorusGeometry(e,s,8,a);i.rotateX(Math.PI/2),i.translate(0,o,0);const c=new n.CylinderGeometry(s*.6,s*.6,o,a),l=[];for(let u=0;u<r;u++){const m=u/r*Math.PI*2,h=c.clone();h.translate(Math.cos(m)*e,o/2,Math.sin(m)*e),l.push(h)}this.copy(g([i,...l],!1))}}class lt extends n.BufferGeometry{constructor(){super();const e=new n.CylinderGeometry(.5,.6,.3,16);e.translate(0,.15,0);const o=new n.CylinderGeometry(.15,.15,2,12,1,!0);o.translate(0,1.3,0);const r=new n.SphereGeometry(.3,16,16);r.translate(0,2.4,0),this.copy(g([e,g([o,r])],!0))}}class L extends n.BufferGeometry{constructor(e=.2,o=.2,r=3,s=32,a=!0){super();const i=new n.CylinderGeometry(e,o,r,s,1,a),c=new n.SphereGeometry(o,s,s/2,0,Math.PI*2,Math.PI/2,Math.PI/2);c.translate(0,-(r/2),0),this.copy(g([i,c],!1))}}class ut extends n.BufferGeometry{constructor({radius:e=3,height:o=.6,widthSegments:r=64,heightSegments:s=16,phiStart:a=0,phiLength:i=Math.PI*2}={}){super(),this.copy(new n.SphereGeometry(e,r,s,a,i,0,Math.PI/2)),this.scale(1,o/e,1)}}class mt extends n.BufferGeometry{constructor({radius:e=Q(5,Math.PI/10),widthSegments:o=64,heightSegments:r=32,phiStart:s=0,phiLength:a=Math.PI*2,thetaLength:i=Math.PI/10}={}){super(),this.copy(new n.SphereGeometry(e,o,r,s,a,0,i));const c=rt(e,i);this.translate(0,-e+c,0)}}class ht extends n.BufferGeometry{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:r=2.5,trunkSegments:s=14,leafSize:a=.8,leafCount:i=6,leafDetail:c=0,leafSpreadRadius:l=1.5}={}){super();const u=new n.CylinderGeometry(e,o,r,s);u.translate(0,r/2,0);const m=[];for(let h=0;h<i;h++){const f=new n.DodecahedronGeometry(a,c);f.translate((Math.random()-.5)*l,(Math.random()-.5)*a+r,(Math.random()-.5)*l),m.push(f)}this.copy(g([u.toNonIndexed(),g(m,!1)],!0)),this.computeVertexNormals()}}const ft={uniforms:{time:{value:0}},vertexShader:`
|
|
2
2
|
varying vec3 vNormal;
|
|
3
3
|
varying vec3 vPosition;
|
|
4
4
|
void main() {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
color *= 0.8 + 0.2 * n; // Modulate color by noise
|
|
36
36
|
gl_FragColor = vec4(color, 1.0);
|
|
37
37
|
}
|
|
38
|
-
`};class fo extends n.Mesh{constructor(){super(new n.SphereGeometry(5,32,32),new n.ShaderMaterial(ht))}}class Mo extends n.Mesh{constructor({width:e=1,height:o=1.5,depth:r=.5,coverThickness:a=.05,pageIndent:s=.05,coverColor:i=L.DARK_RED,pageColor:c=L.TITANIUM_WHITE}={}){super(new H(e,o,r,a,s),[new n.MeshStandardMaterial({color:i,metalness:.1,roughness:.7,flatShading:!0}),new n.MeshStandardMaterial({color:c,flatShading:!0})])}}class po extends n.Mesh{constructor(){super(new _e,[new n.MeshStandardMaterial({color:8965290,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.5}),new n.MeshStandardMaterial({color:9127187,roughness:1})])}}class yo extends n.Mesh{constructor(){super(new Fe,[new n.MeshStandardMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.5,roughness:.1,metalness:.3}),new n.MeshStandardMaterial({color:9127187,roughness:1}),new n.MeshStandardMaterial({color:L.PINK_SHERBET,transparent:!0,depthWrite:!1,opacity:.5})])}}class xo extends n.Mesh{constructor(){super(new ke,new n.MeshPhysicalMaterial({color:5597999,roughness:.1,transmission:.9,thickness:.2,metalness:0,clearcoat:1,clearcoatRoughness:.1}))}}class wo extends n.Mesh{constructor({width:e=.4,height:o=1.2,depth:r=.2}={}){super(new De(e,o,r),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class vo extends n.Mesh{constructor(){super(new ze,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:6908265,flatShading:!0}),new n.MeshStandardMaterial({color:5263440,flatShading:!0}),new n.MeshStandardMaterial({color:4210752,flatShading:!0})])}}class go extends n.Mesh{constructor({totalHeight:e=1.75,baseWidth:o=.75}={}){super(new qe(e,o),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class So extends n.Mesh{constructor(e=.6,o=1,r=.2,a=.6){super(new He(e,o,r,a),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Go extends n.Mesh{constructor(e=.5,o=.8,r=.15){super(new Ye(e,o,r),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Eo extends n.Mesh{constructor({height:e=2.25}={}){super(new Xe({height:e}),new n.MeshStandardMaterial({color:9141627,flatShading:!0}))}}class bo extends n.Mesh{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:r=.3,spikeRadius:a=.075,spikeScaleZ:s=1,radialSegments:i=8}={}){super(new Z({barHeight:e,barRadius:o,spikeHeight:r,spikeRadius:a,spikeScaleZ:s,radialSegments:i}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class Io extends n.Mesh{constructor({count:e=20,spacing:o=.4,barHeight:r=2,barRadius:a=.05,spikeHeight:s=.3,spikeRadius:i=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:h=0,radialSegments:m=8}={}){super(new Ze({count:e,spacing:o,barHeight:r,barRadius:a,spikeHeight:s,spikeRadius:i,spikeScaleZ:c,railHeight:l,railDepth:u,railOffset:h,radialSegments:m}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class Ao extends n.Mesh{constructor({width:e=5,height:o=8,depth:r=1,shelves:a=4,frameThickness:s=.1,open:i=!1}={}){super(new je({width:e,height:o,depth:r,shelves:a,frameThickness:s,open:i}),new n.MeshStandardMaterial({color:9127187}))}}class Bo extends n.Mesh{constructor(){super(new Qe,[new n.MeshStandardMaterial({color:9132587}),new n.MeshStandardMaterial({color:4929057})])}}class Po extends n.Group{constructor(o=1,r=.2){super();v(this,"candle");v(this,"flame");v(this,"candleLight");v(this,"height");v(this,"radius");this.height=o,this.radius=r;const a=new n.CylinderGeometry(this.radius,this.radius,this.height,32),s=new n.MeshStandardMaterial({color:16777215});this.candle=new n.Mesh(a,s),this.candle.position.set(0,this.height/2,0),this.add(this.candle);const i=new n.SphereGeometry(.05,16,16),c=new n.MeshBasicMaterial({color:16753920});this.flame=new n.Mesh(i,c),this.flame.position.set(0,this.height+.05,0),this.add(this.flame),this.candleLight=new n.PointLight(16753920,1,5),this.candleLight.position.set(0,this.height+.05,0),this.candleLight.castShadow=!0,this.add(this.candleLight),this.animateFlicker()}animateFlicker(){const o=()=>{this.candleLight.intensity=1+(Math.random()*.4-.2),this.candleLight.position.x=Math.random()*.02-.01,this.candleLight.position.z=Math.random()*.02-.01,requestAnimationFrame(o)};o()}}class To extends n.Group{constructor(e=1.3,o=.5){super();const r=new n.CylinderGeometry(o,o,.2,16),a=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),s=new n.Mesh(r,a);s.position.set(0,0,0),this.add(s);const i=new n.CylinderGeometry(o*.9,o*.9,e),c=new n.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),l=new n.Mesh(i,c);l.position.set(0,e/2+.1,0),this.add(l);const u=new n.ConeGeometry(o*1.1,.5,8),h=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),m=new n.Mesh(u,h);m.position.set(0,e+.35,0),this.add(m);const d=new n.TorusGeometry(o*.8,.05,8,16),f=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),M=new n.Mesh(d,f);M.position.set(0,e+.85,0),this.add(M);const p=new n.PointLight(16755200,1.5,15);p.position.set(0,e/2+.1,0),p.castShadow=!0,this.add(p)}}class Co extends n.Mesh{constructor(){super(new Ke,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:4950843,flatShading:!0,opacity:.8,transparent:!0})])}}class Ro extends n.Mesh{constructor(e=1,o=4,r=4){super(new Je(e,o,r),new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Vo extends n.Mesh{constructor(){super(new $e,new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Uo extends n.Group{constructor(){super();const e=new n.CylinderGeometry(.3,.4,.1,16),o=new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.3}),r=new n.Mesh(e,o);r.position.y=.05;const a=new n.CylinderGeometry(.1,.1,.7,16),s=new n.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),i=new n.Mesh(a,s);i.position.y=.4;const c=new n.ConeGeometry(.075,.2,16),l=new n.MeshStandardMaterial({color:16733440,emissive:16733440,emissiveIntensity:.6,transparent:!0,opacity:.8}),u=new n.Mesh(c,l);u.position.y=.8,this.add(r,i,u)}}class No extends n.Group{constructor(){super();const e=new n.BoxGeometry(3,4,.1),o=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6}),r=new n.BoxGeometry(.2,.5,.2),a=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),s=new n.CylinderGeometry(.3,.3,.1,16),i=new n.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),c=new n.Mesh(e,o);for(let y=-1;y<=1;y++){const x=new n.Mesh(r,a);x.position.set(y,1.5,.1),c.add(x)}const l=new n.Mesh(s,i);l.rotation.x=Math.PI/2,l.position.set(0,.5,.15),c.add(l);const u=new n.SphereGeometry(.15,8,8),h=new n.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),m=new n.Mesh(u,h);m.position.set(0,-1,.1),c.add(m),this.add(c);let d=.015,f=.8,M=.2;function p(){requestAnimationFrame(p);const y=M+Math.abs(Math.sin(Date.now()*d))*(f-M);m.material.emissiveIntensity=y}p()}}class Oo extends n.Mesh{constructor({flaskRadius:e=1,neckRadius:o=.3,height:r=2.5,neckHeight:a=1,radialSegments:s=16}={}){super(new tt({flaskRadius:e,neckRadius:o,height:r,neckHeight:a,radialSegments:s}),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class _o extends n.Mesh{constructor(){super(new rt,new n.MeshPhysicalMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class Lo extends n.Group{constructor(){super();const e=new n.BoxGeometry(2,3,.1),o=new n.MeshStandardMaterial({color:3355443,roughness:.8,metalness:.5}),r=new n.Mesh(e,o),a=new n.CylinderGeometry(.1,.1,.2,8),s=new n.CylinderGeometry(.05,.05,1,8),i=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let c=-.5;c<=.5;c+=.5){const l=new n.Mesh(a,i);l.position.set(c,1,.1);const u=new n.Mesh(s,i);u.position.y=.5,l.add(u),this.add(l)}this.add(r)}}class Fo extends n.Group{constructor(){super();const e=new n.BoxGeometry(1,.2,.5),o=new n.MeshStandardMaterial({color:4473924,roughness:.6,metalness:.3}),r=new n.Mesh(e,o);r.position.y=.1;const a=new n.BoxGeometry(.2,1,.2),s=new n.Mesh(a,o);s.position.set(0,.6,-.2);const i=new n.CylinderGeometry(.1,.1,.4,8),c=new n.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),l=new n.Mesh(i,c);l.position.set(0,1.1,-.35),l.rotation.x=-Math.PI/4;const u=new n.BoxGeometry(.6,.1,.6),h=new n.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),m=new n.Mesh(u,h);m.position.set(0,.6,0),this.add(r,s,l,m)}}class ko extends n.Group{constructor(){super();const e=new st,o=new n.CylinderGeometry(.2,.3,1.5,8);o.translate(0,.75,0);const r=new n.MeshStandardMaterial({color:6045747,roughness:1,metalness:0,side:n.DoubleSide}),a=new n.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),s=new n.Mesh(e,r);s.castShadow=!0;const i=new n.Mesh(o,a);i.castShadow=!0,i.position.set(.3,1.3,0),i.rotation.z=Math.PI/4,this.add(s,i)}}class Do extends n.Mesh{constructor({width:o=3,height:r=4,depth:a=.1}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,r,a),this.material=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6})}}class zo extends n.Mesh{constructor({radius:o=.15,color:r=16762823,emissive:a=16711680,emissiveIntensity:s=.5}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,8,8),this.material=new n.MeshStandardMaterial({color:r,emissive:a,emissiveIntensity:s})}}class qo extends n.Group{constructor(){super();const e=100,o=.05,r=new n.CatmullRomCurve3(Array.from({length:e},(u,h)=>{const m=h*.2;return new n.Vector3(Math.cos(m)*.4,h*o,Math.sin(m)*.4)})),a=new n.TubeGeometry(r,200,.1,8,!1),s=new n.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),i=new n.Mesh(a,s);this.add(i);function c(){s.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function l(){requestAnimationFrame(l),c()}l()}}class Ho extends n.Mesh{constructor({radius:e=.3,height:o=.4,count:r=3,thickness:a=.03,radialSegments:s=16}={}){super(new at({radius:e,height:o,count:r,thickness:a,radialSegments:s}),new n.MeshStandardMaterial({color:8947848,roughness:.7,metalness:.3}))}}class Yo extends n.Mesh{constructor(){super(new it,[new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.5}),new n.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:n.DoubleSide})])}}class Xo extends n.Mesh{constructor(e=.2,o=.2,r=3,a=32){super(new F(e,o,r,a),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,depthWrite:!1,side:n.DoubleSide}))}}class Zo extends n.Group{constructor(e=3,o=[65450,16711850,11141375]){super();const r=new n.BoxGeometry(3,.2,1),a=new n.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),s=new n.Mesh(r,a);s.position.y=.5,s.castShadow=!0;const i=new F(.1,.1,1,16),c=new n.MeshStandardMaterial({color:11184810,transparent:!0,opacity:.4,roughness:.1,metalness:.5,depthWrite:!1,side:n.DoubleSide});for(let l=0;l<e;l++){const u=new n.Mesh(i,c),h=(l-(e-1)/2)*.8;u.position.set(h,1,0),u.castShadow=!0;const m=new F(.099,.099,.5,16,!1),d=o[l%o.length],f=new n.MeshStandardMaterial({color:d,emissive:d,emissiveIntensity:.5,transparent:!0,opacity:.6}),M=new n.Mesh(m,f);M.position.set(0,-.25,0),u.add(M),s.add(u)}this.add(s)}}class mt extends n.Shape{constructor(e=5,o=.5,r=1){super();const a=Math.PI*2/e,s=a/2,i=a/4;this.moveTo(Math.cos(0)*r,-Math.sin(0)*r);for(let c=1;c<=e;++c){let l=Math.cos(a*c-i*3)*(o/Math.cos(i)),u=-Math.sin(a*c-i*3)*(o/Math.cos(i)),h=Math.cos(a*c-s)*o,m=-Math.sin(a*c-s)*o;this.quadraticCurveTo(l,u,h,m),l=Math.cos(a*c-i)*(o/Math.cos(i)),u=-Math.sin(a*c-i)*(o/Math.cos(i)),h=Math.cos(a*c)*r,m=-Math.sin(a*c)*r,this.quadraticCurveTo(l,u,h,m)}this.closePath()}}class jo extends n.Mesh{constructor(e=5,o=.5,r=1,a=.25){super();const s=new mt(e,o,r),i=new n.ExtrudeGeometry(s,{depth:a,bevelEnabled:a>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});i.center(),this.geometry=i,this.material=c}}class dt extends n.Shape{constructor(e=5,o=.5,r=1,a=5,s=.25){super();const i=Math.PI*2/e,c=i/4;this.moveTo(Math.cos(0)*r,-Math.sin(0)*r);for(let l=1;l<=e;++l)this.lineTo(Math.cos(i*l-c*3)*o,-Math.sin(i*l-c*3)*o),this.lineTo(Math.cos(i*l-c*2)*o,-Math.sin(i*l-c*2)*o),this.lineTo(Math.cos(i*l-c)*r,-Math.sin(i*l-c)*r),this.lineTo(Math.cos(i*l)*r,-Math.sin(i*l)*r);if(this.closePath(),s>0&&a>2){const l=new n.Path,u=Math.PI*2/a;l.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let h=1;h<a;++h)l.lineTo(Math.cos(u*h)*s,-Math.sin(u*h)*s);l.lineTo(Math.cos(0)*s,-Math.sin(0)*s),this.holes.push(l)}}}class Qo extends n.Mesh{constructor(e=5,o=.5,r=1,a=5,s=.25,i=.25){super();const c=new dt(e,o,r,a,s),l=new n.ExtrudeGeometry(c,{depth:i,bevelEnabled:i>0,bevelThickness:0,bevelSize:0}),u=new n.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2});l.center(),this.geometry=l,this.material=u}}class ft extends n.Shape{constructor(e=1,o=2.1,r=1.4,a=1.6){super(),this.moveTo(0,r*e/3),this.bezierCurveTo(-o*.375*e,r*e,-o*e,r*e/3,0,-a*e),this.bezierCurveTo(o*e,r*e/3,o*.375*e,r*e,0,r*e/3)}}class Ko extends n.Mesh{constructor(e=1,o=1,r=1,a=10,s=.25){super();const i=new ft(e,o,r,a),c=new n.ExtrudeGeometry(i,{depth:s,bevelEnabled:s>0,bevelThickness:0,bevelSize:0}),l=new n.MeshStandardMaterial({color:12986408,emissive:12981270,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});c.center(),this.geometry=c,this.material=l}}class Mt extends n.Shape{constructor(e=5,o=.5,r=1){super();const a=Math.PI*2/e,s=a/2;this.moveTo(Math.cos(0)*r,Math.sin(0)*r);for(let i=1;i<=e;++i)this.lineTo(Math.cos(a*i-s)*o,Math.sin(a*i-s)*o),this.lineTo(Math.cos(a*i)*r,Math.sin(a*i)*r);this.closePath()}}class Wo extends n.Mesh{constructor(e=5,o=.5,r=1,a=.25){super();const s=new Mt(e,o,r),i=new n.ExtrudeGeometry(s,{depth:a,bevelEnabled:a>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});i.center(),this.geometry=i,this.material=c}}class Jo extends n.Mesh{constructor(){super(new et,new n.MeshStandardMaterial({color:16777215}))}}class $o extends n.Mesh{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:r=2.5,trunkSegments:a=14,trunkColor:s=9127187,leafSize:i=.8,leafCount:c=6,leafDetail:l=0,leafSpreadRadius:u=1.5,leafColor:h=2263842}={}){super(new ut({trunkRadiusTop:e,trunkRadiusBottom:o,trunkHeight:r,trunkSegments:a,leafSize:i,leafCount:c,leafDetail:l,leafSpreadRadius:u}),[new n.MeshStandardMaterial({color:s,roughness:.9,metalness:0,flatShading:!0}),new n.MeshStandardMaterial({color:h,roughness:.8,metalness:0,flatShading:!0})])}}class en extends n.Mesh{constructor({radius:e=3,height:o=.6,widthSegments:r=64,heightSegments:a=16,phiStart:s=0,phiLength:i=Math.PI*2}={}){super(new ct({radius:e,height:o,widthSegments:r,heightSegments:a,phiStart:s,phiLength:i}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}class tn extends n.Mesh{constructor({radius:e=j(5,Math.PI/10),widthSegments:o=64,heightSegments:r=32,phiStart:a=0,phiLength:s=Math.PI*2,thetaLength:i=Math.PI/10}={}){super(new lt({radius:e,widthSegments:o,heightSegments:r,phiStart:a,phiLength:s,thetaLength:i}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}function on(t,{time:e=0,waveFrequency:o=.2,waveAmplitude:r=.5}={}){t.onBeforeCompile=a=>{a.uniforms.time={value:e},a.uniforms.waveFrequency={value:o},a.uniforms.waveAmplitude={value:r},a.vertexShader=`
|
|
38
|
+
`};class xo extends n.Mesh{constructor(){super(new n.SphereGeometry(5,32,32),new n.ShaderMaterial(ft))}}class wo extends n.Mesh{constructor({width:e=1,height:o=1.5,depth:r=.5,coverThickness:s=.05,pageIndent:a=.05,coverColor:i=F.DARK_RED,pageColor:c=F.TITANIUM_WHITE}={}){super(new H(e,o,r,s,a),[new n.MeshStandardMaterial({color:i,metalness:.1,roughness:.7,flatShading:!0}),new n.MeshStandardMaterial({color:c,flatShading:!0})])}}class vo extends n.Mesh{constructor(){super(new Fe,[new n.MeshStandardMaterial({color:8965290,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.5}),new n.MeshStandardMaterial({color:9127187,roughness:1})])}}class go extends n.Mesh{constructor(){super(new ke,[new n.MeshStandardMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.5,roughness:.1,metalness:.3}),new n.MeshStandardMaterial({color:9127187,roughness:1}),new n.MeshStandardMaterial({color:F.PINK_SHERBET,transparent:!0,depthWrite:!1,opacity:.5})])}}class So extends n.Mesh{constructor(){super(new De,new n.MeshPhysicalMaterial({color:5597999,roughness:.1,transmission:.9,thickness:.2,metalness:0,clearcoat:1,clearcoatRoughness:.1}))}}class Go extends n.Mesh{constructor({width:e=.4,height:o=1.2,depth:r=.2}={}){super(new ze(e,o,r),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class bo extends n.Mesh{constructor(){super(new qe,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:6908265,flatShading:!0}),new n.MeshStandardMaterial({color:5263440,flatShading:!0}),new n.MeshStandardMaterial({color:4210752,flatShading:!0})])}}class Io extends n.Mesh{constructor({totalHeight:e=1.75,baseWidth:o=.75}={}){super(new He(e,o),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Ao extends n.Mesh{constructor(e=.6,o=1,r=.2,s=.6){super(new Ye(e,o,r,s),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Eo extends n.Mesh{constructor(e=.5,o=.8,r=.15){super(new Xe(e,o,r),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Bo extends n.Mesh{constructor({height:e=2.25}={}){super(new Ze({height:e}),new n.MeshStandardMaterial({color:9141627,flatShading:!0}))}}class Po extends n.Mesh{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:r=.3,spikeRadius:s=.075,spikeScaleZ:a=1,radialSegments:i=8}={}){super(new Z({barHeight:e,barRadius:o,spikeHeight:r,spikeRadius:s,spikeScaleZ:a,radialSegments:i}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class To extends n.Mesh{constructor({count:e=20,spacing:o=.4,barHeight:r=2,barRadius:s=.05,spikeHeight:a=.3,spikeRadius:i=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:m=0,radialSegments:h=8}={}){super(new je({count:e,spacing:o,barHeight:r,barRadius:s,spikeHeight:a,spikeRadius:i,spikeScaleZ:c,railHeight:l,railDepth:u,railOffset:m,radialSegments:h}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class Co extends n.Mesh{constructor({width:e=5,height:o=8,depth:r=1,shelves:s=4,frameThickness:a=.1,open:i=!1}={}){super(new Qe({width:e,height:o,depth:r,shelves:s,frameThickness:a,open:i}),new n.MeshStandardMaterial({color:9127187}))}}class Vo extends n.Mesh{constructor(){super(new Ke,[new n.MeshStandardMaterial({color:9132587}),new n.MeshStandardMaterial({color:4929057})])}}class Ro extends n.Mesh{constructor({radiusTop:e=.2,radiusBottom:o=.2,height:r=1,flameHeight:s=.25,flameRadius:a=.05,segments:i=16}={}){super(new We({radiusTop:e,radiusBottom:o,height:r,flameHeight:s,flameRadius:a,segments:i}),[new n.MeshStandardMaterial({color:16777215}),new n.MeshStandardMaterial({color:16766720,emissive:16753920,emissiveIntensity:.35})])}}class Uo extends n.Mesh{constructor({height:e=.25,radius:o=.05,segmentsU:r=16,segmentsV:s=16}={}){super(new j({segmentsU:r,segmentsV:s,height:e,radius:o}),new n.MeshStandardMaterial({color:16766720,emissive:16753920,emissiveIntensity:.35}))}}class No extends n.Group{constructor(e=1.3,o=.5){super();const r=new n.CylinderGeometry(o,o,.2,16),s=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),a=new n.Mesh(r,s);a.position.set(0,0,0),this.add(a);const i=new n.CylinderGeometry(o*.9,o*.9,e),c=new n.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),l=new n.Mesh(i,c);l.position.set(0,e/2+.1,0),this.add(l);const u=new n.ConeGeometry(o*1.1,.5,8),m=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),h=new n.Mesh(u,m);h.position.set(0,e+.35,0),this.add(h);const f=new n.TorusGeometry(o*.8,.05,8,16),d=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),M=new n.Mesh(f,d);M.position.set(0,e+.85,0),this.add(M);const p=new n.PointLight(16755200,1.5,15);p.position.set(0,e/2+.1,0),p.castShadow=!0,this.add(p)}}class Oo extends n.Mesh{constructor(){super(new Je,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:4950843,flatShading:!0,opacity:.8,transparent:!0})])}}class _o extends n.Mesh{constructor(e=1,o=4,r=4){super(new et(e,o,r),new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Fo extends n.Mesh{constructor(){super(new tt,new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Lo extends n.Group{constructor(){super();const e=new n.CylinderGeometry(.3,.4,.1,16),o=new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.3}),r=new n.Mesh(e,o);r.position.y=.05;const s=new n.CylinderGeometry(.1,.1,.7,16),a=new n.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),i=new n.Mesh(s,a);i.position.y=.4;const c=new n.ConeGeometry(.075,.2,16),l=new n.MeshStandardMaterial({color:16733440,emissive:16733440,emissiveIntensity:.6,transparent:!0,opacity:.8}),u=new n.Mesh(c,l);u.position.y=.8,this.add(r,i,u)}}class ko extends n.Group{constructor(){super();const e=new n.BoxGeometry(3,4,.1),o=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6}),r=new n.BoxGeometry(.2,.5,.2),s=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),a=new n.CylinderGeometry(.3,.3,.1,16),i=new n.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),c=new n.Mesh(e,o);for(let y=-1;y<=1;y++){const w=new n.Mesh(r,s);w.position.set(y,1.5,.1),c.add(w)}const l=new n.Mesh(a,i);l.rotation.x=Math.PI/2,l.position.set(0,.5,.15),c.add(l);const u=new n.SphereGeometry(.15,8,8),m=new n.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),h=new n.Mesh(u,m);h.position.set(0,-1,.1),c.add(h),this.add(c);let f=.015,d=.8,M=.2;function p(){requestAnimationFrame(p);const y=M+Math.abs(Math.sin(Date.now()*f))*(d-M);h.material.emissiveIntensity=y}p()}}class Do extends n.Mesh{constructor({flaskRadius:e=1,neckRadius:o=.3,height:r=2.5,neckHeight:s=1,radialSegments:a=16}={}){super(new nt({flaskRadius:e,neckRadius:o,height:r,neckHeight:s,radialSegments:a}),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class zo extends n.Mesh{constructor(){super(new at,new n.MeshPhysicalMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class qo extends n.Group{constructor(){super();const e=new n.BoxGeometry(2,3,.1),o=new n.MeshStandardMaterial({color:3355443,roughness:.8,metalness:.5}),r=new n.Mesh(e,o),s=new n.CylinderGeometry(.1,.1,.2,8),a=new n.CylinderGeometry(.05,.05,1,8),i=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let c=-.5;c<=.5;c+=.5){const l=new n.Mesh(s,i);l.position.set(c,1,.1);const u=new n.Mesh(a,i);u.position.y=.5,l.add(u),this.add(l)}this.add(r)}}class Ho extends n.Group{constructor(){super();const e=new n.BoxGeometry(1,.2,.5),o=new n.MeshStandardMaterial({color:4473924,roughness:.6,metalness:.3}),r=new n.Mesh(e,o);r.position.y=.1;const s=new n.BoxGeometry(.2,1,.2),a=new n.Mesh(s,o);a.position.set(0,.6,-.2);const i=new n.CylinderGeometry(.1,.1,.4,8),c=new n.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),l=new n.Mesh(i,c);l.position.set(0,1.1,-.35),l.rotation.x=-Math.PI/4;const u=new n.BoxGeometry(.6,.1,.6),m=new n.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),h=new n.Mesh(u,m);h.position.set(0,.6,0),this.add(r,a,l,h)}}class Yo extends n.Group{constructor(){super();const e=new it,o=new n.CylinderGeometry(.2,.3,1.5,8);o.translate(0,.75,0);const r=new n.MeshStandardMaterial({color:6045747,roughness:1,metalness:0,side:n.DoubleSide}),s=new n.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),a=new n.Mesh(e,r);a.castShadow=!0;const i=new n.Mesh(o,s);i.castShadow=!0,i.position.set(.3,1.3,0),i.rotation.z=Math.PI/4,this.add(a,i)}}class Xo extends n.Mesh{constructor({width:o=3,height:r=4,depth:s=.1}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,r,s),this.material=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6})}}class Zo extends n.Mesh{constructor({radius:o=.15,color:r=16762823,emissive:s=16711680,emissiveIntensity:a=.5}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,8,8),this.material=new n.MeshStandardMaterial({color:r,emissive:s,emissiveIntensity:a})}}class jo extends n.Group{constructor(){super();const e=100,o=.05,r=new n.CatmullRomCurve3(Array.from({length:e},(u,m)=>{const h=m*.2;return new n.Vector3(Math.cos(h)*.4,m*o,Math.sin(h)*.4)})),s=new n.TubeGeometry(r,200,.1,8,!1),a=new n.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),i=new n.Mesh(s,a);this.add(i);function c(){a.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function l(){requestAnimationFrame(l),c()}l()}}class Qo extends n.Mesh{constructor({radius:e=.3,height:o=.4,count:r=3,thickness:s=.03,radialSegments:a=16}={}){super(new ct({radius:e,height:o,count:r,thickness:s,radialSegments:a}),new n.MeshStandardMaterial({color:8947848,roughness:.7,metalness:.3}))}}class Ko extends n.Mesh{constructor(){super(new lt,[new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.5}),new n.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:n.DoubleSide})])}}class Wo extends n.Mesh{constructor(e=.2,o=.2,r=3,s=32){super(new L(e,o,r,s),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,depthWrite:!1,side:n.DoubleSide}))}}class Jo extends n.Group{constructor(e=3,o=[65450,16711850,11141375]){super();const r=new n.BoxGeometry(3,.2,1),s=new n.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),a=new n.Mesh(r,s);a.position.y=.5,a.castShadow=!0;const i=new L(.1,.1,1,16),c=new n.MeshStandardMaterial({color:11184810,transparent:!0,opacity:.4,roughness:.1,metalness:.5,depthWrite:!1,side:n.DoubleSide});for(let l=0;l<e;l++){const u=new n.Mesh(i,c),m=(l-(e-1)/2)*.8;u.position.set(m,1,0),u.castShadow=!0;const h=new L(.099,.099,.5,16,!1),f=o[l%o.length],d=new n.MeshStandardMaterial({color:f,emissive:f,emissiveIntensity:.5,transparent:!0,opacity:.6}),M=new n.Mesh(h,d);M.position.set(0,-.25,0),u.add(M),a.add(u)}this.add(a)}}class dt extends n.Shape{constructor(e=5,o=.5,r=1){super();const s=Math.PI*2/e,a=s/2,i=s/4;this.moveTo(Math.cos(0)*r,-Math.sin(0)*r);for(let c=1;c<=e;++c){let l=Math.cos(s*c-i*3)*(o/Math.cos(i)),u=-Math.sin(s*c-i*3)*(o/Math.cos(i)),m=Math.cos(s*c-a)*o,h=-Math.sin(s*c-a)*o;this.quadraticCurveTo(l,u,m,h),l=Math.cos(s*c-i)*(o/Math.cos(i)),u=-Math.sin(s*c-i)*(o/Math.cos(i)),m=Math.cos(s*c)*r,h=-Math.sin(s*c)*r,this.quadraticCurveTo(l,u,m,h)}this.closePath()}}class $o extends n.Mesh{constructor(e=5,o=.5,r=1,s=.25){super();const a=new dt(e,o,r),i=new n.ExtrudeGeometry(a,{depth:s,bevelEnabled:s>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});i.center(),this.geometry=i,this.material=c}}class Mt extends n.Shape{constructor(e=5,o=.5,r=1,s=5,a=.25){super();const i=Math.PI*2/e,c=i/4;this.moveTo(Math.cos(0)*r,-Math.sin(0)*r);for(let l=1;l<=e;++l)this.lineTo(Math.cos(i*l-c*3)*o,-Math.sin(i*l-c*3)*o),this.lineTo(Math.cos(i*l-c*2)*o,-Math.sin(i*l-c*2)*o),this.lineTo(Math.cos(i*l-c)*r,-Math.sin(i*l-c)*r),this.lineTo(Math.cos(i*l)*r,-Math.sin(i*l)*r);if(this.closePath(),a>0&&s>2){const l=new n.Path,u=Math.PI*2/s;l.moveTo(Math.cos(0)*a,-Math.sin(0)*a);for(let m=1;m<s;++m)l.lineTo(Math.cos(u*m)*a,-Math.sin(u*m)*a);l.lineTo(Math.cos(0)*a,-Math.sin(0)*a),this.holes.push(l)}}}class en extends n.Mesh{constructor(e=5,o=.5,r=1,s=5,a=.25,i=.25){super();const c=new Mt(e,o,r,s,a),l=new n.ExtrudeGeometry(c,{depth:i,bevelEnabled:i>0,bevelThickness:0,bevelSize:0}),u=new n.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2});l.center(),this.geometry=l,this.material=u}}class pt extends n.Shape{constructor(e=1,o=2.1,r=1.4,s=1.6){super(),this.moveTo(0,r*e/3),this.bezierCurveTo(-o*.375*e,r*e,-o*e,r*e/3,0,-s*e),this.bezierCurveTo(o*e,r*e/3,o*.375*e,r*e,0,r*e/3)}}class tn extends n.Mesh{constructor(e=1,o=1,r=1,s=10,a=.25){super();const i=new pt(e,o,r,s),c=new n.ExtrudeGeometry(i,{depth:a,bevelEnabled:a>0,bevelThickness:0,bevelSize:0}),l=new n.MeshStandardMaterial({color:12986408,emissive:12981270,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});c.center(),this.geometry=c,this.material=l}}class yt extends n.Shape{constructor(e=5,o=.5,r=1){super();const s=Math.PI*2/e,a=s/2;this.moveTo(Math.cos(0)*r,Math.sin(0)*r);for(let i=1;i<=e;++i)this.lineTo(Math.cos(s*i-a)*o,Math.sin(s*i-a)*o),this.lineTo(Math.cos(s*i)*r,Math.sin(s*i)*r);this.closePath()}}class on extends n.Mesh{constructor(e=5,o=.5,r=1,s=.25){super();const a=new yt(e,o,r),i=new n.ExtrudeGeometry(a,{depth:s,bevelEnabled:s>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});i.center(),this.geometry=i,this.material=c}}class nn extends n.Mesh{constructor(){super(new ot,new n.MeshStandardMaterial({color:16777215}))}}class rn extends n.Mesh{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:r=2.5,trunkSegments:s=14,trunkColor:a=9127187,leafSize:i=.8,leafCount:c=6,leafDetail:l=0,leafSpreadRadius:u=1.5,leafColor:m=2263842}={}){super(new ht({trunkRadiusTop:e,trunkRadiusBottom:o,trunkHeight:r,trunkSegments:s,leafSize:i,leafCount:c,leafDetail:l,leafSpreadRadius:u}),[new n.MeshStandardMaterial({color:a,roughness:.9,metalness:0,flatShading:!0}),new n.MeshStandardMaterial({color:m,roughness:.8,metalness:0,flatShading:!0})])}}class sn extends n.Mesh{constructor({radius:e=3,height:o=.6,widthSegments:r=64,heightSegments:s=16,phiStart:a=0,phiLength:i=Math.PI*2}={}){super(new ut({radius:e,height:o,widthSegments:r,heightSegments:s,phiStart:a,phiLength:i}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}class an extends n.Mesh{constructor({radius:e=Q(5,Math.PI/10),widthSegments:o=64,heightSegments:r=32,phiStart:s=0,phiLength:a=Math.PI*2,thetaLength:i=Math.PI/10}={}){super(new mt({radius:e,widthSegments:o,heightSegments:r,phiStart:s,phiLength:a,thetaLength:i}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}function cn(t,{time:e=0,waveFrequency:o=.2,waveAmplitude:r=.5}={}){t.onBeforeCompile=s=>{s.uniforms.time={value:e},s.uniforms.waveFrequency={value:o},s.uniforms.waveAmplitude={value:r},s.vertexShader=`
|
|
39
39
|
uniform float time;
|
|
40
40
|
uniform float waveFrequency;
|
|
41
41
|
uniform float waveAmplitude;
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
|
|
50
50
|
return displaced;
|
|
51
51
|
}
|
|
52
|
-
`+
|
|
52
|
+
`+s.vertexShader,s.vertexShader=s.vertexShader.replace("#include <begin_vertex>",`
|
|
53
53
|
vec3 transformed = waterDisplacement(position, normal);
|
|
54
|
-
`),t.userData.shader=
|
|
54
|
+
`),t.userData.shader=s}}function ln(t,e){t.userData.shader&&(t.userData.shader.uniforms.time.value+=e)}function un(t,{time:e=0,intensity:o=1,axis:r=D.XYZ,scale:s=10}={}){t.onBeforeCompile=a=>{a.uniforms.time={value:e},a.uniforms.axis={value:r},a.uniforms.intensity={value:o},a.uniforms.scale={value:s},a.vertexShader=`
|
|
55
55
|
uniform float time;
|
|
56
56
|
uniform vec3 axis;
|
|
57
57
|
uniform float intensity;
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
|
|
83
83
|
return o4.y * d.y + o4.x * (1.0 - d.y);
|
|
84
84
|
}
|
|
85
|
-
`+
|
|
85
|
+
`+a.vertexShader,a.vertexShader=a.vertexShader.replace("#include <begin_vertex>",`
|
|
86
86
|
vec3 transformed = vec3(position);
|
|
87
87
|
float n = noise(transformed * scale + time);
|
|
88
88
|
transformed += normalize(axis) * n * intensity;
|
|
89
89
|
vec3 transformedNormal = normal;
|
|
90
|
-
`),t.userData.shader=
|
|
90
|
+
`),t.userData.shader=a}}function mn(t,e){t.userData.shader&&(t.userData.shader.uniforms.time.value+=e)}const N={uniforms:{turbidity:{value:10},rayleigh:{value:2},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new n.Vector3().setFromSphericalCoords(1,n.MathUtils.degToRad(90),n.MathUtils.degToRad(180))},up:{value:new n.Vector3(0,1,0)}},vertexShader:`
|
|
91
91
|
uniform vec3 sunPosition;
|
|
92
92
|
uniform float rayleigh;
|
|
93
93
|
uniform float turbidity;
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1
|
|
253
253
|
gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);
|
|
254
254
|
}
|
|
255
|
-
`},
|
|
255
|
+
`},hn={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
|
|
256
256
|
varying vec2 vUv;
|
|
257
257
|
void main() {
|
|
258
258
|
vUv = uv;
|
|
@@ -283,5 +283,5 @@
|
|
|
283
283
|
float h = normalize(vWorldPosition + offset).y;
|
|
284
284
|
gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);
|
|
285
285
|
}
|
|
286
|
-
`};class cn extends n.Mesh{constructor(){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(1,1,1),this.material=new n.ShaderMaterial({uniforms:N.uniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,depthWrite:!1,side:n.BackSide}),this.scale.setScalar(45e4);const o=n.MathUtils.degToRad(89),r=n.MathUtils.degToRad(180),a=new n.Vector3().setFromSphericalCoords(1,o,r);this.material.uniforms.sunPosition.value=a}sunPosition(o,r){const a=new n.Vector3;a.setFromSphericalCoords(1,o,r),this.material.uniforms.sunPosition.value=a}}class ln extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,o,o),this.material=new n.ShaderMaterial({uniforms:O.uniforms,vertexShader:O.vertexShader,fragmentShader:O.fragmentShader,side:n.BackSide})}}class un extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,32,15),this.material=new n.ShaderMaterial({vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,uniforms:_.uniforms,side:n.BackSide})}}const hn=t=>{const e=new Uint8Array(4*t*t);for(let r=0;r<t*t;r++){const a=r*4,s=(r%t^Math.floor(r/t))&1?255:0;e[a]=s,e[a+1]=s,e[a+2]=s,e[a+3]=255}const o=new n.DataTexture(e,t,t,n.RGBAFormat,n.UnsignedByteType);return o.wrapS=n.RepeatWrapping,o.wrapT=n.RepeatWrapping,o.minFilter=n.NearestFilter,o.needsUpdate=!0,o};function mn(t){const e=parseInt(t.slice(1),16);return[e>>16&255,e>>8&255,e&255]}function dn(t){const[e,o,r]=T(t);return yt(e,o,r)}function T(t){const e=t>>16&255,o=t>>8&255,r=t&255;return[e,o,r]}function fn(t,e,o){e/=100,o/=100;function r(l,u,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?l+(u-l)*6*h:h<1/2?u:h<2/3?l+(u-l)*(2/3-h)*6:l}let a,s,i;if(e===0)a=s=i=o;else{const l=o<.5?o*(1+e):o+e-o*e,u=2*o-l;a=r(u,l,t/360+1/3),s=r(u,l,t/360),i=r(u,l,t/360-1/3)}const c=l=>Math.round(l*255);return[c(a),c(s),c(i)]}function pt(t,e,o){e/=100,o/=100;const r=i=>(i+t/30)%12,a=e*Math.min(o,1-o),s=i=>o-a*Math.max(-1,Math.min(r(i)-3,Math.min(9-r(i),1)));return[s(0)*255,s(8)*255,s(4)*255]}function Mn(t,e,o){return[t/255,e/255,o/255]}function pn(t,e,o){return t=Math.round(t),e=Math.round(e),o=Math.round(o),(t<<16)+(e<<8)+o}function yt(t,e,o){t/=255,e/=255,o/=255;const r=Math.max(t,e,o),a=Math.min(t,e,o),s=r-a;let i=0,c=0;const l=(r+a)/2;s!==0&&(r===t?i=((e-o)/s+(e<o?6:0))*60:r===e?i=((o-t)/s+2)*60:r===o&&(i=((t-e)/s+4)*60)),s!==0&&(c=s/(1-Math.abs(2*l-1))),i=Math.round(i),c=Math.round(c*100);const u=Math.round(l*100);return[i,c,u]}function xt(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function wt(t,e){return Math.abs(t[0]-e[0])+Math.abs(t[1]-e[1])+Math.abs(t[2]-e[2])}function yn(t,e){const o=T(t);let r=null,a=1/0;for(const s of e){const i=T(s),c=xt(o,i);c<a&&(a=c,r=s)}return r}function xn(t,e){const o=T(t);let r=null,a=1/0;for(const s of e){const i=T(s),c=wt(o,i);c<a&&(a=c,r=s)}return r}function wn(t){const e=(t+Math.floor(-30+Math.random()*61))%360,o=Math.floor(60+Math.random()*21),r=Math.floor(50+Math.random()*21);return pt(e,o,r)}function vn(t){const e=new n.Box3().setFromObject(t),o=new n.Vector3;e.getCenter(o),t.position.sub(o)}function gn(t,e=new n.Vector3(0,0,0)){const o=new n.Box3().setFromObject(t),r=new n.Vector3;o.getCenter(r);const a=new n.Vector3().subVectors(e,r);t.position.add(a)}function Sn(t){t.computeBoundingBox();const e=t.boundingBox;if(e){const o=e.getCenter(new n.Vector3);t.translateX(-o.x),t.translateY(-o.y),t.translateZ(-o.z)}}function Gn(t,e,o){return Math.max(0,Math.min(1,(t-e)/(o-e)))}function En(t,e,o,r,a,s=20,i=0,c=1){const l=[];for(let u=0;u<=s;u++){const h=u/s,m=t(Gn(h,i,c)),d=e+m*(o-e),f=r+h*(a-r);l.push(new n.Vector2(d,f))}return l}function bn(t){const o=new n.Box3().setFromObject(t).getCenter(new n.Vector3);t.translateX(-o.x),t.translateY(-o.y),t.translateZ(-o.z),t.updateMatrixWorld(!0)}function In(t){t.geometry.computeBoundingBox();const e=t.geometry.boundingBox;if(e){const o=e.getCenter(new n.Vector3);t.geometry.translate(-o.x,-o.y,-o.z)}}const vt=(t,e,o,r,a=24)=>{let s=[];for(let i=0;i<=a;i++){const c=i/a,l=P.CUBIC(c,t.x,e.x,o.x,r.x),u=P.CUBIC(c,t.y,e.y,o.y,r.y);s.push(new n.Vector2(l,u))}return s},gt=(t,e,o,r=24)=>{let a=[];for(let s=0;s<=r;s++){const i=s/r,c=P.DAMPED(i,o)*(e.x-t.x)+t.x,l=t.y+i*(e.y-t.y);a.push(new n.Vector2(c,l))}return a},St=(t,e,o,r,a=24)=>{let s=[];for(let i=0;i<=a;i++){const c=i/a,l=P.EXPONENTIAL(c,o,r)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);s.push(new n.Vector2(l,u))}return s},Gt=(t,e,o,r,a=24)=>{let s=[];for(let i=0;i<=a;i++){const c=i/a,l=P.LOGARITHMIC(c,o,r)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);s.push(new n.Vector2(l,u))}return s},Et=(t,e,o,r,a,s=24)=>{let i=[];for(let c=0;c<=s;c++){const l=c/s,u=o*l*l+r*l+a+t.x,h=t.y+l*(e.y-t.y);i.push(new n.Vector2(u,h))}return i},bt=(t,e,o,r=24)=>{let a=[];for(let s=0;s<=r;s++){const i=s/r,c=P.QUADRATIC(i,t.x,e.x,o.x),l=P.QUADRATIC(i,t.y,e.y,o.y);a.push(new n.Vector2(c,l))}return a},It=(t,e,o,r=24)=>{let a=[];for(let s=0;s<=r;s++){const i=s/r,c=P.SIGMOID(i,o)*(e.x-t.x)+t.x,l=t.y+i*(e.y-t.y);a.push(new n.Vector2(c,l))}return a},An={createCubicCurvePoints:vt,createDampedCurvePoints:gt,createExponentialCurvePoints:St,createLogarithmicCurvePoints:Gt,createParabolicCurvePoints:Et,createQuadraticCurvePoints:bt,createSigmoidCurvePoints:It};function Bn(t,e,o,r,a,s=[0,0],i=[1,0],c=[0,1],l=[1,1]){const u=a||At(t,e,o);return[{pos:t,norm:u,uv:s},{pos:e,norm:u,uv:i},{pos:r,norm:u,uv:l},{pos:t,norm:u,uv:s},{pos:r,norm:u,uv:l},{pos:o,norm:u,uv:c}]}function At(t,e,o){const r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],a=[o[0]-t[0],o[1]-t[1],o[2]-t[2]],s=[r[1]*a[2]-r[2]*a[1],r[2]*a[0]-r[0]*a[2],r[0]*a[1]-r[1]*a[0]],i=Math.sqrt(s[0]**2+s[1]**2+s[2]**2);return s.map(c=>c/i)}function Pn(t,e){return t.map(([o,r,a])=>{switch(e){case"x":return[r,a];case"y":return[o,a];case"z":return[o,r];default:throw new Error(`Invalid axis: ${e}`)}})}function Bt(t){const[e,o,r]=t,a=Math.abs(e),s=Math.abs(o),i=Math.abs(r);return a>=s&&a>=i?[r>0?r:-r,o]:s>=a&&s>=i?[e,r>0?r:-r]:[e,o]}function Tn(t){return t.map(e=>Bt(e))}function Cn(t){return t.map(([e,o,r])=>{const a=Math.atan2(r,e),s=Math.acos(o/Math.sqrt(e**2+o**2+r**2)),i=a/(2*Math.PI)+.5,c=1-s/Math.PI;return[i,c]})}function Rn(t){return t.map(([e,o,r])=>[Math.atan2(r,e)/(2*Math.PI)+.5,o])}function Vn(t){return t.map(([e,o,r])=>{const a=Math.sqrt(e**2+r**2);return[Math.atan2(r,e)/(2*Math.PI)+.5,a]})}function Pt(t,e,o,r,a){return[(t[0]-e)/(o-e),(t[1]-r)/(a-r)]}function Un(t,e,o){const[r,a]=e,[s,i]=o;return t.map(c=>Pt(c,r,s,a,i))}function Nn(t){const e=Math.min(...t.map(s=>s[0])),o=Math.max(...t.map(s=>s[0])),r=Math.min(...t.map(s=>s[1])),a=Math.max(...t.map(s=>s[1]));return{minBounds:[e,r],maxBounds:[o,a]}}exports.AtmosphericSkybox=cn;exports.Axis=k;exports.BifurcatedStaircaseGeometry=no;exports.Bone=Jo;exports.BoneGeometry=et;exports.Book=Mo;exports.BookGeometry=H;exports.Bookshelf=Ao;exports.BookshelfGeometry=je;exports.BubblingEffect=Jt;exports.BunsenBurner=Uo;exports.Burst=jo;exports.BurstShape=mt;exports.Candle=Po;exports.ColorPalette=L;exports.CrossHeadstone=wo;exports.CrossHeadstoneGeometry=De;exports.DaySkybox=ln;exports.Desk=Bo;exports.DeskGeometry=Qe;exports.DioramaGeometry=ro;exports.Direction=U;exports.Easing=Kt;exports.ElectricPanel=No;exports.EllipticLeafGeometry=Ne;exports.EmissivePulseAnimation=kt;exports.ErlenmeyerFlask=Oo;exports.ErlenmeyerFlaskGeometry=tt;exports.Falloff=C;exports.FlorenceFlask=_o;exports.FlorenceFlaskGeometry=rt;exports.Gear=Qo;exports.GearShape=dt;exports.Heart=Ko;exports.HeartShape=ft;exports.Hill=en;exports.HillGeometry=ct;exports.Jar=po;exports.JarGeometry=_e;exports.LShapedStaircaseGeometry=so;exports.Lantern=To;exports.LeafEffect=$t;exports.LeverPanel=Lo;exports.LightningAnimation=qt;exports.LineEquations=co;exports.Mausoleum=vo;exports.MausoleumGeometry=ze;exports.Microscope=Fo;exports.Moon=fo;exports.MortarAndPestle=ko;exports.MortarGeometry=st;exports.MossyRocks=Co;exports.MossyRocksGeometry=Ke;exports.Mound=tn;exports.MoundGeometry=lt;exports.NightSkybox=un;exports.ObeliskHeadstone=go;exports.ObeliskHeadstoneGeometry=qe;exports.Panel=Do;exports.PanelLight=zo;exports.ParametricCurve=P;exports.ParametricCurveUtils=An;exports.PotionBottle=yo;exports.PotionBottleGeometry=Fe;exports.Rock=Ro;exports.RockGeometry=Je;exports.Rocks=Vo;exports.RocksGeometry=$e;exports.RoundedHeadstone=So;exports.RoundedHeadstoneGeometry=He;exports.SpiralStaircaseGeometry=ao;exports.SpiralTube=qo;exports.SquareHeadstone=Go;exports.SquareHeadstoneGeometry=Ye;exports.StaircaseGeometry=io;exports.Stand=Ho;exports.StandGeometry=at;exports.Star=Wo;exports.StarShape=Mt;exports.StoneFencePost=Eo;exports.StoneFencePostGeometry=Xe;exports.TeslaCoil=Yo;exports.TeslaCoilGeometry=it;exports.TestTube=Xo;exports.TestTubeGeometry=F;exports.TestTubeRack=Zo;exports.Tree=$o;exports.TreeGeometry=ut;exports.WineBottle=xo;exports.WineBottleGeometry=ke;exports.WroughtIronBar=bo;exports.WroughtIronBarGeometry=Z;exports.WroughtIronFence=Io;exports.WroughtIronFenceGeometry=Ze;exports.addNoiseDisplacement=rn;exports.addWaterDisplacement=on;exports.appendSphericalCurve=nt;exports.atmosphericShader=N;exports.calculateChannelDifference=wt;exports.calculateDistance=xt;exports.calculateNormal=At;exports.calculateUVBounds=Nn;exports.calculateXFromSlopeIntercept=X;exports.calculateYFromSlopeIntercept=Le;exports.cameraDollyAnimation=Vt;exports.cameraFlythroughAnimation=Ut;exports.cameraOrbitAnimation=Nt;exports.cameraPendulumAnimation=Ot;exports.cameraSpiralAscensionAnimation=_t;exports.cameraWobbleAnimation=Lt;exports.cameraZoomInAnimation=Ft;exports.capHeightFromRadius=ot;exports.capWidthFromRadius=uo;exports.cartesianToSpherical=mo;exports.centerGroup=vn;exports.centerGroupAtTarget=gn;exports.centerInstancedMesh=Sn;exports.centerMesh=bn;exports.centerMeshGeometry=In;exports.checkerboardTexture=hn;exports.circularEaseIn=ye;exports.circularEaseInOut=we;exports.circularEaseOut=xe;exports.concave=Se;exports.convex=Ge;exports.createCubicCurvePoints=vt;exports.createDampedCurvePoints=gt;exports.createExponentialCurvePoints=St;exports.createLogarithmicCurvePoints=Gt;exports.createParabolicCurvePoints=Et;exports.createQuad=Bn;exports.createQuadraticCurvePoints=bt;exports.createSigmoidCurvePoints=It;exports.cubicCurve=Be;exports.cubicEaseIn=se;exports.cubicEaseInOut=ie;exports.cubicEaseOut=ae;exports.cubicUVMapping=Bt;exports.cubicUVMappingBatch=Tn;exports.cylindricalUVMapping=Rn;exports.dampedCurve=Pe;exports.daySkyShader=O;exports.displacementBrush=Ht;exports.exponentialCurve=Te;exports.exponentialEaseIn=fe;exports.exponentialEaseInOut=pe;exports.exponentialEaseOut=Me;exports.fadeShader=an;exports.findClosestColor=yn;exports.findClosestColorChannelWise=xn;exports.flattenBrush=Yt;exports.gaussian=Ae;exports.getAnalogousColors=wn;exports.hexToHsl=dn;exports.hexToRgb=T;exports.hslToHex=fn;exports.hslToRgb=pt;exports.interpolateCurve=En;exports.inverse=Ie;exports.linear=ve;exports.logarithmic=Ee;exports.logarithmicCurve=Ce;exports.logarithmicRandomMax=K;exports.logarithmicRandomMin=W;exports.moonShader=ht;exports.nightSkyShader=_;exports.noiseBrush=Xt;exports.normalizeRgb=Mn;exports.normalizeUV=Pt;exports.normalizeUVBatch=Un;exports.parabolicCurve=Re;exports.parseHexCode=mn;exports.planarUVMapping=Pn;exports.polarUVMapping=Vn;exports.quadraticCurve=Ve;exports.quadraticEaseIn=oe;exports.quadraticEaseInOut=re;exports.quadraticEaseOut=ne;exports.quarticEaseIn=ce;exports.quarticEaseInOut=ue;exports.quarticEaseOut=le;exports.quinticEaseIn=he;exports.quinticEaseInOut=de;exports.quinticEaseOut=me;exports.radiusFromCapHeight=lo;exports.radiusFromCapWidth=j;exports.randomFloat=q;exports.randomInteger=Dt;exports.randomTransformVertices=We;exports.rgbToHex=pn;exports.rgbToHsl=yt;exports.rowOfBooksByCount=to;exports.rowOfBooksByLength=oo;exports.rowOfBooksByScales=Y;exports.setRandomInterval=zt;exports.setRandomTimeout=J;exports.sigmoidCurve=Ue;exports.sineEaseIn=$;exports.sineEaseInOut=te;exports.sineEaseOut=ee;exports.smoothBrush=Zt;exports.smoothstep=ge;exports.sphericalToCartesian=ho;exports.sphericalUVMapping=Cn;exports.spikeBrush=jt;exports.squareRoot=be;exports.thetaLengthForRadius=z;exports.twistBrush=Qt;exports.updateNoiseDisplacementTime=sn;exports.updateWaterDisplacementTime=nn;
|
|
286
|
+
`};class fn extends n.Mesh{constructor(){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(1,1,1),this.material=new n.ShaderMaterial({uniforms:N.uniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,depthWrite:!1,side:n.BackSide}),this.scale.setScalar(45e4);const o=n.MathUtils.degToRad(89),r=n.MathUtils.degToRad(180),s=new n.Vector3().setFromSphericalCoords(1,o,r);this.material.uniforms.sunPosition.value=s}sunPosition(o,r){const s=new n.Vector3;s.setFromSphericalCoords(1,o,r),this.material.uniforms.sunPosition.value=s}}class dn extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,o,o),this.material=new n.ShaderMaterial({uniforms:O.uniforms,vertexShader:O.vertexShader,fragmentShader:O.fragmentShader,side:n.BackSide})}}class Mn extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,32,15),this.material=new n.ShaderMaterial({vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,uniforms:_.uniforms,side:n.BackSide})}}const pn=t=>{const e=new Uint8Array(4*t*t);for(let r=0;r<t*t;r++){const s=r*4,a=(r%t^Math.floor(r/t))&1?255:0;e[s]=a,e[s+1]=a,e[s+2]=a,e[s+3]=255}const o=new n.DataTexture(e,t,t,n.RGBAFormat,n.UnsignedByteType);return o.wrapS=n.RepeatWrapping,o.wrapT=n.RepeatWrapping,o.minFilter=n.NearestFilter,o.needsUpdate=!0,o};function yn(t){const e=parseInt(t.slice(1),16);return[e>>16&255,e>>8&255,e&255]}function xn(t){const[e,o,r]=T(t);return wt(e,o,r)}function T(t){const e=t>>16&255,o=t>>8&255,r=t&255;return[e,o,r]}function wn(t,e,o){e/=100,o/=100;function r(l,u,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?l+(u-l)*6*m:m<1/2?u:m<2/3?l+(u-l)*(2/3-m)*6:l}let s,a,i;if(e===0)s=a=i=o;else{const l=o<.5?o*(1+e):o+e-o*e,u=2*o-l;s=r(u,l,t/360+1/3),a=r(u,l,t/360),i=r(u,l,t/360-1/3)}const c=l=>Math.round(l*255);return[c(s),c(a),c(i)]}function xt(t,e,o){e/=100,o/=100;const r=i=>(i+t/30)%12,s=e*Math.min(o,1-o),a=i=>o-s*Math.max(-1,Math.min(r(i)-3,Math.min(9-r(i),1)));return[a(0)*255,a(8)*255,a(4)*255]}function vn(t,e,o){return[t/255,e/255,o/255]}function gn(t,e,o){return t=Math.round(t),e=Math.round(e),o=Math.round(o),(t<<16)+(e<<8)+o}function wt(t,e,o){t/=255,e/=255,o/=255;const r=Math.max(t,e,o),s=Math.min(t,e,o),a=r-s;let i=0,c=0;const l=(r+s)/2;a!==0&&(r===t?i=((e-o)/a+(e<o?6:0))*60:r===e?i=((o-t)/a+2)*60:r===o&&(i=((t-e)/a+4)*60)),a!==0&&(c=a/(1-Math.abs(2*l-1))),i=Math.round(i),c=Math.round(c*100);const u=Math.round(l*100);return[i,c,u]}function vt(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function gt(t,e){return Math.abs(t[0]-e[0])+Math.abs(t[1]-e[1])+Math.abs(t[2]-e[2])}function Sn(t,e){const o=T(t);let r=null,s=1/0;for(const a of e){const i=T(a),c=vt(o,i);c<s&&(s=c,r=a)}return r}function Gn(t,e){const o=T(t);let r=null,s=1/0;for(const a of e){const i=T(a),c=gt(o,i);c<s&&(s=c,r=a)}return r}function bn(t){const e=(t+Math.floor(-30+Math.random()*61))%360,o=Math.floor(60+Math.random()*21),r=Math.floor(50+Math.random()*21);return xt(e,o,r)}function In(t){const e=new n.Box3().setFromObject(t),o=new n.Vector3;e.getCenter(o),t.position.sub(o)}function An(t,e=new n.Vector3(0,0,0)){const o=new n.Box3().setFromObject(t),r=new n.Vector3;o.getCenter(r);const s=new n.Vector3().subVectors(e,r);t.position.add(s)}function En(t){t.computeBoundingBox();const e=t.boundingBox;if(e){const o=e.getCenter(new n.Vector3);t.translateX(-o.x),t.translateY(-o.y),t.translateZ(-o.z)}}function Bn(t,e,o){return Math.max(0,Math.min(1,(t-e)/(o-e)))}function Pn(t,e,o,r,s,a=20,i=0,c=1){const l=[];for(let u=0;u<=a;u++){const m=u/a,h=t(Bn(m,i,c)),f=e+h*(o-e),d=r+m*(s-r);l.push(new n.Vector2(f,d))}return l}function Tn(t){const o=new n.Box3().setFromObject(t).getCenter(new n.Vector3);t.translateX(-o.x),t.translateY(-o.y),t.translateZ(-o.z),t.updateMatrixWorld(!0)}function Cn(t,e=new n.Vector3(0,0,0)){const o=new n.Box3().setFromObject(t),r=new n.Vector3;o.getCenter(r);const s=new n.Vector3().subVectors(e,r);t.position.add(s)}function Vn(t){t.geometry.computeBoundingBox();const e=t.geometry.boundingBox;if(e){const o=e.getCenter(new n.Vector3);t.geometry.translate(-o.x,-o.y,-o.z)}}function Rn(t,e=new n.Vector3(0,0,0)){t.geometry.computeBoundingBox();const o=t.geometry.boundingBox;if(o){const r=o.getCenter(new n.Vector3),s=new n.Vector3().subVectors(e,r);t.geometry.translate(s.x,s.y,s.z)}}const St=(t,e,o,r,s=24)=>{let a=[];for(let i=0;i<=s;i++){const c=i/s,l=P.CUBIC(c,t.x,e.x,o.x,r.x),u=P.CUBIC(c,t.y,e.y,o.y,r.y);a.push(new n.Vector2(l,u))}return a},Gt=(t,e,o,r=24)=>{let s=[];for(let a=0;a<=r;a++){const i=a/r,c=P.DAMPED(i,o)*(e.x-t.x)+t.x,l=t.y+i*(e.y-t.y);s.push(new n.Vector2(c,l))}return s},bt=(t,e,o,r,s=24)=>{let a=[];for(let i=0;i<=s;i++){const c=i/s,l=P.EXPONENTIAL(c,o,r)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);a.push(new n.Vector2(l,u))}return a},It=(t,e,o,r,s=24)=>{let a=[];for(let i=0;i<=s;i++){const c=i/s,l=P.LOGARITHMIC(c,o,r)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);a.push(new n.Vector2(l,u))}return a},At=(t,e,o,r,s,a=24)=>{let i=[];for(let c=0;c<=a;c++){const l=c/a,u=o*l*l+r*l+s+t.x,m=t.y+l*(e.y-t.y);i.push(new n.Vector2(u,m))}return i},Et=(t,e,o,r=24)=>{let s=[];for(let a=0;a<=r;a++){const i=a/r,c=P.QUADRATIC(i,t.x,e.x,o.x),l=P.QUADRATIC(i,t.y,e.y,o.y);s.push(new n.Vector2(c,l))}return s},Bt=(t,e,o,r=24)=>{let s=[];for(let a=0;a<=r;a++){const i=a/r,c=P.SIGMOID(i,o)*(e.x-t.x)+t.x,l=t.y+i*(e.y-t.y);s.push(new n.Vector2(c,l))}return s},Un={createCubicCurvePoints:St,createDampedCurvePoints:Gt,createExponentialCurvePoints:bt,createLogarithmicCurvePoints:It,createParabolicCurvePoints:At,createQuadraticCurvePoints:Et,createSigmoidCurvePoints:Bt};function Nn(t,e,o,r,s,a=[0,0],i=[1,0],c=[0,1],l=[1,1]){const u=s||Pt(t,e,o);return[{pos:t,norm:u,uv:a},{pos:e,norm:u,uv:i},{pos:r,norm:u,uv:l},{pos:t,norm:u,uv:a},{pos:r,norm:u,uv:l},{pos:o,norm:u,uv:c}]}function Pt(t,e,o){const r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],s=[o[0]-t[0],o[1]-t[1],o[2]-t[2]],a=[r[1]*s[2]-r[2]*s[1],r[2]*s[0]-r[0]*s[2],r[0]*s[1]-r[1]*s[0]],i=Math.sqrt(a[0]**2+a[1]**2+a[2]**2);return a.map(c=>c/i)}function On(t,e){return t.map(([o,r,s])=>{switch(e){case"x":return[r,s];case"y":return[o,s];case"z":return[o,r];default:throw new Error(`Invalid axis: ${e}`)}})}function Tt(t){const[e,o,r]=t,s=Math.abs(e),a=Math.abs(o),i=Math.abs(r);return s>=a&&s>=i?[r>0?r:-r,o]:a>=s&&a>=i?[e,r>0?r:-r]:[e,o]}function _n(t){return t.map(e=>Tt(e))}function Fn(t){return t.map(([e,o,r])=>{const s=Math.atan2(r,e),a=Math.acos(o/Math.sqrt(e**2+o**2+r**2)),i=s/(2*Math.PI)+.5,c=1-a/Math.PI;return[i,c]})}function Ln(t){return t.map(([e,o,r])=>[Math.atan2(r,e)/(2*Math.PI)+.5,o])}function kn(t){return t.map(([e,o,r])=>{const s=Math.sqrt(e**2+r**2);return[Math.atan2(r,e)/(2*Math.PI)+.5,s]})}function Ct(t,e,o,r,s){return[(t[0]-e)/(o-e),(t[1]-r)/(s-r)]}function Dn(t,e,o){const[r,s]=e,[a,i]=o;return t.map(c=>Ct(c,r,a,s,i))}function zn(t){const e=Math.min(...t.map(a=>a[0])),o=Math.max(...t.map(a=>a[0])),r=Math.min(...t.map(a=>a[1])),s=Math.max(...t.map(a=>a[1]));return{minBounds:[e,r],maxBounds:[o,s]}}exports.AtmosphericSkybox=fn;exports.Axis=D;exports.BifurcatedStaircaseGeometry=io;exports.Bone=nn;exports.BoneGeometry=ot;exports.Book=wo;exports.BookGeometry=H;exports.Bookshelf=Co;exports.BookshelfGeometry=Qe;exports.BubblingEffect=to;exports.BunsenBurner=Lo;exports.Burst=$o;exports.BurstShape=dt;exports.Candle=Ro;exports.CandleGeometry=We;exports.ColorPalette=F;exports.CrossHeadstone=Go;exports.CrossHeadstoneGeometry=ze;exports.DaySkybox=dn;exports.Desk=Vo;exports.DeskGeometry=Ke;exports.DioramaGeometry=co;exports.Direction=U;exports.Easing=$t;exports.ElectricPanel=ko;exports.EllipticLeafGeometry=Oe;exports.EmissivePulseAnimation=zt;exports.ErlenmeyerFlask=Do;exports.ErlenmeyerFlaskGeometry=nt;exports.Falloff=C;exports.Flame=Uo;exports.FlameGeometry=j;exports.FlorenceFlask=zo;exports.FlorenceFlaskGeometry=at;exports.Gear=en;exports.GearShape=Mt;exports.Heart=tn;exports.HeartShape=pt;exports.Hill=sn;exports.HillGeometry=ut;exports.Jar=vo;exports.JarGeometry=Fe;exports.LShapedStaircaseGeometry=lo;exports.Lantern=No;exports.LeafEffect=oo;exports.LeverPanel=qo;exports.LightFlickerAnimation=Ht;exports.LightningAnimation=Xt;exports.LineEquations=ho;exports.Mausoleum=bo;exports.MausoleumGeometry=qe;exports.Microscope=Ho;exports.Moon=xo;exports.MortarAndPestle=Yo;exports.MortarGeometry=it;exports.MossyRocks=Oo;exports.MossyRocksGeometry=Je;exports.Mound=an;exports.MoundGeometry=mt;exports.NightSkybox=Mn;exports.ObeliskHeadstone=Io;exports.ObeliskHeadstoneGeometry=He;exports.Panel=Xo;exports.PanelLight=Zo;exports.ParametricCurve=P;exports.ParametricCurveUtils=Un;exports.PotionBottle=go;exports.PotionBottleGeometry=ke;exports.Rock=_o;exports.RockGeometry=et;exports.Rocks=Fo;exports.RocksGeometry=tt;exports.RoundedHeadstone=Ao;exports.RoundedHeadstoneGeometry=Ye;exports.SpiralStaircaseGeometry=uo;exports.SpiralTube=jo;exports.SquareHeadstone=Eo;exports.SquareHeadstoneGeometry=Xe;exports.StaircaseGeometry=mo;exports.Stand=Qo;exports.StandGeometry=ct;exports.Star=on;exports.StarShape=yt;exports.StoneFencePost=Bo;exports.StoneFencePostGeometry=Ze;exports.TeslaCoil=Ko;exports.TeslaCoilGeometry=lt;exports.TestTube=Wo;exports.TestTubeGeometry=L;exports.TestTubeRack=Jo;exports.Tree=rn;exports.TreeGeometry=ht;exports.WineBottle=So;exports.WineBottleGeometry=De;exports.WroughtIronBar=Po;exports.WroughtIronBarGeometry=Z;exports.WroughtIronFence=To;exports.WroughtIronFenceGeometry=je;exports.addNoiseDisplacement=un;exports.addWaterDisplacement=cn;exports.appendSphericalCurve=st;exports.atmosphericShader=N;exports.calculateChannelDifference=gt;exports.calculateDistance=vt;exports.calculateNormal=Pt;exports.calculateUVBounds=zn;exports.calculateXFromSlopeIntercept=X;exports.calculateYFromSlopeIntercept=Le;exports.cameraDollyAnimation=Nt;exports.cameraFlythroughAnimation=Ot;exports.cameraOrbitAnimation=_t;exports.cameraPendulumAnimation=Ft;exports.cameraSpiralAscensionAnimation=Lt;exports.cameraWobbleAnimation=kt;exports.cameraZoomInAnimation=Dt;exports.capHeightFromRadius=rt;exports.capWidthFromRadius=Mo;exports.cartesianToSpherical=yo;exports.centerGroup=In;exports.centerGroupAtTarget=An;exports.centerInstancedMesh=En;exports.centerMesh=Tn;exports.centerMeshAtTarget=Cn;exports.centerMeshGeometry=Vn;exports.centerMeshGeometryAtTarget=Rn;exports.checkerboardTexture=pn;exports.circularEaseIn=xe;exports.circularEaseInOut=ve;exports.circularEaseOut=we;exports.concave=Ge;exports.convex=be;exports.createCubicCurvePoints=St;exports.createDampedCurvePoints=Gt;exports.createExponentialCurvePoints=bt;exports.createLogarithmicCurvePoints=It;exports.createParabolicCurvePoints=At;exports.createQuad=Nn;exports.createQuadraticCurvePoints=Et;exports.createSigmoidCurvePoints=Bt;exports.cubicCurve=Pe;exports.cubicEaseIn=ae;exports.cubicEaseInOut=ce;exports.cubicEaseOut=ie;exports.cubicUVMapping=Tt;exports.cubicUVMappingBatch=_n;exports.cylindricalUVMapping=Ln;exports.dampedCurve=Te;exports.daySkyShader=O;exports.displacementBrush=Zt;exports.exponentialCurve=Ce;exports.exponentialEaseIn=Me;exports.exponentialEaseInOut=ye;exports.exponentialEaseOut=pe;exports.fadeShader=hn;exports.findClosestColor=Sn;exports.findClosestColorChannelWise=Gn;exports.flattenBrush=jt;exports.gaussian=Be;exports.getAnalogousColors=bn;exports.hexToHsl=xn;exports.hexToRgb=T;exports.hslToHex=wn;exports.hslToRgb=xt;exports.interpolateCurve=Pn;exports.inverse=Ee;exports.linear=ge;exports.logarithmic=Ie;exports.logarithmicCurve=Ve;exports.logarithmicRandomMax=W;exports.logarithmicRandomMin=J;exports.moonShader=ft;exports.nightSkyShader=_;exports.noiseBrush=Qt;exports.normalizeRgb=vn;exports.normalizeUV=Ct;exports.normalizeUVBatch=Dn;exports.parabolicCurve=Re;exports.parseHexCode=yn;exports.planarUVMapping=On;exports.polarUVMapping=kn;exports.quadraticCurve=Ue;exports.quadraticEaseIn=ne;exports.quadraticEaseInOut=se;exports.quadraticEaseOut=re;exports.quarticEaseIn=le;exports.quarticEaseInOut=me;exports.quarticEaseOut=ue;exports.quinticEaseIn=he;exports.quinticEaseInOut=de;exports.quinticEaseOut=fe;exports.radiusFromCapHeight=fo;exports.radiusFromCapWidth=Q;exports.randomFloat=k;exports.randomInteger=qt;exports.randomTransformVertices=$e;exports.rgbToHex=gn;exports.rgbToHsl=wt;exports.rowOfBooksByCount=so;exports.rowOfBooksByLength=ao;exports.rowOfBooksByScales=Y;exports.setRandomInterval=Yt;exports.setRandomTimeout=$;exports.sigmoidCurve=Ne;exports.sineEaseIn=ee;exports.sineEaseInOut=oe;exports.sineEaseOut=te;exports.smoothBrush=Kt;exports.smoothstep=Se;exports.sphericalToCartesian=po;exports.sphericalUVMapping=Fn;exports.spikeBrush=Wt;exports.squareRoot=Ae;exports.thetaLengthForRadius=q;exports.twistBrush=Jt;exports.updateNoiseDisplacementTime=mn;exports.updateWaterDisplacementTime=ln;
|
|
287
287
|
//# sourceMappingURL=index.cjs.js.map
|