gl-draw 0.4.4 → 0.4.6

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