gl-draw 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Pencil.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.module.js +1 -1
- package/package.json +1 -1
package/dist/core/Pencil.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ interface Options {
|
|
|
26
26
|
antialias?: false | 'fxaa' | 'msaa';
|
|
27
27
|
} & Omit<Partial<RendererParams>, 'antialias'>;
|
|
28
28
|
multisampling?: number;
|
|
29
|
+
passes?: any[];
|
|
29
30
|
staticRender?: boolean;
|
|
30
31
|
scene?: Partial<SceneParams>;
|
|
31
32
|
camera?: Partial<CameraParams> | THREE.PerspectiveCamera;
|
|
@@ -55,6 +56,7 @@ export default class Pencil {
|
|
|
55
56
|
get scene(): THREE.Scene;
|
|
56
57
|
event: EventEmitter;
|
|
57
58
|
clock: THREE.Clock;
|
|
59
|
+
userData: Record<string, any>;
|
|
58
60
|
static options: {
|
|
59
61
|
isdev: boolean;
|
|
60
62
|
stats: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var xe={187:function(R){"use strict";var j=typeof Reflect=="object"?Reflect:null,_=j&&typeof j.apply=="function"?j.apply:function(o,l,d){return Function.prototype.apply.call(o,l,d)},T;j&&typeof j.ownKeys=="function"?T=j.ownKeys:Object.getOwnPropertySymbols?T=function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:T=function(o){return Object.getOwnPropertyNames(o)};function A(a){console&&console.warn&&console.warn(a)}var L=Number.isNaN||function(o){return o!==o};function h(){h.init.call(this)}R.exports=h,R.exports.once=Y,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var G=10;function B(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(a){if(typeof a!="number"||a<0||L(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");G=a}}),h.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},h.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||L(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this};function k(a){return a._maxListeners===void 0?h.defaultMaxListeners:a._maxListeners}h.prototype.getMaxListeners=function(){return k(this)},h.prototype.emit=function(o){for(var l=[],d=1;d<arguments.length;d++)l.push(arguments[d]);var m=o==="error",E=this._events;if(E!==void 0)m=m&&E.error===void 0;else if(!m)return!1;if(m){var w;if(l.length>0&&(w=l[0]),w instanceof Error)throw w;var K=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw K.context=w,K}var oe=E[o];if(oe===void 0)return!1;if(typeof oe=="function")_(oe,this,l);else for(var F=oe.length,X=ie(oe,F),d=0;d<F;++d)_(X[d],this,l);return!0};function P(a,o,l,d){var m,E,w;if(B(l),E=a._events,E===void 0?(E=a._events=Object.create(null),a._eventsCount=0):(E.newListener!==void 0&&(a.emit("newListener",o,l.listener?l.listener:l),E=a._events),w=E[o]),w===void 0)w=E[o]=l,++a._eventsCount;else if(typeof w=="function"?w=E[o]=d?[l,w]:[w,l]:d?w.unshift(l):w.push(l),m=k(a),m>0&&w.length>m&&!w.warned){w.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=a,K.type=o,K.count=w.length,A(K)}return a}h.prototype.addListener=function(o,l){return P(this,o,l,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(o,l){return P(this,o,l,!0)};function V(){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 b(a,o,l){var d={fired:!1,wrapFn:void 0,target:a,type:o,listener:l},m=V.bind(d);return m.listener=l,d.wrapFn=m,m}h.prototype.once=function(o,l){return B(l),this.on(o,b(this,o,l)),this},h.prototype.prependOnceListener=function(o,l){return B(l),this.prependListener(o,b(this,o,l)),this},h.prototype.removeListener=function(o,l){var d,m,E,w,K;if(B(l),m=this._events,m===void 0)return this;if(d=m[o],d===void 0)return this;if(d===l||d.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[o],m.removeListener&&this.emit("removeListener",o,d.listener||l));else if(typeof d!="function"){for(E=-1,w=d.length-1;w>=0;w--)if(d[w]===l||d[w].listener===l){K=d[w].listener,E=w;break}if(E<0)return this;E===0?d.shift():re(d,E),d.length===1&&(m[o]=d[0]),m.removeListener!==void 0&&this.emit("removeListener",o,K||l)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(o){var l,d,m;if(d=this._events,d===void 0)return this;if(d.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):d[o]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete d[o]),this;if(arguments.length===0){var E=Object.keys(d),w;for(m=0;m<E.length;++m)w=E[m],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(l=d[o],typeof l=="function")this.removeListener(o,l);else if(l!==void 0)for(m=l.length-1;m>=0;m--)this.removeListener(o,l[m]);return this};function W(a,o,l){var d=a._events;if(d===void 0)return[];var m=d[o];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?U(m):ie(m,m.length)}h.prototype.listeners=function(o){return W(this,o,!0)},h.prototype.rawListeners=function(o){return W(this,o,!1)},h.listenerCount=function(a,o){return typeof a.listenerCount=="function"?a.listenerCount(o):ee.call(a,o)},h.prototype.listenerCount=ee;function ee(a){var o=this._events;if(o!==void 0){var l=o[a];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?T(this._events):[]};function ie(a,o){for(var l=new Array(o),d=0;d<o;++d)l[d]=a[d];return l}function re(a,o){for(;o+1<a.length;o++)a[o]=a[o+1];a.pop()}function U(a){for(var o=new Array(a.length),l=0;l<o.length;++l)o[l]=a[l].listener||a[l];return o}function Y(a,o){return new Promise(function(l,d){function m(w){a.removeListener(o,E),d(w)}function E(){typeof a.removeListener=="function"&&a.removeListener("error",m),l([].slice.call(arguments))}x(a,o,E,{once:!0}),o!=="error"&&q(a,m,{once:!0})})}function q(a,o,l){typeof a.on=="function"&&x(a,"error",o,l)}function x(a,o,l,d){if(typeof a.on=="function")d.once?a.once(o,l):a.on(o,l);else if(typeof a.addEventListener=="function")a.addEventListener(o,function m(E){d.once&&a.removeEventListener(o,m),l(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}},666:function(R){var j=function(_){"use strict";var T=Object.prototype,A=T.hasOwnProperty,L,h=typeof Symbol=="function"?Symbol:{},G=h.iterator||"@@iterator",B=h.asyncIterator||"@@asyncIterator",k=h.toStringTag||"@@toStringTag";function P(f,s,v){return Object.defineProperty(f,s,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[s]}try{P({},"")}catch(f){P=function(s,v,O){return s[v]=O}}function V(f,s,v,O){var C=s&&s.prototype instanceof Y?s:Y,$=Object.create(C.prototype),ae=new X(O||[]);return $._invoke=w(f,v,ae),$}_.wrap=V;function b(f,s,v){try{return{type:"normal",arg:f.call(s,v)}}catch(O){return{type:"throw",arg:O}}}var W="suspendedStart",ee="suspendedYield",ie="executing",re="completed",U={};function Y(){}function q(){}function x(){}var a={};P(a,G,function(){return this});var o=Object.getPrototypeOf,l=o&&o(o(ne([])));l&&l!==T&&A.call(l,G)&&(a=l);var d=x.prototype=Y.prototype=Object.create(a);q.prototype=x,P(d,"constructor",x),P(x,"constructor",q),q.displayName=P(x,k,"GeneratorFunction");function m(f){["next","throw","return"].forEach(function(s){P(f,s,function(v){return this._invoke(s,v)})})}_.isGeneratorFunction=function(f){var s=typeof f=="function"&&f.constructor;return s?s===q||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,x):(f.__proto__=x,P(f,k,"GeneratorFunction")),f.prototype=Object.create(d),f},_.awrap=function(f){return{__await:f}};function E(f,s){function v($,ae,J,ue){var se=b(f[$],f,ae);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&A.call(pe,"__await")?s.resolve(pe.__await).then(function(ce){v("next",ce,J,ue)},function(ce){v("throw",ce,J,ue)}):s.resolve(pe).then(function(ce){me.value=ce,J(me)},function(ce){return v("throw",ce,J,ue)})}}var O;function C($,ae){function J(){return new s(function(ue,se){v($,ae,ue,se)})}return O=O?O.then(J,J):J()}this._invoke=C}m(E.prototype),P(E.prototype,B,function(){return this}),_.AsyncIterator=E,_.async=function(f,s,v,O,C){C===void 0&&(C=Promise);var $=new E(V(f,s,v,O),C);return _.isGeneratorFunction(s)?$:$.next().then(function(ae){return ae.done?ae.value:$.next()})};function w(f,s,v){var O=W;return function($,ae){if(O===ie)throw new Error("Generator is already running");if(O===re){if($==="throw")throw ae;return le()}for(v.method=$,v.arg=ae;;){var J=v.delegate;if(J){var ue=K(J,v);if(ue){if(ue===U)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===W)throw O=re,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=ie;var se=b(f,s,v);if(se.type==="normal"){if(O=v.done?re:ee,se.arg===U)continue;return{value:se.arg,done:v.done}}else se.type==="throw"&&(O=re,v.method="throw",v.arg=se.arg)}}}function K(f,s){var v=f.iterator[s.method];if(v===L){if(s.delegate=null,s.method==="throw"){if(f.iterator.return&&(s.method="return",s.arg=L,K(f,s),s.method==="throw"))return U;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return U}var O=b(v,f.iterator,s.arg);if(O.type==="throw")return s.method="throw",s.arg=O.arg,s.delegate=null,U;var C=O.arg;if(!C)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,U;if(C.done)s[f.resultName]=C.value,s.next=f.nextLoc,s.method!=="return"&&(s.method="next",s.arg=L);else return C;return s.delegate=null,U}m(d),P(d,k,"Generator"),P(d,G,function(){return this}),P(d,"toString",function(){return"[object Generator]"});function oe(f){var s={tryLoc:f[0]};1 in f&&(s.catchLoc=f[1]),2 in f&&(s.finallyLoc=f[2],s.afterLoc=f[3]),this.tryEntries.push(s)}function F(f){var s=f.completion||{};s.type="normal",delete s.arg,f.completion=s}function X(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(oe,this),this.reset(!0)}_.keys=function(f){var s=[];for(var v in f)s.push(v);return s.reverse(),function O(){for(;s.length;){var C=s.pop();if(C in f)return O.value=C,O.done=!1,O}return O.done=!0,O}};function ne(f){if(f){var s=f[G];if(s)return s.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function C(){for(;++v<f.length;)if(A.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=L,C.done=!0,C};return O.next=O}}return{next:le}}_.values=ne;function le(){return{value:L,done:!0}}return X.prototype={constructor:X,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(F),!f)for(var s in this)s.charAt(0)==="t"&&A.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=L)},stop:function(){this.done=!0;var f=this.tryEntries[0],s=f.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function v(ue,se){return $.type="throw",$.arg=f,s.next=ue,se&&(s.method="next",s.arg=L),!!se}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],$=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var ae=A.call(C,"catchLoc"),J=A.call(C,"finallyLoc");if(ae&&J){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(ae){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,s){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&A.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=s&&s<=C.finallyLoc&&(C=null);var $=C?C.completion:{};return $.type=f,$.arg=s,C?(this.method="next",this.next=C.finallyLoc,U):this.complete($)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),U},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),U}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var C=O.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,v){return this.delegate={iterator:ne(f),resultName:s,nextLoc:v},this.method==="next"&&(this.arg=L),U}},_}(R.exports);try{regeneratorRuntime=j}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function T(A){if(A.geometry&&A.geometry.dispose(),A.material){var L=Array.isArray(A.material)?A.material:[A.material];L.forEach(function(h){var G,B,k,P,V,b,W,ee,ie,re,U,Y,q;(G=h.map)===null||G===void 0||G.dispose(),(B=h.lightMap)===null||B===void 0||B.dispose(),(k=h.bumpMap)===null||k===void 0||k.dispose(),(P=h.normalMap)===null||P===void 0||P.dispose(),(V=h.specularMap)===null||V===void 0||V.dispose(),(b=h.envMap)===null||b===void 0||b.dispose(),(W=h.alphaMap)===null||W===void 0||W.dispose(),(ee=h.aoMap)===null||ee===void 0||ee.dispose(),(ie=h.displacementMap)===null||ie===void 0||ie.dispose(),(re=h.emissiveMap)===null||re===void 0||re.dispose(),(U=h.gradientMap)===null||U===void 0||U.dispose(),(Y=h.metalnessMap)===null||Y===void 0||Y.dispose(),(q=h.roughnessMap)===null||q===void 0||q.dispose(),h.dispose()})}}},584:function(R,j,_){"use strict";_.d(j,{disposeMesh:function(){return h.Z},isPlainObject:function(){return k.Z}});var T=_(666),A=_.n(T),L=null,h=_(695),G=_(644);function B(Y){if(Y.material){var q=Array.isArray(Y.material)?Y.material:[Y.material];q.forEach(function(x){var a,o;(a=x.color)===null||a===void 0||a.convertSRGBToLinear(),(o=x.emissive)===null||o===void 0||o.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var k=_(738),P=_(568),V=_(924),b=_(360),W=_(484),ee=null,ie=null,re=function(){var Y=(0,P.Z)(A().mark(function q(x,a){var o,l,d,m,E,w,K,oe,F;return A().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return o=a.type,l=o===void 0?"blob":o,d=a.version,m=d===void 0?"1":d,ne.next=4,(0,b.get)(x);case 4:if(w=ne.sent,!(w&&w[m])){ne.next=9;break}E=w[m],ne.next=15;break;case 9:return ne.next=11,(0,W.Z)(fetch(x).then(function(le){if(le.ok)return le[l]();throw new Error}));case 11:K=ne.sent,oe=K.res,F=K.err,F||(E=oe,(0,b.set)(x,(0,V.Z)({},m,oe)));case 15:return ne.abrupt("return",E?{url:l==="json"?x:URL.createObjectURL(E),store:E}:{url:x});case 16:case"end":return ne.stop()}},q)}));return function(x,a){return Y.apply(this,arguments)}}(),U=_(705)},738:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});function T(L){return Object.prototype.toString.call(L)==="[object Object]"}function A(L){if(T(L)===!1)return!1;var h=L.constructor;if(h===void 0)return!0;var G=h.prototype;return!(T(G)===!1||G.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});var T=_(42);function A(L){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L.then(function(G){return(0,T.Z)({err:null,res:G},h)}).catch(function(G){return(0,T.Z)({err:G,res:void 0},h)})}},705:function(R,j,_){"use strict";var T=_(644),A=_.n(T),L=new Map,h=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(k,P,V,b,W){var ee=P[V*3],ie=P[V*3+1],re=P[b*3],U=P[b*3+1],Y=P[W*3],q=P[W*3+1],x;if(L.has(k))x=L.get(k);else{var a=B.box3||new THREE.Box3;if(!B.box3){var o=k.parameters.shapes.getPoints();a.setFromArray(o.map(function(w){return[w.x,w.y,0]}).flat())}var l=a.getSize(new THREE.Vector3);B.split&&(l.y/=B.split),x={box:a,size:l},L.set(k,x)}var d=x.box,m=x.size,E=B.split?1-B.split:0;return[new THREE.Vector2((ee-d.min.x)/m.x,(ie-d.min.y)/m.y+E),new THREE.Vector2((re-d.min.x)/m.x,(U-d.min.y)/m.y+E),new THREE.Vector2((Y-d.min.x)/m.x,(q-d.min.y)/m.y+E)]},generateSideWallUV:function(k,P,V,b,W,ee){var ie=P[V*3],re=P[V*3+1],U=P[V*3+2],Y=P[b*3],q=P[b*3+1],x=P[b*3+2],a=P[W*3],o=P[W*3+1],l=P[W*3+2],d=P[ee*3],m=P[ee*3+1],E=P[ee*3+2],w;if(L.has(P))w=L.get(P);else{var K=new THREE.Box3;K.setFromArray(P);var oe=K.getSize(new THREE.Vector3);B.split&&(oe.z/=1-B.split),w={box:K,size:oe},L.set(P,w)}var F=w.box,X=w.size;return Math.abs(re-q)<Math.abs(ie-Y)?[new THREE.Vector2((ie-F.min.x)/X.x,(U-F.min.z)/X.z),new THREE.Vector2((Y-F.min.x)/X.x,(x-F.min.z)/X.z),new THREE.Vector2((a-F.min.x)/X.x,(l-F.min.z)/X.z),new THREE.Vector2((d-F.min.x)/X.x,(E-F.min.z)/X.z)]:[new THREE.Vector2((re-F.min.y)/X.y,(U-F.min.z)/X.z),new THREE.Vector2((q-F.min.y)/X.y,(x-F.min.z)/X.z),new THREE.Vector2((o-F.min.y)/X.y,(l-F.min.z)/X.z),new THREE.Vector2((m-F.min.y)/X.y,(E-F.min.z)/X.z)]}}},G=function(){L.clear()}},360:function(R){"use strict";R.exports=require("idb-keyval")},644:function(R){"use strict";R.exports=require("three")},568:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});function T(L,h,G,B,k,P,V){try{var b=L[P](V),W=b.value}catch(ee){G(ee);return}b.done?h(W):Promise.resolve(W).then(B,k)}function A(L){return function(){var h=this,G=arguments;return new Promise(function(B,k){var P=L.apply(h,G);function V(W){T(P,B,k,V,b,"next",W)}function b(W){T(P,B,k,V,b,"throw",W)}V(void 0)})}}},924:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function T(A,L,h){return L in A?Object.defineProperty(A,L,{value:h,enumerable:!0,configurable:!0,writable:!0}):A[L]=h,A}},42:function(R,j,_){"use strict";_.d(j,{Z:function(){return A}});var T=_(924);function A(L){for(var h=1;h<arguments.length;h++){var G=arguments[h]!=null?arguments[h]:{},B=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(B=B.concat(Object.getOwnPropertySymbols(G).filter(function(k){return Object.getOwnPropertyDescriptor(G,k).enumerable}))),B.forEach(function(k){(0,T.Z)(L,k,G[k])})}return L}}},we={};function te(R){var j=we[R];if(j!==void 0)return j.exports;var _=we[R]={exports:{}};return xe[R](_,_.exports,te),_.exports}(function(){te.n=function(R){var j=R&&R.__esModule?function(){return R.default}:function(){return R};return te.d(j,{a:j}),j}})(),function(){te.d=function(R,j){for(var _ in j)te.o(j,_)&&!te.o(R,_)&&Object.defineProperty(R,_,{enumerable:!0,get:j[_]})}}(),function(){te.o=function(R,j){return Object.prototype.hasOwnProperty.call(R,j)}}(),function(){te.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";te.r(ye),te.d(ye,{BaseObject:function(){return Me},GUIObject:function(){return x},Pencil:function(){return be},default:function(){return be}});function R(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}function j(u,i){for(var t=0;t<i.length;t++){var e=i[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(u,e.key,e)}}function _(u,i,t){return i&&j(u.prototype,i),t&&j(u,t),u}var T=te(42);function A(u,i){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),t.push.apply(t,e)}return t}function L(u,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(i,t))}),u}function h(u,i){(i==null||i>u.length)&&(i=u.length);for(var t=0,e=new Array(i);t<i;t++)e[t]=u[t];return e}function G(u){if(Array.isArray(u))return h(u)}function B(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function k(){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 P(u,i){if(!!u){if(typeof u=="string")return h(u,i);var t=Object.prototype.toString.call(u).slice(8,-1);if(t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(u,i)}}function V(u){return G(u)||B(u)||P(u)||k()}var b=te(644),W=te(187),ee=require("deepmerge"),ie=te.n(ee),re=require("three/examples/jsm/libs/stats.module"),U=te.n(re),Y=require("lil-gui"),q=te.n(Y),x=function(){"use strict";function u(t){R(this,u),this.guiParams={},t&&(this.guiParams=t)}var i=u.prototype;return i.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(n){var c=e.addFolder(n),p=r.guiParams[n];Object.keys(p).forEach(function(g){var y=p[g],N=y.min,z=y.max,D=y.step,S=y.name,M=y.paramMap,H=y.items,Q=y.value,Z=y.target,fe=g.toLowerCase().indexOf("color")>-1,I,de=typeof Q=="undefined"&&Z,he=de?Z():p[g],ve=de?g:"value";H?I=c.add(he,ve,H):fe?I=c.addColor(he,ve):I=c.add(he,ve),I=I.name(S||g),typeof N!="undefined"&&(I=I.min(N)),typeof z!="undefined"&&(I=I.max(z)),typeof D!="undefined"&&(I=I.step(D)),I=I.onChange(function(){r.setTargetValue(n,g,he[ve],M)}),de&&I.listen()})})},i.setTargetValue=function(e,r,n,c){var p=this.guiParams[e][r],g=p.onChange,y=p.target,N=p.value,z=r.toLowerCase().indexOf("color")>-1,D=typeof N=="undefined"&&y;if(y&&!D){var S=y();Array.isArray(S)||(S=[S]),S.forEach(function(M){if(!!M)if(z)try{M[c||r].set(n)}catch(H){r!=="color"&&!c&&console.warn("".concat(r," is not a color,set paramMap"))}else M[c||r]=n})}g&&g(n)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(n){var c=e.guiParams[r][n];typeof c.value!="undefined"&&e.setTargetValue(r,n,c.value,c.paramMap)})})},u}(),a={None:b.NoToneMapping,Linear:b.LinearToneMapping,Reinhard:b.ReinhardToneMapping,Cineon:b.CineonToneMapping,ACESFilmic:b.ACESFilmicToneMapping},o={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:b.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},l=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.width,r=t.height,n=t.rendererParams,c=n.context,p=n.alpha,g=n.devicePixelRatio,y=n.antialias,N=n.powerPreference,z=n.toneMapping,D=n.toneMappingExposure,S=n.outputEncoding,M=n.logarithmicDepthBuffer,H=n.preserveDrawingBuffer,Q=n.stencil,Z=n.depth,fe=n.physicallyCorrectLights,I=new b.WebGLRenderer({context:c,alpha:p,antialias:y,powerPreference:N,logarithmicDepthBuffer:M,preserveDrawingBuffer:H,stencil:Q,depth:Z});I.setSize(e,r),I.setPixelRatio(g),I.toneMapping=a[z],I.toneMappingExposure=D,I.outputEncoding=S,I.physicallyCorrectLights=fe,this.renderer=I}var i=u.prototype;return i.setSize=function(e,r){this.renderer.setSize(e,r)},i.render=function(){var e=this.options,r=e.scene,n=e.camera;this.renderer.render(r,n)},i.setGui=function(e){var r=this,n=new x({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:a,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});n.showGui(e)},i.dispose=function(){var e,r,n;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(n=this.renderer)===null||n===void 0||n.renderLists.dispose()},u}(),d={fov:45,near:1,far:1e3},m=function(){"use strict";function u(t){R(this,u),this.oldCameraPosition=new b.Vector3,this.oldCameraRotation=new b.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,n=t.cameraParams;if(n instanceof b.Camera)this.camera=n,this.customCamera=!0;else{var c=n.fov,p=n.far,g=n.near,y=new b.PerspectiveCamera(c,e/r,g,p);y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}var i=u.prototype;return i.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},i.setSize=function(e,r){this.camera instanceof b.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},i.setGui=function(e){var r=this,n=new x({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}}});this.camera instanceof b.PerspectiveCamera&&(n.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}),n.showGui(e)},u}(),E=te(584),w={background:null},K=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.sceneParams,n=r.background,c=new b.Scene;n&&(c.background=n),c.add(e),this.scene=c}var i=u.prototype;return i.addAxesHelper=function(){var e,r=new b.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,E.disposeMesh)(r)})},u}(),oe=require("three/examples/jsm/controls/OrbitControls"),F={},X=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.controlParams,n=t.mapControl,c=r.domElement,p=n?new oe.MapControls(e,c):new oe.OrbitControls(e,c);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var i=u.prototype;return i.limitPan=function(e){var r=e.maxX,n=r===void 0?1/0:r,c=e.minX,p=c===void 0?-1/0:c,g=e.maxZ,y=g===void 0?1/0:g,N=e.minZ,z=N===void 0?-1/0:N,D=e.maxY,S=D===void 0?1/0:D,M=e.minY,H=M===void 0?-1/0:M,Q=this.limitPanV||new b.Vector3,Z=this.control,fe=this.options.camera,I=new b.Vector3(p,H,z),de=new b.Vector3(n,S,y);this.limitPanV=Q,Q.copy(Z.target),Z.target.clamp(I,de),Q.sub(Z.target),fe.position.sub(Q)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},u}(),ne=require("three/examples/jsm/renderers/CSS3DRenderer"),le=new b.Vector3,f=new b.Matrix4,s=new b.Matrix4,v=new b.Vector3,O=new b.Vector3,C=function u(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,u);var t=function(M,H){return v.setFromMatrixPosition(M.matrixWorld),O.setFromMatrixPosition(H.matrixWorld),v.distanceToSquared(O)},e=function(M){var H=[];return M.traverse(function(Q){Q.isCSS2DObject&&H.push(Q)}),H},r=function(M){for(var H=e(M).sort(function(de,he){if(de.renderOrder!==he.renderOrder)return he.renderOrder-de.renderOrder;var ve=N.objects.get(de).distanceToCameraSquared,ze=N.objects.get(he).distanceToCameraSquared;return ve-ze}),Q=H.length,Z=0,fe=H.length;Z<fe;Z++){var I=H[Z].userData.zIndexFix||0;H[Z].element.style.zIndex=Q-Z+I}},n=this,c,p,g,y,N={objects:new WeakMap},z=i.element!==void 0?i.element:document.createElement("div");z.style.overflow="hidden",this.domElement=z,this.getSize=function(){return{width:c,height:p}},this.render=function(S,M){+b.REVISION<144?(S.autoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld()):(S.matrixWorldAutoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.matrixWorldAutoUpdate===!0&&M.updateMatrixWorld()),f.copy(M.matrixWorldInverse),s.multiplyMatrices(M.projectionMatrix,f),D(S,S,M),r(S)},this.setSize=function(S,M){c=S,p=M,g=c/2,y=p/2,z.style.width="".concat(S,"px"),z.style.height="".concat(M,"px")};function D(S,M,H){if(S.isCSS2DObject){le.setFromMatrixPosition(S.matrixWorld),le.applyMatrix4(s);var Q=S.visible===!0&&le.z>=-1&&le.z<=1&&S.layers.test(H.layers)===!0;if(S.element.style.display=Q===!0?"":"none",Q===!0){S.onBeforeRender(n,M,H);var Z=S.element;Z.style.transform="translate(-50%,-50%) translate(".concat(le.x*g+g,"px,").concat(-le.y*y+y,"px)"),Z.parentNode!==z&&z.appendChild(Z),S.onAfterRender(n,M,H)}var fe={distanceToCameraSquared:t(H,S)};N.objects.set(S,fe)}for(var I=0,de=S.children.length;I<de;I++)D(S.children[I],M,H)}},$={zIndex:"auto"},ae=function(){"use strict";function u(t){R(this,u),this.container=t}var i=u.prototype;return i.addRenderer=function(e,r){var n=this.container,c=n.offsetWidth,p=n.offsetHeight,g=e==="css2d"?new C:new ne.CSS3DRenderer;g.domElement.style.position="absolute",g.domElement.style.top="0",g.domElement.style.pointerEvents="none",g.domElement.style.zIndex=r.zIndex,g.setSize(c,p),n.appendChild(g.domElement),e==="css2d"?this.css2Drenderer=g:e==="css3d"&&(this.css3Drenderer=g)},i.setSize=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.setSize(e,r),(c=this.css3Drenderer)===null||c===void 0||c.setSize(e,r)},i.render=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.render(e,r),(c=this.css3Drenderer)===null||c===void 0||c.render(e,r)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},u}(),J=require("postprocessing"),ue={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},se=function(){"use strict";function u(t){R(this,u),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,n=t.camera,c=t.composerParams,p=c.multisampling,g=e.capabilities.maxSamples,y=new J.EffectComposer(e,{multisampling:Math.min(p,g)});y.addPass(new J.RenderPass(r,n)),this.finalComposer=y,this.renderer=e,this.scene=r,this.camera=n}var i=u.prototype;return i.addCopyPass=function(){var e=new J.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},i.addFXAAPass=function(){var e=this.camera,r=new J.FXAAEffect({blendFunction:J.BlendFunction.NORMAL}),n=new J.EffectPass(e,r);this.finalComposer.addPass(n),this.fxaaPass=n},i.addBloomPass=function(e){var r=this,n=r.camera,c=r.scene,p=new J.SelectiveBloomEffect(c,n,(0,T.Z)({},e)),g=new J.EffectPass(n,p);g.enabled=!1,this.finalComposer.addPass(g),this.bloomPass=g,this.bloomEffect=p},i.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var n=new x({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(c){r.bloomEffect.luminancePass.enabled=c}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});n.showGui(e)}},i.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},i.getSize=function(){var e=this.options.renderer;return e.getSize(new b.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.setSize=function(e,r){this.finalComposer.setSize(e,r)},i.render=function(){!this.active||this.finalComposer.render()},i.dispose=function(){this.finalComposer.dispose()},u}(),me=function(){try{var u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(i){return!1}},pe=0,ce=!1,Pe=me()!==!1,be=function(){"use strict";function u(t){R(this,u),this.raycaster=new b.Raycaster,this.installPlugins=new Map,this.event=new W.EventEmitter,this.clock=new b.Clock,this.options=ie()(u.options,t,{isMergeableObject:E.isPlainObject});var e=this.options,r=e.container,n=e.stats,c=e.gui,p=e.resizeObserver;if(c){var g=new(q());g.open(!1),this.gui=g}if(n){var y=new(U());y.showPanel(0),y.dom.style.position="absolute",r.appendChild(y.dom),this.stats=y}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=u.prototype;return i.use=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),c=1;c<r;c++)n[c-1]=arguments[c];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(V(n))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,r=e.container,n=e.isdev,c=e.axesHelper,p=e.renderer,g=e.scene,y=e.camera,N=this.getSize(),z=N.width,D=N.height,S=new m({isdev:n,width:z,height:D,cameraParams:y});this.gui&&S.setGui(this.gui);var M=S.camera,H=new K({camera:M,sceneParams:g}),Q=H.scene,Z=new l({width:z,height:D,scene:Q,camera:M,isdev:n,rendererParams:L((0,T.Z)({},p),{antialias:!1})});this.gui&&Z.setGui(this.gui);var fe=Z.renderer;c&&H.addAxesHelper(),this.sceneController=H,this.rendererController=Z,this.cameraController=S,r.appendChild(fe.domElement)},i.initComposer=function(){var e=this.options,r=e.bloom,n=e.bloomParams,c=e.renderer,p=e.multisampling,g=c.antialias;g==="msaa"&&!Pe&&(g=!1,console.warn("MSAA is not supported on this browser"));var y=new se({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:g==="msaa"?p:0,type:b.UnsignedByteType,encoding:c.outputEncoding}});this.composerController=y,r&&(y.addBloomPass(n),this.gui&&y.addBloomGui(this.gui)),g==="fxaa"&&y.addFXAAPass(),y.addCopyPass()},i.initCSSRenderer=function(){var e=this.options,r=e.container,n=e.css2DRenderer,c=e.css3DRenderer,p=e.css2DRendererParams,g=e.css3DRendererParams;if(n||c){var y=new ae(r);n&&y.addRenderer("css2d",p),c&&y.addRenderer("css3d",g),this.cssRendererController=y}},i.initControl=function(){var e=this.options,r=e.control,n=e.mapControl,c=e.controlParams;if(r){var p=new X({camera:this.camera,controlParams:{domElement:(c==null?void 0:c.domElement)||this.renderer.domElement},mapControl:n});this.controlController=p}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var n=new ResizeObserver(function(c){var p=!0,g=!1,y=void 0;try{for(var N=c[Symbol.iterator](),z;!(p=(z=N.next()).done);p=!0){var D=z.value,S=D.contentRect;e.handeleResize(S.width,S.height),e.render()}}catch(M){g=!0,y=M}finally{try{!p&&N.return!=null&&N.return()}finally{if(g)throw y}}});n.observe(r),this.resizeObserver=n}},i.handeleResize=function(e,r){var n=this,c=n.rendererController,p=n.cameraController,g=n.composerController,y=n.cssRendererController;p==null||p.setSize(e,r),c==null||c.setSize(e,r),g==null||g.setSize(e,r),y==null||y.setSize(e,r),this.installPlugins.forEach(function(N,z){var D;(D=z.resize)===null||D===void 0||D.call(z,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},i.pick=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=this,p=c.raycaster,g=c.options,y=g.container,N=new b.Vector2,z=y.getBoundingClientRect();if(N.x=(e.clientX-z.left)/(z.right-z.left)*2-1,N.y=-((e.clientY-z.top)/(z.bottom-z.top))*2+1,this.camera&&this.scene){p.setFromCamera(N,this.camera);var D=p.intersectObjects(r||this.scene.children,n);if(D.length)return{object:D[0].object,intersects:D}}},i.render=function(){var e,r,n,c,p=this,g=p.renderer,y=p.scene,N=p.camera,z=p.clock;if(!(!g||!y||!N||this.options.staticRender&&!this.cameraController.checkCameraChange())){var D=z.getDelta(),S=z.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,Q){var Z;(Z=Q.update)===null||Z===void 0||Z.call(Q,D,S)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(n=this.cssRendererController)===null||n===void 0||n.render(y,N),(c=this.stats)===null||c===void 0||c.update(),this.event.emit("render",{delta:D,elapsed:S})}},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,r,n,c,p,g,y;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(N,z){var D;(D=z.dispose)===null||D===void 0||D.call(z)}),(r=this.controlController)===null||r===void 0||r.dispose(),(n=this.cssRendererController)===null||n===void 0||n.dispose(),(c=this.sceneController)===null||c===void 0||c.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(g=this.rendererController)===null||g===void 0||g.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},_(u,[{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}}]),u}();be.options={isdev:ce,stats:ce,gui:ce,axesHelper:ce,control:ce,resizeObserver:!0,renderer:L((0,T.Z)({},o),{antialias:Pe?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:w,camera:d,bloom:!1,bloomParams:ue,css2DRenderer:!1,css2DRendererParams:(0,T.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,T.Z)({},$)};function _e(u,i){return _e=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},_e(u,i)}function Oe(u,i){return _e(u,i)}function Se(){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(u){return!1}}function ge(u,i,t){return Se()?ge=Reflect.construct:ge=function(r,n,c){var p=[null];p.push.apply(p,n);var g=Function.bind.apply(r,p),y=new g;return c&&Oe(y,c.prototype),y},ge.apply(null,arguments)}function Ce(u,i,t){return ge.apply(null,arguments)}var Le=te(484);function Re(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),u&&(t.promise=(0,Le.Z)(t.promise,i)),t}var je=require("three/examples/jsm/renderers/CSS2DRenderer"),Ee=function(u){u&&((0,E.disposeMesh)(u),u.children.forEach(function(i){i.userData.BaseObject_||Ee(i)}))},Me=function(){"use strict";function u(){R(this,u),this.objecttype__="BaseObject",this.userData={},this.pm=Re(),this.visible=!1}var i=u.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,r){},i.resize=function(e,r){},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,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(b.Mesh,V(r)),this},i.createGroup=function(){return this.object3d=new b.Group,this},i.createPoints=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(b.Points,V(r)),this},i.createCSS2DObject=function(e){return this.object3d=new je.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 b.Sprite(e),this},i.add=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).add.apply(c,V(r)),this},i.remove=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).remove.apply(c,V(r)),this},i.getSize=function(){var e=new b.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new b.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},i.dispose=function(){Ee(this.object3d)},_(u,[{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})}}]),u}()})(),module.exports=ye})();
|
|
1
|
+
(function(){var xe={187:function(R){"use strict";var j=typeof Reflect=="object"?Reflect:null,_=j&&typeof j.apply=="function"?j.apply:function(o,l,d){return Function.prototype.apply.call(o,l,d)},D;j&&typeof j.ownKeys=="function"?D=j.ownKeys:Object.getOwnPropertySymbols?D=function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:D=function(o){return Object.getOwnPropertyNames(o)};function T(a){console&&console.warn&&console.warn(a)}var L=Number.isNaN||function(o){return o!==o};function h(){h.init.call(this)}R.exports=h,R.exports.once=Y,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var B=10;function k(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(a){if(typeof a!="number"||a<0||L(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");B=a}}),h.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},h.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||L(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this};function I(a){return a._maxListeners===void 0?h.defaultMaxListeners:a._maxListeners}h.prototype.getMaxListeners=function(){return I(this)},h.prototype.emit=function(o){for(var l=[],d=1;d<arguments.length;d++)l.push(arguments[d]);var m=o==="error",E=this._events;if(E!==void 0)m=m&&E.error===void 0;else if(!m)return!1;if(m){var w;if(l.length>0&&(w=l[0]),w instanceof Error)throw w;var K=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw K.context=w,K}var oe=E[o];if(oe===void 0)return!1;if(typeof oe=="function")_(oe,this,l);else for(var F=oe.length,X=ie(oe,F),d=0;d<F;++d)_(X[d],this,l);return!0};function P(a,o,l,d){var m,E,w;if(k(l),E=a._events,E===void 0?(E=a._events=Object.create(null),a._eventsCount=0):(E.newListener!==void 0&&(a.emit("newListener",o,l.listener?l.listener:l),E=a._events),w=E[o]),w===void 0)w=E[o]=l,++a._eventsCount;else if(typeof w=="function"?w=E[o]=d?[l,w]:[w,l]:d?w.unshift(l):w.push(l),m=I(a),m>0&&w.length>m&&!w.warned){w.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=a,K.type=o,K.count=w.length,T(K)}return a}h.prototype.addListener=function(o,l){return P(this,o,l,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(o,l){return P(this,o,l,!0)};function N(){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 g(a,o,l){var d={fired:!1,wrapFn:void 0,target:a,type:o,listener:l},m=N.bind(d);return m.listener=l,d.wrapFn=m,m}h.prototype.once=function(o,l){return k(l),this.on(o,g(this,o,l)),this},h.prototype.prependOnceListener=function(o,l){return k(l),this.prependListener(o,g(this,o,l)),this},h.prototype.removeListener=function(o,l){var d,m,E,w,K;if(k(l),m=this._events,m===void 0)return this;if(d=m[o],d===void 0)return this;if(d===l||d.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[o],m.removeListener&&this.emit("removeListener",o,d.listener||l));else if(typeof d!="function"){for(E=-1,w=d.length-1;w>=0;w--)if(d[w]===l||d[w].listener===l){K=d[w].listener,E=w;break}if(E<0)return this;E===0?d.shift():re(d,E),d.length===1&&(m[o]=d[0]),m.removeListener!==void 0&&this.emit("removeListener",o,K||l)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(o){var l,d,m;if(d=this._events,d===void 0)return this;if(d.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):d[o]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete d[o]),this;if(arguments.length===0){var E=Object.keys(d),w;for(m=0;m<E.length;++m)w=E[m],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(l=d[o],typeof l=="function")this.removeListener(o,l);else if(l!==void 0)for(m=l.length-1;m>=0;m--)this.removeListener(o,l[m]);return this};function W(a,o,l){var d=a._events;if(d===void 0)return[];var m=d[o];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?U(m):ie(m,m.length)}h.prototype.listeners=function(o){return W(this,o,!0)},h.prototype.rawListeners=function(o){return W(this,o,!1)},h.listenerCount=function(a,o){return typeof a.listenerCount=="function"?a.listenerCount(o):ee.call(a,o)},h.prototype.listenerCount=ee;function ee(a){var o=this._events;if(o!==void 0){var l=o[a];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};function ie(a,o){for(var l=new Array(o),d=0;d<o;++d)l[d]=a[d];return l}function re(a,o){for(;o+1<a.length;o++)a[o]=a[o+1];a.pop()}function U(a){for(var o=new Array(a.length),l=0;l<o.length;++l)o[l]=a[l].listener||a[l];return o}function Y(a,o){return new Promise(function(l,d){function m(w){a.removeListener(o,E),d(w)}function E(){typeof a.removeListener=="function"&&a.removeListener("error",m),l([].slice.call(arguments))}x(a,o,E,{once:!0}),o!=="error"&&q(a,m,{once:!0})})}function q(a,o,l){typeof a.on=="function"&&x(a,"error",o,l)}function x(a,o,l,d){if(typeof a.on=="function")d.once?a.once(o,l):a.on(o,l);else if(typeof a.addEventListener=="function")a.addEventListener(o,function m(E){d.once&&a.removeEventListener(o,m),l(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}},666:function(R){var j=function(_){"use strict";var D=Object.prototype,T=D.hasOwnProperty,L,h=typeof Symbol=="function"?Symbol:{},B=h.iterator||"@@iterator",k=h.asyncIterator||"@@asyncIterator",I=h.toStringTag||"@@toStringTag";function P(f,s,v){return Object.defineProperty(f,s,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[s]}try{P({},"")}catch(f){P=function(s,v,O){return s[v]=O}}function N(f,s,v,O){var C=s&&s.prototype instanceof Y?s:Y,$=Object.create(C.prototype),ae=new X(O||[]);return $._invoke=w(f,v,ae),$}_.wrap=N;function g(f,s,v){try{return{type:"normal",arg:f.call(s,v)}}catch(O){return{type:"throw",arg:O}}}var W="suspendedStart",ee="suspendedYield",ie="executing",re="completed",U={};function Y(){}function q(){}function x(){}var a={};P(a,B,function(){return this});var o=Object.getPrototypeOf,l=o&&o(o(ne([])));l&&l!==D&&T.call(l,B)&&(a=l);var d=x.prototype=Y.prototype=Object.create(a);q.prototype=x,P(d,"constructor",x),P(x,"constructor",q),q.displayName=P(x,I,"GeneratorFunction");function m(f){["next","throw","return"].forEach(function(s){P(f,s,function(v){return this._invoke(s,v)})})}_.isGeneratorFunction=function(f){var s=typeof f=="function"&&f.constructor;return s?s===q||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,x):(f.__proto__=x,P(f,I,"GeneratorFunction")),f.prototype=Object.create(d),f},_.awrap=function(f){return{__await:f}};function E(f,s){function v($,ae,J,ue){var se=g(f[$],f,ae);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&T.call(pe,"__await")?s.resolve(pe.__await).then(function(ce){v("next",ce,J,ue)},function(ce){v("throw",ce,J,ue)}):s.resolve(pe).then(function(ce){me.value=ce,J(me)},function(ce){return v("throw",ce,J,ue)})}}var O;function C($,ae){function J(){return new s(function(ue,se){v($,ae,ue,se)})}return O=O?O.then(J,J):J()}this._invoke=C}m(E.prototype),P(E.prototype,k,function(){return this}),_.AsyncIterator=E,_.async=function(f,s,v,O,C){C===void 0&&(C=Promise);var $=new E(N(f,s,v,O),C);return _.isGeneratorFunction(s)?$:$.next().then(function(ae){return ae.done?ae.value:$.next()})};function w(f,s,v){var O=W;return function($,ae){if(O===ie)throw new Error("Generator is already running");if(O===re){if($==="throw")throw ae;return le()}for(v.method=$,v.arg=ae;;){var J=v.delegate;if(J){var ue=K(J,v);if(ue){if(ue===U)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===W)throw O=re,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=ie;var se=g(f,s,v);if(se.type==="normal"){if(O=v.done?re:ee,se.arg===U)continue;return{value:se.arg,done:v.done}}else se.type==="throw"&&(O=re,v.method="throw",v.arg=se.arg)}}}function K(f,s){var v=f.iterator[s.method];if(v===L){if(s.delegate=null,s.method==="throw"){if(f.iterator.return&&(s.method="return",s.arg=L,K(f,s),s.method==="throw"))return U;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return U}var O=g(v,f.iterator,s.arg);if(O.type==="throw")return s.method="throw",s.arg=O.arg,s.delegate=null,U;var C=O.arg;if(!C)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,U;if(C.done)s[f.resultName]=C.value,s.next=f.nextLoc,s.method!=="return"&&(s.method="next",s.arg=L);else return C;return s.delegate=null,U}m(d),P(d,I,"Generator"),P(d,B,function(){return this}),P(d,"toString",function(){return"[object Generator]"});function oe(f){var s={tryLoc:f[0]};1 in f&&(s.catchLoc=f[1]),2 in f&&(s.finallyLoc=f[2],s.afterLoc=f[3]),this.tryEntries.push(s)}function F(f){var s=f.completion||{};s.type="normal",delete s.arg,f.completion=s}function X(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(oe,this),this.reset(!0)}_.keys=function(f){var s=[];for(var v in f)s.push(v);return s.reverse(),function O(){for(;s.length;){var C=s.pop();if(C in f)return O.value=C,O.done=!1,O}return O.done=!0,O}};function ne(f){if(f){var s=f[B];if(s)return s.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function C(){for(;++v<f.length;)if(T.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=L,C.done=!0,C};return O.next=O}}return{next:le}}_.values=ne;function le(){return{value:L,done:!0}}return X.prototype={constructor:X,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(F),!f)for(var s in this)s.charAt(0)==="t"&&T.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=L)},stop:function(){this.done=!0;var f=this.tryEntries[0],s=f.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function v(ue,se){return $.type="throw",$.arg=f,s.next=ue,se&&(s.method="next",s.arg=L),!!se}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],$=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var ae=T.call(C,"catchLoc"),J=T.call(C,"finallyLoc");if(ae&&J){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(ae){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,s){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&T.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=s&&s<=C.finallyLoc&&(C=null);var $=C?C.completion:{};return $.type=f,$.arg=s,C?(this.method="next",this.next=C.finallyLoc,U):this.complete($)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),U},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),U}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var C=O.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,v){return this.delegate={iterator:ne(f),resultName:s,nextLoc:v},this.method==="next"&&(this.arg=L),U}},_}(R.exports);try{regeneratorRuntime=j}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(R,j,_){"use strict";_.d(j,{Z:function(){return D}});function D(T){if(T.geometry&&T.geometry.dispose(),T.material){var L=Array.isArray(T.material)?T.material:[T.material];L.forEach(function(h){var B,k,I,P,N,g,W,ee,ie,re,U,Y,q;(B=h.map)===null||B===void 0||B.dispose(),(k=h.lightMap)===null||k===void 0||k.dispose(),(I=h.bumpMap)===null||I===void 0||I.dispose(),(P=h.normalMap)===null||P===void 0||P.dispose(),(N=h.specularMap)===null||N===void 0||N.dispose(),(g=h.envMap)===null||g===void 0||g.dispose(),(W=h.alphaMap)===null||W===void 0||W.dispose(),(ee=h.aoMap)===null||ee===void 0||ee.dispose(),(ie=h.displacementMap)===null||ie===void 0||ie.dispose(),(re=h.emissiveMap)===null||re===void 0||re.dispose(),(U=h.gradientMap)===null||U===void 0||U.dispose(),(Y=h.metalnessMap)===null||Y===void 0||Y.dispose(),(q=h.roughnessMap)===null||q===void 0||q.dispose(),h.dispose()})}}},584:function(R,j,_){"use strict";_.d(j,{disposeMesh:function(){return h.Z},isPlainObject:function(){return I.Z}});var D=_(666),T=_.n(D),L=null,h=_(695),B=_(644);function k(Y){if(Y.material){var q=Array.isArray(Y.material)?Y.material:[Y.material];q.forEach(function(x){var a,o;(a=x.color)===null||a===void 0||a.convertSRGBToLinear(),(o=x.emissive)===null||o===void 0||o.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var I=_(738),P=_(568),N=_(924),g=_(360),W=_(484),ee=null,ie=null,re=function(){var Y=(0,P.Z)(T().mark(function q(x,a){var o,l,d,m,E,w,K,oe,F;return T().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return o=a.type,l=o===void 0?"blob":o,d=a.version,m=d===void 0?"1":d,ne.next=4,(0,g.get)(x);case 4:if(w=ne.sent,!(w&&w[m])){ne.next=9;break}E=w[m],ne.next=15;break;case 9:return ne.next=11,(0,W.Z)(fetch(x).then(function(le){if(le.ok)return le[l]();throw new Error}));case 11:K=ne.sent,oe=K.res,F=K.err,F||(E=oe,(0,g.set)(x,(0,N.Z)({},m,oe)));case 15:return ne.abrupt("return",E?{url:l==="json"?x:URL.createObjectURL(E),store:E}:{url:x});case 16:case"end":return ne.stop()}},q)}));return function(x,a){return Y.apply(this,arguments)}}(),U=_(705)},738:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function D(L){return Object.prototype.toString.call(L)==="[object Object]"}function T(L){if(D(L)===!1)return!1;var h=L.constructor;if(h===void 0)return!0;var B=h.prototype;return!(D(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});var D=_(42);function T(L){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L.then(function(B){return(0,D.Z)({err:null,res:B},h)}).catch(function(B){return(0,D.Z)({err:B,res:void 0},h)})}},705:function(R,j,_){"use strict";var D=_(644),T=_.n(D),L=new Map,h=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(I,P,N,g,W){var ee=P[N*3],ie=P[N*3+1],re=P[g*3],U=P[g*3+1],Y=P[W*3],q=P[W*3+1],x;if(L.has(I))x=L.get(I);else{var a=k.box3||new THREE.Box3;if(!k.box3){var o=I.parameters.shapes.getPoints();a.setFromArray(o.map(function(w){return[w.x,w.y,0]}).flat())}var l=a.getSize(new THREE.Vector3);k.split&&(l.y/=k.split),x={box:a,size:l},L.set(I,x)}var d=x.box,m=x.size,E=k.split?1-k.split:0;return[new THREE.Vector2((ee-d.min.x)/m.x,(ie-d.min.y)/m.y+E),new THREE.Vector2((re-d.min.x)/m.x,(U-d.min.y)/m.y+E),new THREE.Vector2((Y-d.min.x)/m.x,(q-d.min.y)/m.y+E)]},generateSideWallUV:function(I,P,N,g,W,ee){var ie=P[N*3],re=P[N*3+1],U=P[N*3+2],Y=P[g*3],q=P[g*3+1],x=P[g*3+2],a=P[W*3],o=P[W*3+1],l=P[W*3+2],d=P[ee*3],m=P[ee*3+1],E=P[ee*3+2],w;if(L.has(P))w=L.get(P);else{var K=new THREE.Box3;K.setFromArray(P);var oe=K.getSize(new THREE.Vector3);k.split&&(oe.z/=1-k.split),w={box:K,size:oe},L.set(P,w)}var F=w.box,X=w.size;return Math.abs(re-q)<Math.abs(ie-Y)?[new THREE.Vector2((ie-F.min.x)/X.x,(U-F.min.z)/X.z),new THREE.Vector2((Y-F.min.x)/X.x,(x-F.min.z)/X.z),new THREE.Vector2((a-F.min.x)/X.x,(l-F.min.z)/X.z),new THREE.Vector2((d-F.min.x)/X.x,(E-F.min.z)/X.z)]:[new THREE.Vector2((re-F.min.y)/X.y,(U-F.min.z)/X.z),new THREE.Vector2((q-F.min.y)/X.y,(x-F.min.z)/X.z),new THREE.Vector2((o-F.min.y)/X.y,(l-F.min.z)/X.z),new THREE.Vector2((m-F.min.y)/X.y,(E-F.min.z)/X.z)]}}},B=function(){L.clear()}},360:function(R){"use strict";R.exports=require("idb-keyval")},644:function(R){"use strict";R.exports=require("three")},568:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function D(L,h,B,k,I,P,N){try{var g=L[P](N),W=g.value}catch(ee){B(ee);return}g.done?h(W):Promise.resolve(W).then(k,I)}function T(L){return function(){var h=this,B=arguments;return new Promise(function(k,I){var P=L.apply(h,B);function N(W){D(P,k,I,N,g,"next",W)}function g(W){D(P,k,I,N,g,"throw",W)}N(void 0)})}}},924:function(R,j,_){"use strict";_.d(j,{Z:function(){return D}});function D(T,L,h){return L in T?Object.defineProperty(T,L,{value:h,enumerable:!0,configurable:!0,writable:!0}):T[L]=h,T}},42:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});var D=_(924);function T(L){for(var h=1;h<arguments.length;h++){var B=arguments[h]!=null?arguments[h]:{},k=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(k=k.concat(Object.getOwnPropertySymbols(B).filter(function(I){return Object.getOwnPropertyDescriptor(B,I).enumerable}))),k.forEach(function(I){(0,D.Z)(L,I,B[I])})}return L}}},we={};function te(R){var j=we[R];if(j!==void 0)return j.exports;var _=we[R]={exports:{}};return xe[R](_,_.exports,te),_.exports}(function(){te.n=function(R){var j=R&&R.__esModule?function(){return R.default}:function(){return R};return te.d(j,{a:j}),j}})(),function(){te.d=function(R,j){for(var _ in j)te.o(j,_)&&!te.o(R,_)&&Object.defineProperty(R,_,{enumerable:!0,get:j[_]})}}(),function(){te.o=function(R,j){return Object.prototype.hasOwnProperty.call(R,j)}}(),function(){te.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";te.r(ye),te.d(ye,{BaseObject:function(){return Me},GUIObject:function(){return x},Pencil:function(){return be},default:function(){return be}});function R(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}function j(u,i){for(var t=0;t<i.length;t++){var e=i[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(u,e.key,e)}}function _(u,i,t){return i&&j(u.prototype,i),t&&j(u,t),u}var D=te(42);function T(u,i){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),t.push.apply(t,e)}return t}function L(u,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):T(Object(i)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(i,t))}),u}function h(u,i){(i==null||i>u.length)&&(i=u.length);for(var t=0,e=new Array(i);t<i;t++)e[t]=u[t];return e}function B(u){if(Array.isArray(u))return h(u)}function k(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function I(){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 P(u,i){if(!!u){if(typeof u=="string")return h(u,i);var t=Object.prototype.toString.call(u).slice(8,-1);if(t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(u,i)}}function N(u){return B(u)||k(u)||P(u)||I()}var g=te(644),W=te(187),ee=require("deepmerge"),ie=te.n(ee),re=require("three/examples/jsm/libs/stats.module"),U=te.n(re),Y=require("lil-gui"),q=te.n(Y),x=function(){"use strict";function u(t){R(this,u),this.guiParams={},t&&(this.guiParams=t)}var i=u.prototype;return i.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(n){var c=e.addFolder(n),p=r.guiParams[n];Object.keys(p).forEach(function(y){var b=p[y],A=b.min,z=b.max,G=b.step,S=b.name,M=b.paramMap,H=b.items,Q=b.value,Z=b.target,fe=y.toLowerCase().indexOf("color")>-1,V,de=typeof Q=="undefined"&&Z,he=de?Z():p[y],ve=de?y:"value";H?V=c.add(he,ve,H):fe?V=c.addColor(he,ve):V=c.add(he,ve),V=V.name(S||y),typeof A!="undefined"&&(V=V.min(A)),typeof z!="undefined"&&(V=V.max(z)),typeof G!="undefined"&&(V=V.step(G)),V=V.onChange(function(){r.setTargetValue(n,y,he[ve],M)}),de&&V.listen()})})},i.setTargetValue=function(e,r,n,c){var p=this.guiParams[e][r],y=p.onChange,b=p.target,A=p.value,z=r.toLowerCase().indexOf("color")>-1,G=typeof A=="undefined"&&b;if(b&&!G){var S=b();Array.isArray(S)||(S=[S]),S.forEach(function(M){if(!!M)if(z)try{M[c||r].set(n)}catch(H){r!=="color"&&!c&&console.warn("".concat(r," is not a color,set paramMap"))}else M[c||r]=n})}y&&y(n)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(n){var c=e.guiParams[r][n];typeof c.value!="undefined"&&e.setTargetValue(r,n,c.value,c.paramMap)})})},u}(),a={None:g.NoToneMapping,Linear:g.LinearToneMapping,Reinhard:g.ReinhardToneMapping,Cineon:g.CineonToneMapping,ACESFilmic:g.ACESFilmicToneMapping},o={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:g.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},l=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.width,r=t.height,n=t.rendererParams,c=n.context,p=n.alpha,y=n.devicePixelRatio,b=n.antialias,A=n.powerPreference,z=n.toneMapping,G=n.toneMappingExposure,S=n.outputEncoding,M=n.logarithmicDepthBuffer,H=n.preserveDrawingBuffer,Q=n.stencil,Z=n.depth,fe=n.physicallyCorrectLights,V=new g.WebGLRenderer({context:c,alpha:p,antialias:b,powerPreference:A,logarithmicDepthBuffer:M,preserveDrawingBuffer:H,stencil:Q,depth:Z});V.setSize(e,r),V.setPixelRatio(y),V.toneMapping=a[z],V.toneMappingExposure=G,V.outputEncoding=S,V.physicallyCorrectLights=fe,this.renderer=V}var i=u.prototype;return i.setSize=function(e,r){this.renderer.setSize(e,r)},i.render=function(){var e=this.options,r=e.scene,n=e.camera;this.renderer.render(r,n)},i.setGui=function(e){var r=this,n=new x({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:a,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});n.showGui(e)},i.dispose=function(){var e,r,n;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(n=this.renderer)===null||n===void 0||n.renderLists.dispose()},u}(),d={fov:45,near:1,far:1e3},m=function(){"use strict";function u(t){R(this,u),this.oldCameraPosition=new g.Vector3,this.oldCameraRotation=new g.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,n=t.cameraParams;if(n instanceof g.Camera)this.camera=n,this.customCamera=!0;else{var c=n.fov,p=n.far,y=n.near,b=new g.PerspectiveCamera(c,e/r,y,p);b.position.set(0,0,400),b.lookAt(0,0,0),this.camera=b}}var i=u.prototype;return i.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},i.setSize=function(e,r){this.camera instanceof g.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},i.setGui=function(e){var r=this,n=new x({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}}});this.camera instanceof g.PerspectiveCamera&&(n.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}),n.showGui(e)},u}(),E=te(584),w={background:null},K=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.sceneParams,n=r.background,c=new g.Scene;n&&(c.background=n),c.add(e),this.scene=c}var i=u.prototype;return i.addAxesHelper=function(){var e,r=new g.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,E.disposeMesh)(r)})},u}(),oe=require("three/examples/jsm/controls/OrbitControls"),F={},X=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.controlParams,n=t.mapControl,c=r.domElement,p=n?new oe.MapControls(e,c):new oe.OrbitControls(e,c);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var i=u.prototype;return i.limitPan=function(e){var r=e.maxX,n=r===void 0?1/0:r,c=e.minX,p=c===void 0?-1/0:c,y=e.maxZ,b=y===void 0?1/0:y,A=e.minZ,z=A===void 0?-1/0:A,G=e.maxY,S=G===void 0?1/0:G,M=e.minY,H=M===void 0?-1/0:M,Q=this.limitPanV||new g.Vector3,Z=this.control,fe=this.options.camera,V=new g.Vector3(p,H,z),de=new g.Vector3(n,S,b);this.limitPanV=Q,Q.copy(Z.target),Z.target.clamp(V,de),Q.sub(Z.target),fe.position.sub(Q)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},u}(),ne=require("three/examples/jsm/renderers/CSS3DRenderer"),le=new g.Vector3,f=new g.Matrix4,s=new g.Matrix4,v=new g.Vector3,O=new g.Vector3,C=function u(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,u);var t=function(M,H){return v.setFromMatrixPosition(M.matrixWorld),O.setFromMatrixPosition(H.matrixWorld),v.distanceToSquared(O)},e=function(M){var H=[];return M.traverse(function(Q){Q.isCSS2DObject&&H.push(Q)}),H},r=function(M){for(var H=e(M).sort(function(de,he){if(de.renderOrder!==he.renderOrder)return he.renderOrder-de.renderOrder;var ve=A.objects.get(de).distanceToCameraSquared,ze=A.objects.get(he).distanceToCameraSquared;return ve-ze}),Q=H.length,Z=0,fe=H.length;Z<fe;Z++){var V=H[Z].userData.zIndexFix||0;H[Z].element.style.zIndex=Q-Z+V}},n=this,c,p,y,b,A={objects:new WeakMap},z=i.element!==void 0?i.element:document.createElement("div");z.style.overflow="hidden",this.domElement=z,this.getSize=function(){return{width:c,height:p}},this.render=function(S,M){+g.REVISION<144?(S.autoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld()):(S.matrixWorldAutoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.matrixWorldAutoUpdate===!0&&M.updateMatrixWorld()),f.copy(M.matrixWorldInverse),s.multiplyMatrices(M.projectionMatrix,f),G(S,S,M),r(S)},this.setSize=function(S,M){c=S,p=M,y=c/2,b=p/2,z.style.width="".concat(S,"px"),z.style.height="".concat(M,"px")};function G(S,M,H){if(S.isCSS2DObject){le.setFromMatrixPosition(S.matrixWorld),le.applyMatrix4(s);var Q=S.visible===!0&&le.z>=-1&&le.z<=1&&S.layers.test(H.layers)===!0;if(S.element.style.display=Q===!0?"":"none",Q===!0){S.onBeforeRender(n,M,H);var Z=S.element;Z.style.transform="translate(-50%,-50%) translate(".concat(le.x*y+y,"px,").concat(-le.y*b+b,"px)"),Z.parentNode!==z&&z.appendChild(Z),S.onAfterRender(n,M,H)}var fe={distanceToCameraSquared:t(H,S)};A.objects.set(S,fe)}for(var V=0,de=S.children.length;V<de;V++)G(S.children[V],M,H)}},$={zIndex:"auto"},ae=function(){"use strict";function u(t){R(this,u),this.container=t}var i=u.prototype;return i.addRenderer=function(e,r){var n=this.container,c=n.offsetWidth,p=n.offsetHeight,y=e==="css2d"?new C:new ne.CSS3DRenderer;y.domElement.style.position="absolute",y.domElement.style.top="0",y.domElement.style.pointerEvents="none",y.domElement.style.zIndex=r.zIndex,y.setSize(c,p),n.appendChild(y.domElement),e==="css2d"?this.css2Drenderer=y:e==="css3d"&&(this.css3Drenderer=y)},i.setSize=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.setSize(e,r),(c=this.css3Drenderer)===null||c===void 0||c.setSize(e,r)},i.render=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.render(e,r),(c=this.css3Drenderer)===null||c===void 0||c.render(e,r)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},u}(),J=require("postprocessing"),ue={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},se=function(){"use strict";function u(t){R(this,u),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,n=t.camera,c=t.composerParams,p=c.multisampling,y=e.capabilities.maxSamples,b=new J.EffectComposer(e,{multisampling:Math.min(p,y)});b.addPass(new J.RenderPass(r,n)),this.finalComposer=b,this.renderer=e,this.scene=r,this.camera=n}var i=u.prototype;return i.addCopyPass=function(){var e=new J.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},i.addFXAAPass=function(){var e=this.camera,r=new J.FXAAEffect({blendFunction:J.BlendFunction.NORMAL}),n=new J.EffectPass(e,r);this.finalComposer.addPass(n),this.fxaaPass=n},i.addBloomPass=function(e){var r=this,n=r.camera,c=r.scene,p=new J.SelectiveBloomEffect(c,n,(0,D.Z)({},e)),y=new J.EffectPass(n,p);y.enabled=!1,this.finalComposer.addPass(y),this.bloomPass=y,this.bloomEffect=p},i.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var n=new x({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(c){r.bloomEffect.luminancePass.enabled=c}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});n.showGui(e)}},i.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},i.getSize=function(){var e=this.options.renderer;return e.getSize(new g.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.setSize=function(e,r){this.finalComposer.setSize(e,r)},i.render=function(){!this.active||this.finalComposer.render()},i.dispose=function(){this.finalComposer.dispose()},u}(),me=function(){try{var u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(i){return!1}},pe=0,ce=!1,Pe=me()!==!1,be=function(){"use strict";function u(t){R(this,u),this.raycaster=new g.Raycaster,this.installPlugins=new Map,this.event=new W.EventEmitter,this.clock=new g.Clock,this.userData={},this.options=ie()(u.options,t,{isMergeableObject:E.isPlainObject});var e=this.options,r=e.container,n=e.stats,c=e.gui,p=e.resizeObserver;if(c){var y=new(q());y.open(!1),this.gui=y}if(n){var b=new(U());b.showPanel(0),b.dom.style.position="absolute",r.appendChild(b.dom),this.stats=b}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=u.prototype;return i.use=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),c=1;c<r;c++)n[c-1]=arguments[c];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(N(n))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,r=e.container,n=e.isdev,c=e.axesHelper,p=e.renderer,y=e.scene,b=e.camera,A=this.getSize(),z=A.width,G=A.height,S=new m({isdev:n,width:z,height:G,cameraParams:b});this.gui&&S.setGui(this.gui);var M=S.camera,H=new K({camera:M,sceneParams:y}),Q=H.scene,Z=new l({width:z,height:G,scene:Q,camera:M,isdev:n,rendererParams:L((0,D.Z)({},p),{antialias:!1})});this.gui&&Z.setGui(this.gui);var fe=Z.renderer;c&&H.addAxesHelper(),this.sceneController=H,this.rendererController=Z,this.cameraController=S,r.appendChild(fe.domElement)},i.initComposer=function(){var e=this.options,r=e.bloom,n=e.bloomParams,c=e.renderer,p=e.multisampling,y=e.passes,b=c.antialias;b==="msaa"&&!Pe&&(b=!1,console.warn("MSAA is not supported on this browser"));var A=new se({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:b==="msaa"?p:0,type:g.UnsignedByteType,encoding:c.outputEncoding}});this.composerController=A,r&&(A.addBloomPass(n),this.gui&&A.addBloomGui(this.gui)),b==="fxaa"&&A.addFXAAPass(),y&&y.forEach(function(z){A.finalComposer.addPass(z)}),A.addCopyPass()},i.initCSSRenderer=function(){var e=this.options,r=e.container,n=e.css2DRenderer,c=e.css3DRenderer,p=e.css2DRendererParams,y=e.css3DRendererParams;if(n||c){var b=new ae(r);n&&b.addRenderer("css2d",p),c&&b.addRenderer("css3d",y),this.cssRendererController=b}},i.initControl=function(){var e=this.options,r=e.control,n=e.mapControl,c=e.controlParams;if(r){var p=new X({camera:this.camera,controlParams:{domElement:(c==null?void 0:c.domElement)||this.renderer.domElement},mapControl:n});this.controlController=p}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var n=new ResizeObserver(function(c){var p=!0,y=!1,b=void 0;try{for(var A=c[Symbol.iterator](),z;!(p=(z=A.next()).done);p=!0){var G=z.value,S=G.contentRect;e.handeleResize(S.width,S.height),e.render()}}catch(M){y=!0,b=M}finally{try{!p&&A.return!=null&&A.return()}finally{if(y)throw b}}});n.observe(r),this.resizeObserver=n}},i.handeleResize=function(e,r){var n=this,c=n.rendererController,p=n.cameraController,y=n.composerController,b=n.cssRendererController;p==null||p.setSize(e,r),c==null||c.setSize(e,r),y==null||y.setSize(e,r),b==null||b.setSize(e,r),this.installPlugins.forEach(function(A,z){var G;(G=z.resize)===null||G===void 0||G.call(z,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},i.pick=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=this,p=c.raycaster,y=c.options,b=y.container,A=new g.Vector2,z=b.getBoundingClientRect();if(A.x=(e.clientX-z.left)/(z.right-z.left)*2-1,A.y=-((e.clientY-z.top)/(z.bottom-z.top))*2+1,this.camera&&this.scene){p.setFromCamera(A,this.camera);var G=p.intersectObjects(r||this.scene.children,n);if(G.length)return{object:G[0].object,intersects:G}}},i.render=function(){var e,r,n,c,p=this,y=p.renderer,b=p.scene,A=p.camera,z=p.clock;if(!(!y||!b||!A||this.options.staticRender&&!this.cameraController.checkCameraChange())){var G=z.getDelta(),S=z.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,Q){var Z;(Z=Q.update)===null||Z===void 0||Z.call(Q,G,S)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(n=this.cssRendererController)===null||n===void 0||n.render(b,A),(c=this.stats)===null||c===void 0||c.update(),this.event.emit("render",{delta:G,elapsed:S})}},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,r,n,c,p,y,b;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(A,z){var G;(G=z.dispose)===null||G===void 0||G.call(z)}),(r=this.controlController)===null||r===void 0||r.dispose(),(n=this.cssRendererController)===null||n===void 0||n.dispose(),(c=this.sceneController)===null||c===void 0||c.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(y=this.rendererController)===null||y===void 0||y.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(b=this.gui)===null||b===void 0||b.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},_(u,[{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}}]),u}();be.options={isdev:ce,stats:ce,gui:ce,axesHelper:ce,control:ce,resizeObserver:!0,renderer:L((0,D.Z)({},o),{antialias:Pe?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:w,camera:d,bloom:!1,bloomParams:ue,css2DRenderer:!1,css2DRendererParams:(0,D.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,D.Z)({},$)};function _e(u,i){return _e=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},_e(u,i)}function Oe(u,i){return _e(u,i)}function Se(){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(u){return!1}}function ge(u,i,t){return Se()?ge=Reflect.construct:ge=function(r,n,c){var p=[null];p.push.apply(p,n);var y=Function.bind.apply(r,p),b=new y;return c&&Oe(b,c.prototype),b},ge.apply(null,arguments)}function Ce(u,i,t){return ge.apply(null,arguments)}var Le=te(484);function Re(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),u&&(t.promise=(0,Le.Z)(t.promise,i)),t}var je=require("three/examples/jsm/renderers/CSS2DRenderer"),Ee=function(u){u&&((0,E.disposeMesh)(u),u.children.forEach(function(i){i.userData.BaseObject_||Ee(i)}))},Me=function(){"use strict";function u(){R(this,u),this.objecttype__="BaseObject",this.userData={},this.pm=Re(),this.visible=!1}var i=u.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,r){},i.resize=function(e,r){},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,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(g.Mesh,N(r)),this},i.createGroup=function(){return this.object3d=new g.Group,this},i.createPoints=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(g.Points,N(r)),this},i.createCSS2DObject=function(e){return this.object3d=new je.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 g.Sprite(e),this},i.add=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).add.apply(c,N(r)),this},i.remove=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).remove.apply(c,N(r)),this},i.getSize=function(){var e=new g.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new g.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},i.dispose=function(){Ee(this.object3d)},_(u,[{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})}}]),u}()})(),module.exports=ye})();
|
package/dist/index.module.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as Re from"idb-keyval";import*as $ from"three";import*as Ue from"deepmerge";import*as Ze from"three/examples/jsm/libs/stats.module";import*as Xe from"lil-gui";import*as Me from"three/examples/jsm/controls/OrbitControls";import*as xe from"three/examples/jsm/renderers/CSS3DRenderer";import*as me from"postprocessing";import*as Ke from"three/examples/jsm/renderers/CSS2DRenderer";var Ye={187:function(j){var R=typeof Reflect=="object"?Reflect:null,b=R&&typeof R.apply=="function"?R.apply:function(a,c,h){return Function.prototype.apply.call(a,c,h)},D;R&&typeof R.ownKeys=="function"?D=R.ownKeys:Object.getOwnPropertySymbols?D=function(a){return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a))}:D=function(a){return Object.getOwnPropertyNames(a)};function L(s){console&&console.warn&&console.warn(s)}var S=Number.isNaN||function(a){return a!==a};function d(){d.init.call(this)}j.exports=d,j.exports.once=J,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var T=10;function W(s){if(typeof s!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return T},set:function(s){if(typeof s!="number"||s<0||S(s))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+s+".");T=s}}),d.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},d.prototype.setMaxListeners=function(a){if(typeof a!="number"||a<0||S(a))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+a+".");return this._maxListeners=a,this};function E(s){return s._maxListeners===void 0?d.defaultMaxListeners:s._maxListeners}d.prototype.getMaxListeners=function(){return E(this)},d.prototype.emit=function(a){for(var c=[],h=1;h<arguments.length;h++)c.push(arguments[h]);var y=a==="error",w=this._events;if(w!==void 0)y=y&&w.error===void 0;else if(!y)return!1;if(y){var P;if(c.length>0&&(P=c[0]),P instanceof Error)throw P;var Q=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw Q.context=P,Q}var G=w[a];if(G===void 0)return!1;if(typeof G=="function")b(G,this,c);else for(var F=G.length,de=ae(G,F),h=0;h<F;++h)b(de[h],this,c);return!0};function B(s,a,c,h){var y,w,P;if(W(c),w=s._events,w===void 0?(w=s._events=Object.create(null),s._eventsCount=0):(w.newListener!==void 0&&(s.emit("newListener",a,c.listener?c.listener:c),w=s._events),P=w[a]),P===void 0)P=w[a]=c,++s._eventsCount;else if(typeof P=="function"?P=w[a]=h?[c,P]:[P,c]:h?P.unshift(c):P.push(c),y=E(s),y>0&&P.length>y&&!P.warned){P.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=s,Q.type=a,Q.count=P.length,L(Q)}return s}d.prototype.addListener=function(a,c){return B(this,a,c,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(a,c){return B(this,a,c,!0)};function I(){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 _(s,a,c){var h={fired:!1,wrapFn:void 0,target:s,type:a,listener:c},y=I.bind(h);return y.listener=c,h.wrapFn=y,y}d.prototype.once=function(a,c){return W(c),this.on(a,_(this,a,c)),this},d.prototype.prependOnceListener=function(a,c){return W(c),this.prependListener(a,_(this,a,c)),this},d.prototype.removeListener=function(a,c){var h,y,w,P,Q;if(W(c),y=this._events,y===void 0)return this;if(h=y[a],h===void 0)return this;if(h===c||h.listener===c)--this._eventsCount===0?this._events=Object.create(null):(delete y[a],y.removeListener&&this.emit("removeListener",a,h.listener||c));else if(typeof h!="function"){for(w=-1,P=h.length-1;P>=0;P--)if(h[P]===c||h[P].listener===c){Q=h[P].listener,w=P;break}if(w<0)return this;w===0?h.shift():ne(h,w),h.length===1&&(y[a]=h[0]),y.removeListener!==void 0&&this.emit("removeListener",a,Q||c)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(a){var c,h,y;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[a]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[a]),this;if(arguments.length===0){var w=Object.keys(h),P;for(y=0;y<w.length;++y)P=w[y],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(c=h[a],typeof c=="function")this.removeListener(a,c);else if(c!==void 0)for(y=c.length-1;y>=0;y--)this.removeListener(a,c[y]);return this};function Z(s,a,c){var h=s._events;if(h===void 0)return[];var y=h[a];return y===void 0?[]:typeof y=="function"?c?[y.listener||y]:[y]:c?K(y):ae(y,y.length)}d.prototype.listeners=function(a){return Z(this,a,!0)},d.prototype.rawListeners=function(a){return Z(this,a,!1)},d.listenerCount=function(s,a){return typeof s.listenerCount=="function"?s.listenerCount(a):re.call(s,a)},d.prototype.listenerCount=re;function re(s){var a=this._events;if(a!==void 0){var c=a[s];if(typeof c=="function")return 1;if(c!==void 0)return c.length}return 0}d.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};function ae(s,a){for(var c=new Array(a),h=0;h<a;++h)c[h]=s[h];return c}function ne(s,a){for(;a+1<s.length;a++)s[a]=s[a+1];s.pop()}function K(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}function J(s,a){return new Promise(function(c,h){function y(P){s.removeListener(a,w),h(P)}function w(){typeof s.removeListener=="function"&&s.removeListener("error",y),c([].slice.call(arguments))}M(s,a,w,{once:!0}),a!=="error"&&U(s,y,{once:!0})})}function U(s,a,c){typeof s.on=="function"&&M(s,"error",a,c)}function M(s,a,c,h){if(typeof s.on=="function")h.once?s.once(a,c):s.on(a,c);else if(typeof s.addEventListener=="function")s.addEventListener(a,function y(w){h.once&&s.removeEventListener(a,y),c(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof s)}},666:function(j){var R=function(b){"use strict";var D=Object.prototype,L=D.hasOwnProperty,S,d=typeof Symbol=="function"?Symbol:{},T=d.iterator||"@@iterator",W=d.asyncIterator||"@@asyncIterator",E=d.toStringTag||"@@toStringTag";function B(f,u,v){return Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{B({},"")}catch(f){B=function(u,v,O){return u[v]=O}}function I(f,u,v,O){var C=u&&u.prototype instanceof J?u:J,Y=Object.create(C.prototype),q=new de(O||[]);return Y._invoke=P(f,v,q),Y}b.wrap=I;function _(f,u,v){try{return{type:"normal",arg:f.call(u,v)}}catch(O){return{type:"throw",arg:O}}}var Z="suspendedStart",re="suspendedYield",ae="executing",ne="completed",K={};function J(){}function U(){}function M(){}var s={};B(s,T,function(){return this});var a=Object.getPrototypeOf,c=a&&a(a(se([])));c&&c!==D&&L.call(c,T)&&(s=c);var h=M.prototype=J.prototype=Object.create(s);U.prototype=M,B(h,"constructor",M),B(M,"constructor",U),U.displayName=B(M,E,"GeneratorFunction");function y(f){["next","throw","return"].forEach(function(u){B(f,u,function(v){return this._invoke(u,v)})})}b.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===U||(u.displayName||u.name)==="GeneratorFunction":!1},b.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,M):(f.__proto__=M,B(f,E,"GeneratorFunction")),f.prototype=Object.create(h),f},b.awrap=function(f){return{__await:f}};function w(f,u){function v(Y,q,ie,ue){var oe=_(f[Y],f,q);if(oe.type==="throw")ue(oe.arg);else{var _e=oe.arg,ve=_e.value;return ve&&typeof ve=="object"&&L.call(ve,"__await")?u.resolve(ve.__await).then(function(fe){v("next",fe,ie,ue)},function(fe){v("throw",fe,ie,ue)}):u.resolve(ve).then(function(fe){_e.value=fe,ie(_e)},function(fe){return v("throw",fe,ie,ue)})}}var O;function C(Y,q){function ie(){return new u(function(ue,oe){v(Y,q,ue,oe)})}return O=O?O.then(ie,ie):ie()}this._invoke=C}y(w.prototype),B(w.prototype,W,function(){return this}),b.AsyncIterator=w,b.async=function(f,u,v,O,C){C===void 0&&(C=Promise);var Y=new w(I(f,u,v,O),C);return b.isGeneratorFunction(u)?Y:Y.next().then(function(q){return q.done?q.value:Y.next()})};function P(f,u,v){var O=Z;return function(Y,q){if(O===ae)throw new Error("Generator is already running");if(O===ne){if(Y==="throw")throw q;return ge()}for(v.method=Y,v.arg=q;;){var ie=v.delegate;if(ie){var ue=Q(ie,v);if(ue){if(ue===K)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===Z)throw O=ne,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=ae;var oe=_(f,u,v);if(oe.type==="normal"){if(O=v.done?ne:re,oe.arg===K)continue;return{value:oe.arg,done:v.done}}else oe.type==="throw"&&(O=ne,v.method="throw",v.arg=oe.arg)}}}function Q(f,u){var v=f.iterator[u.method];if(v===S){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=S,Q(f,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var O=_(v,f.iterator,u.arg);if(O.type==="throw")return u.method="throw",u.arg=O.arg,u.delegate=null,K;var C=O.arg;if(!C)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(C.done)u[f.resultName]=C.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=S);else return C;return u.delegate=null,K}y(h),B(h,E,"Generator"),B(h,T,function(){return this}),B(h,"toString",function(){return"[object Generator]"});function G(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function F(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function de(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(G,this),this.reset(!0)}b.keys=function(f){var u=[];for(var v in f)u.push(v);return u.reverse(),function O(){for(;u.length;){var C=u.pop();if(C in f)return O.value=C,O.done=!1,O}return O.done=!0,O}};function se(f){if(f){var u=f[T];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function C(){for(;++v<f.length;)if(L.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=S,C.done=!0,C};return O.next=O}}return{next:ge}}b.values=se;function ge(){return{value:S,done:!0}}return de.prototype={constructor:de,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=S,this.done=!1,this.delegate=null,this.method="next",this.arg=S,this.tryEntries.forEach(F),!f)for(var u in this)u.charAt(0)==="t"&&L.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=S)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function v(ue,oe){return Y.type="throw",Y.arg=f,u.next=ue,oe&&(u.method="next",u.arg=S),!!oe}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],Y=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var q=L.call(C,"catchLoc"),ie=L.call(C,"finallyLoc");if(q&&ie){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(q){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(ie){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&L.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=u&&u<=C.finallyLoc&&(C=null);var Y=C?C.completion:{};return Y.type=f,Y.arg=u,C?(this.method="next",this.next=C.finallyLoc,K):this.complete(Y)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),K},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),K}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var C=O.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,v){return this.delegate={iterator:se(f),resultName:u,nextLoc:v},this.method==="next"&&(this.arg=S),K}},b}(j.exports);try{regeneratorRuntime=R}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(j,R,b){b.d(R,{Z:function(){return D}});function D(L){if(L.geometry&&L.geometry.dispose(),L.material){var S=Array.isArray(L.material)?L.material:[L.material];S.forEach(function(d){var T,W,E,B,I,_,Z,re,ae,ne,K,J,U;(T=d.map)===null||T===void 0||T.dispose(),(W=d.lightMap)===null||W===void 0||W.dispose(),(E=d.bumpMap)===null||E===void 0||E.dispose(),(B=d.normalMap)===null||B===void 0||B.dispose(),(I=d.specularMap)===null||I===void 0||I.dispose(),(_=d.envMap)===null||_===void 0||_.dispose(),(Z=d.alphaMap)===null||Z===void 0||Z.dispose(),(re=d.aoMap)===null||re===void 0||re.dispose(),(ae=d.displacementMap)===null||ae===void 0||ae.dispose(),(ne=d.emissiveMap)===null||ne===void 0||ne.dispose(),(K=d.gradientMap)===null||K===void 0||K.dispose(),(J=d.metalnessMap)===null||J===void 0||J.dispose(),(U=d.roughnessMap)===null||U===void 0||U.dispose(),d.dispose()})}}},584:function(j,R,b){b.d(R,{wf:function(){return d.Z},PO:function(){return E.Z}});var D=b(666),L=b.n(D),S=null,d=b(695),T=b(949);function W(J){if(J.material){var U=Array.isArray(J.material)?J.material:[J.material];U.forEach(function(M){var s,a;(s=M.color)===null||s===void 0||s.convertSRGBToLinear(),(a=M.emissive)===null||a===void 0||a.convertSRGBToLinear(),M.map&&(M.map.encoding=THREE.sRGBEncoding),M.emissiveMap&&(M.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=b(738),B=b(568),I=b(924),_=b(77),Z=b(484),re=null,ae=null,ne=function(){var J=(0,B.Z)(L().mark(function U(M,s){var a,c,h,y,w,P,Q,G,F;return L().wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return a=s.type,c=a===void 0?"blob":a,h=s.version,y=h===void 0?"1":h,se.next=4,(0,_.get)(M);case 4:if(P=se.sent,!(P&&P[y])){se.next=9;break}w=P[y],se.next=15;break;case 9:return se.next=11,(0,Z.Z)(fetch(M).then(function(ge){if(ge.ok)return ge[c]();throw new Error}));case 11:Q=se.sent,G=Q.res,F=Q.err,F||(w=G,(0,_.set)(M,(0,I.Z)({},y,G)));case 15:return se.abrupt("return",w?{url:c==="json"?M:URL.createObjectURL(w),store:w}:{url:M});case 16:case"end":return se.stop()}},U)}));return function(M,s){return J.apply(this,arguments)}}(),K=b(705)},738:function(j,R,b){b.d(R,{Z:function(){return L}});function D(S){return Object.prototype.toString.call(S)==="[object Object]"}function L(S){if(D(S)===!1)return!1;var d=S.constructor;if(d===void 0)return!0;var T=d.prototype;return!(D(T)===!1||T.hasOwnProperty("isPrototypeOf")===!1)}},484:function(j,R,b){b.d(R,{Z:function(){return L}});var D=b(42);function L(S){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return S.then(function(T){return(0,D.Z)({err:null,res:T},d)}).catch(function(T){return(0,D.Z)({err:T,res:void 0},d)})}},705:function(j,R,b){var D=b(949),L=new Map,S=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(W,E,B,I,_){var Z=E[B*3],re=E[B*3+1],ae=E[I*3],ne=E[I*3+1],K=E[_*3],J=E[_*3+1],U;if(L.has(W))U=L.get(W);else{var M=T.box3||new THREE.Box3;if(!T.box3){var s=W.parameters.shapes.getPoints();M.setFromArray(s.map(function(w){return[w.x,w.y,0]}).flat())}var a=M.getSize(new THREE.Vector3);T.split&&(a.y/=T.split),U={box:M,size:a},L.set(W,U)}var c=U.box,h=U.size,y=T.split?1-T.split:0;return[new THREE.Vector2((Z-c.min.x)/h.x,(re-c.min.y)/h.y+y),new THREE.Vector2((ae-c.min.x)/h.x,(ne-c.min.y)/h.y+y),new THREE.Vector2((K-c.min.x)/h.x,(J-c.min.y)/h.y+y)]},generateSideWallUV:function(W,E,B,I,_,Z){var re=E[B*3],ae=E[B*3+1],ne=E[B*3+2],K=E[I*3],J=E[I*3+1],U=E[I*3+2],M=E[_*3],s=E[_*3+1],a=E[_*3+2],c=E[Z*3],h=E[Z*3+1],y=E[Z*3+2],w;if(L.has(E))w=L.get(E);else{var P=new THREE.Box3;P.setFromArray(E);var Q=P.getSize(new THREE.Vector3);T.split&&(Q.z/=1-T.split),w={box:P,size:Q},L.set(E,w)}var G=w.box,F=w.size;return Math.abs(ae-J)<Math.abs(re-K)?[new THREE.Vector2((re-G.min.x)/F.x,(ne-G.min.z)/F.z),new THREE.Vector2((K-G.min.x)/F.x,(U-G.min.z)/F.z),new THREE.Vector2((M-G.min.x)/F.x,(a-G.min.z)/F.z),new THREE.Vector2((c-G.min.x)/F.x,(y-G.min.z)/F.z)]:[new THREE.Vector2((ae-G.min.y)/F.y,(ne-G.min.z)/F.z),new THREE.Vector2((J-G.min.y)/F.y,(U-G.min.z)/F.z),new THREE.Vector2((s-G.min.y)/F.y,(a-G.min.z)/F.z),new THREE.Vector2((h-G.min.y)/F.y,(y-G.min.z)/F.z)]}}},d=function(){L.clear()}},77:function(j,R,b){var D=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=D({get:()=>Re.get,set:()=>Re.set})},949:function(j,R,b){var D=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=D({ACESFilmicToneMapping:()=>$.ACESFilmicToneMapping,AxesHelper:()=>$.AxesHelper,Box3:()=>$.Box3,Camera:()=>$.Camera,CineonToneMapping:()=>$.CineonToneMapping,Clock:()=>$.Clock,Euler:()=>$.Euler,Group:()=>$.Group,LinearEncoding:()=>$.LinearEncoding,LinearToneMapping:()=>$.LinearToneMapping,Matrix4:()=>$.Matrix4,Mesh:()=>$.Mesh,NoToneMapping:()=>$.NoToneMapping,PerspectiveCamera:()=>$.PerspectiveCamera,Points:()=>$.Points,REVISION:()=>$.REVISION,Raycaster:()=>$.Raycaster,ReinhardToneMapping:()=>$.ReinhardToneMapping,Scene:()=>$.Scene,Sprite:()=>$.Sprite,UnsignedByteType:()=>$.UnsignedByteType,Vector2:()=>$.Vector2,Vector3:()=>$.Vector3,WebGLRenderer:()=>$.WebGLRenderer})},568:function(j,R,b){b.d(R,{Z:function(){return L}});function D(S,d,T,W,E,B,I){try{var _=S[B](I),Z=_.value}catch(re){T(re);return}_.done?d(Z):Promise.resolve(Z).then(W,E)}function L(S){return function(){var d=this,T=arguments;return new Promise(function(W,E){var B=S.apply(d,T);function I(Z){D(B,W,E,I,_,"next",Z)}function _(Z){D(B,W,E,I,_,"throw",Z)}I(void 0)})}}},924:function(j,R,b){b.d(R,{Z:function(){return D}});function D(L,S,d){return S in L?Object.defineProperty(L,S,{value:d,enumerable:!0,configurable:!0,writable:!0}):L[S]=d,L}},42:function(j,R,b){b.d(R,{Z:function(){return L}});var D=b(924);function L(S){for(var d=1;d<arguments.length;d++){var T=arguments[d]!=null?arguments[d]:{},W=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(W=W.concat(Object.getOwnPropertySymbols(T).filter(function(E){return Object.getOwnPropertyDescriptor(T,E).enumerable}))),W.forEach(function(E){(0,D.Z)(S,E,T[E])})}return S}}},je={};function te(j){var R=je[j];if(R!==void 0)return R.exports;var b=je[j]={exports:{}};return Ye[j](b,b.exports,te),b.exports}(function(){te.n=function(j){var R=j&&j.__esModule?function(){return j.default}:function(){return j};return te.d(R,{a:R}),R}})(),function(){te.d=function(j,R){for(var b in R)te.o(R,b)&&!te.o(j,b)&&Object.defineProperty(j,b,{enumerable:!0,get:R[b]})}}(),function(){te.o=function(j,R){return Object.prototype.hasOwnProperty.call(j,R)}}();var we={};(function(){te.d(we,{L6:function(){return Fe},sb:function(){return c},z:function(){return Ee},ZP:function(){return Ee}});function j(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}function R(o,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}function b(o,n,t){return n&&R(o.prototype,n),t&&R(o,t),o}var D=te(42);function L(o,n){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,e)}return t}function S(o,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(n,t))}),o}function d(o,n){(n==null||n>o.length)&&(n=o.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=o[t];return e}function T(o){if(Array.isArray(o))return d(o)}function W(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function E(){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 B(o,n){if(!!o){if(typeof o=="string")return d(o,n);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(o,n)}}function I(o){return T(o)||W(o)||B(o)||E()}var _=te(949),Z=te(187),re=o=>{var n={};return te.d(n,o),n},ae=o=>()=>o,ne=re({default:()=>Ue.default}),K=o=>{var n={};return te.d(n,o),n},J=o=>()=>o,U=K({default:()=>Ze.default}),M=o=>{var n={};return te.d(n,o),n},s=o=>()=>o,a=M({default:()=>Xe.default}),c=function(){"use strict";function o(t){j(this,o),this.guiParams={},t&&(this.guiParams=t)}var n=o.prototype;return n.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(i){var l=e.addFolder(i),p=r.guiParams[i];Object.keys(p).forEach(function(m){var g=p[m],V=g.min,z=g.max,k=g.step,x=g.name,A=g.paramMap,H=g.items,ee=g.value,X=g.target,ce=m.toLowerCase().indexOf("color")>-1,N,le=typeof ee=="undefined"&&X,pe=le?X():p[m],ye=le?m:"value";H?N=l.add(pe,ye,H):ce?N=l.addColor(pe,ye):N=l.add(pe,ye),N=N.name(x||m),typeof V!="undefined"&&(N=N.min(V)),typeof z!="undefined"&&(N=N.max(z)),typeof k!="undefined"&&(N=N.step(k)),N=N.onChange(function(){r.setTargetValue(i,m,pe[ye],A)}),le&&N.listen()})})},n.setTargetValue=function(e,r,i,l){var p=this.guiParams[e][r],m=p.onChange,g=p.target,V=p.value,z=r.toLowerCase().indexOf("color")>-1,k=typeof V=="undefined"&&g;if(g&&!k){var x=g();Array.isArray(x)||(x=[x]),x.forEach(function(A){if(!!A)if(z)try{A[l||r].set(i)}catch(H){r!=="color"&&!l&&console.warn("".concat(r," is not a color,set paramMap"))}else A[l||r]=i})}m&&m(i)},n.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(i){var l=e.guiParams[r][i];typeof l.value!="undefined"&&e.setTargetValue(r,i,l.value,l.paramMap)})})},o}(),h={None:_.NoToneMapping,Linear:_.LinearToneMapping,Reinhard:_.ReinhardToneMapping,Cineon:_.CineonToneMapping,ACESFilmic:_.ACESFilmicToneMapping},y={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:_.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},w=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.width,r=t.height,i=t.rendererParams,l=i.context,p=i.alpha,m=i.devicePixelRatio,g=i.antialias,V=i.powerPreference,z=i.toneMapping,k=i.toneMappingExposure,x=i.outputEncoding,A=i.logarithmicDepthBuffer,H=i.preserveDrawingBuffer,ee=i.stencil,X=i.depth,ce=i.physicallyCorrectLights,N=new _.WebGLRenderer({context:l,alpha:p,antialias:g,powerPreference:V,logarithmicDepthBuffer:A,preserveDrawingBuffer:H,stencil:ee,depth:X});N.setSize(e,r),N.setPixelRatio(m),N.toneMapping=h[z],N.toneMappingExposure=k,N.outputEncoding=x,N.physicallyCorrectLights=ce,this.renderer=N}var n=o.prototype;return n.setSize=function(e,r){this.renderer.setSize(e,r)},n.render=function(){var e=this.options,r=e.scene,i=e.camera;this.renderer.render(r,i)},n.setGui=function(e){var r=this,i=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:h,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});i.showGui(e)},n.dispose=function(){var e,r,i;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},o}(),P={fov:45,near:1,far:1e3},Q=function(){"use strict";function o(t){j(this,o),this.oldCameraPosition=new _.Vector3,this.oldCameraRotation=new _.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,i=t.cameraParams;if(i instanceof _.Camera)this.camera=i,this.customCamera=!0;else{var l=i.fov,p=i.far,m=i.near,g=new _.PerspectiveCamera(l,e/r,m,p);g.position.set(0,0,400),g.lookAt(0,0,0),this.camera=g}}var n=o.prototype;return n.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},n.setSize=function(e,r){this.camera instanceof _.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},n.setGui=function(e){var r=this,i=new c({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}}});this.camera instanceof _.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}),i.showGui(e)},o}(),G=te(584),F={background:null},de=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.sceneParams,i=r.background,l=new _.Scene;i&&(l.background=i),l.add(e),this.scene=l}var n=o.prototype;return n.addAxesHelper=function(){var e,r=new _.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},n.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,G.wf)(r)})},o}(),se=o=>{var n={};return te.d(n,o),n},ge=o=>()=>o,f=se({MapControls:()=>Me.MapControls,OrbitControls:()=>Me.OrbitControls}),u={},v=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.controlParams,i=t.mapControl,l=r.domElement,p=i?new f.MapControls(e,l):new f.OrbitControls(e,l);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var n=o.prototype;return n.limitPan=function(e){var r=e.maxX,i=r===void 0?1/0:r,l=e.minX,p=l===void 0?-1/0:l,m=e.maxZ,g=m===void 0?1/0:m,V=e.minZ,z=V===void 0?-1/0:V,k=e.maxY,x=k===void 0?1/0:k,A=e.minY,H=A===void 0?-1/0:A,ee=this.limitPanV||new _.Vector3,X=this.control,ce=this.options.camera,N=new _.Vector3(p,H,z),le=new _.Vector3(i,x,g);this.limitPanV=ee,ee.copy(X.target),X.target.clamp(N,le),ee.sub(X.target),ce.position.sub(ee)},n.update=function(){this.control.update()},n.dispose=function(){this.control.dispose()},o}(),O=o=>{var n={};return te.d(n,o),n},C=o=>()=>o,Y=O({CSS3DObject:()=>xe.CSS3DObject,CSS3DRenderer:()=>xe.CSS3DRenderer,CSS3DSprite:()=>xe.CSS3DSprite}),q=new _.Vector3,ie=new _.Matrix4,ue=new _.Matrix4,oe=new _.Vector3,_e=new _.Vector3,ve=function o(){"use strict";var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,o);var t=function(A,H){return oe.setFromMatrixPosition(A.matrixWorld),_e.setFromMatrixPosition(H.matrixWorld),oe.distanceToSquared(_e)},e=function(A){var H=[];return A.traverse(function(ee){ee.isCSS2DObject&&H.push(ee)}),H},r=function(A){for(var H=e(A).sort(function(le,pe){if(le.renderOrder!==pe.renderOrder)return pe.renderOrder-le.renderOrder;var ye=V.objects.get(le).distanceToCameraSquared,He=V.objects.get(pe).distanceToCameraSquared;return ye-He}),ee=H.length,X=0,ce=H.length;X<ce;X++){var N=H[X].userData.zIndexFix||0;H[X].element.style.zIndex=ee-X+N}},i=this,l,p,m,g,V={objects:new WeakMap},z=n.element!==void 0?n.element:document.createElement("div");z.style.overflow="hidden",this.domElement=z,this.getSize=function(){return{width:l,height:p}},this.render=function(x,A){+_.REVISION<144?(x.autoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld()):(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld()),ie.copy(A.matrixWorldInverse),ue.multiplyMatrices(A.projectionMatrix,ie),k(x,x,A),r(x)},this.setSize=function(x,A){l=x,p=A,m=l/2,g=p/2,z.style.width="".concat(x,"px"),z.style.height="".concat(A,"px")};function k(x,A,H){if(x.isCSS2DObject){q.setFromMatrixPosition(x.matrixWorld),q.applyMatrix4(ue);var ee=x.visible===!0&&q.z>=-1&&q.z<=1&&x.layers.test(H.layers)===!0;if(x.element.style.display=ee===!0?"":"none",ee===!0){x.onBeforeRender(i,A,H);var X=x.element;X.style.transform="translate(-50%,-50%) translate(".concat(q.x*m+m,"px,").concat(-q.y*g+g,"px)"),X.parentNode!==z&&z.appendChild(X),x.onAfterRender(i,A,H)}var ce={distanceToCameraSquared:t(H,x)};V.objects.set(x,ce)}for(var N=0,le=x.children.length;N<le;N++)k(x.children[N],A,H)}},fe={zIndex:"auto"},Ae=function(){"use strict";function o(t){j(this,o),this.container=t}var n=o.prototype;return n.addRenderer=function(e,r){var i=this.container,l=i.offsetWidth,p=i.offsetHeight,m=e==="css2d"?new ve:new Y.CSS3DRenderer;m.domElement.style.position="absolute",m.domElement.style.top="0",m.domElement.style.pointerEvents="none",m.domElement.style.zIndex=r.zIndex,m.setSize(l,p),i.appendChild(m.domElement),e==="css2d"?this.css2Drenderer=m:e==="css3d"&&(this.css3Drenderer=m)},n.setSize=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,r),(l=this.css3Drenderer)===null||l===void 0||l.setSize(e,r)},n.render=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.render(e,r),(l=this.css3Drenderer)===null||l===void 0||l.render(e,r)},n.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},o}(),Te=o=>{var n={};return te.d(n,o),n},et=o=>()=>o,he=Te({BlendFunction:()=>me.BlendFunction,CopyPass:()=>me.CopyPass,EffectComposer:()=>me.EffectComposer,EffectPass:()=>me.EffectPass,FXAAEffect:()=>me.FXAAEffect,RenderPass:()=>me.RenderPass,SelectiveBloomEffect:()=>me.SelectiveBloomEffect}),ze={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},De=function(){"use strict";function o(t){j(this,o),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,i=t.camera,l=t.composerParams,p=l.multisampling,m=e.capabilities.maxSamples,g=new he.EffectComposer(e,{multisampling:Math.min(p,m)});g.addPass(new he.RenderPass(r,i)),this.finalComposer=g,this.renderer=e,this.scene=r,this.camera=i}var n=o.prototype;return n.addCopyPass=function(){var e=new he.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},n.addFXAAPass=function(){var e=this.camera,r=new he.FXAAEffect({blendFunction:he.BlendFunction.NORMAL}),i=new he.EffectPass(e,r);this.finalComposer.addPass(i),this.fxaaPass=i},n.addBloomPass=function(e){var r=this,i=r.camera,l=r.scene,p=new he.SelectiveBloomEffect(l,i,(0,D.Z)({},e)),m=new he.EffectPass(i,p);m.enabled=!1,this.finalComposer.addPass(m),this.bloomPass=m,this.bloomEffect=p},n.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var i=new c({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(l){r.bloomEffect.luminancePass.enabled=l}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});i.showGui(e)}},n.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},n.getSize=function(){var e=this.options.renderer;return e.getSize(new _.Vector2)},n.enable=function(){this.active||(this.active=!0)},n.disable=function(){!this.active||(this.active=!1)},n.setSize=function(e,r){this.finalComposer.setSize(e,r)},n.render=function(){!this.active||this.finalComposer.render()},n.dispose=function(){this.finalComposer.dispose()},o}(),Be=function(){try{var o=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&o.getContext("webgl2"))}catch(n){return!1}},tt=0,be=!1,Se=Be()!==!1,Ee=function(){"use strict";function o(t){j(this,o),this.raycaster=new _.Raycaster,this.installPlugins=new Map,this.event=new Z.EventEmitter,this.clock=new _.Clock,this.options=(0,ne.default)(o.options,t,{isMergeableObject:G.PO});var e=this.options,r=e.container,i=e.stats,l=e.gui,p=e.resizeObserver;if(l){var m=new a.default;m.open(!1),this.gui=m}if(i){var g=new U.default;g.showPanel(0),g.dom.style.position="absolute",r.appendChild(g.dom),this.stats=g}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var n=o.prototype;return n.use=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(I(i))),this.installPlugins.set(e,!0)}},n.init=function(){var e=this.options,r=e.container,i=e.isdev,l=e.axesHelper,p=e.renderer,m=e.scene,g=e.camera,V=this.getSize(),z=V.width,k=V.height,x=new Q({isdev:i,width:z,height:k,cameraParams:g});this.gui&&x.setGui(this.gui);var A=x.camera,H=new de({camera:A,sceneParams:m}),ee=H.scene,X=new w({width:z,height:k,scene:ee,camera:A,isdev:i,rendererParams:S((0,D.Z)({},p),{antialias:!1})});this.gui&&X.setGui(this.gui);var ce=X.renderer;l&&H.addAxesHelper(),this.sceneController=H,this.rendererController=X,this.cameraController=x,r.appendChild(ce.domElement)},n.initComposer=function(){var e=this.options,r=e.bloom,i=e.bloomParams,l=e.renderer,p=e.multisampling,m=l.antialias;m==="msaa"&&!Se&&(m=!1,console.warn("MSAA is not supported on this browser"));var g=new De({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:m==="msaa"?p:0,type:_.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=g,r&&(g.addBloomPass(i),this.gui&&g.addBloomGui(this.gui)),m==="fxaa"&&g.addFXAAPass(),g.addCopyPass()},n.initCSSRenderer=function(){var e=this.options,r=e.container,i=e.css2DRenderer,l=e.css3DRenderer,p=e.css2DRendererParams,m=e.css3DRendererParams;if(i||l){var g=new Ae(r);i&&g.addRenderer("css2d",p),l&&g.addRenderer("css3d",m),this.cssRendererController=g}},n.initControl=function(){var e=this.options,r=e.control,i=e.mapControl,l=e.controlParams;if(r){var p=new v({camera:this.camera,controlParams:{domElement:(l==null?void 0:l.domElement)||this.renderer.domElement},mapControl:i});this.controlController=p}},n.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},n.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var i=new ResizeObserver(function(l){var p=!0,m=!1,g=void 0;try{for(var V=l[Symbol.iterator](),z;!(p=(z=V.next()).done);p=!0){var k=z.value,x=k.contentRect;e.handeleResize(x.width,x.height),e.render()}}catch(A){m=!0,g=A}finally{try{!p&&V.return!=null&&V.return()}finally{if(m)throw g}}});i.observe(r),this.resizeObserver=i}},n.handeleResize=function(e,r){var i=this,l=i.rendererController,p=i.cameraController,m=i.composerController,g=i.cssRendererController;p==null||p.setSize(e,r),l==null||l.setSize(e,r),m==null||m.setSize(e,r),g==null||g.setSize(e,r),this.installPlugins.forEach(function(V,z){var k;(k=z.resize)===null||k===void 0||k.call(z,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},n.pick=function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=this,p=l.raycaster,m=l.options,g=m.container,V=new _.Vector2,z=g.getBoundingClientRect();if(V.x=(e.clientX-z.left)/(z.right-z.left)*2-1,V.y=-((e.clientY-z.top)/(z.bottom-z.top))*2+1,this.camera&&this.scene){p.setFromCamera(V,this.camera);var k=p.intersectObjects(r||this.scene.children,i);if(k.length)return{object:k[0].object,intersects:k}}},n.render=function(){var e,r,i,l,p=this,m=p.renderer,g=p.scene,V=p.camera,z=p.clock;if(!(!m||!g||!V||this.options.staticRender&&!this.cameraController.checkCameraChange())){var k=z.getDelta(),x=z.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,ee){var X;(X=ee.update)===null||X===void 0||X.call(ee,k,x)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(i=this.cssRendererController)===null||i===void 0||i.render(g,V),(l=this.stats)===null||l===void 0||l.update(),this.event.emit("render",{delta:k,elapsed:x})}},n.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},n.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},n.dispose=function(){var e,r,i,l,p,m,g;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(V,z){var k;(k=z.dispose)===null||k===void 0||k.call(z)}),(r=this.controlController)===null||r===void 0||r.dispose(),(i=this.cssRendererController)===null||i===void 0||i.dispose(),(l=this.sceneController)===null||l===void 0||l.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(m=this.rendererController)===null||m===void 0||m.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(g=this.gui)===null||g===void 0||g.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},b(o,[{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}}]),o}();Ee.options={isdev:be,stats:be,gui:be,axesHelper:be,control:be,resizeObserver:!0,renderer:S((0,D.Z)({},y),{antialias:Se?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:F,camera:P,bloom:!1,bloomParams:ze,css2DRenderer:!1,css2DRendererParams:(0,D.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,D.Z)({},fe)};function Pe(o,n){return Pe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Pe(o,n)}function Ge(o,n){return Pe(o,n)}function ke(){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(o){return!1}}function Ce(o,n,t){return ke()?Ce=Reflect.construct:Ce=function(r,i,l){var p=[null];p.push.apply(p,i);var m=Function.bind.apply(r,p),g=new m;return l&&Ge(g,l.prototype),g},Ce.apply(null,arguments)}function Oe(o,n,t){return Ce.apply(null,arguments)}var Ne=te(484);function Ie(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),o&&(t.promise=(0,Ne.Z)(t.promise,n)),t}var Ve=o=>{var n={};return te.d(n,o),n},rt=o=>()=>o,We=Ve({CSS2DObject:()=>Ke.CSS2DObject}),Le=function(o){o&&((0,G.wf)(o),o.children.forEach(function(n){n.userData.BaseObject_||Le(n)}))},Fe=function(){"use strict";function o(){j(this,o),this.objecttype__="BaseObject",this.userData={},this.pm=Ie(),this.visible=!1}var n=o.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,r){},n.resize=function(e,r){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(_.Mesh,I(r)),this},n.createGroup=function(){return this.object3d=new _.Group,this},n.createPoints=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(_.Points,I(r)),this},n.createCSS2DObject=function(e){return this.object3d=new We.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new Y.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new Y.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new _.Sprite(e),this},n.add=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).add.apply(l,I(r)),this},n.remove=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).remove.apply(l,I(r)),this},n.getSize=function(){var e=new _.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new _.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},n.dispose=function(){Le(this.object3d)},b(o,[{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})}}]),o}()})();var $e=we.L6,Je=we.sb,Qe=we.z,qe=we.ZP;export{$e as BaseObject,Je as GUIObject,Qe as Pencil,qe as default};
|
|
1
|
+
import*as Re from"idb-keyval";import*as $ from"three";import*as Ue from"deepmerge";import*as Ze from"three/examples/jsm/libs/stats.module";import*as Xe from"lil-gui";import*as Me from"three/examples/jsm/controls/OrbitControls";import*as xe from"three/examples/jsm/renderers/CSS3DRenderer";import*as me from"postprocessing";import*as Ke from"three/examples/jsm/renderers/CSS2DRenderer";var Ye={187:function(j){var R=typeof Reflect=="object"?Reflect:null,b=R&&typeof R.apply=="function"?R.apply:function(a,c,h){return Function.prototype.apply.call(a,c,h)},B;R&&typeof R.ownKeys=="function"?B=R.ownKeys:Object.getOwnPropertySymbols?B=function(a){return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a))}:B=function(a){return Object.getOwnPropertyNames(a)};function L(s){console&&console.warn&&console.warn(s)}var S=Number.isNaN||function(a){return a!==a};function d(){d.init.call(this)}j.exports=d,j.exports.once=J,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var T=10;function W(s){if(typeof s!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return T},set:function(s){if(typeof s!="number"||s<0||S(s))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+s+".");T=s}}),d.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},d.prototype.setMaxListeners=function(a){if(typeof a!="number"||a<0||S(a))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+a+".");return this._maxListeners=a,this};function E(s){return s._maxListeners===void 0?d.defaultMaxListeners:s._maxListeners}d.prototype.getMaxListeners=function(){return E(this)},d.prototype.emit=function(a){for(var c=[],h=1;h<arguments.length;h++)c.push(arguments[h]);var g=a==="error",w=this._events;if(w!==void 0)g=g&&w.error===void 0;else if(!g)return!1;if(g){var P;if(c.length>0&&(P=c[0]),P instanceof Error)throw P;var Q=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw Q.context=P,Q}var k=w[a];if(k===void 0)return!1;if(typeof k=="function")b(k,this,c);else for(var F=k.length,de=ae(k,F),h=0;h<F;++h)b(de[h],this,c);return!0};function G(s,a,c,h){var g,w,P;if(W(c),w=s._events,w===void 0?(w=s._events=Object.create(null),s._eventsCount=0):(w.newListener!==void 0&&(s.emit("newListener",a,c.listener?c.listener:c),w=s._events),P=w[a]),P===void 0)P=w[a]=c,++s._eventsCount;else if(typeof P=="function"?P=w[a]=h?[c,P]:[P,c]:h?P.unshift(c):P.push(c),g=E(s),g>0&&P.length>g&&!P.warned){P.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=s,Q.type=a,Q.count=P.length,L(Q)}return s}d.prototype.addListener=function(a,c){return G(this,a,c,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(a,c){return G(this,a,c,!0)};function V(){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 m(s,a,c){var h={fired:!1,wrapFn:void 0,target:s,type:a,listener:c},g=V.bind(h);return g.listener=c,h.wrapFn=g,g}d.prototype.once=function(a,c){return W(c),this.on(a,m(this,a,c)),this},d.prototype.prependOnceListener=function(a,c){return W(c),this.prependListener(a,m(this,a,c)),this},d.prototype.removeListener=function(a,c){var h,g,w,P,Q;if(W(c),g=this._events,g===void 0)return this;if(h=g[a],h===void 0)return this;if(h===c||h.listener===c)--this._eventsCount===0?this._events=Object.create(null):(delete g[a],g.removeListener&&this.emit("removeListener",a,h.listener||c));else if(typeof h!="function"){for(w=-1,P=h.length-1;P>=0;P--)if(h[P]===c||h[P].listener===c){Q=h[P].listener,w=P;break}if(w<0)return this;w===0?h.shift():ne(h,w),h.length===1&&(g[a]=h[0]),g.removeListener!==void 0&&this.emit("removeListener",a,Q||c)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(a){var c,h,g;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[a]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[a]),this;if(arguments.length===0){var w=Object.keys(h),P;for(g=0;g<w.length;++g)P=w[g],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(c=h[a],typeof c=="function")this.removeListener(a,c);else if(c!==void 0)for(g=c.length-1;g>=0;g--)this.removeListener(a,c[g]);return this};function Z(s,a,c){var h=s._events;if(h===void 0)return[];var g=h[a];return g===void 0?[]:typeof g=="function"?c?[g.listener||g]:[g]:c?K(g):ae(g,g.length)}d.prototype.listeners=function(a){return Z(this,a,!0)},d.prototype.rawListeners=function(a){return Z(this,a,!1)},d.listenerCount=function(s,a){return typeof s.listenerCount=="function"?s.listenerCount(a):re.call(s,a)},d.prototype.listenerCount=re;function re(s){var a=this._events;if(a!==void 0){var c=a[s];if(typeof c=="function")return 1;if(c!==void 0)return c.length}return 0}d.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function ae(s,a){for(var c=new Array(a),h=0;h<a;++h)c[h]=s[h];return c}function ne(s,a){for(;a+1<s.length;a++)s[a]=s[a+1];s.pop()}function K(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}function J(s,a){return new Promise(function(c,h){function g(P){s.removeListener(a,w),h(P)}function w(){typeof s.removeListener=="function"&&s.removeListener("error",g),c([].slice.call(arguments))}M(s,a,w,{once:!0}),a!=="error"&&U(s,g,{once:!0})})}function U(s,a,c){typeof s.on=="function"&&M(s,"error",a,c)}function M(s,a,c,h){if(typeof s.on=="function")h.once?s.once(a,c):s.on(a,c);else if(typeof s.addEventListener=="function")s.addEventListener(a,function g(w){h.once&&s.removeEventListener(a,g),c(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof s)}},666:function(j){var R=function(b){"use strict";var B=Object.prototype,L=B.hasOwnProperty,S,d=typeof Symbol=="function"?Symbol:{},T=d.iterator||"@@iterator",W=d.asyncIterator||"@@asyncIterator",E=d.toStringTag||"@@toStringTag";function G(f,u,v){return Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{G({},"")}catch(f){G=function(u,v,O){return u[v]=O}}function V(f,u,v,O){var C=u&&u.prototype instanceof J?u:J,Y=Object.create(C.prototype),q=new de(O||[]);return Y._invoke=P(f,v,q),Y}b.wrap=V;function m(f,u,v){try{return{type:"normal",arg:f.call(u,v)}}catch(O){return{type:"throw",arg:O}}}var Z="suspendedStart",re="suspendedYield",ae="executing",ne="completed",K={};function J(){}function U(){}function M(){}var s={};G(s,T,function(){return this});var a=Object.getPrototypeOf,c=a&&a(a(se([])));c&&c!==B&&L.call(c,T)&&(s=c);var h=M.prototype=J.prototype=Object.create(s);U.prototype=M,G(h,"constructor",M),G(M,"constructor",U),U.displayName=G(M,E,"GeneratorFunction");function g(f){["next","throw","return"].forEach(function(u){G(f,u,function(v){return this._invoke(u,v)})})}b.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===U||(u.displayName||u.name)==="GeneratorFunction":!1},b.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,M):(f.__proto__=M,G(f,E,"GeneratorFunction")),f.prototype=Object.create(h),f},b.awrap=function(f){return{__await:f}};function w(f,u){function v(Y,q,ie,ue){var oe=m(f[Y],f,q);if(oe.type==="throw")ue(oe.arg);else{var _e=oe.arg,ve=_e.value;return ve&&typeof ve=="object"&&L.call(ve,"__await")?u.resolve(ve.__await).then(function(fe){v("next",fe,ie,ue)},function(fe){v("throw",fe,ie,ue)}):u.resolve(ve).then(function(fe){_e.value=fe,ie(_e)},function(fe){return v("throw",fe,ie,ue)})}}var O;function C(Y,q){function ie(){return new u(function(ue,oe){v(Y,q,ue,oe)})}return O=O?O.then(ie,ie):ie()}this._invoke=C}g(w.prototype),G(w.prototype,W,function(){return this}),b.AsyncIterator=w,b.async=function(f,u,v,O,C){C===void 0&&(C=Promise);var Y=new w(V(f,u,v,O),C);return b.isGeneratorFunction(u)?Y:Y.next().then(function(q){return q.done?q.value:Y.next()})};function P(f,u,v){var O=Z;return function(Y,q){if(O===ae)throw new Error("Generator is already running");if(O===ne){if(Y==="throw")throw q;return ge()}for(v.method=Y,v.arg=q;;){var ie=v.delegate;if(ie){var ue=Q(ie,v);if(ue){if(ue===K)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===Z)throw O=ne,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=ae;var oe=m(f,u,v);if(oe.type==="normal"){if(O=v.done?ne:re,oe.arg===K)continue;return{value:oe.arg,done:v.done}}else oe.type==="throw"&&(O=ne,v.method="throw",v.arg=oe.arg)}}}function Q(f,u){var v=f.iterator[u.method];if(v===S){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=S,Q(f,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var O=m(v,f.iterator,u.arg);if(O.type==="throw")return u.method="throw",u.arg=O.arg,u.delegate=null,K;var C=O.arg;if(!C)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(C.done)u[f.resultName]=C.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=S);else return C;return u.delegate=null,K}g(h),G(h,E,"Generator"),G(h,T,function(){return this}),G(h,"toString",function(){return"[object Generator]"});function k(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function F(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function de(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(k,this),this.reset(!0)}b.keys=function(f){var u=[];for(var v in f)u.push(v);return u.reverse(),function O(){for(;u.length;){var C=u.pop();if(C in f)return O.value=C,O.done=!1,O}return O.done=!0,O}};function se(f){if(f){var u=f[T];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function C(){for(;++v<f.length;)if(L.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=S,C.done=!0,C};return O.next=O}}return{next:ge}}b.values=se;function ge(){return{value:S,done:!0}}return de.prototype={constructor:de,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=S,this.done=!1,this.delegate=null,this.method="next",this.arg=S,this.tryEntries.forEach(F),!f)for(var u in this)u.charAt(0)==="t"&&L.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=S)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function v(ue,oe){return Y.type="throw",Y.arg=f,u.next=ue,oe&&(u.method="next",u.arg=S),!!oe}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],Y=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var q=L.call(C,"catchLoc"),ie=L.call(C,"finallyLoc");if(q&&ie){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(q){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(ie){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&L.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=u&&u<=C.finallyLoc&&(C=null);var Y=C?C.completion:{};return Y.type=f,Y.arg=u,C?(this.method="next",this.next=C.finallyLoc,K):this.complete(Y)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),K},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),K}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var C=O.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,v){return this.delegate={iterator:se(f),resultName:u,nextLoc:v},this.method==="next"&&(this.arg=S),K}},b}(j.exports);try{regeneratorRuntime=R}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(j,R,b){b.d(R,{Z:function(){return B}});function B(L){if(L.geometry&&L.geometry.dispose(),L.material){var S=Array.isArray(L.material)?L.material:[L.material];S.forEach(function(d){var T,W,E,G,V,m,Z,re,ae,ne,K,J,U;(T=d.map)===null||T===void 0||T.dispose(),(W=d.lightMap)===null||W===void 0||W.dispose(),(E=d.bumpMap)===null||E===void 0||E.dispose(),(G=d.normalMap)===null||G===void 0||G.dispose(),(V=d.specularMap)===null||V===void 0||V.dispose(),(m=d.envMap)===null||m===void 0||m.dispose(),(Z=d.alphaMap)===null||Z===void 0||Z.dispose(),(re=d.aoMap)===null||re===void 0||re.dispose(),(ae=d.displacementMap)===null||ae===void 0||ae.dispose(),(ne=d.emissiveMap)===null||ne===void 0||ne.dispose(),(K=d.gradientMap)===null||K===void 0||K.dispose(),(J=d.metalnessMap)===null||J===void 0||J.dispose(),(U=d.roughnessMap)===null||U===void 0||U.dispose(),d.dispose()})}}},584:function(j,R,b){b.d(R,{wf:function(){return d.Z},PO:function(){return E.Z}});var B=b(666),L=b.n(B),S=null,d=b(695),T=b(949);function W(J){if(J.material){var U=Array.isArray(J.material)?J.material:[J.material];U.forEach(function(M){var s,a;(s=M.color)===null||s===void 0||s.convertSRGBToLinear(),(a=M.emissive)===null||a===void 0||a.convertSRGBToLinear(),M.map&&(M.map.encoding=THREE.sRGBEncoding),M.emissiveMap&&(M.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=b(738),G=b(568),V=b(924),m=b(77),Z=b(484),re=null,ae=null,ne=function(){var J=(0,G.Z)(L().mark(function U(M,s){var a,c,h,g,w,P,Q,k,F;return L().wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return a=s.type,c=a===void 0?"blob":a,h=s.version,g=h===void 0?"1":h,se.next=4,(0,m.get)(M);case 4:if(P=se.sent,!(P&&P[g])){se.next=9;break}w=P[g],se.next=15;break;case 9:return se.next=11,(0,Z.Z)(fetch(M).then(function(ge){if(ge.ok)return ge[c]();throw new Error}));case 11:Q=se.sent,k=Q.res,F=Q.err,F||(w=k,(0,m.set)(M,(0,V.Z)({},g,k)));case 15:return se.abrupt("return",w?{url:c==="json"?M:URL.createObjectURL(w),store:w}:{url:M});case 16:case"end":return se.stop()}},U)}));return function(M,s){return J.apply(this,arguments)}}(),K=b(705)},738:function(j,R,b){b.d(R,{Z:function(){return L}});function B(S){return Object.prototype.toString.call(S)==="[object Object]"}function L(S){if(B(S)===!1)return!1;var d=S.constructor;if(d===void 0)return!0;var T=d.prototype;return!(B(T)===!1||T.hasOwnProperty("isPrototypeOf")===!1)}},484:function(j,R,b){b.d(R,{Z:function(){return L}});var B=b(42);function L(S){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return S.then(function(T){return(0,B.Z)({err:null,res:T},d)}).catch(function(T){return(0,B.Z)({err:T,res:void 0},d)})}},705:function(j,R,b){var B=b(949),L=new Map,S=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(W,E,G,V,m){var Z=E[G*3],re=E[G*3+1],ae=E[V*3],ne=E[V*3+1],K=E[m*3],J=E[m*3+1],U;if(L.has(W))U=L.get(W);else{var M=T.box3||new THREE.Box3;if(!T.box3){var s=W.parameters.shapes.getPoints();M.setFromArray(s.map(function(w){return[w.x,w.y,0]}).flat())}var a=M.getSize(new THREE.Vector3);T.split&&(a.y/=T.split),U={box:M,size:a},L.set(W,U)}var c=U.box,h=U.size,g=T.split?1-T.split:0;return[new THREE.Vector2((Z-c.min.x)/h.x,(re-c.min.y)/h.y+g),new THREE.Vector2((ae-c.min.x)/h.x,(ne-c.min.y)/h.y+g),new THREE.Vector2((K-c.min.x)/h.x,(J-c.min.y)/h.y+g)]},generateSideWallUV:function(W,E,G,V,m,Z){var re=E[G*3],ae=E[G*3+1],ne=E[G*3+2],K=E[V*3],J=E[V*3+1],U=E[V*3+2],M=E[m*3],s=E[m*3+1],a=E[m*3+2],c=E[Z*3],h=E[Z*3+1],g=E[Z*3+2],w;if(L.has(E))w=L.get(E);else{var P=new THREE.Box3;P.setFromArray(E);var Q=P.getSize(new THREE.Vector3);T.split&&(Q.z/=1-T.split),w={box:P,size:Q},L.set(E,w)}var k=w.box,F=w.size;return Math.abs(ae-J)<Math.abs(re-K)?[new THREE.Vector2((re-k.min.x)/F.x,(ne-k.min.z)/F.z),new THREE.Vector2((K-k.min.x)/F.x,(U-k.min.z)/F.z),new THREE.Vector2((M-k.min.x)/F.x,(a-k.min.z)/F.z),new THREE.Vector2((c-k.min.x)/F.x,(g-k.min.z)/F.z)]:[new THREE.Vector2((ae-k.min.y)/F.y,(ne-k.min.z)/F.z),new THREE.Vector2((J-k.min.y)/F.y,(U-k.min.z)/F.z),new THREE.Vector2((s-k.min.y)/F.y,(a-k.min.z)/F.z),new THREE.Vector2((h-k.min.y)/F.y,(g-k.min.z)/F.z)]}}},d=function(){L.clear()}},77:function(j,R,b){var B=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=B({get:()=>Re.get,set:()=>Re.set})},949:function(j,R,b){var B=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=B({ACESFilmicToneMapping:()=>$.ACESFilmicToneMapping,AxesHelper:()=>$.AxesHelper,Box3:()=>$.Box3,Camera:()=>$.Camera,CineonToneMapping:()=>$.CineonToneMapping,Clock:()=>$.Clock,Euler:()=>$.Euler,Group:()=>$.Group,LinearEncoding:()=>$.LinearEncoding,LinearToneMapping:()=>$.LinearToneMapping,Matrix4:()=>$.Matrix4,Mesh:()=>$.Mesh,NoToneMapping:()=>$.NoToneMapping,PerspectiveCamera:()=>$.PerspectiveCamera,Points:()=>$.Points,REVISION:()=>$.REVISION,Raycaster:()=>$.Raycaster,ReinhardToneMapping:()=>$.ReinhardToneMapping,Scene:()=>$.Scene,Sprite:()=>$.Sprite,UnsignedByteType:()=>$.UnsignedByteType,Vector2:()=>$.Vector2,Vector3:()=>$.Vector3,WebGLRenderer:()=>$.WebGLRenderer})},568:function(j,R,b){b.d(R,{Z:function(){return L}});function B(S,d,T,W,E,G,V){try{var m=S[G](V),Z=m.value}catch(re){T(re);return}m.done?d(Z):Promise.resolve(Z).then(W,E)}function L(S){return function(){var d=this,T=arguments;return new Promise(function(W,E){var G=S.apply(d,T);function V(Z){B(G,W,E,V,m,"next",Z)}function m(Z){B(G,W,E,V,m,"throw",Z)}V(void 0)})}}},924:function(j,R,b){b.d(R,{Z:function(){return B}});function B(L,S,d){return S in L?Object.defineProperty(L,S,{value:d,enumerable:!0,configurable:!0,writable:!0}):L[S]=d,L}},42:function(j,R,b){b.d(R,{Z:function(){return L}});var B=b(924);function L(S){for(var d=1;d<arguments.length;d++){var T=arguments[d]!=null?arguments[d]:{},W=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(W=W.concat(Object.getOwnPropertySymbols(T).filter(function(E){return Object.getOwnPropertyDescriptor(T,E).enumerable}))),W.forEach(function(E){(0,B.Z)(S,E,T[E])})}return S}}},je={};function te(j){var R=je[j];if(R!==void 0)return R.exports;var b=je[j]={exports:{}};return Ye[j](b,b.exports,te),b.exports}(function(){te.n=function(j){var R=j&&j.__esModule?function(){return j.default}:function(){return j};return te.d(R,{a:R}),R}})(),function(){te.d=function(j,R){for(var b in R)te.o(R,b)&&!te.o(j,b)&&Object.defineProperty(j,b,{enumerable:!0,get:R[b]})}}(),function(){te.o=function(j,R){return Object.prototype.hasOwnProperty.call(j,R)}}();var we={};(function(){te.d(we,{L6:function(){return Fe},sb:function(){return c},z:function(){return Ee},ZP:function(){return Ee}});function j(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}function R(o,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}function b(o,n,t){return n&&R(o.prototype,n),t&&R(o,t),o}var B=te(42);function L(o,n){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,e)}return t}function S(o,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(n,t))}),o}function d(o,n){(n==null||n>o.length)&&(n=o.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=o[t];return e}function T(o){if(Array.isArray(o))return d(o)}function W(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function E(){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 G(o,n){if(!!o){if(typeof o=="string")return d(o,n);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(o,n)}}function V(o){return T(o)||W(o)||G(o)||E()}var m=te(949),Z=te(187),re=o=>{var n={};return te.d(n,o),n},ae=o=>()=>o,ne=re({default:()=>Ue.default}),K=o=>{var n={};return te.d(n,o),n},J=o=>()=>o,U=K({default:()=>Ze.default}),M=o=>{var n={};return te.d(n,o),n},s=o=>()=>o,a=M({default:()=>Xe.default}),c=function(){"use strict";function o(t){j(this,o),this.guiParams={},t&&(this.guiParams=t)}var n=o.prototype;return n.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(i){var l=e.addFolder(i),p=r.guiParams[i];Object.keys(p).forEach(function(_){var y=p[_],z=y.min,D=y.max,N=y.step,x=y.name,A=y.paramMap,H=y.items,ee=y.value,X=y.target,ce=_.toLowerCase().indexOf("color")>-1,I,le=typeof ee=="undefined"&&X,pe=le?X():p[_],ye=le?_:"value";H?I=l.add(pe,ye,H):ce?I=l.addColor(pe,ye):I=l.add(pe,ye),I=I.name(x||_),typeof z!="undefined"&&(I=I.min(z)),typeof D!="undefined"&&(I=I.max(D)),typeof N!="undefined"&&(I=I.step(N)),I=I.onChange(function(){r.setTargetValue(i,_,pe[ye],A)}),le&&I.listen()})})},n.setTargetValue=function(e,r,i,l){var p=this.guiParams[e][r],_=p.onChange,y=p.target,z=p.value,D=r.toLowerCase().indexOf("color")>-1,N=typeof z=="undefined"&&y;if(y&&!N){var x=y();Array.isArray(x)||(x=[x]),x.forEach(function(A){if(!!A)if(D)try{A[l||r].set(i)}catch(H){r!=="color"&&!l&&console.warn("".concat(r," is not a color,set paramMap"))}else A[l||r]=i})}_&&_(i)},n.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(i){var l=e.guiParams[r][i];typeof l.value!="undefined"&&e.setTargetValue(r,i,l.value,l.paramMap)})})},o}(),h={None:m.NoToneMapping,Linear:m.LinearToneMapping,Reinhard:m.ReinhardToneMapping,Cineon:m.CineonToneMapping,ACESFilmic:m.ACESFilmicToneMapping},g={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:m.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},w=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.width,r=t.height,i=t.rendererParams,l=i.context,p=i.alpha,_=i.devicePixelRatio,y=i.antialias,z=i.powerPreference,D=i.toneMapping,N=i.toneMappingExposure,x=i.outputEncoding,A=i.logarithmicDepthBuffer,H=i.preserveDrawingBuffer,ee=i.stencil,X=i.depth,ce=i.physicallyCorrectLights,I=new m.WebGLRenderer({context:l,alpha:p,antialias:y,powerPreference:z,logarithmicDepthBuffer:A,preserveDrawingBuffer:H,stencil:ee,depth:X});I.setSize(e,r),I.setPixelRatio(_),I.toneMapping=h[D],I.toneMappingExposure=N,I.outputEncoding=x,I.physicallyCorrectLights=ce,this.renderer=I}var n=o.prototype;return n.setSize=function(e,r){this.renderer.setSize(e,r)},n.render=function(){var e=this.options,r=e.scene,i=e.camera;this.renderer.render(r,i)},n.setGui=function(e){var r=this,i=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:h,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});i.showGui(e)},n.dispose=function(){var e,r,i;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},o}(),P={fov:45,near:1,far:1e3},Q=function(){"use strict";function o(t){j(this,o),this.oldCameraPosition=new m.Vector3,this.oldCameraRotation=new m.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,i=t.cameraParams;if(i instanceof m.Camera)this.camera=i,this.customCamera=!0;else{var l=i.fov,p=i.far,_=i.near,y=new m.PerspectiveCamera(l,e/r,_,p);y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}var n=o.prototype;return n.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},n.setSize=function(e,r){this.camera instanceof m.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},n.setGui=function(e){var r=this,i=new c({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}}});this.camera instanceof m.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}),i.showGui(e)},o}(),k=te(584),F={background:null},de=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.sceneParams,i=r.background,l=new m.Scene;i&&(l.background=i),l.add(e),this.scene=l}var n=o.prototype;return n.addAxesHelper=function(){var e,r=new m.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},n.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,k.wf)(r)})},o}(),se=o=>{var n={};return te.d(n,o),n},ge=o=>()=>o,f=se({MapControls:()=>Me.MapControls,OrbitControls:()=>Me.OrbitControls}),u={},v=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.controlParams,i=t.mapControl,l=r.domElement,p=i?new f.MapControls(e,l):new f.OrbitControls(e,l);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var n=o.prototype;return n.limitPan=function(e){var r=e.maxX,i=r===void 0?1/0:r,l=e.minX,p=l===void 0?-1/0:l,_=e.maxZ,y=_===void 0?1/0:_,z=e.minZ,D=z===void 0?-1/0:z,N=e.maxY,x=N===void 0?1/0:N,A=e.minY,H=A===void 0?-1/0:A,ee=this.limitPanV||new m.Vector3,X=this.control,ce=this.options.camera,I=new m.Vector3(p,H,D),le=new m.Vector3(i,x,y);this.limitPanV=ee,ee.copy(X.target),X.target.clamp(I,le),ee.sub(X.target),ce.position.sub(ee)},n.update=function(){this.control.update()},n.dispose=function(){this.control.dispose()},o}(),O=o=>{var n={};return te.d(n,o),n},C=o=>()=>o,Y=O({CSS3DObject:()=>xe.CSS3DObject,CSS3DRenderer:()=>xe.CSS3DRenderer,CSS3DSprite:()=>xe.CSS3DSprite}),q=new m.Vector3,ie=new m.Matrix4,ue=new m.Matrix4,oe=new m.Vector3,_e=new m.Vector3,ve=function o(){"use strict";var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,o);var t=function(A,H){return oe.setFromMatrixPosition(A.matrixWorld),_e.setFromMatrixPosition(H.matrixWorld),oe.distanceToSquared(_e)},e=function(A){var H=[];return A.traverse(function(ee){ee.isCSS2DObject&&H.push(ee)}),H},r=function(A){for(var H=e(A).sort(function(le,pe){if(le.renderOrder!==pe.renderOrder)return pe.renderOrder-le.renderOrder;var ye=z.objects.get(le).distanceToCameraSquared,He=z.objects.get(pe).distanceToCameraSquared;return ye-He}),ee=H.length,X=0,ce=H.length;X<ce;X++){var I=H[X].userData.zIndexFix||0;H[X].element.style.zIndex=ee-X+I}},i=this,l,p,_,y,z={objects:new WeakMap},D=n.element!==void 0?n.element:document.createElement("div");D.style.overflow="hidden",this.domElement=D,this.getSize=function(){return{width:l,height:p}},this.render=function(x,A){+m.REVISION<144?(x.autoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld()):(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld()),ie.copy(A.matrixWorldInverse),ue.multiplyMatrices(A.projectionMatrix,ie),N(x,x,A),r(x)},this.setSize=function(x,A){l=x,p=A,_=l/2,y=p/2,D.style.width="".concat(x,"px"),D.style.height="".concat(A,"px")};function N(x,A,H){if(x.isCSS2DObject){q.setFromMatrixPosition(x.matrixWorld),q.applyMatrix4(ue);var ee=x.visible===!0&&q.z>=-1&&q.z<=1&&x.layers.test(H.layers)===!0;if(x.element.style.display=ee===!0?"":"none",ee===!0){x.onBeforeRender(i,A,H);var X=x.element;X.style.transform="translate(-50%,-50%) translate(".concat(q.x*_+_,"px,").concat(-q.y*y+y,"px)"),X.parentNode!==D&&D.appendChild(X),x.onAfterRender(i,A,H)}var ce={distanceToCameraSquared:t(H,x)};z.objects.set(x,ce)}for(var I=0,le=x.children.length;I<le;I++)N(x.children[I],A,H)}},fe={zIndex:"auto"},Ae=function(){"use strict";function o(t){j(this,o),this.container=t}var n=o.prototype;return n.addRenderer=function(e,r){var i=this.container,l=i.offsetWidth,p=i.offsetHeight,_=e==="css2d"?new ve:new Y.CSS3DRenderer;_.domElement.style.position="absolute",_.domElement.style.top="0",_.domElement.style.pointerEvents="none",_.domElement.style.zIndex=r.zIndex,_.setSize(l,p),i.appendChild(_.domElement),e==="css2d"?this.css2Drenderer=_:e==="css3d"&&(this.css3Drenderer=_)},n.setSize=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,r),(l=this.css3Drenderer)===null||l===void 0||l.setSize(e,r)},n.render=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.render(e,r),(l=this.css3Drenderer)===null||l===void 0||l.render(e,r)},n.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},o}(),Te=o=>{var n={};return te.d(n,o),n},et=o=>()=>o,he=Te({BlendFunction:()=>me.BlendFunction,CopyPass:()=>me.CopyPass,EffectComposer:()=>me.EffectComposer,EffectPass:()=>me.EffectPass,FXAAEffect:()=>me.FXAAEffect,RenderPass:()=>me.RenderPass,SelectiveBloomEffect:()=>me.SelectiveBloomEffect}),De={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},ze=function(){"use strict";function o(t){j(this,o),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,i=t.camera,l=t.composerParams,p=l.multisampling,_=e.capabilities.maxSamples,y=new he.EffectComposer(e,{multisampling:Math.min(p,_)});y.addPass(new he.RenderPass(r,i)),this.finalComposer=y,this.renderer=e,this.scene=r,this.camera=i}var n=o.prototype;return n.addCopyPass=function(){var e=new he.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},n.addFXAAPass=function(){var e=this.camera,r=new he.FXAAEffect({blendFunction:he.BlendFunction.NORMAL}),i=new he.EffectPass(e,r);this.finalComposer.addPass(i),this.fxaaPass=i},n.addBloomPass=function(e){var r=this,i=r.camera,l=r.scene,p=new he.SelectiveBloomEffect(l,i,(0,B.Z)({},e)),_=new he.EffectPass(i,p);_.enabled=!1,this.finalComposer.addPass(_),this.bloomPass=_,this.bloomEffect=p},n.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var i=new c({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(l){r.bloomEffect.luminancePass.enabled=l}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});i.showGui(e)}},n.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},n.getSize=function(){var e=this.options.renderer;return e.getSize(new m.Vector2)},n.enable=function(){this.active||(this.active=!0)},n.disable=function(){!this.active||(this.active=!1)},n.setSize=function(e,r){this.finalComposer.setSize(e,r)},n.render=function(){!this.active||this.finalComposer.render()},n.dispose=function(){this.finalComposer.dispose()},o}(),Be=function(){try{var o=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&o.getContext("webgl2"))}catch(n){return!1}},tt=0,be=!1,Se=Be()!==!1,Ee=function(){"use strict";function o(t){j(this,o),this.raycaster=new m.Raycaster,this.installPlugins=new Map,this.event=new Z.EventEmitter,this.clock=new m.Clock,this.userData={},this.options=(0,ne.default)(o.options,t,{isMergeableObject:k.PO});var e=this.options,r=e.container,i=e.stats,l=e.gui,p=e.resizeObserver;if(l){var _=new a.default;_.open(!1),this.gui=_}if(i){var y=new U.default;y.showPanel(0),y.dom.style.position="absolute",r.appendChild(y.dom),this.stats=y}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var n=o.prototype;return n.use=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(V(i))),this.installPlugins.set(e,!0)}},n.init=function(){var e=this.options,r=e.container,i=e.isdev,l=e.axesHelper,p=e.renderer,_=e.scene,y=e.camera,z=this.getSize(),D=z.width,N=z.height,x=new Q({isdev:i,width:D,height:N,cameraParams:y});this.gui&&x.setGui(this.gui);var A=x.camera,H=new de({camera:A,sceneParams:_}),ee=H.scene,X=new w({width:D,height:N,scene:ee,camera:A,isdev:i,rendererParams:S((0,B.Z)({},p),{antialias:!1})});this.gui&&X.setGui(this.gui);var ce=X.renderer;l&&H.addAxesHelper(),this.sceneController=H,this.rendererController=X,this.cameraController=x,r.appendChild(ce.domElement)},n.initComposer=function(){var e=this.options,r=e.bloom,i=e.bloomParams,l=e.renderer,p=e.multisampling,_=e.passes,y=l.antialias;y==="msaa"&&!Se&&(y=!1,console.warn("MSAA is not supported on this browser"));var z=new ze({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:y==="msaa"?p:0,type:m.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=z,r&&(z.addBloomPass(i),this.gui&&z.addBloomGui(this.gui)),y==="fxaa"&&z.addFXAAPass(),_&&_.forEach(function(D){z.finalComposer.addPass(D)}),z.addCopyPass()},n.initCSSRenderer=function(){var e=this.options,r=e.container,i=e.css2DRenderer,l=e.css3DRenderer,p=e.css2DRendererParams,_=e.css3DRendererParams;if(i||l){var y=new Ae(r);i&&y.addRenderer("css2d",p),l&&y.addRenderer("css3d",_),this.cssRendererController=y}},n.initControl=function(){var e=this.options,r=e.control,i=e.mapControl,l=e.controlParams;if(r){var p=new v({camera:this.camera,controlParams:{domElement:(l==null?void 0:l.domElement)||this.renderer.domElement},mapControl:i});this.controlController=p}},n.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},n.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var i=new ResizeObserver(function(l){var p=!0,_=!1,y=void 0;try{for(var z=l[Symbol.iterator](),D;!(p=(D=z.next()).done);p=!0){var N=D.value,x=N.contentRect;e.handeleResize(x.width,x.height),e.render()}}catch(A){_=!0,y=A}finally{try{!p&&z.return!=null&&z.return()}finally{if(_)throw y}}});i.observe(r),this.resizeObserver=i}},n.handeleResize=function(e,r){var i=this,l=i.rendererController,p=i.cameraController,_=i.composerController,y=i.cssRendererController;p==null||p.setSize(e,r),l==null||l.setSize(e,r),_==null||_.setSize(e,r),y==null||y.setSize(e,r),this.installPlugins.forEach(function(z,D){var N;(N=D.resize)===null||N===void 0||N.call(D,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},n.pick=function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=this,p=l.raycaster,_=l.options,y=_.container,z=new m.Vector2,D=y.getBoundingClientRect();if(z.x=(e.clientX-D.left)/(D.right-D.left)*2-1,z.y=-((e.clientY-D.top)/(D.bottom-D.top))*2+1,this.camera&&this.scene){p.setFromCamera(z,this.camera);var N=p.intersectObjects(r||this.scene.children,i);if(N.length)return{object:N[0].object,intersects:N}}},n.render=function(){var e,r,i,l,p=this,_=p.renderer,y=p.scene,z=p.camera,D=p.clock;if(!(!_||!y||!z||this.options.staticRender&&!this.cameraController.checkCameraChange())){var N=D.getDelta(),x=D.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,ee){var X;(X=ee.update)===null||X===void 0||X.call(ee,N,x)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(i=this.cssRendererController)===null||i===void 0||i.render(y,z),(l=this.stats)===null||l===void 0||l.update(),this.event.emit("render",{delta:N,elapsed:x})}},n.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},n.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},n.dispose=function(){var e,r,i,l,p,_,y;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(z,D){var N;(N=D.dispose)===null||N===void 0||N.call(D)}),(r=this.controlController)===null||r===void 0||r.dispose(),(i=this.cssRendererController)===null||i===void 0||i.dispose(),(l=this.sceneController)===null||l===void 0||l.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(_=this.rendererController)===null||_===void 0||_.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},b(o,[{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}}]),o}();Ee.options={isdev:be,stats:be,gui:be,axesHelper:be,control:be,resizeObserver:!0,renderer:S((0,B.Z)({},g),{antialias:Se?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:F,camera:P,bloom:!1,bloomParams:De,css2DRenderer:!1,css2DRendererParams:(0,B.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},fe)};function Pe(o,n){return Pe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Pe(o,n)}function Ge(o,n){return Pe(o,n)}function ke(){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(o){return!1}}function Ce(o,n,t){return ke()?Ce=Reflect.construct:Ce=function(r,i,l){var p=[null];p.push.apply(p,i);var _=Function.bind.apply(r,p),y=new _;return l&&Ge(y,l.prototype),y},Ce.apply(null,arguments)}function Oe(o,n,t){return Ce.apply(null,arguments)}var Ne=te(484);function Ie(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),o&&(t.promise=(0,Ne.Z)(t.promise,n)),t}var Ve=o=>{var n={};return te.d(n,o),n},rt=o=>()=>o,We=Ve({CSS2DObject:()=>Ke.CSS2DObject}),Le=function(o){o&&((0,k.wf)(o),o.children.forEach(function(n){n.userData.BaseObject_||Le(n)}))},Fe=function(){"use strict";function o(){j(this,o),this.objecttype__="BaseObject",this.userData={},this.pm=Ie(),this.visible=!1}var n=o.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,r){},n.resize=function(e,r){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(m.Mesh,V(r)),this},n.createGroup=function(){return this.object3d=new m.Group,this},n.createPoints=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(m.Points,V(r)),this},n.createCSS2DObject=function(e){return this.object3d=new We.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new Y.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new Y.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new m.Sprite(e),this},n.add=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).add.apply(l,V(r)),this},n.remove=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).remove.apply(l,V(r)),this},n.getSize=function(){var e=new m.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new m.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},n.dispose=function(){Le(this.object3d)},b(o,[{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})}}]),o}()})();var $e=we.L6,Je=we.sb,Qe=we.z,qe=we.ZP;export{$e as BaseObject,Je as GUIObject,Qe as Pencil,qe as default};
|