gl-draw 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import*as Ne from"idb-keyval";import*as z from"three";import*as kt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Ht from"lil-gui";import*as We from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Xt from"three/examples/jsm/postprocessing/EffectComposer";import*as Kt from"three/examples/jsm/postprocessing/RenderPass";import*as Zt from"three/examples/jsm/postprocessing/ShaderPass";import*as Qt from"three/examples/jsm/shaders/CopyShader";import*as Yt from"three/examples/jsm/shaders/GammaCorrectionShader";import*as $t from"three/examples/jsm/postprocessing/SMAAPass";import*as Jt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as qt from"three/examples/jsm/shaders/FXAAShader";import*as ke from"three/examples/jsm/postprocessing/Pass";import*as er from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as tr from"three/examples/jsm/postprocessing/OutlinePass";import*as rr from"three/examples/jsm/postprocessing/SSRPass";import*as nr from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ar from"three/examples/jsm/renderers/CSS2DRenderer";var ir={187:function(L){var D=typeof Reflect=="object"?Reflect:null,x=D&&typeof D.apply=="function"?D.apply:function(u,d,m){return Function.prototype.apply.call(u,d,m)},B;D&&typeof D.ownKeys=="function"?B=D.ownKeys:Object.getOwnPropertySymbols?B=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:B=function(u){return Object.getOwnPropertyNames(u)};function j(f){console&&console.warn&&console.warn(f)}var T=Number.isNaN||function(u){return u!==u};function g(){g.init.call(this)}L.exports=g,L.exports.once=oe,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var F=10;function N(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return F},set:function(f){if(typeof f!="number"||f<0||T(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");F=f}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(u){if(typeof u!="number"||u<0||T(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function Z(f){return f._maxListeners===void 0?g.defaultMaxListeners:f._maxListeners}g.prototype.getMaxListeners=function(){return Z(this)},g.prototype.emit=function(u){for(var d=[],m=1;m<arguments.length;m++)d.push(arguments[m]);var b=u==="error",E=this._events;if(E!==void 0)b=b&&E.error===void 0;else if(!b)return!1;if(b){var C;if(d.length>0&&(C=d[0]),C instanceof Error)throw C;var I=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw I.context=C,I}var ae=E[u];if(ae===void 0)return!1;if(typeof ae=="function")x(ae,this,d);else for(var fe=ae.length,G=te(ae,fe),m=0;m<fe;++m)x(G[m],this,d);return!0};function U(f,u,d,m){var b,E,C;if(N(d),E=f._events,E===void 0?(E=f._events=Object.create(null),f._eventsCount=0):(E.newListener!==void 0&&(f.emit("newListener",u,d.listener?d.listener:d),E=f._events),C=E[u]),C===void 0)C=E[u]=d,++f._eventsCount;else if(typeof C=="function"?C=E[u]=m?[d,C]:[C,d]:m?C.unshift(d):C.push(d),b=Z(f),b>0&&C.length>b&&!C.warned){C.warned=!0;var I=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");I.name="MaxListenersExceededWarning",I.emitter=f,I.type=u,I.count=C.length,j(I)}return f}g.prototype.addListener=function(u,d){return U(this,u,d,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(u,d){return U(this,u,d,!0)};function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(f,u,d){var m={fired:!1,wrapFn:void 0,target:f,type:u,listener:d},b=O.bind(m);return b.listener=d,m.wrapFn=b,b}g.prototype.once=function(u,d){return N(d),this.on(u,c(this,u,d)),this},g.prototype.prependOnceListener=function(u,d){return N(d),this.prependListener(u,c(this,u,d)),this},g.prototype.removeListener=function(u,d){var m,b,E,C,I;if(N(d),b=this._events,b===void 0)return this;if(m=b[u],m===void 0)return this;if(m===d||m.listener===d)--this._eventsCount===0?this._events=Object.create(null):(delete b[u],b.removeListener&&this.emit("removeListener",u,m.listener||d));else if(typeof m!="function"){for(E=-1,C=m.length-1;C>=0;C--)if(m[C]===d||m[C].listener===d){I=m[C].listener,E=C;break}if(E<0)return this;E===0?m.shift():re(m,E),m.length===1&&(b[u]=m[0]),b.removeListener!==void 0&&this.emit("removeListener",u,I||d)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(u){var d,m,b;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[u]),this;if(arguments.length===0){var E=Object.keys(m),C;for(b=0;b<E.length;++b)C=E[b],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(d=m[u],typeof d=="function")this.removeListener(u,d);else if(d!==void 0)for(b=d.length-1;b>=0;b--)this.removeListener(u,d[b]);return this};function Q(f,u,d){var m=f._events;if(m===void 0)return[];var b=m[u];return b===void 0?[]:typeof b=="function"?d?[b.listener||b]:[b]:d?Y(b):te(b,b.length)}g.prototype.listeners=function(u){return Q(this,u,!0)},g.prototype.rawListeners=function(u){return Q(this,u,!1)},g.listenerCount=function(f,u){return typeof f.listenerCount=="function"?f.listenerCount(u):q.call(f,u)},g.prototype.listenerCount=q;function q(f){var u=this._events;if(u!==void 0){var d=u[f];if(typeof d=="function")return 1;if(d!==void 0)return d.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function te(f,u){for(var d=new Array(u),m=0;m<u;++m)d[m]=f[m];return d}function re(f,u){for(;u+1<f.length;u++)f[u]=f[u+1];f.pop()}function Y(f){for(var u=new Array(f.length),d=0;d<u.length;++d)u[d]=f[d].listener||f[d];return u}function oe(f,u){return new Promise(function(d,m){function b(C){f.removeListener(u,E),m(C)}function E(){typeof f.removeListener=="function"&&f.removeListener("error",b),d([].slice.call(arguments))}H(f,u,E,{once:!0}),u!=="error"&&ne(f,b,{once:!0})})}function ne(f,u,d){typeof f.on=="function"&&H(f,"error",u,d)}function H(f,u,d,m){if(typeof f.on=="function")m.once?f.once(u,d):f.on(u,d);else if(typeof f.addEventListener=="function")f.addEventListener(u,function b(E){m.once&&f.removeEventListener(u,b),d(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(L){var D=function(x){"use strict";var B=Object.prototype,j=B.hasOwnProperty,T,g=typeof Symbol=="function"?Symbol:{},F=g.iterator||"@@iterator",N=g.asyncIterator||"@@asyncIterator",Z=g.toStringTag||"@@toStringTag";function U(p,h,_){return Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[h]}try{U({},"")}catch(p){U=function(h,_,M){return h[_]=M}}function O(p,h,_,M){var R=h&&h.prototype instanceof oe?h:oe,J=Object.create(R.prototype),ee=new G(M||[]);return J._invoke=C(p,_,ee),J}x.wrap=O;function c(p,h,_){try{return{type:"normal",arg:p.call(h,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",q="suspendedYield",te="executing",re="completed",Y={};function oe(){}function ne(){}function H(){}var f={};U(f,F,function(){return this});var u=Object.getPrototypeOf,d=u&&u(u($([])));d&&d!==B&&j.call(d,F)&&(f=d);var m=H.prototype=oe.prototype=Object.create(f);ne.prototype=H,U(m,"constructor",H),U(H,"constructor",ne),ne.displayName=U(H,Z,"GeneratorFunction");function b(p){["next","throw","return"].forEach(function(h){U(p,h,function(_){return this._invoke(h,_)})})}x.isGeneratorFunction=function(p){var h=typeof p=="function"&&p.constructor;return h?h===ne||(h.displayName||h.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,H):(p.__proto__=H,U(p,Z,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function E(p,h){function _(J,ee,ie,ue){var se=c(p[J],p,ee);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&j.call(pe,"__await")?h.resolve(pe.__await).then(function(de){_("next",de,ie,ue)},function(de){_("throw",de,ie,ue)}):h.resolve(pe).then(function(de){me.value=de,ie(me)},function(de){return _("throw",de,ie,ue)})}}var M;function R(J,ee){function ie(){return new h(function(ue,se){_(J,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=R}b(E.prototype),U(E.prototype,N,function(){return this}),x.AsyncIterator=E,x.async=function(p,h,_,M,R){R===void 0&&(R=Promise);var J=new E(O(p,h,_,M),R);return x.isGeneratorFunction(h)?J:J.next().then(function(ee){return ee.done?ee.value:J.next()})};function C(p,h,_){var M=Q;return function(J,ee){if(M===te)throw new Error("Generator is already running");if(M===re){if(J==="throw")throw ee;return Se()}for(_.method=J,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=I(ie,_);if(ue){if(ue===Y)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(M===Q)throw M=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);M=te;var se=c(p,h,_);if(se.type==="normal"){if(M=_.done?re:q,se.arg===Y)continue;return{value:se.arg,done:_.done}}else se.type==="throw"&&(M=re,_.method="throw",_.arg=se.arg)}}}function I(p,h){var _=p.iterator[h.method];if(_===T){if(h.delegate=null,h.method==="throw"){if(p.iterator.return&&(h.method="return",h.arg=T,I(p,h),h.method==="throw"))return Y;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,h.arg);if(M.type==="throw")return h.method="throw",h.arg=M.arg,h.delegate=null,Y;var R=M.arg;if(!R)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,Y;if(R.done)h[p.resultName]=R.value,h.next=p.nextLoc,h.method!=="return"&&(h.method="next",h.arg=T);else return R;return h.delegate=null,Y}b(m),U(m,Z,"Generator"),U(m,F,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function ae(p){var h={tryLoc:p[0]};1 in p&&(h.catchLoc=p[1]),2 in p&&(h.finallyLoc=p[2],h.afterLoc=p[3]),this.tryEntries.push(h)}function fe(p){var h=p.completion||{};h.type="normal",delete h.arg,p.completion=h}function G(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ae,this),this.reset(!0)}x.keys=function(p){var h=[];for(var _ in p)h.push(_);return h.reverse(),function M(){for(;h.length;){var R=h.pop();if(R in p)return M.value=R,M.done=!1,M}return M.done=!0,M}};function $(p){if(p){var h=p[F];if(h)return h.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function R(){for(;++_<p.length;)if(j.call(p,_))return R.value=p[_],R.done=!1,R;return R.value=T,R.done=!0,R};return M.next=M}}return{next:Se}}x.values=$;function Se(){return{value:T,done:!0}}return G.prototype={constructor:G,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(fe),!p)for(var h in this)h.charAt(0)==="t"&&j.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=T)},stop:function(){this.done=!0;var p=this.tryEntries[0],h=p.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var h=this;function _(ue,se){return J.type="throw",J.arg=p,h.next=ue,se&&(h.method="next",h.arg=T),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var R=this.tryEntries[M],J=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var ee=j.call(R,"catchLoc"),ie=j.call(R,"finallyLoc");if(ee&&ie){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(ee){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else if(ie){if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,h){for(var _=this.tryEntries.length-1;_>=0;--_){var M=this.tryEntries[_];if(M.tryLoc<=this.prev&&j.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var R=M;break}}R&&(p==="break"||p==="continue")&&R.tryLoc<=h&&h<=R.finallyLoc&&(R=null);var J=R?R.completion:{};return J.type=p,J.arg=h,R?(this.method="next",this.next=R.finallyLoc,Y):this.complete(J)},complete:function(p,h){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&h&&(this.next=h),Y},finish:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),fe(_),Y}},catch:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var R=M.arg;fe(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(p,h,_){return this.delegate={iterator:$(p),resultName:h,nextLoc:_},this.method==="next"&&(this.arg=T),Y}},x}(L.exports);try{regeneratorRuntime=D}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},44:function(L,D,x){x.d(D,{Z:function(){return B}});function B(j){if(j.geometry&&j.geometry.dispose(),j.material){var T=Array.isArray(j.material)?j.material:[j.material];T.forEach(function(g){var F,N,Z,U,O,c,Q,q,te,re,Y,oe,ne;(F=g.map)===null||F===void 0||F.dispose(),(N=g.lightMap)===null||N===void 0||N.dispose(),(Z=g.bumpMap)===null||Z===void 0||Z.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(O=g.specularMap)===null||O===void 0||O.dispose(),(c=g.envMap)===null||c===void 0||c.dispose(),(Q=g.alphaMap)===null||Q===void 0||Q.dispose(),(q=g.aoMap)===null||q===void 0||q.dispose(),(te=g.displacementMap)===null||te===void 0||te.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(Y=g.gradientMap)===null||Y===void 0||Y.dispose(),(oe=g.metalnessMap)===null||oe===void 0||oe.dispose(),(ne=g.roughnessMap)===null||ne===void 0||ne.dispose(),g.dispose()})}}},218:function(L,D,x){x.d(D,{wf:function(){return g.Z},PO:function(){return Z.Z}});var B=x(666),j=x.n(B),T=null,g=x(44),F=x(949);function N(H){if(H.material){var f=Array.isArray(H.material)?H.material:[H.material];f.forEach(function(u){var d,m;(d=u.color)===null||d===void 0||d.convertSRGBToLinear(),(m=u.emissive)===null||m===void 0||m.convertSRGBToLinear(),u.map&&(u.map.encoding=THREE.sRGBEncoding),u.emissiveMap&&(u.emissiveMap.encoding=THREE.sRGBEncoding)})}}var Z=x(417),U=x(568),O=x(924),c=H=>{var f={};return x.d(f,H),f},Q=H=>()=>H,q=c({get:()=>Ne.get,set:()=>Ne.set}),te=x(485),re=null,Y=null,oe=function(){var H=(0,U.Z)(j().mark(function f(u,d){var m,b,E,C,I,ae;return j().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return m=d.version,G.next=4,(0,q.get)(u);case 4:if(E=G.sent,!(E&&E[m])){G.next=9;break}b=E[m],G.next=15;break;case 9:return G.next=11,(0,te.Z)(fetch(u).then(function($){if($.ok)return $.blob();throw new Error}));case 11:C=G.sent,I=C.res,ae=C.err,ae||(b=I,(0,q.set)(u,(0,O.Z)({},m,I)));case 15:return G.abrupt("return",b?{url:URL.createObjectURL(b)}:{url:u});case 16:case"end":return G.stop()}},f)}));return function(u,d){return H.apply(this,arguments)}}(),ne=x(818)},417:function(L,D,x){x.d(D,{Z:function(){return j}});function B(T){return Object.prototype.toString.call(T)==="[object Object]"}function j(T){if(B(T)===!1)return!1;var g=T.constructor;if(g===void 0)return!0;var F=g.prototype;return!(B(F)===!1||F.hasOwnProperty("isPrototypeOf")===!1)}},485:function(L,D,x){x.d(D,{Z:function(){return j}});var B=x(42);function j(T){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(F){return(0,B.Z)({err:null,res:F},g)}).catch(function(F){return(0,B.Z)({err:F,res:void 0},g)})}},818:function(L,D,x){var B=x(949),j=new Map,T=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(U,O,c,Q,q){var te=O[c*3],re=O[c*3+1],Y=O[Q*3],oe=O[Q*3+1],ne=O[q*3],H=O[q*3+1],f;if(j.has(U))f=j.get(U);else{var u=N.box3||new THREE.Box3;if(!N.box3){var d=U.parameters.shapes.getPoints();u.setFromArray(d.map(function(I){return[I.x,I.y,0]}).flat())}var m=u.getSize(new THREE.Vector3);N.split&&(m.y/=N.split),f={box:u,size:m},j.set(U,f)}var b=f.box,E=f.size,C=N.split?1-N.split:0;return[new THREE.Vector2((te-b.min.x)/E.x,(re-b.min.y)/E.y+C),new THREE.Vector2((Y-b.min.x)/E.x,(oe-b.min.y)/E.y+C),new THREE.Vector2((ne-b.min.x)/E.x,(H-b.min.y)/E.y+C)]},generateSideWallUV:function(U,O,c,Q,q,te){var re=O[c*3],Y=O[c*3+1],oe=O[c*3+2],ne=O[Q*3],H=O[Q*3+1],f=O[Q*3+2],u=O[q*3],d=O[q*3+1],m=O[q*3+2],b=O[te*3],E=O[te*3+1],C=O[te*3+2],I;if(j.has(O))I=j.get(O);else{var ae=new THREE.Box3;ae.setFromArray(O);var fe=ae.getSize(new THREE.Vector3);N.split&&(fe.z/=1-N.split),I={box:ae,size:fe},j.set(O,I)}var G=I.box,$=I.size;return Math.abs(Y-H)<Math.abs(re-ne)?[new THREE.Vector2((re-G.min.x)/$.x,(oe-G.min.z)/$.z),new THREE.Vector2((ne-G.min.x)/$.x,(f-G.min.z)/$.z),new THREE.Vector2((u-G.min.x)/$.x,(m-G.min.z)/$.z),new THREE.Vector2((b-G.min.x)/$.x,(C-G.min.z)/$.z)]:[new THREE.Vector2((Y-G.min.y)/$.x,(oe-G.min.z)/$.z),new THREE.Vector2((H-G.min.y)/$.x,(f-G.min.z)/$.z),new THREE.Vector2((d-G.min.y)/$.x,(m-G.min.z)/$.z),new THREE.Vector2((E-G.min.y)/$.x,(C-G.min.z)/$.z)]}}},g=function(){j.clear()}},949:function(L,D,x){var B=T=>{var g={};return x.d(g,T),g},j=T=>()=>T;L.exports=B({ACESFilmicToneMapping:()=>z.ACESFilmicToneMapping,AdditiveBlending:()=>z.AdditiveBlending,AxesHelper:()=>z.AxesHelper,Box3:()=>z.Box3,Camera:()=>z.Camera,CineonToneMapping:()=>z.CineonToneMapping,Clock:()=>z.Clock,Color:()=>z.Color,Euler:()=>z.Euler,Group:()=>z.Group,Layers:()=>z.Layers,LinearEncoding:()=>z.LinearEncoding,LinearFilter:()=>z.LinearFilter,LinearToneMapping:()=>z.LinearToneMapping,Matrix4:()=>z.Matrix4,Mesh:()=>z.Mesh,MeshBasicMaterial:()=>z.MeshBasicMaterial,NoToneMapping:()=>z.NoToneMapping,PerspectiveCamera:()=>z.PerspectiveCamera,PlaneGeometry:()=>z.PlaneGeometry,Points:()=>z.Points,REVISION:()=>z.REVISION,RGBAFormat:()=>z.RGBAFormat,Raycaster:()=>z.Raycaster,ReinhardToneMapping:()=>z.ReinhardToneMapping,Scene:()=>z.Scene,ShaderMaterial:()=>z.ShaderMaterial,Sprite:()=>z.Sprite,SpriteMaterial:()=>z.SpriteMaterial,UniformsUtils:()=>z.UniformsUtils,UnsignedByteType:()=>z.UnsignedByteType,Vector2:()=>z.Vector2,Vector3:()=>z.Vector3,WebGLMultisampleRenderTarget:()=>z.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>z.WebGLRenderTarget,WebGLRenderer:()=>z.WebGLRenderer,sRGBEncoding:()=>z.sRGBEncoding})},568:function(L,D,x){x.d(D,{Z:function(){return j}});function B(T,g,F,N,Z,U,O){try{var c=T[U](O),Q=c.value}catch(q){F(q);return}c.done?g(Q):Promise.resolve(Q).then(N,Z)}function j(T){return function(){var g=this,F=arguments;return new Promise(function(N,Z){var U=T.apply(g,F);function O(Q){B(U,N,Z,O,c,"next",Q)}function c(Q){B(U,N,Z,O,c,"throw",Q)}O(void 0)})}}},924:function(L,D,x){x.d(D,{Z:function(){return B}});function B(j,T,g){return T in j?Object.defineProperty(j,T,{value:g,enumerable:!0,configurable:!0,writable:!0}):j[T]=g,j}},42:function(L,D,x){x.d(D,{Z:function(){return j}});var B=x(924);function j(T){for(var g=1;g<arguments.length;g++){var F=arguments[g]!=null?arguments[g]:{},N=Object.keys(F);typeof Object.getOwnPropertySymbols=="function"&&(N=N.concat(Object.getOwnPropertySymbols(F).filter(function(Z){return Object.getOwnPropertyDescriptor(F,Z).enumerable}))),N.forEach(function(Z){(0,B.Z)(T,Z,F[Z])})}return T}}},Ie={};function V(L){var D=Ie[L];if(D!==void 0)return D.exports;var x=Ie[L]={exports:{}};return ir[L](x,x.exports,V),x.exports}(function(){V.n=function(L){var D=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(D,{a:D}),D}})(),function(){V.d=function(L,D){for(var x in D)V.o(D,x)&&!V.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:D[x]})}}(),function(){V.o=function(L,D){return Object.prototype.hasOwnProperty.call(L,D)}}();var _e={};(function(){V.d(_e,{L6:function(){return Vt},sb:function(){return d},z:function(){return Re},ZP:function(){return Re}});function L(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function D(a,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}function x(a,n,i){return n&&D(a.prototype,n),i&&D(a,i),a}var B=V(42);function j(a,n){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),i.push.apply(i,e)}return i}function T(a,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(n,i))}),a}function g(a,n){(n==null||n>a.length)&&(n=a.length);for(var i=0,e=new Array(n);i<n;i++)e[i]=a[i];return e}function F(a){if(Array.isArray(a))return g(a)}function N(a){if(typeof Symbol!="undefined"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Z(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(a,n){if(!!a){if(typeof a=="string")return g(a,n);var i=Object.prototype.toString.call(a).slice(8,-1);if(i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return g(a,n)}}function O(a){return F(a)||N(a)||U(a)||Z()}var c=V(949),Q=V(187),q=a=>{var n={};return V.d(n,a),n},te=a=>()=>a,re=q({default:()=>kt.default}),Y=a=>{var n={};return V.d(n,a),n},oe=a=>()=>a,ne=Y({default:()=>It.default}),H=a=>{var n={};return V.d(n,a),n},f=a=>()=>a,u=H({default:()=>Ht.default}),d=function(){"use strict";function a(i){L(this,a),this.guiParams={},i&&(this.guiParams=i)}var n=a.prototype;return n.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(t){var s=e.addFolder(t),l=r.guiParams[t];Object.keys(l).forEach(function(o){var v=l[o],w=v.min,y=v.max,P=v.step,S=v.name,A=v.paramMap,W=v.items,k=v.value,K=v.target,ce=o.toLowerCase().indexOf("color")>-1,X,le=typeof k=="undefined"&&K,he=le?K():l[o],ve=le?o:"value";W?X=s.add(he,ve,W):ce?X=s.addColor(he,ve):X=s.add(he,ve),X=X.name(S||o),typeof w!="undefined"&&(X=X.min(w)),typeof y!="undefined"&&(X=X.max(y)),typeof P!="undefined"&&(X=X.step(P)),X=X.onChange(function(){r.setTargetValue(t,o,he[ve],A)}),le&&X.listen()})})},n.setTargetValue=function(e,r,t,s){var l=this.guiParams[e][r],o=l.onChange,v=l.target,w=l.value,y=r.toLowerCase().indexOf("color")>-1,P=typeof w=="undefined"&&v;if(v&&!P){var S=v();Array.isArray(S)||(S=[S]),S.forEach(function(A){if(!!A)if(y)try{A[s||r].set(t)}catch(W){r!=="color"&&!s&&console.warn("".concat(r," is not a color,set paramMap"))}else A[s||r]=t})}o&&o(t)},n.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(t){var s=e.guiParams[r][t];typeof s.value!="undefined"&&e.setTargetValue(r,t,s.value,s.paramMap)})})},a}(),m={None:c.NoToneMapping,Linear:c.LinearToneMapping,Reinhard:c.ReinhardToneMapping,Cineon:c.CineonToneMapping,ACESFilmic:c.ACESFilmicToneMapping},b={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:c.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},E=function(){"use strict";function a(i){L(this,a),this.options=i;var e=i.width,r=i.height,t=i.rendererParams,s=t.context,l=t.alpha,o=t.devicePixelRatio,v=t.antialias,w=t.powerPreference,y=t.toneMapping,P=t.toneMappingExposure,S=t.outputEncoding,A=t.logarithmicDepthBuffer,W=t.preserveDrawingBuffer,k=new c.WebGLRenderer({context:s,alpha:l,antialias:v,powerPreference:w,logarithmicDepthBuffer:A,preserveDrawingBuffer:W});k.setSize(e,r),k.setPixelRatio(o),k.autoClear=!1,k.toneMapping=m[y],k.toneMappingExposure=P,k.outputEncoding=S,this.renderer=k}var n=a.prototype;return n.setSize=function(e,r){this.renderer.setSize(e,r)},n.render=function(){var e=this.options,r=e.scene,t=e.camera;this.renderer.render(r,t)},n.setGui=function(e){var r=this,t=new d({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});t.showGui(e)},n.dispose=function(){var e,r,t;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(t=this.renderer)===null||t===void 0||t.renderLists.dispose()},a}(),C={fov:45,near:1,far:1e3},I=function(){"use strict";function a(i){L(this,a),this.oldCameraPosition=new c.Vector3,this.oldCameraRotation=new c.Euler,this.customCamera=!1,this.options=i;var e=i.width,r=i.height,t=i.cameraParams;if(t instanceof c.Camera)this.camera=t,this.customCamera=!0;else{var s=t.fov,l=t.far,o=t.near,v=new c.PerspectiveCamera(s,e/r,o,l);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var n=a.prototype;return n.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},n.setSize=function(e,r){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},n.setGui=function(e){var r=this,t=new d({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}}});this.camera instanceof c.PerspectiveCamera&&(t.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}),t.showGui(e)},a}(),ae=V(218),fe={background:null},G=function(){"use strict";function a(i){L(this,a),this.options=i;var e=i.camera,r=i.sceneParams,t=r.background,s=new c.Scene;t&&(s.background=t),s.add(e),this.scene=s}var n=a.prototype;return n.addAxesHelper=function(){var e,r=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},n.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,ae.wf)(r)})},a}(),$=a=>{var n={};return V.d(n,a),n},Se=a=>()=>a,p=$({MapControls:()=>We.MapControls,OrbitControls:()=>We.OrbitControls}),h={},_=function(){"use strict";function a(i){L(this,a),this.options=i;var e=i.camera,r=i.controlParams,t=i.mapControl,s=r.domElement,l=t?new p.MapControls(e,s):new p.OrbitControls(e,s);l.minPolarAngle=Math.PI*.15,l.maxPolarAngle=Math.PI*.85,l.enableDamping=!0,l.dampingFactor=.063,l.autoRotate=!1,l.autoRotateSpeed=-60,l.enableZoom=!0,l.zoomSpeed=.2,this.control=l}var n=a.prototype;return n.limitPan=function(e){var r=e.maxX,t=r===void 0?1/0:r,s=e.minX,l=s===void 0?-1/0:s,o=e.maxZ,v=o===void 0?1/0:o,w=e.minZ,y=w===void 0?-1/0:w,P=e.maxY,S=P===void 0?1/0:P,A=e.minY,W=A===void 0?-1/0:A,k=this.limitPanV||new c.Vector3,K=this.control,ce=this.options.camera,X=new c.Vector3(l,W,y),le=new c.Vector3(t,S,v);this.limitPanV=k,k.copy(K.target),K.target.clamp(X,le),k.sub(K.target),ce.position.sub(k)},n.update=function(){this.control.update()},n.dispose=function(){this.control.dispose()},a}(),M=a=>{var n={};return V.d(n,a),n},R=a=>()=>a,J=M({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,me=new c.Vector3,pe=function a(){"use strict";var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,a);var i=function(A,W){return se.setFromMatrixPosition(A.matrixWorld),me.setFromMatrixPosition(W.matrixWorld),se.distanceToSquared(me)},e=function(A){var W=[];return A.traverse(function(k){k.isCSS2DObject&&W.push(k)}),W},r=function(A){for(var W=e(A).sort(function(le,he){if(le.renderOrder!==he.renderOrder)return he.renderOrder-le.renderOrder;var ve=w.objects.get(le).distanceToCameraSquared,ye=w.objects.get(he).distanceToCameraSquared;return ve-ye}),k=W.length,K=0,ce=W.length;K<ce;K++){var X=W[K].userData.zIndexFix||0;W[K].element.style.zIndex=k-K+X}},t=this,s,l,o,v,w={objects:new WeakMap},y=n.element!==void 0?n.element:document.createElement("div");y.style.overflow="hidden",this.domElement=y,this.getSize=function(){return{width:s,height:l}},this.render=function(S,A){+c.REVISION<144?(S.autoUpdate===!0&&S.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld()):(S.matrixWorldAutoUpdate===!0&&S.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld()),ie.copy(A.matrixWorldInverse),ue.multiplyMatrices(A.projectionMatrix,ie),P(S,S,A),r(S)},this.setSize=function(S,A){s=S,l=A,o=s/2,v=l/2,y.style.width="".concat(S,"px"),y.style.height="".concat(A,"px")};function P(S,A,W){if(S.isCSS2DObject){ee.setFromMatrixPosition(S.matrixWorld),ee.applyMatrix4(ue);var k=S.visible===!0&&ee.z>=-1&&ee.z<=1&&S.layers.test(W.layers)===!0;if(S.element.style.display=k===!0?"":"none",k===!0){S.onBeforeRender(t,A,W);var K=S.element;K.style.transform="translate(-50%,-50%) translate(".concat(ee.x*o+o,"px,").concat(-ee.y*v+v,"px)"),K.parentNode!==y&&y.appendChild(K),S.onAfterRender(t,A,W)}var ce={distanceToCameraSquared:i(W,S)};w.objects.set(S,ce)}for(var X=0,le=S.children.length;X<le;X++)P(S.children[X],A,W)}},de={zIndex:"auto"},He=function(){"use strict";function a(i){L(this,a),this.container=i}var n=a.prototype;return n.addRenderer=function(e,r){var t=this.container,s=t.offsetWidth,l=t.offsetHeight,o=e==="css2d"?new pe:new J.CSS3DRenderer;o.domElement.style.position="absolute",o.domElement.style.top="0",o.domElement.style.pointerEvents="none",o.domElement.style.zIndex=r.zIndex,o.setSize(s,l),t.appendChild(o.domElement),e==="css2d"?this.css2Drenderer=o:e==="css3d"&&(this.css3Drenderer=o)},n.setSize=function(e,r){var t,s;(t=this.css2Drenderer)===null||t===void 0||t.setSize(e,r),(s=this.css3Drenderer)===null||s===void 0||s.setSize(e,r)},n.render=function(e,r){var t,s;(t=this.css2Drenderer)===null||t===void 0||t.render(e,r),(s=this.css3Drenderer)===null||s===void 0||s.render(e,r)},n.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},a}(),Xe=a=>{var n={};return V.d(n,a),n},cr=a=>()=>a,Te=Xe({EffectComposer:()=>Xt.EffectComposer}),Ke=a=>{var n={};return V.d(n,a),n},fr=a=>()=>a,Ze=Ke({RenderPass:()=>Kt.RenderPass}),Qe=a=>{var n={};return V.d(n,a),n},dr=a=>()=>a,be=Qe({ShaderPass:()=>Zt.ShaderPass}),Ye=a=>{var n={};return V.d(n,a),n},hr=a=>()=>a,xe=Ye({CopyShader:()=>Qt.CopyShader}),$e=a=>{var n={};return V.d(n,a),n},vr=a=>()=>a,Je=$e({GammaCorrectionShader:()=>Yt.GammaCorrectionShader}),qe=a=>{var n={};return V.d(n,a),n},pr=a=>()=>a,et=qe({SMAAPass:()=>$t.SMAAPass}),tt=a=>{var n={};return V.d(n,a),n},mr=a=>()=>a,rt=tt({SSAARenderPass:()=>Jt.SSAARenderPass}),nt=a=>{var n={};return V.d(n,a),n},gr=a=>()=>a,at=nt({FXAAShader:()=>qt.FXAAShader}),it=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(i){return!1}},_r=0,st=1,ge=!1,Ae=it()!==!1,ot=`varying vec2 vUv;
1
+ import*as Be from"idb-keyval";import*as B from"three";import*as Gt from"deepmerge";import*as Ut from"three/examples/jsm/libs/stats.module";import*as Ft from"lil-gui";import*as Ge from"three/examples/jsm/controls/OrbitControls";import*as Re from"three/examples/jsm/renderers/CSS3DRenderer";import*as Vt from"three/examples/jsm/postprocessing/EffectComposer";import*as Nt from"three/examples/jsm/postprocessing/RenderPass";import*as Wt from"three/examples/jsm/postprocessing/ShaderPass";import*as kt from"three/examples/jsm/shaders/CopyShader";import*as It from"three/examples/jsm/shaders/GammaCorrectionShader";import*as Ht from"three/examples/jsm/postprocessing/SMAAPass";import*as Xt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as Kt from"three/examples/jsm/shaders/FXAAShader";import*as Ue from"three/examples/jsm/postprocessing/Pass";import*as Zt from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as Qt from"three/examples/jsm/postprocessing/OutlinePass";import*as Yt from"three/examples/jsm/postprocessing/SSRPass";import*as $t from"three/examples/jsm/objects/ReflectorForSSRPass";import*as Jt from"three/examples/jsm/renderers/CSS2DRenderer";var qt={187:function(L){var D=typeof Reflect=="object"?Reflect:null,C=D&&typeof D.apply=="function"?D.apply:function(u,f,m){return Function.prototype.apply.call(u,f,m)},G;D&&typeof D.ownKeys=="function"?G=D.ownKeys:Object.getOwnPropertySymbols?G=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:G=function(u){return Object.getOwnPropertyNames(u)};function j(h){console&&console.warn&&console.warn(h)}var A=Number.isNaN||function(u){return u!==u};function g(){g.init.call(this)}L.exports=g,L.exports.once=oe,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var z=10;function X(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return z},set:function(h){if(typeof h!="number"||h<0||A(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");z=h}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(u){if(typeof u!="number"||u<0||A(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function O(h){return h._maxListeners===void 0?g.defaultMaxListeners:h._maxListeners}g.prototype.getMaxListeners=function(){return O(this)},g.prototype.emit=function(u){for(var f=[],m=1;m<arguments.length;m++)f.push(arguments[m]);var S=u==="error",w=this._events;if(w!==void 0)S=S&&w.error===void 0;else if(!S)return!1;if(S){var E;if(f.length>0&&(E=f[0]),E instanceof Error)throw E;var $=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw $.context=E,$}var N=w[u];if(N===void 0)return!1;if(typeof N=="function")C(N,this,f);else for(var K=N.length,ne=ae(N,K),m=0;m<K;++m)C(ne[m],this,f);return!0};function U(h,u,f,m){var S,w,E;if(X(f),w=h._events,w===void 0?(w=h._events=Object.create(null),h._eventsCount=0):(w.newListener!==void 0&&(h.emit("newListener",u,f.listener?f.listener:f),w=h._events),E=w[u]),E===void 0)E=w[u]=f,++h._eventsCount;else if(typeof E=="function"?E=w[u]=m?[f,E]:[E,f]:m?E.unshift(f):E.push(f),S=O(h),S>0&&E.length>S&&!E.warned){E.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(u)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=h,$.type=u,$.count=E.length,j($)}return h}g.prototype.addListener=function(u,f){return U(this,u,f,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(u,f){return U(this,u,f,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(h,u,f){var m={fired:!1,wrapFn:void 0,target:h,type:u,listener:f},S=k.bind(m);return S.listener=f,m.wrapFn=S,S}g.prototype.once=function(u,f){return X(f),this.on(u,c(this,u,f)),this},g.prototype.prependOnceListener=function(u,f){return X(f),this.prependListener(u,c(this,u,f)),this},g.prototype.removeListener=function(u,f){var m,S,w,E,$;if(X(f),S=this._events,S===void 0)return this;if(m=S[u],m===void 0)return this;if(m===f||m.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete S[u],S.removeListener&&this.emit("removeListener",u,m.listener||f));else if(typeof m!="function"){for(w=-1,E=m.length-1;E>=0;E--)if(m[E]===f||m[E].listener===f){$=m[E].listener,w=E;break}if(w<0)return this;w===0?m.shift():re(m,w),m.length===1&&(S[u]=m[0]),S.removeListener!==void 0&&this.emit("removeListener",u,$||f)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(u){var f,m,S;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[u]),this;if(arguments.length===0){var w=Object.keys(m),E;for(S=0;S<w.length;++S)E=w[S],E!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=m[u],typeof f=="function")this.removeListener(u,f);else if(f!==void 0)for(S=f.length-1;S>=0;S--)this.removeListener(u,f[S]);return this};function Q(h,u,f){var m=h._events;if(m===void 0)return[];var S=m[u];return S===void 0?[]:typeof S=="function"?f?[S.listener||S]:[S]:f?Y(S):ae(S,S.length)}g.prototype.listeners=function(u){return Q(this,u,!0)},g.prototype.rawListeners=function(u){return Q(this,u,!1)},g.listenerCount=function(h,u){return typeof h.listenerCount=="function"?h.listenerCount(u):te.call(h,u)},g.prototype.listenerCount=te;function te(h){var u=this._events;if(u!==void 0){var f=u[h];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ae(h,u){for(var f=new Array(u),m=0;m<u;++m)f[m]=h[m];return f}function re(h,u){for(;u+1<h.length;u++)h[u]=h[u+1];h.pop()}function Y(h){for(var u=new Array(h.length),f=0;f<u.length;++f)u[f]=h[f].listener||h[f];return u}function oe(h,u){return new Promise(function(f,m){function S(E){h.removeListener(u,w),m(E)}function w(){typeof h.removeListener=="function"&&h.removeListener("error",S),f([].slice.call(arguments))}W(h,u,w,{once:!0}),u!=="error"&&q(h,S,{once:!0})})}function q(h,u,f){typeof h.on=="function"&&W(h,"error",u,f)}function W(h,u,f,m){if(typeof h.on=="function")m.once?h.once(u,f):h.on(u,f);else if(typeof h.addEventListener=="function")h.addEventListener(u,function S(w){m.once&&h.removeEventListener(u,S),f(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}},666:function(L){var D=function(C){"use strict";var G=Object.prototype,j=G.hasOwnProperty,A,g=typeof Symbol=="function"?Symbol:{},z=g.iterator||"@@iterator",X=g.asyncIterator||"@@asyncIterator",O=g.toStringTag||"@@toStringTag";function U(p,d,_){return Object.defineProperty(p,d,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{U({},"")}catch(p){U=function(d,_,M){return d[_]=M}}function k(p,d,_,M){var R=d&&d.prototype instanceof oe?d:oe,J=Object.create(R.prototype),ee=new ne(M||[]);return J._invoke=E(p,_,ee),J}C.wrap=k;function c(p,d,_){try{return{type:"normal",arg:p.call(d,_)}}catch(M){return{type:"throw",arg:M}}}var Q="suspendedStart",te="suspendedYield",ae="executing",re="completed",Y={};function oe(){}function q(){}function W(){}var h={};U(h,z,function(){return this});var u=Object.getPrototypeOf,f=u&&u(u(de([])));f&&f!==G&&j.call(f,z)&&(h=f);var m=W.prototype=oe.prototype=Object.create(h);q.prototype=W,U(m,"constructor",W),U(W,"constructor",q),q.displayName=U(W,O,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(d){U(p,d,function(_){return this._invoke(d,_)})})}C.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===q||(d.displayName||d.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,U(p,O,"GeneratorFunction")),p.prototype=Object.create(m),p},C.awrap=function(p){return{__await:p}};function w(p,d){function _(J,ee,ie,ue){var se=c(p[J],p,ee);if(se.type==="throw")ue(se.arg);else{var pe=se.arg,ve=pe.value;return ve&&typeof ve=="object"&&j.call(ve,"__await")?d.resolve(ve.__await).then(function(fe){_("next",fe,ie,ue)},function(fe){_("throw",fe,ie,ue)}):d.resolve(ve).then(function(fe){pe.value=fe,ie(pe)},function(fe){return _("throw",fe,ie,ue)})}}var M;function R(J,ee){function ie(){return new d(function(ue,se){_(J,ee,ue,se)})}return M=M?M.then(ie,ie):ie()}this._invoke=R}S(w.prototype),U(w.prototype,X,function(){return this}),C.AsyncIterator=w,C.async=function(p,d,_,M,R){R===void 0&&(R=Promise);var J=new w(k(p,d,_,M),R);return C.isGeneratorFunction(d)?J:J.next().then(function(ee){return ee.done?ee.value:J.next()})};function E(p,d,_){var M=Q;return function(J,ee){if(M===ae)throw new Error("Generator is already running");if(M===re){if(J==="throw")throw ee;return ye()}for(_.method=J,_.arg=ee;;){var ie=_.delegate;if(ie){var ue=$(ie,_);if(ue){if(ue===Y)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(M===Q)throw M=re,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);M=ae;var se=c(p,d,_);if(se.type==="normal"){if(M=_.done?re:te,se.arg===Y)continue;return{value:se.arg,done:_.done}}else se.type==="throw"&&(M=re,_.method="throw",_.arg=se.arg)}}}function $(p,d){var _=p.iterator[d.method];if(_===A){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=A,$(p,d),d.method==="throw"))return Y;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var M=c(_,p.iterator,d.arg);if(M.type==="throw")return d.method="throw",d.arg=M.arg,d.delegate=null,Y;var R=M.arg;if(!R)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,Y;if(R.done)d[p.resultName]=R.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=A);else return R;return d.delegate=null,Y}S(m),U(m,O,"Generator"),U(m,z,function(){return this}),U(m,"toString",function(){return"[object Generator]"});function N(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function K(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function ne(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(N,this),this.reset(!0)}C.keys=function(p){var d=[];for(var _ in p)d.push(_);return d.reverse(),function M(){for(;d.length;){var R=d.pop();if(R in p)return M.value=R,M.done=!1,M}return M.done=!0,M}};function de(p){if(p){var d=p[z];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,M=function R(){for(;++_<p.length;)if(j.call(p,_))return R.value=p[_],R.done=!1,R;return R.value=A,R.done=!0,R};return M.next=M}}return{next:ye}}C.values=de;function ye(){return{value:A,done:!0}}return ne.prototype={constructor:ne,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=A,this.done=!1,this.delegate=null,this.method="next",this.arg=A,this.tryEntries.forEach(K),!p)for(var d in this)d.charAt(0)==="t"&&j.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=A)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function _(ue,se){return J.type="throw",J.arg=p,d.next=ue,se&&(d.method="next",d.arg=A),!!se}for(var M=this.tryEntries.length-1;M>=0;--M){var R=this.tryEntries[M],J=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var ee=j.call(R,"catchLoc"),ie=j.call(R,"finallyLoc");if(ee&&ie){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(ee){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else if(ie){if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var _=this.tryEntries.length-1;_>=0;--_){var M=this.tryEntries[_];if(M.tryLoc<=this.prev&&j.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var R=M;break}}R&&(p==="break"||p==="continue")&&R.tryLoc<=d&&d<=R.finallyLoc&&(R=null);var J=R?R.completion:{};return J.type=p,J.arg=d,R?(this.method="next",this.next=R.finallyLoc,Y):this.complete(J)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),Y},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),K(_),Y}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.tryLoc===p){var M=_.completion;if(M.type==="throw"){var R=M.arg;K(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,_){return this.delegate={iterator:de(p),resultName:d,nextLoc:_},this.method==="next"&&(this.arg=A),Y}},C}(L.exports);try{regeneratorRuntime=D}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},695:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j){if(j.geometry&&j.geometry.dispose(),j.material){var A=Array.isArray(j.material)?j.material:[j.material];A.forEach(function(g){var z,X,O,U,k,c,Q,te,ae,re,Y,oe,q;(z=g.map)===null||z===void 0||z.dispose(),(X=g.lightMap)===null||X===void 0||X.dispose(),(O=g.bumpMap)===null||O===void 0||O.dispose(),(U=g.normalMap)===null||U===void 0||U.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(c=g.envMap)===null||c===void 0||c.dispose(),(Q=g.alphaMap)===null||Q===void 0||Q.dispose(),(te=g.aoMap)===null||te===void 0||te.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(Y=g.gradientMap)===null||Y===void 0||Y.dispose(),(oe=g.metalnessMap)===null||oe===void 0||oe.dispose(),(q=g.roughnessMap)===null||q===void 0||q.dispose(),g.dispose()})}}},521:function(L,D,C){C.d(D,{wf:function(){return g.Z},PO:function(){return O.Z}});var G=C(666),j=C.n(G),A=null,g=C(695),z=C(949);function X(W){if(W.material){var h=Array.isArray(W.material)?W.material:[W.material];h.forEach(function(u){var f,m;(f=u.color)===null||f===void 0||f.convertSRGBToLinear(),(m=u.emissive)===null||m===void 0||m.convertSRGBToLinear(),u.map&&(u.map.encoding=THREE.sRGBEncoding),u.emissiveMap&&(u.emissiveMap.encoding=THREE.sRGBEncoding)})}}var O=C(738),U=C(568),k=C(924),c=W=>{var h={};return C.d(h,W),h},Q=W=>()=>W,te=c({get:()=>Be.get,set:()=>Be.set}),ae=C(484),re=null,Y=null,oe=function(){var W=(0,U.Z)(j().mark(function h(u,f){var m,S,w,E,$,N;return j().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return m=f.version,ne.next=4,(0,te.get)(u);case 4:if(w=ne.sent,!(w&&w[m])){ne.next=9;break}S=w[m],ne.next=15;break;case 9:return ne.next=11,(0,ae.Z)(fetch(u).then(function(de){if(de.ok)return de.blob();throw new Error}));case 11:E=ne.sent,$=E.res,N=E.err,N||(S=$,(0,te.set)(u,(0,k.Z)({},m,$)));case 15:return ne.abrupt("return",S?{url:URL.createObjectURL(S)}:{url:u});case 16:case"end":return ne.stop()}},h)}));return function(u,f){return W.apply(this,arguments)}}(),q=C(705)},738:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A){return Object.prototype.toString.call(A)==="[object Object]"}function j(A){if(G(A)===!1)return!1;var g=A.constructor;if(g===void 0)return!0;var z=g.prototype;return!(G(z)===!1||z.hasOwnProperty("isPrototypeOf")===!1)}},484:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(42);function j(A){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A.then(function(z){return(0,G.Z)({err:null,res:z},g)}).catch(function(z){return(0,G.Z)({err:z,res:void 0},g)})}},705:function(L,D,C){var G=C(949),j=new Map,A=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,O,U,k,c){var Q=O[U*3],te=O[U*3+1],ae=O[k*3],re=O[k*3+1],Y=O[c*3],oe=O[c*3+1],q;if(j.has(X))q=j.get(X);else{var W=z.box3||new THREE.Box3;if(!z.box3){var h=X.parameters.shapes.getPoints();W.setFromArray(h.map(function(w){return[w.x,w.y,0]}).flat())}var u=W.getSize(new THREE.Vector3);z.split&&(u.y/=z.split),q={box:W,size:u},j.set(X,q)}var f=q.box,m=q.size,S=z.split?1-z.split:0;return[new THREE.Vector2((Q-f.min.x)/m.x,(te-f.min.y)/m.y+S),new THREE.Vector2((ae-f.min.x)/m.x,(re-f.min.y)/m.y+S),new THREE.Vector2((Y-f.min.x)/m.x,(oe-f.min.y)/m.y+S)]},generateSideWallUV:function(X,O,U,k,c,Q){var te=O[U*3],ae=O[U*3+1],re=O[U*3+2],Y=O[k*3],oe=O[k*3+1],q=O[k*3+2],W=O[c*3],h=O[c*3+1],u=O[c*3+2],f=O[Q*3],m=O[Q*3+1],S=O[Q*3+2],w;if(j.has(O))w=j.get(O);else{var E=new THREE.Box3;E.setFromArray(O);var $=E.getSize(new THREE.Vector3);z.split&&($.z/=1-z.split),w={box:E,size:$},j.set(O,w)}var N=w.box,K=w.size;return Math.abs(ae-oe)<Math.abs(te-Y)?[new THREE.Vector2((te-N.min.x)/K.x,(re-N.min.z)/K.z),new THREE.Vector2((Y-N.min.x)/K.x,(q-N.min.z)/K.z),new THREE.Vector2((W-N.min.x)/K.x,(u-N.min.z)/K.z),new THREE.Vector2((f-N.min.x)/K.x,(S-N.min.z)/K.z)]:[new THREE.Vector2((ae-N.min.y)/K.x,(re-N.min.z)/K.z),new THREE.Vector2((oe-N.min.y)/K.x,(q-N.min.z)/K.z),new THREE.Vector2((h-N.min.y)/K.x,(u-N.min.z)/K.z),new THREE.Vector2((m-N.min.y)/K.x,(S-N.min.z)/K.z)]}}},g=function(){j.clear()}},949:function(L,D,C){var G=A=>{var g={};return C.d(g,A),g},j=A=>()=>A;L.exports=G({ACESFilmicToneMapping:()=>B.ACESFilmicToneMapping,AdditiveBlending:()=>B.AdditiveBlending,AxesHelper:()=>B.AxesHelper,Box3:()=>B.Box3,Camera:()=>B.Camera,CineonToneMapping:()=>B.CineonToneMapping,Clock:()=>B.Clock,Color:()=>B.Color,Euler:()=>B.Euler,Group:()=>B.Group,Layers:()=>B.Layers,LinearEncoding:()=>B.LinearEncoding,LinearFilter:()=>B.LinearFilter,LinearToneMapping:()=>B.LinearToneMapping,Matrix4:()=>B.Matrix4,Mesh:()=>B.Mesh,MeshBasicMaterial:()=>B.MeshBasicMaterial,NoToneMapping:()=>B.NoToneMapping,PerspectiveCamera:()=>B.PerspectiveCamera,PlaneGeometry:()=>B.PlaneGeometry,Points:()=>B.Points,REVISION:()=>B.REVISION,RGBAFormat:()=>B.RGBAFormat,Raycaster:()=>B.Raycaster,ReinhardToneMapping:()=>B.ReinhardToneMapping,Scene:()=>B.Scene,ShaderMaterial:()=>B.ShaderMaterial,Sprite:()=>B.Sprite,SpriteMaterial:()=>B.SpriteMaterial,UniformsUtils:()=>B.UniformsUtils,UnsignedByteType:()=>B.UnsignedByteType,Vector2:()=>B.Vector2,Vector3:()=>B.Vector3,WebGLMultisampleRenderTarget:()=>B.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>B.WebGLRenderTarget,WebGLRenderer:()=>B.WebGLRenderer,sRGBEncoding:()=>B.sRGBEncoding})},568:function(L,D,C){C.d(D,{Z:function(){return j}});function G(A,g,z,X,O,U,k){try{var c=A[U](k),Q=c.value}catch(te){z(te);return}c.done?g(Q):Promise.resolve(Q).then(X,O)}function j(A){return function(){var g=this,z=arguments;return new Promise(function(X,O){var U=A.apply(g,z);function k(Q){G(U,X,O,k,c,"next",Q)}function c(Q){G(U,X,O,k,c,"throw",Q)}k(void 0)})}}},924:function(L,D,C){C.d(D,{Z:function(){return G}});function G(j,A,g){return A in j?Object.defineProperty(j,A,{value:g,enumerable:!0,configurable:!0,writable:!0}):j[A]=g,j}},42:function(L,D,C){C.d(D,{Z:function(){return j}});var G=C(924);function j(A){for(var g=1;g<arguments.length;g++){var z=arguments[g]!=null?arguments[g]:{},X=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(z).filter(function(O){return Object.getOwnPropertyDescriptor(z,O).enumerable}))),X.forEach(function(O){(0,G.Z)(A,O,z[O])})}return A}}},Fe={};function V(L){var D=Fe[L];if(D!==void 0)return D.exports;var C=Fe[L]={exports:{}};return qt[L](C,C.exports,V),C.exports}(function(){V.n=function(L){var D=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(D,{a:D}),D}})(),function(){V.d=function(L,D){for(var C in D)V.o(D,C)&&!V.o(L,C)&&Object.defineProperty(L,C,{enumerable:!0,get:D[C]})}}(),function(){V.o=function(L,D){return Object.prototype.hasOwnProperty.call(L,D)}}();var _e={};(function(){V.d(_e,{L6:function(){return zt},sb:function(){return f},z:function(){return Ee},ZP:function(){return Ee}});function L(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,t,i){return t&&D(n.prototype,t),i&&D(n,i),n}var G=V(42);function j(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),i.push.apply(i,e)}return i}function A(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))}),n}function g(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=n[i];return e}function z(n){if(Array.isArray(n))return g(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(n,t){if(!!n){if(typeof n=="string")return g(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return g(n,t)}}function k(n){return z(n)||X(n)||U(n)||O()}var c=V(949),Q=V(187),te=n=>{var t={};return V.d(t,n),t},ae=n=>()=>n,re=te({default:()=>Gt.default}),Y=n=>{var t={};return V.d(t,n),t},oe=n=>()=>n,q=Y({default:()=>Ut.default}),W=n=>{var t={};return V.d(t,n),t},h=n=>()=>n,u=W({default:()=>Ft.default}),f=function(){"use strict";function n(i){L(this,n),this.guiParams={},i&&(this.guiParams=i)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),l=r.guiParams[a];Object.keys(l).forEach(function(s){var v=l[s],x=v.min,y=v.max,b=v.step,P=v.name,T=v.paramMap,F=v.items,I=v.value,H=v.target,le=s.toLowerCase().indexOf("color")>-1,Z,ce=typeof I=="undefined"&&H,he=ce?H():l[s],me=ce?s:"value";F?Z=o.add(he,me,F):le?Z=o.addColor(he,me):Z=o.add(he,me),Z=Z.name(P||s),typeof x!="undefined"&&(Z=Z.min(x)),typeof y!="undefined"&&(Z=Z.max(y)),typeof b!="undefined"&&(Z=Z.step(b)),Z=Z.onChange(function(){r.setTargetValue(a,s,he[me],T)}),ce&&Z.listen()})})},t.setTargetValue=function(e,r,a,o){var l=this.guiParams[e][r],s=l.onChange,v=l.target,x=l.value,y=r.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&v;if(v&&!b){var P=v();Array.isArray(P)||(P=[P]),P.forEach(function(T){if(!!T)if(y)try{T[o||r].set(a)}catch(F){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else T[o||r]=a})}s&&s(a)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(a){var o=e.guiParams[r][a];typeof o.value!="undefined"&&e.setTargetValue(r,a,o.value,o.paramMap)})})},n}(),m={None:c.NoToneMapping,Linear:c.LinearToneMapping,Reinhard:c.ReinhardToneMapping,Cineon:c.CineonToneMapping,ACESFilmic:c.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:c.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},w=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.width,r=i.height,a=i.rendererParams,o=a.context,l=a.alpha,s=a.devicePixelRatio,v=a.antialias,x=a.powerPreference,y=a.toneMapping,b=a.toneMappingExposure,P=a.outputEncoding,T=a.logarithmicDepthBuffer,F=a.preserveDrawingBuffer,I=new c.WebGLRenderer({context:o,alpha:l,antialias:v,powerPreference:x,logarithmicDepthBuffer:T,preserveDrawingBuffer:F});I.setSize(e,r),I.setPixelRatio(s),I.autoClear=!1,I.toneMapping=m[y],I.toneMappingExposure=b,I.outputEncoding=P,this.renderer=I}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,a=e.camera;this.renderer.render(r,a)},t.setGui=function(e){var r=this,a=new f({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:m,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});a.showGui(e)},t.dispose=function(){var e,r,a;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),E={fov:45,near:1,far:1e3},$=function(){"use strict";function n(i){L(this,n),this.oldCameraPosition=new c.Vector3,this.oldCameraRotation=new c.Euler,this.customCamera=!1,this.options=i;var e=i.width,r=i.height,a=i.cameraParams;if(a instanceof c.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,l=a.far,s=a.near,v=new c.PerspectiveCamera(o,e/r,s,l);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var t=n.prototype;return t.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},t.setSize=function(e,r){this.camera instanceof c.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,a=new f({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof c.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),N=V(521),K={background:null},ne=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.sceneParams,a=r.background,o=new c.Scene;a&&(o.background=a),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new c.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,N.wf)(r)})},n}(),de=n=>{var t={};return V.d(t,n),t},ye=n=>()=>n,p=de({MapControls:()=>Ge.MapControls,OrbitControls:()=>Ge.OrbitControls}),d={},_=function(){"use strict";function n(i){L(this,n),this.options=i;var e=i.camera,r=i.controlParams,a=i.mapControl,o=r.domElement,l=a?new p.MapControls(e,o):new p.OrbitControls(e,o);l.minPolarAngle=Math.PI*.15,l.maxPolarAngle=Math.PI*.85,l.enableDamping=!0,l.dampingFactor=.063,l.autoRotate=!1,l.autoRotateSpeed=-60,l.enableZoom=!0,l.zoomSpeed=.2,this.control=l}var t=n.prototype;return t.limitPan=function(e){var r=e.maxX,a=r===void 0?1/0:r,o=e.minX,l=o===void 0?-1/0:o,s=e.maxZ,v=s===void 0?1/0:s,x=e.minZ,y=x===void 0?-1/0:x,b=e.maxY,P=b===void 0?1/0:b,T=e.minY,F=T===void 0?-1/0:T,I=this.limitPanV||new c.Vector3,H=this.control,le=this.options.camera,Z=new c.Vector3(l,F,y),ce=new c.Vector3(a,P,v);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,ce),I.sub(H.target),le.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),M=n=>{var t={};return V.d(t,n),t},R=n=>()=>n,J=M({CSS3DObject:()=>Re.CSS3DObject,CSS3DRenderer:()=>Re.CSS3DRenderer,CSS3DSprite:()=>Re.CSS3DSprite}),ee=new c.Vector3,ie=new c.Matrix4,ue=new c.Matrix4,se=new c.Vector3,pe=new c.Vector3,ve=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,n);var i=function(T,F){return se.setFromMatrixPosition(T.matrixWorld),pe.setFromMatrixPosition(F.matrixWorld),se.distanceToSquared(pe)},e=function(T){var F=[];return T.traverse(function(I){I.isCSS2DObject&&F.push(I)}),F},r=function(T){for(var F=e(T).sort(function(ce,he){if(ce.renderOrder!==he.renderOrder)return he.renderOrder-ce.renderOrder;var me=x.objects.get(ce).distanceToCameraSquared,Bt=x.objects.get(he).distanceToCameraSquared;return me-Bt}),I=F.length,H=0,le=F.length;H<le;H++){var Z=F[H].userData.zIndexFix||0;F[H].element.style.zIndex=I-H+Z}},a=this,o,l,s,v,x={objects:new WeakMap},y=t.element!==void 0?t.element:document.createElement("div");y.style.overflow="hidden",this.domElement=y,this.getSize=function(){return{width:o,height:l}},this.render=function(P,T){+c.REVISION<144?(P.autoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.updateMatrixWorld()):(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),T.parent===null&&T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld()),ie.copy(T.matrixWorldInverse),ue.multiplyMatrices(T.projectionMatrix,ie),b(P,P,T),r(P)},this.setSize=function(P,T){o=P,l=T,s=o/2,v=l/2,y.style.width="".concat(P,"px"),y.style.height="".concat(T,"px")};function b(P,T,F){if(P.isCSS2DObject){ee.setFromMatrixPosition(P.matrixWorld),ee.applyMatrix4(ue);var I=P.visible===!0&&ee.z>=-1&&ee.z<=1&&P.layers.test(F.layers)===!0;if(P.element.style.display=I===!0?"":"none",I===!0){P.onBeforeRender(a,T,F);var H=P.element;H.style.transform="translate(-50%,-50%) translate(".concat(ee.x*s+s,"px,").concat(-ee.y*v+v,"px)"),H.parentNode!==y&&y.appendChild(H),P.onAfterRender(a,T,F)}var le={distanceToCameraSquared:i(F,P)};x.objects.set(P,le)}for(var Z=0,ce=P.children.length;Z<ce;Z++)b(P.children[Z],T,F)}},fe={zIndex:"auto"},Ve=function(){"use strict";function n(i){L(this,n),this.container=i}var t=n.prototype;return t.addRenderer=function(e,r){var a=this.container,o=a.offsetWidth,l=a.offsetHeight,s=e==="css2d"?new ve:new J.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,l),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Ne=n=>{var t={};return V.d(t,n),t},ar=n=>()=>n,Oe=Ne({EffectComposer:()=>Vt.EffectComposer}),We=n=>{var t={};return V.d(t,n),t},ir=n=>()=>n,ke=We({RenderPass:()=>Nt.RenderPass}),Ie=n=>{var t={};return V.d(t,n),t},sr=n=>()=>n,be=Ie({ShaderPass:()=>Wt.ShaderPass}),He=n=>{var t={};return V.d(t,n),t},or=n=>()=>n,Se=He({CopyShader:()=>kt.CopyShader}),Xe=n=>{var t={};return V.d(t,n),t},ur=n=>()=>n,Ke=Xe({GammaCorrectionShader:()=>It.GammaCorrectionShader}),Ze=n=>{var t={};return V.d(t,n),t},lr=n=>()=>n,Qe=Ze({SMAAPass:()=>Ht.SMAAPass}),Ye=n=>{var t={};return V.d(t,n),t},cr=n=>()=>n,$e=Ye({SSAARenderPass:()=>Xt.SSAARenderPass}),Je=n=>{var t={};return V.d(t,n),t},fr=n=>()=>n,qe=Je({FXAAShader:()=>Kt.FXAAShader}),et=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},dr=0,tt=1,ge=!1,Me=et()!==!1,rt=`varying vec2 vUv;
2
2
 
3
3
  void main() {
4
4
 
@@ -6,7 +6,7 @@ void main() {
6
6
 
7
7
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
8
8
 
9
- }`,ut=`uniform sampler2D baseTexture;
9
+ }`,nt=`uniform sampler2D baseTexture;
10
10
  uniform sampler2D bloomTexture;
11
11
 
12
12
  varying vec2 vUv;
@@ -15,7 +15,7 @@ void main() {
15
15
 
16
16
  gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
17
17
 
18
- }`;function Ce(a,n){return Ce=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Ce(a,n)}function Le(a,n){return Ce(a,n)}function lt(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Le(a,n)}function ct(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function we(a){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},we(a)}function je(a){return we(a)}function ft(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function dt(a){return a&&a.constructor===Symbol?"symbol":typeof a}function ht(a,n){return n&&(dt(n)==="object"||typeof n=="function")?n:ft(a)}function vt(a){var n=ct();return function(){var e=je(a),r;if(n){var t=je(this).constructor;r=Reflect.construct(e,arguments,t)}else r=e.apply(this,arguments);return ht(this,r)}}var pt=a=>{var n={};return V.d(n,a),n},br=a=>()=>a,De=pt({FullScreenQuad:()=>ke.FullScreenQuad,Pass:()=>ke.Pass}),mt=a=>{var n={};return V.d(n,a),n},Pr=a=>()=>a,ze=mt({LuminosityHighPassShader:()=>er.LuminosityHighPassShader}),Ee=function(a){"use strict";lt(i,a);var n=vt(i);function i(r,t,s,l){L(this,i);var o;o=n.call(this),o.strength=t!==void 0?t:1,o.radius=s,o.threshold=l,o.resolution=r!==void 0?new c.Vector2(r.x,r.y):new c.Vector2(256,256),o.clearColor=new c.Color(0,0,0);var v={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat};o.renderTargetsHorizontal=[],o.renderTargetsVertical=[],o.nMips=5;var w=Math.round(o.resolution.x/2),y=Math.round(o.resolution.y/2);o.renderTargetBright=new c.WebGLRenderTarget(w,y,v),o.renderTargetBright.texture.name="UnrealBloomPass.bright",o.renderTargetBright.texture.generateMipmaps=!1;for(var P=0;P<o.nMips;P++){var S=new c.WebGLRenderTarget(w,y,v);S.texture.name="UnrealBloomPass.h".concat(P),S.texture.generateMipmaps=!1,o.renderTargetsHorizontal.push(S);var A=new c.WebGLRenderTarget(w,y,v);A.texture.name="UnrealBloomPass.v".concat(P),A.texture.generateMipmaps=!1,o.renderTargetsVertical.push(A),w=Math.round(w/2),y=Math.round(y/2)}ze.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var W=ze.LuminosityHighPassShader;o.highPassUniforms=c.UniformsUtils.clone(W.uniforms),o.highPassUniforms.luminosityThreshold.value=l,o.highPassUniforms.smoothWidth.value=.01,o.materialHighPassFilter=new c.ShaderMaterial({uniforms:o.highPassUniforms,vertexShader:W.vertexShader,fragmentShader:W.fragmentShader,defines:{}}),o.separableBlurMaterials=[];var k=[3,5,7,9,11];w=Math.round(o.resolution.x/2),y=Math.round(o.resolution.y/2);for(var K=0;K<o.nMips;K++)o.separableBlurMaterials.push(o.getSeperableBlurMaterial(k[K])),o.separableBlurMaterials[K].uniforms.texSize.value=new c.Vector2(w,y),w=Math.round(w/2),y=Math.round(y/2);o.compositeMaterial=o.getCompositeMaterial(o.nMips),o.compositeMaterial.uniforms.blurTexture1.value=o.renderTargetsVertical[0].texture,o.compositeMaterial.uniforms.blurTexture2.value=o.renderTargetsVertical[1].texture,o.compositeMaterial.uniforms.blurTexture3.value=o.renderTargetsVertical[2].texture,o.compositeMaterial.uniforms.blurTexture4.value=o.renderTargetsVertical[3].texture,o.compositeMaterial.uniforms.blurTexture5.value=o.renderTargetsVertical[4].texture,o.compositeMaterial.uniforms.bloomStrength.value=t,o.compositeMaterial.uniforms.bloomRadius.value=.1,o.compositeMaterial.needsUpdate=!0;var ce=[1,.8,.6,.4,.2];o.compositeMaterial.uniforms.bloomFactors.value=ce,o.bloomTintColors=[new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1)],o.compositeMaterial.uniforms.bloomTintColors.value=o.bloomTintColors,xe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var X=xe.CopyShader;return o.copyUniforms=c.UniformsUtils.clone(X.uniforms),o.copyUniforms.opacity.value=1,o.materialCopy=new c.ShaderMaterial({uniforms:o.copyUniforms,vertexShader:X.vertexShader,fragmentShader:X.fragmentShader,blending:c.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),o.enabled=!0,o.needsSwap=!1,o._oldClearColor=new c.Color,o.oldClearAlpha=1,o.basic=new c.MeshBasicMaterial,o.fsQuad=new De.FullScreenQuad(void 0),o}var e=i.prototype;return e.dispose=function(){for(var t=0;t<this.renderTargetsHorizontal.length;t++)this.renderTargetsHorizontal[t].dispose();for(var s=0;s<this.renderTargetsVertical.length;s++)this.renderTargetsVertical[s].dispose();this.renderTargetBright.dispose()},e.setSize=function(t,s){var l=Math.round(t/2),o=Math.round(s/2);this.renderTargetBright.setSize(l,o);for(var v=0;v<this.nMips;v++)this.renderTargetsHorizontal[v].setSize(l,o),this.renderTargetsVertical[v].setSize(l,o),this.separableBlurMaterials[v].uniforms.texSize.value=new c.Vector2(l,o),l=Math.round(l/2),o=Math.round(o/2)},e.render=function(t,s,l,o,v){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();var w=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),v&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=l.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=l.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);for(var y=this.renderTargetBright,P=0;P<this.nMips;P++)this.fsQuad.material=this.separableBlurMaterials[P],this.separableBlurMaterials[P].uniforms.colorTexture.value=y.texture,this.separableBlurMaterials[P].uniforms.direction.value=i.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[P]),t.clear(),this.fsQuad.render(t),this.separableBlurMaterials[P].uniforms.colorTexture.value=this.renderTargetsHorizontal[P].texture,this.separableBlurMaterials[P].uniforms.direction.value=i.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[P]),t.clear(),this.fsQuad.render(t),y=this.renderTargetsVertical[P];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,v&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(l),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=w},e.getSeperableBlurMaterial=function(t){return new c.ShaderMaterial({defines:{KERNEL_RADIUS:t,SIGMA:t},uniforms:{colorTexture:{value:null},texSize:{value:new c.Vector2(.5,.5)},direction:{value:new c.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
18
+ }`;function xe(n,t){return xe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},xe(n,t)}function Te(n,t){return xe(n,t)}function at(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&Te(n,t)}function it(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function Ce(n){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},Ce(n)}function Ae(n){return Ce(n)}function st(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ot(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ut(n,t){return t&&(ot(t)==="object"||typeof t=="function")?t:st(n)}function lt(n){var t=it();return function(){var e=Ae(n),r;if(t){var a=Ae(this).constructor;r=Reflect.construct(e,arguments,a)}else r=e.apply(this,arguments);return ut(this,r)}}var ct=n=>{var t={};return V.d(t,n),t},hr=n=>()=>n,Le=ct({FullScreenQuad:()=>Ue.FullScreenQuad,Pass:()=>Ue.Pass}),ft=n=>{var t={};return V.d(t,n),t},vr=n=>()=>n,je=ft({LuminosityHighPassShader:()=>Zt.LuminosityHighPassShader}),we=function(n){"use strict";at(i,n);var t=lt(i);function i(r,a,o,l){L(this,i);var s;s=t.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=l,s.resolution=r!==void 0?new c.Vector2(r.x,r.y):new c.Vector2(256,256),s.clearColor=new c.Color(0,0,0);var v={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var x=Math.round(s.resolution.x/2),y=Math.round(s.resolution.y/2);s.renderTargetBright=new c.WebGLRenderTarget(x,y,v),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var P=new c.WebGLRenderTarget(x,y,v);P.texture.name="UnrealBloomPass.h".concat(b),P.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(P);var T=new c.WebGLRenderTarget(x,y,v);T.texture.name="UnrealBloomPass.v".concat(b),T.texture.generateMipmaps=!1,s.renderTargetsVertical.push(T),x=Math.round(x/2),y=Math.round(y/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var F=je.LuminosityHighPassShader;s.highPassUniforms=c.UniformsUtils.clone(F.uniforms),s.highPassUniforms.luminosityThreshold.value=l,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new c.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:F.vertexShader,fragmentShader:F.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var I=[3,5,7,9,11];x=Math.round(s.resolution.x/2),y=Math.round(s.resolution.y/2);for(var H=0;H<s.nMips;H++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(I[H])),s.separableBlurMaterials[H].uniforms.texSize.value=new c.Vector2(x,y),x=Math.round(x/2),y=Math.round(y/2);s.compositeMaterial=s.getCompositeMaterial(s.nMips),s.compositeMaterial.uniforms.blurTexture1.value=s.renderTargetsVertical[0].texture,s.compositeMaterial.uniforms.blurTexture2.value=s.renderTargetsVertical[1].texture,s.compositeMaterial.uniforms.blurTexture3.value=s.renderTargetsVertical[2].texture,s.compositeMaterial.uniforms.blurTexture4.value=s.renderTargetsVertical[3].texture,s.compositeMaterial.uniforms.blurTexture5.value=s.renderTargetsVertical[4].texture,s.compositeMaterial.uniforms.bloomStrength.value=a,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var le=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=le,s.bloomTintColors=[new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,Se.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var Z=Se.CopyShader;return s.copyUniforms=c.UniformsUtils.clone(Z.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new c.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:Z.vertexShader,fragmentShader:Z.fragmentShader,blending:c.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new c.Color,s.oldClearAlpha=1,s.basic=new c.MeshBasicMaterial,s.fsQuad=new Le.FullScreenQuad(void 0),s}var e=i.prototype;return e.dispose=function(){for(var a=0;a<this.renderTargetsHorizontal.length;a++)this.renderTargetsHorizontal[a].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(a,o){var l=Math.round(a/2),s=Math.round(o/2);this.renderTargetBright.setSize(l,s);for(var v=0;v<this.nMips;v++)this.renderTargetsHorizontal[v].setSize(l,s),this.renderTargetsVertical[v].setSize(l,s),this.separableBlurMaterials[v].uniforms.texSize.value=new c.Vector2(l,s),l=Math.round(l/2),s=Math.round(s/2)},e.render=function(a,o,l,s,v){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var x=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),v&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=l.texture,a.setRenderTarget(null),a.clear(),this.fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=l.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,a.setRenderTarget(this.renderTargetBright),a.clear(),this.fsQuad.render(a);for(var y=this.renderTargetBright,b=0;b<this.nMips;b++)this.fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=y.texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionX,a.setRenderTarget(this.renderTargetsHorizontal[b]),a.clear(),this.fsQuad.render(a),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionY,a.setRenderTarget(this.renderTargetsVertical[b]),a.clear(),this.fsQuad.render(a),y=this.renderTargetsVertical[b];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,a.setRenderTarget(this.renderTargetsHorizontal[0]),a.clear(),this.fsQuad.render(a),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,v&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?(a.setRenderTarget(null),this.fsQuad.render(a)):(a.setRenderTarget(l),this.fsQuad.render(a)),a.setClearColor(this._oldClearColor,this.oldClearAlpha),a.autoClear=x},e.getSeperableBlurMaterial=function(a){return new c.ShaderMaterial({defines:{KERNEL_RADIUS:a,SIGMA:a},uniforms:{colorTexture:{value:null},texSize:{value:new c.Vector2(.5,.5)},direction:{value:new c.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
19
19
  void main() {
20
20
  vUv = uv;
21
21
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -29,7 +29,7 @@ void main() {
29
29
  }
30
30
  void main() {
31
31
  vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
32
- }`})},e.getCompositeMaterial=function(t){return new c.ShaderMaterial({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
32
+ }`})},e.getCompositeMaterial=function(a){return new c.ShaderMaterial({defines:{NUM_MIPS:a},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
33
33
  void main() {
34
34
  vUv = uv;
35
35
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -54,4 +54,4 @@ void main() {
54
54
  lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
55
  lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
56
  lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
- }`})},i}(De.Pass);Ee.BlurDirectionX=new c.Vector2(1,0),Ee.BlurDirectionY=new c.Vector2(0,1);var gt={threshold:.2,strength:.5,radius:0},_t=new c.MeshBasicMaterial({color:"black"}),bt=new c.SpriteMaterial({color:"#000"}),Pt=function(){"use strict";function a(i,e){L(this,a),this.materials={},this.bloomLayer=new c.Layers,this.active=!0,this.composerController=i,this.options=e;var r=i.renderer,t=i.renderPass,s=i.finalComposer,l=i.getSize(),o=l.width,v=l.height,w=new Ee(new c.Vector2(o,v),e.strength,e.radius,e.threshold);this.bloomPass=w;var y=new Te.EffectComposer(r);y.renderToScreen=!1,y.addPass(t),y.addPass(this.bloomPass),this.bloomComposer=y,this.bloomLayer.set(st);var P=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:y.renderTarget2.texture}},vertexShader:ot,fragmentShader:ut,defines:{}}),S=new be.ShaderPass(P,"baseTexture");S.needsSwap=!0,this.finalPass=S,s.addPass(S)}var n=a.prototype;return n.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},n.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},n.render=function(e){if(!!this.active){var r=this,t=r.bloomComposer,s=r.bloomLayer,l=r.materials;e.traverse(function(o){var v=o;v.material&&s.test(v.layers)===!1&&(l[v.uuid]=v.material,v.material=v.isSprite?bt:_t)}),t.render(),e.traverse(function(o){var v=o;l[v.uuid]&&(v.material=l[v.uuid],delete l[v.uuid])})}},n.setSize=function(e,r){this.bloomComposer.setSize(e,r)},n.setGui=function(e){var r=this,t=new d({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});t.showGui(e)},n.dispose=function(){this.bloomPass.dispose(),this.materials={}},a}(),yt=a=>{var n={};return V.d(n,a),n},yr=a=>()=>a,St=yt({OutlinePass:()=>tr.OutlinePass}),xt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ct=function(){"use strict";function a(i,e){L(this,a),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,t=i.camera,s=i.finalComposer,l=i.getSize(),o=l.width,v=l.height,w=new St.OutlinePass(new c.Vector2(o,v),r,t);w.selectedObjects=this.selectedObjects,this.outlinePass=w,s.addPass(w),this.setGui()}var n=a.prototype;return n.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},n.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},n.setGui=function(){var e=this,r=new d({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});r.setTargetValueByParams(),this.outlineGui=r},n.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},a}();function wt(a,n){if(a==null)return{};var i={},e=Object.keys(a),r,t;for(t=0;t<e.length;t++)r=e[t],!(n.indexOf(r)>=0)&&(i[r]=a[r]);return i}function Et(a,n){if(a==null)return{};var i=wt(a,n),e,r;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);for(r=0;r<t.length;r++)e=t[r],!(n.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(a,e)||(i[e]=a[e]))}return i}var Rt=a=>{var n={};return V.d(n,a),n},Sr=a=>()=>a,Ot=Rt({SSRPass:()=>rr.SSRPass}),Mt=a=>{var n={};return V.d(n,a),n},xr=a=>()=>a,Tt=Mt({ReflectorForSSRPass:()=>nr.ReflectorForSSRPass}),At={maxDistance:10,selects:!0},Lt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},jt=function(){"use strict";function a(i,e){L(this,a),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,t=i.camera,s=i.renderer,l=i.finalComposer,o=i.getSize(),v=o.width,w=o.height,y=new Ot.SSRPass({renderer:s,scene:r,camera:t,width:v,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=y,l.addPass(y),this.setGui()}var n=a.prototype;return n.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,B.Z)({},Lt,e),t=r.width,s=r.height,l=Et(r,["width","height"]),o=this.composerController,v=o.scene,w=o.getSize(),y=new c.PlaneGeometry(t,s),P=new Tt.ReflectorForSSRPass(y,T((0,B.Z)({},l),{textureWidth:w.width,textureHeight:w.height}));P.material.depthWrite=!1,P.rotation.x=-Math.PI/2,P.visible=!1,v.add(P),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=P},n.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},n.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},n.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},n.setSize=function(e,r){var t=this.groundReflector;t&&(t.getRenderTarget().setSize(e,r),t.resolution.set(e,r))},n.setGui=function(){var e=this,r=new d({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(s){s?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});r.setTargetValueByParams(),this.ssrGui=r},n.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},a}(),Dt=function(){"use strict";function a(i){L(this,a),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,t=i.camera,s=this.createRenderTarget(),l=new Te.EffectComposer(e,s);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=s,this.camera=t}var n=a.prototype;return n.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,t=e.type,s=e.encoding,l=this.getSize(),o={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,encoding:s,type:t},v;if(+c.REVISION<138&&r>0){var w=new c.WebGLMultisampleRenderTarget(l.width,l.height,o);w.samples=r,v=w}else if(+c.REVISION>=138&&r>0){var y=new c.WebGLRenderTarget(l.width,l.height,T((0,B.Z)({},o),{samples:r}));v=y}else{var P=new c.WebGLRenderTarget(l.width,l.height,o);v=P}return v.texture.name="EffectComposer.rt1",v},n.addRenderPasss=function(){var e=this.options,r=e.scene,t=e.camera,s=new Ze.RenderPass(r,t);this.finalComposer.addPass(s),this.renderPass=s},n.addCopyPass=function(){var e=new be.ShaderPass(xe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},n.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Je.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},n.addFXAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,s=new be.ShaderPass(at.FXAAShader);this.finalComposer.addPass(s),this.fxaaPass=s,this.setFXAAPassSize(r,t)},n.addSMAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,s=this.options.renderer,l=new et.SMAAPass(r*s.getPixelRatio(),t*s.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},n.addSSAAPass=function(){var e=this.options,r=e.scene,t=e.camera,s=new rt.SSAARenderPass(r,t,0,0);s.unbiased=!0,s.sampleLevel=1,this.finalComposer.addPass(s),this.ssaaPass=s},n.addBloomPass=function(e){var r=new Pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},n.addOutlinePass=function(e){var r=new Ct(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},n.addSSRPass=function(e){var r=new jt(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},n.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},n.enable=function(){this.active||(this.active=!0)},n.disable=function(){!this.active||(this.active=!1)},n.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(t){return t!==e.renderPass&&t!==e.copyPass?t.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},n.setSize=function(e,r){var t,s;this.finalComposer.setSize(e,r),(t=this.bloomController)===null||t===void 0||t.setSize(e,r),(s=this.ssrController)===null||s===void 0||s.setSize(e,r),this.setFXAAPassSize(e,r)},n.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var t=this.options.renderer,s=t.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*s),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*s)}},n.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},n.dispose=function(){var e,r,t;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(t=this.ssrController)===null||t===void 0||t.dispose(),this.finalComposer.passes.forEach(function(s){var l,o,v;(l=s.fsQuad)===null||l===void 0||l.dispose(),(o=s.fsQuad)===null||o===void 0||(v=o.material)===null||v===void 0||v.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},a}(),Re=function(){"use strict";function a(i){L(this,a),this.raycaster=new c.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new c.Clock,this.options=(0,re.default)(a.options,i,{isMergeableObject:ae.PO});var e=this.options,r=e.container,t=e.stats,s=e.gui;if(s){var l=new u.default;l.open(!1),this.gui=l}if(t){var o=new ne.default;o.showPanel(0),o.dom.style.position="absolute",r.appendChild(o.dom),this.stats=o}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var n=a.prototype;return n.use=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),s=1;s<r;s++)t[s-1]=arguments[s];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var l;(l=e).install.apply(l,[this].concat(O(t))),this.installPlugins.set(e,!0)}},n.init=function(){var e=this,r=this.options,t=r.container,s=r.isdev,l=r.axesHelper,o=r.renderer,v=r.scene,w=r.camera,y=this.getSize(),P=y.width,S=y.height,A=new I({isdev:s,width:P,height:S,cameraParams:w});this.gui&&A.setGui(this.gui);var W=A.camera,k=new G({camera:W,sceneParams:v}),K=k.scene,ce=new E({width:P,height:S,scene:K,camera:W,isdev:s,rendererParams:T((0,B.Z)({},o),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&ce.setGui(this.gui);var X=ce.renderer;l&&k.addAxesHelper(),this.sceneController=k,this.rendererController=ce,this.cameraController=A,t.appendChild(X.domElement);var le=new ResizeObserver(function(he){var ve=!0,ye=!1,Ue=void 0;try{for(var Oe=he[Symbol.iterator](),Fe;!(ve=(Fe=Oe.next()).done);ve=!0){var Nt=Fe.value,Ve=Nt.contentRect;e.handeleResize(Ve.width,Ve.height)}}catch(Wt){ye=!0,Ue=Wt}finally{try{!ve&&Oe.return!=null&&Oe.return()}finally{if(ye)throw Ue}}});le.observe(t),this.resizeObserver=le},n.initComposer=function(){var e=this.options,r=e.bloom,t=e.outline,s=e.ssr,l=e.renderer,o=e.bloomParams,v=e.outlineParams,w=e.ssrParams,y=e.multisampling,P=l.antialias;P==="msaa"&&!Ae&&(P=!1,console.warn("MSAA is not supported on this browser"));var S=new Dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:P==="msaa"?y:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=S,P==="ssaa"&&S.addSSAAPass(),s&&S.addSSRPass(w),r&&S.addBloomPass(o),t&&S.addOutlinePass(v),l.outputEncoding===c.sRGBEncoding&&S.addGammaCorrectionPass(),P==="fxaa"?S.addFXAAPass():P==="smaa"&&S.addSMAAPass(),S.checkCopyPass(),this.event.on("passcheck",function(){S.checkCopyPass()})},n.initCSSRenderer=function(){var e=this.options,r=e.container,t=e.css2DRenderer,s=e.css3DRenderer,l=e.css2DRendererParams,o=e.css3DRendererParams;if(t||s){var v=new He(r);t&&v.addRenderer("css2d",l),s&&v.addRenderer("css3d",o),this.cssRendererController=v}},n.initControl=function(){var e=this.options,r=e.control,t=e.mapControl,s=e.controlParams;if(r){var l=new _({camera:this.camera,controlParams:{domElement:(s==null?void 0:s.domElement)||this.renderer.domElement},mapControl:t});this.controlController=l}},n.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},n.handeleResize=function(e,r){var t=this,s=t.rendererController,l=t.cameraController,o=t.composerController,v=t.cssRendererController;l==null||l.setSize(e,r),s==null||s.setSize(e,r),o==null||o.setSize(e,r),v==null||v.setSize(e,r),this.installPlugins.forEach(function(w,y){var P;(P=y.resize)===null||P===void 0||P.call(y,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},n.pick=function(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=this,l=s.raycaster,o=s.options,v=o.container,w=new c.Vector2,y=v.getBoundingClientRect();if(w.x=(e.clientX-y.left)/(y.right-y.left)*2-1,w.y=-((e.clientY-y.top)/(y.bottom-y.top))*2+1,this.camera&&this.scene){l.setFromCamera(w,this.camera);var P=l.intersectObjects(r||this.scene.children,t);if(P.length)return{object:P[0].object,intersects:P}}},n.render=function(){var e,r,t,s,l=this,o=l.renderer,v=l.scene,w=l.camera,y=l.clock;if(!(!o||!v||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var P=y.getDelta(),S=y.getElapsedTime();if(o.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(W,k){var K;(K=k.update)===null||K===void 0||K.call(k,P,S)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(t=this.cssRendererController)===null||t===void 0||t.render(v,w),(s=this.stats)===null||s===void 0||s.update(),this.event.emit("render",{delta:P,elapsed:S})}},n.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},n.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},n.dispose=function(){var e,r,t,s,l,o,v;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,y){var P;(P=y.dispose)===null||P===void 0||P.call(y)}),(r=this.controlController)===null||r===void 0||r.dispose(),(t=this.cssRendererController)===null||t===void 0||t.dispose(),(s=this.sceneController)===null||s===void 0||s.dispose(),(l=this.composerController)===null||l===void 0||l.dispose(),(o=this.rendererController)===null||o===void 0||o.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(v=this.gui)===null||v===void 0||v.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(a,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),a}();Re.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:T((0,B.Z)({},b),{antialias:Ae?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:fe,camera:C,bloom:!1,bloomParams:gt,outline:!1,outlineParams:xt,css2DRenderer:!1,ssr:!1,ssrParams:At,css2DRendererParams:(0,B.Z)({},de),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},de)};function zt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(a){return!1}}function Pe(a,n,i){return zt()?Pe=Reflect.construct:Pe=function(r,t,s){var l=[null];l.push.apply(l,t);var o=Function.bind.apply(r,l),v=new o;return s&&Le(v,s.prototype),v},Pe.apply(null,arguments)}function Be(a,n,i){return Pe.apply(null,arguments)}var Bt=V(485);function Gt(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),a&&(i.promise=(0,Bt.Z)(i.promise,n)),i}var Ut=a=>{var n={};return V.d(n,a),n},Cr=a=>()=>a,Ft=Ut({CSS2DObject:()=>ar.CSS2DObject}),Ge=function(a){a&&((0,ae.wf)(a),a.children.forEach(function(n){n.userData.BaseObject_||Ge(n)}))},Vt=function(){"use strict";function a(){L(this,a),this.objecttype__="BaseObject",this.userData={},this.pm=Gt(),this.visible=!1}var n=a.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,r){},n.resize=function(e,r){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return this.object3d=Be(c.Mesh,O(r)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return this.object3d=Be(c.Points,O(r)),this},n.createCSS2DObject=function(e){return this.object3d=new Ft.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new c.Sprite(e),this},n.add=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var s;return(s=this.object3d).add.apply(s,O(r)),this},n.remove=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var s;return(s=this.object3d).remove.apply(s,O(r)),this},n.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},n.dispose=function(){Ge(this.object3d)},x(a,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),a}()})();var sr=_e.L6,or=_e.sb,ur=_e.z,lr=_e.ZP;export{sr as BaseObject,or as GUIObject,ur as Pencil,lr as default};
57
+ }`})},i}(Le.Pass);we.BlurDirectionX=new c.Vector2(1,0),we.BlurDirectionY=new c.Vector2(0,1);var dt={threshold:.2,strength:.5,radius:0},ht=new c.MeshBasicMaterial({color:"black"}),vt=new c.SpriteMaterial({color:"#000"}),pt=function(){"use strict";function n(i,e){L(this,n),this.materials={},this.bloomLayer=new c.Layers,this.active=!0,this.composerController=i,this.options=e;var r=i.renderer,a=i.renderPass,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,x=new we(new c.Vector2(s,v),e.strength,e.radius,e.threshold);this.bloomPass=x;var y=new Oe.EffectComposer(r);y.renderToScreen=!1,y.addPass(a),y.addPass(this.bloomPass),this.bloomComposer=y,this.bloomLayer.set(tt);var b=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:y.renderTarget2.texture}},vertexShader:rt,fragmentShader:nt,defines:{}}),P=new be.ShaderPass(b,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,a=r.bloomComposer,o=r.bloomLayer,l=r.materials;e.traverse(function(s){var v=s;v.material&&o.test(v.layers)===!1&&(l[v.uuid]=v.material,v.material=v.isSprite?vt:ht)}),a.render(),e.traverse(function(s){var v=s;l[v.uuid]&&(v.material=l[v.uuid],delete l[v.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,a=new f({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});a.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),mt=n=>{var t={};return V.d(t,n),t},pr=n=>()=>n,gt=mt({OutlinePass:()=>Qt.OutlinePass}),_t={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},bt=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.finalComposer,l=i.getSize(),s=l.width,v=l.height,x=new gt.OutlinePass(new c.Vector2(s,v),r,a);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=new f({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});r.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function Pt(n,t){if(n==null)return{};var i={},e=Object.keys(n),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(i[r]=n[r]);return i}function yt(n,t){if(n==null)return{};var i=Pt(n,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var St=n=>{var t={};return V.d(t,n),t},mr=n=>()=>n,xt=St({SSRPass:()=>Yt.SSRPass}),Ct=n=>{var t={};return V.d(t,n),t},gr=n=>()=>n,wt=Ct({ReflectorForSSRPass:()=>$t.ReflectorForSSRPass}),Et={maxDistance:10,selects:!0},Rt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Ot=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.renderer,l=i.finalComposer,s=i.getSize(),v=s.width,x=s.height,y=new xt.SSRPass({renderer:o,scene:r,camera:a,width:v,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=y,l.addPass(y),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Rt,e),a=r.width,o=r.height,l=yt(r,["width","height"]),s=this.composerController,v=s.scene,x=s.getSize(),y=new c.PlaneGeometry(a,o),b=new wt.ReflectorForSSRPass(y,A((0,G.Z)({},l),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,v.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,r),a.resolution.set(e,r))},t.setGui=function(){var e=this,r=new f({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(a){a?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});r.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Mt=function(){"use strict";function n(i){L(this,n),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,a=i.camera,o=this.createRenderTarget(),l=new Oe.EffectComposer(e,o);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=a}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,a=e.type,o=e.encoding,l=this.getSize(),s={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,encoding:o,type:a},v;if(+c.REVISION<138&&r>0){var x=new c.WebGLMultisampleRenderTarget(l.width,l.height,s);x.samples=r,v=x}else if(+c.REVISION>=138&&r>0){var y=new c.WebGLRenderTarget(l.width,l.height,A((0,G.Z)({},s),{samples:r}));v=y}else{var b=new c.WebGLRenderTarget(l.width,l.height,s);v=b}return v.texture.name="EffectComposer.rt1",v},t.addRenderPasss=function(){var e=this.options,r=e.scene,a=e.camera,o=new ke.RenderPass(r,a);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new be.ShaderPass(Se.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=new be.ShaderPass(qe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,a)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=this.options.renderer,l=new Qe.SMAAPass(r*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},t.addSSAAPass=function(){var e=this.options,r=e.scene,a=e.camera,o=new $e.SSAARenderPass(r,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new bt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Ot(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var a,o;this.finalComposer.setSize(e,r),(a=this.bloomController)===null||a===void 0||a.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*o)}},t.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},t.dispose=function(){var e,r,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var l,s,v;(l=o.fsQuad)===null||l===void 0||l.dispose(),(s=o.fsQuad)===null||s===void 0||(v=s.material)===null||v===void 0||v.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Ee=function(){"use strict";function n(i){L(this,n),this.raycaster=new c.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new c.Clock,this.options=(0,re.default)(n.options,i,{isMergeableObject:N.PO});var e=this.options,r=e.container,a=e.stats,o=e.gui;if(o){var l=new u.default;l.open(!1),this.gui=l}if(a){var s=new q.default;s.showPanel(0),s.dom.style.position="absolute",r.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var l;(l=e).install.apply(l,[this].concat(k(a))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this.options,r=e.container,a=e.isdev,o=e.axesHelper,l=e.renderer,s=e.scene,v=e.camera,x=this.getSize(),y=x.width,b=x.height,P=new $({isdev:a,width:y,height:b,cameraParams:v});this.gui&&P.setGui(this.gui);var T=P.camera,F=new ne({camera:T,sceneParams:s}),I=F.scene,H=new w({width:y,height:b,scene:I,camera:T,isdev:a,rendererParams:A((0,G.Z)({},l),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var le=H.renderer;o&&F.addAxesHelper(),this.sceneController=F,this.rendererController=H,this.cameraController=P,r.appendChild(le.domElement)},t.initComposer=function(){var e=this.options,r=e.bloom,a=e.outline,o=e.ssr,l=e.renderer,s=e.bloomParams,v=e.outlineParams,x=e.ssrParams,y=e.multisampling,b=l.antialias;b==="msaa"&&!Me&&(b=!1,console.warn("MSAA is not supported on this browser"));var P=new Mt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?y:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=P,b==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(x),r&&P.addBloomPass(s),a&&P.addOutlinePass(v),l.outputEncoding===c.sRGBEncoding&&P.addGammaCorrectionPass(),b==="fxaa"?P.addFXAAPass():b==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,a=e.css2DRenderer,o=e.css3DRenderer,l=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var v=new Ve(r);a&&v.addRenderer("css2d",l),o&&v.addRenderer("css3d",s),this.cssRendererController=v}},t.initControl=function(){var e=this.options,r=e.control,a=e.mapControl,o=e.controlParams;if(r){var l=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=l}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var a=new ResizeObserver(function(o){var l=!0,s=!1,v=void 0;try{for(var x=o[Symbol.iterator](),y;!(l=(y=x.next()).done);l=!0){var b=y.value,P=b.contentRect;e.handeleResize(P.width,P.height)}}catch(T){s=!0,v=T}finally{try{!l&&x.return!=null&&x.return()}finally{if(s)throw v}}});a.observe(r),this.resizeObserver=a}},t.handeleResize=function(e,r){var a=this,o=a.rendererController,l=a.cameraController,s=a.composerController,v=a.cssRendererController;l==null||l.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),v==null||v.setSize(e,r),this.installPlugins.forEach(function(x,y){var b;(b=y.resize)===null||b===void 0||b.call(y,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,l=o.raycaster,s=o.options,v=s.container,x=new c.Vector2,y=v.getBoundingClientRect();if(x.x=(e.clientX-y.left)/(y.right-y.left)*2-1,x.y=-((e.clientY-y.top)/(y.bottom-y.top))*2+1,this.camera&&this.scene){l.setFromCamera(x,this.camera);var b=l.intersectObjects(r||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,a,o,l=this,s=l.renderer,v=l.scene,x=l.camera,y=l.clock;if(!(!s||!v||!x||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=y.getDelta(),P=y.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(F,I){var H;(H=I.update)===null||H===void 0||H.call(I,b,P)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var T;(T=this.rendererController)===null||T===void 0||T.render()}(a=this.cssRendererController)===null||a===void 0||a.render(v,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:P})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,a,o,l,s,v;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(x,y){var b;(b=y.dispose)===null||b===void 0||b.call(y)}),(r=this.controlController)===null||r===void 0||r.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(l=this.composerController)===null||l===void 0||l.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(v=this.gui)===null||v===void 0||v.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Ee.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:A((0,G.Z)({},S),{antialias:Me?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:K,camera:E,bloom:!1,bloomParams:dt,outline:!1,outlineParams:_t,css2DRenderer:!1,ssr:!1,ssrParams:Et,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Tt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function Pe(n,t,i){return Tt()?Pe=Reflect.construct:Pe=function(r,a,o){var l=[null];l.push.apply(l,a);var s=Function.bind.apply(r,l),v=new s;return o&&Te(v,o.prototype),v},Pe.apply(null,arguments)}function De(n,t,i){return Pe.apply(null,arguments)}var At=V(484);function Lt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),n&&(i.promise=(0,At.Z)(i.promise,t)),i}var jt=n=>{var t={};return V.d(t,n),t},_r=n=>()=>n,Dt=jt({CSS2DObject:()=>Jt.CSS2DObject}),ze=function(n){n&&((0,N.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||ze(t)}))},zt=function(){"use strict";function n(){L(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Lt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Mesh,k(r)),this},t.createGroup=function(){return this.object3d=new c.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Points,k(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Dt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new c.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,k(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,k(r)),this},t.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){ze(this.object3d)},C(n,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),n}()})();var er=_e.L6,tr=_e.sb,rr=_e.z,nr=_e.ZP;export{er as BaseObject,tr as GUIObject,rr as Pencil,nr as default};
@@ -1,5 +1,6 @@
1
1
  import * as THREE from 'three';
2
2
  import BaseObject from '../../core/BaseObject';
3
+ import type WorkerController from '../../plugins/Worker';
3
4
  declare type Coordinate = [number, number];
4
5
  interface Options {
5
6
  points?: THREE.Vector2[];
@@ -9,7 +10,7 @@ interface Options {
9
10
  depth: number;
10
11
  split?: number;
11
12
  useGroups?: boolean;
12
- worker?: string | Worker;
13
+ workerController?: WorkerController;
13
14
  projection?: {
14
15
  center: [number, number];
15
16
  scale: number;