gl-draw 0.3.10 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -54,4 +54,4 @@ void main() {
54
54
  lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
55
  lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
56
  lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
- }`})},n}(Te.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var We={threshold:.2,strength:.5,radius:0},Ze=new l.MeshBasicMaterial({color:"black"}),Xe=new l.SpriteMaterial({color:"#000"}),qe=function(){"use strict";function s(n,e){L(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,S=new we(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=S;var _=new ae.EffectComposer(t);_.renderToScreen=!1,_.addPass(r),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(Ge);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Be,fragmentShader:Ve,defines:{}}),P=new te.ShaderPass(y,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?Xe:Ze)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new T({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),Qe=require("three/examples/jsm/postprocessing/OutlinePass"),Ye={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ke=function(){"use strict";function s(n,e){L(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,S=new Qe.OutlinePass(new l.Vector2(a,h),t,r);S.selectedObjects=this.selectedObjects,this.outlinePass=S,o.addPass(S),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new T({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function $e(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function Je(s,i){if(s==null)return{};var n=$e(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var et=require("three/examples/jsm/postprocessing/SSRPass"),tt=require("three/examples/jsm/objects/ReflectorForSSRPass"),rt={maxDistance:10,selects:!0},nt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},it=function(){"use strict";function s(n,e){L(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,S=a.height,_=new et.SSRPass({renderer:o,scene:t,camera:r,width:h,height:S,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},nt,e),r=t.width,o=t.height,u=Je(t,["width","height"]),a=this.composerController,h=a.scene,S=a.getSize(),_=new l.PlaneGeometry(r,o),y=new tt.ReflectorForSSRPass(_,E((0,G.Z)({},u),{textureWidth:S.width,textureHeight:S.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new T({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),at=function(){"use strict";function s(n){L(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ae.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var S=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);S.samples=t,h=S}else if(+l.REVISION>=138&&t>0){var _=new l.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=_}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new oe.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new te.ShaderPass(ve.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new te.ShaderPass(pe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new te.ShaderPass(Ae.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new fe.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new ze.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new qe(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new Ke(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new it(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Se=function(){"use strict";function s(n){L(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new N.EventEmitter,this.clock=new l.Clock,this.options=ie()(s.options,n,{isMergeableObject:M.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui,u=e.resizeObserver;if(o){var a=new(K());a.open(!1),this.gui=a}if(r){var h=new(X());h.showPanel(0),h.dom.style.position="absolute",t.appendChild(h.dom),this.stats=h}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),u&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,t=e.container,r=e.isdev,o=e.axesHelper,u=e.renderer,a=e.scene,h=e.camera,S=this.getSize(),_=S.width,y=S.height,P=new w({isdev:r,width:_,height:y,cameraParams:h});this.gui&&P.setGui(this.gui);var z=P.camera,B=new J({camera:z,sceneParams:a}),I=B.scene,H=new v({width:_,height:y,scene:I,camera:z,isdev:r,rendererParams:E((0,G.Z)({},u),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var ue=H.renderer;o&&B.addAxesHelper(),this.sceneController=B,this.rendererController=H,this.cameraController=P,t.appendChild(ue.domElement)},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,S=e.ssrParams,_=e.multisampling,y=u.antialias;y==="msaa"&&!Ce&&(y=!1,console.warn("MSAA is not supported on this browser"));var P=new at({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?_:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=P,y==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(S),t&&P.addBloomPass(a),r&&P.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&P.addGammaCorrectionPass(),y==="fxaa"?P.addFXAAPass():y==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new se(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new Y({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,t=this.options.container;if(!this.resizeObserver){var r=new ResizeObserver(function(o){var u=!0,a=!1,h=void 0;try{for(var S=o[Symbol.iterator](),_;!(u=(_=S.next()).done);u=!0){var y=_.value,P=y.contentRect;e.handeleResize(P.width,P.height)}}catch(z){a=!0,h=z}finally{try{!u&&S.return!=null&&S.return()}finally{if(a)throw h}}});r.observe(t),this.resizeObserver=r}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(S,_){var y;(y=_.resize)===null||y===void 0||y.call(_,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,S=new l.Vector2,_=h.getBoundingClientRect();if(S.x=(e.clientX-_.left)/(_.right-_.left)*2-1,S.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(S,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,S=u.camera,_=u.clock;if(!(!a||!h||!S||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=_.getDelta(),P=_.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(B,I){var H;(H=I.update)===null||H===void 0||H.call(I,y,P)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var z;(z=this.rendererController)===null||z===void 0||z.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,S),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:P})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(S,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Se.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:E((0,G.Z)({},c),{antialias:Ce?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:O,camera:m,bloom:!1,bloomParams:We,outline:!1,outlineParams:Ye,css2DRenderer:!1,ssr:!1,ssrParams:rt,css2DRendererParams:(0,G.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},$)};function st(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return st()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Oe(h,o.prototype),h},be.apply(null,arguments)}function Me(s,i,n){return be.apply(null,arguments)}var ot=re(484);function ut(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,ot.Z)(n.promise,i)),n}var lt=require("three/examples/jsm/renderers/CSS2DRenderer"),je=function(s){s&&((0,M.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||je(i)}))},ct=function(){"use strict";function s(){L(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ut(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Me(l.Mesh,k(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Me(l.Points,k(t)),this},i.createCSS2DObject=function(e){return this.object3d=new lt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new he.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new he.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,k(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,k(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){je(this.object3d)},x(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=ye})();
57
+ }`})},n}(Te.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var We={threshold:.2,strength:.5,radius:0},Ze=new l.MeshBasicMaterial({color:"black"}),Xe=new l.SpriteMaterial({color:"#000"}),qe=function(){"use strict";function s(n,e){L(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,S=new we(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=S;var _=new ae.EffectComposer(t);_.renderToScreen=!1,_.addPass(r),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(Ge);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Be,fragmentShader:Ve,defines:{}}),P=new te.ShaderPass(y,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?Xe:Ze)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new T({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),Qe=require("three/examples/jsm/postprocessing/OutlinePass"),Ye={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ke=function(){"use strict";function s(n,e){L(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,S=new Qe.OutlinePass(new l.Vector2(a,h),t,r);S.selectedObjects=this.selectedObjects,this.outlinePass=S,o.addPass(S),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new T({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function $e(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function Je(s,i){if(s==null)return{};var n=$e(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var et=require("three/examples/jsm/postprocessing/SSRPass"),tt=require("three/examples/jsm/objects/ReflectorForSSRPass"),rt={maxDistance:10,selects:!0},nt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},it=function(){"use strict";function s(n,e){L(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,S=a.height,_=new et.SSRPass({renderer:o,scene:t,camera:r,width:h,height:S,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},nt,e),r=t.width,o=t.height,u=Je(t,["width","height"]),a=this.composerController,h=a.scene,S=a.getSize(),_=new l.PlaneGeometry(r,o),y=new tt.ReflectorForSSRPass(_,E((0,G.Z)({},u),{textureWidth:S.width,textureHeight:S.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new T({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),at=function(){"use strict";function s(n){L(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ae.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var S=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);S.samples=t,h=S}else if(+l.REVISION>=138&&t>0){var _=new l.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=_}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new oe.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new te.ShaderPass(ve.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new te.ShaderPass(pe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new te.ShaderPass(Ae.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new fe.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new ze.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new qe(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new Ke(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new it(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Se=function(){"use strict";function s(n){L(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new N.EventEmitter,this.clock=new l.Clock,this.options=ie()(s.options,n,{isMergeableObject:M.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui,u=e.resizeObserver;if(o){var a=new(K());a.open(!1),this.gui=a}if(r){var h=new(X());h.showPanel(0),h.dom.style.position="absolute",t.appendChild(h.dom),this.stats=h}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),u&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,t=e.container,r=e.isdev,o=e.axesHelper,u=e.renderer,a=e.scene,h=e.camera,S=this.getSize(),_=S.width,y=S.height,P=new w({isdev:r,width:_,height:y,cameraParams:h});this.gui&&P.setGui(this.gui);var z=P.camera,B=new J({camera:z,sceneParams:a}),I=B.scene,H=new v({width:_,height:y,scene:I,camera:z,isdev:r,rendererParams:E((0,G.Z)({},u),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var ue=H.renderer;o&&B.addAxesHelper(),this.sceneController=B,this.rendererController=H,this.cameraController=P,t.appendChild(ue.domElement)},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,S=e.ssrParams,_=e.multisampling,y=u.antialias;y==="msaa"&&!Ce&&(y=!1,console.warn("MSAA is not supported on this browser"));var P=new at({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?_:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=P,y==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(S),t&&P.addBloomPass(a),r&&P.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&P.addGammaCorrectionPass(),y==="fxaa"?P.addFXAAPass():y==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new se(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new Y({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,t=this.options.container;if(!this.resizeObserver){var r=new ResizeObserver(function(o){var u=!0,a=!1,h=void 0;try{for(var S=o[Symbol.iterator](),_;!(u=(_=S.next()).done);u=!0){var y=_.value,P=y.contentRect;e.handeleResize(P.width,P.height),e.render()}}catch(z){a=!0,h=z}finally{try{!u&&S.return!=null&&S.return()}finally{if(a)throw h}}});r.observe(t),this.resizeObserver=r}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(S,_){var y;(y=_.resize)===null||y===void 0||y.call(_,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,S=new l.Vector2,_=h.getBoundingClientRect();if(S.x=(e.clientX-_.left)/(_.right-_.left)*2-1,S.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(S,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,S=u.camera,_=u.clock;if(!(!a||!h||!S||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=_.getDelta(),P=_.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(B,I){var H;(H=I.update)===null||H===void 0||H.call(I,y,P)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var z;(z=this.rendererController)===null||z===void 0||z.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,S),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:P})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(S,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Se.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:E((0,G.Z)({},c),{antialias:Ce?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:O,camera:m,bloom:!1,bloomParams:We,outline:!1,outlineParams:Ye,css2DRenderer:!1,ssr:!1,ssrParams:rt,css2DRendererParams:(0,G.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},$)};function st(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return st()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Oe(h,o.prototype),h},be.apply(null,arguments)}function Me(s,i,n){return be.apply(null,arguments)}var ot=re(484);function ut(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,ot.Z)(n.promise,i)),n}var lt=require("three/examples/jsm/renderers/CSS2DRenderer"),je=function(s){s&&((0,M.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||je(i)}))},ct=function(){"use strict";function s(){L(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ut(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Me(l.Mesh,k(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Me(l.Points,k(t)),this},i.createCSS2DObject=function(e){return this.object3d=new lt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new he.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new he.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,k(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,k(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){je(this.object3d)},x(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=ye})();
@@ -54,4 +54,4 @@ void main() {
54
54
  lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
55
  lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
56
  lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
- }`})},i}(Le.Pass);we.BlurDirectionX=new c.Vector2(1,0),we.BlurDirectionY=new c.Vector2(0,1);var dt={threshold:.2,strength:.5,radius:0},ht=new c.MeshBasicMaterial({color:"black"}),vt=new c.SpriteMaterial({color:"#000"}),pt=function(){"use strict";function n(i,e){L(this,n),this.materials={},this.bloomLayer=new c.Layers,this.active=!0,this.composerController=i,this.options=e;var r=i.renderer,a=i.renderPass,o=i.finalComposer,l=i.getSize(),s=l.width,d=l.height,x=new we(new c.Vector2(s,d),e.strength,e.radius,e.threshold);this.bloomPass=x;var y=new Oe.EffectComposer(r);y.renderToScreen=!1,y.addPass(a),y.addPass(this.bloomPass),this.bloomComposer=y,this.bloomLayer.set(tt);var b=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:y.renderTarget2.texture}},vertexShader:rt,fragmentShader:nt,defines:{}}),P=new be.ShaderPass(b,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,a=r.bloomComposer,o=r.bloomLayer,l=r.materials;e.traverse(function(s){var d=s;d.material&&o.test(d.layers)===!1&&(l[d.uuid]=d.material,d.material=d.isSprite?vt:ht)}),a.render(),e.traverse(function(s){var d=s;l[d.uuid]&&(d.material=l[d.uuid],delete l[d.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,a=new f({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});a.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),mt=n=>{var t={};return V.d(t,n),t},pr=n=>()=>n,gt=mt({OutlinePass:()=>Qt.OutlinePass}),_t={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},bt=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.finalComposer,l=i.getSize(),s=l.width,d=l.height,x=new gt.OutlinePass(new c.Vector2(s,d),r,a);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=new f({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});r.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function Pt(n,t){if(n==null)return{};var i={},e=Object.keys(n),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(i[r]=n[r]);return i}function yt(n,t){if(n==null)return{};var i=Pt(n,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var St=n=>{var t={};return V.d(t,n),t},mr=n=>()=>n,xt=St({SSRPass:()=>Yt.SSRPass}),Ct=n=>{var t={};return V.d(t,n),t},gr=n=>()=>n,wt=Ct({ReflectorForSSRPass:()=>$t.ReflectorForSSRPass}),Et={maxDistance:10,selects:!0},Rt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Ot=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.renderer,l=i.finalComposer,s=i.getSize(),d=s.width,x=s.height,y=new xt.SSRPass({renderer:o,scene:r,camera:a,width:d,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=y,l.addPass(y),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Rt,e),a=r.width,o=r.height,l=yt(r,["width","height"]),s=this.composerController,d=s.scene,x=s.getSize(),y=new c.PlaneGeometry(a,o),b=new wt.ReflectorForSSRPass(y,A((0,G.Z)({},l),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,d.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,r),a.resolution.set(e,r))},t.setGui=function(){var e=this,r=new f({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(a){a?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});r.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Mt=function(){"use strict";function n(i){L(this,n),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,a=i.camera,o=this.createRenderTarget(),l=new Oe.EffectComposer(e,o);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=a}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,a=e.type,o=e.encoding,l=this.getSize(),s={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,encoding:o,type:a},d;if(+c.REVISION<138&&r>0){var x=new c.WebGLMultisampleRenderTarget(l.width,l.height,s);x.samples=r,d=x}else if(+c.REVISION>=138&&r>0){var y=new c.WebGLRenderTarget(l.width,l.height,A((0,G.Z)({},s),{samples:r}));d=y}else{var b=new c.WebGLRenderTarget(l.width,l.height,s);d=b}return d.texture.name="EffectComposer.rt1",d},t.addRenderPasss=function(){var e=this.options,r=e.scene,a=e.camera,o=new ke.RenderPass(r,a);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new be.ShaderPass(Se.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=new be.ShaderPass(qe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,a)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=this.options.renderer,l=new Qe.SMAAPass(r*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},t.addSSAAPass=function(){var e=this.options,r=e.scene,a=e.camera,o=new $e.SSAARenderPass(r,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new bt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Ot(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var a,o;this.finalComposer.setSize(e,r),(a=this.bloomController)===null||a===void 0||a.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*o)}},t.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},t.dispose=function(){var e,r,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var l,s,d;(l=o.fsQuad)===null||l===void 0||l.dispose(),(s=o.fsQuad)===null||s===void 0||(d=s.material)===null||d===void 0||d.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Ee=function(){"use strict";function n(i){L(this,n),this.raycaster=new c.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new c.Clock,this.options=(0,re.default)(n.options,i,{isMergeableObject:N.PO});var e=this.options,r=e.container,a=e.stats,o=e.gui,l=e.resizeObserver;if(o){var s=new u.default;s.open(!1),this.gui=s}if(a){var d=new q.default;d.showPanel(0),d.dom.style.position="absolute",r.appendChild(d.dom),this.stats=d}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),l&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var l;(l=e).install.apply(l,[this].concat(k(a))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this.options,r=e.container,a=e.isdev,o=e.axesHelper,l=e.renderer,s=e.scene,d=e.camera,x=this.getSize(),y=x.width,b=x.height,P=new $({isdev:a,width:y,height:b,cameraParams:d});this.gui&&P.setGui(this.gui);var T=P.camera,F=new ne({camera:T,sceneParams:s}),I=F.scene,H=new w({width:y,height:b,scene:I,camera:T,isdev:a,rendererParams:A((0,G.Z)({},l),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var le=H.renderer;o&&F.addAxesHelper(),this.sceneController=F,this.rendererController=H,this.cameraController=P,r.appendChild(le.domElement)},t.initComposer=function(){var e=this.options,r=e.bloom,a=e.outline,o=e.ssr,l=e.renderer,s=e.bloomParams,d=e.outlineParams,x=e.ssrParams,y=e.multisampling,b=l.antialias;b==="msaa"&&!Me&&(b=!1,console.warn("MSAA is not supported on this browser"));var P=new Mt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?y:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=P,b==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(x),r&&P.addBloomPass(s),a&&P.addOutlinePass(d),l.outputEncoding===c.sRGBEncoding&&P.addGammaCorrectionPass(),b==="fxaa"?P.addFXAAPass():b==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,a=e.css2DRenderer,o=e.css3DRenderer,l=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var d=new Ve(r);a&&d.addRenderer("css2d",l),o&&d.addRenderer("css3d",s),this.cssRendererController=d}},t.initControl=function(){var e=this.options,r=e.control,a=e.mapControl,o=e.controlParams;if(r){var l=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=l}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var a=new ResizeObserver(function(o){var l=!0,s=!1,d=void 0;try{for(var x=o[Symbol.iterator](),y;!(l=(y=x.next()).done);l=!0){var b=y.value,P=b.contentRect;e.handeleResize(P.width,P.height)}}catch(T){s=!0,d=T}finally{try{!l&&x.return!=null&&x.return()}finally{if(s)throw d}}});a.observe(r),this.resizeObserver=a}},t.handeleResize=function(e,r){var a=this,o=a.rendererController,l=a.cameraController,s=a.composerController,d=a.cssRendererController;l==null||l.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(x,y){var b;(b=y.resize)===null||b===void 0||b.call(y,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,l=o.raycaster,s=o.options,d=s.container,x=new c.Vector2,y=d.getBoundingClientRect();if(x.x=(e.clientX-y.left)/(y.right-y.left)*2-1,x.y=-((e.clientY-y.top)/(y.bottom-y.top))*2+1,this.camera&&this.scene){l.setFromCamera(x,this.camera);var b=l.intersectObjects(r||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,a,o,l=this,s=l.renderer,d=l.scene,x=l.camera,y=l.clock;if(!(!s||!d||!x||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=y.getDelta(),P=y.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(F,I){var H;(H=I.update)===null||H===void 0||H.call(I,b,P)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var T;(T=this.rendererController)===null||T===void 0||T.render()}(a=this.cssRendererController)===null||a===void 0||a.render(d,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:P})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,a,o,l,s,d;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(x,y){var b;(b=y.dispose)===null||b===void 0||b.call(y)}),(r=this.controlController)===null||r===void 0||r.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(l=this.composerController)===null||l===void 0||l.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(d=this.gui)===null||d===void 0||d.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Ee.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:A((0,G.Z)({},S),{antialias:Me?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:K,camera:E,bloom:!1,bloomParams:dt,outline:!1,outlineParams:_t,css2DRenderer:!1,ssr:!1,ssrParams:Et,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Tt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function Pe(n,t,i){return Tt()?Pe=Reflect.construct:Pe=function(r,a,o){var l=[null];l.push.apply(l,a);var s=Function.bind.apply(r,l),d=new s;return o&&Te(d,o.prototype),d},Pe.apply(null,arguments)}function De(n,t,i){return Pe.apply(null,arguments)}var At=V(484);function Lt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),n&&(i.promise=(0,At.Z)(i.promise,t)),i}var jt=n=>{var t={};return V.d(t,n),t},_r=n=>()=>n,Dt=jt({CSS2DObject:()=>Jt.CSS2DObject}),ze=function(n){n&&((0,N.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||ze(t)}))},zt=function(){"use strict";function n(){L(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Lt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Mesh,k(r)),this},t.createGroup=function(){return this.object3d=new c.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Points,k(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Dt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new c.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,k(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,k(r)),this},t.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){ze(this.object3d)},C(n,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),n}()})();var er=_e.L6,tr=_e.sb,rr=_e.z,nr=_e.ZP;export{er as BaseObject,tr as GUIObject,rr as Pencil,nr as default};
57
+ }`})},i}(Le.Pass);we.BlurDirectionX=new c.Vector2(1,0),we.BlurDirectionY=new c.Vector2(0,1);var dt={threshold:.2,strength:.5,radius:0},ht=new c.MeshBasicMaterial({color:"black"}),vt=new c.SpriteMaterial({color:"#000"}),pt=function(){"use strict";function n(i,e){L(this,n),this.materials={},this.bloomLayer=new c.Layers,this.active=!0,this.composerController=i,this.options=e;var r=i.renderer,a=i.renderPass,o=i.finalComposer,l=i.getSize(),s=l.width,d=l.height,x=new we(new c.Vector2(s,d),e.strength,e.radius,e.threshold);this.bloomPass=x;var y=new Oe.EffectComposer(r);y.renderToScreen=!1,y.addPass(a),y.addPass(this.bloomPass),this.bloomComposer=y,this.bloomLayer.set(tt);var b=new c.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:y.renderTarget2.texture}},vertexShader:rt,fragmentShader:nt,defines:{}}),P=new be.ShaderPass(b,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,a=r.bloomComposer,o=r.bloomLayer,l=r.materials;e.traverse(function(s){var d=s;d.material&&o.test(d.layers)===!1&&(l[d.uuid]=d.material,d.material=d.isSprite?vt:ht)}),a.render(),e.traverse(function(s){var d=s;l[d.uuid]&&(d.material=l[d.uuid],delete l[d.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,a=new f({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});a.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),mt=n=>{var t={};return V.d(t,n),t},pr=n=>()=>n,gt=mt({OutlinePass:()=>Qt.OutlinePass}),_t={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},bt=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.finalComposer,l=i.getSize(),s=l.width,d=l.height,x=new gt.OutlinePass(new c.Vector2(s,d),r,a);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=new f({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});r.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function Pt(n,t){if(n==null)return{};var i={},e=Object.keys(n),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(i[r]=n[r]);return i}function yt(n,t){if(n==null)return{};var i=Pt(n,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var St=n=>{var t={};return V.d(t,n),t},mr=n=>()=>n,xt=St({SSRPass:()=>Yt.SSRPass}),Ct=n=>{var t={};return V.d(t,n),t},gr=n=>()=>n,wt=Ct({ReflectorForSSRPass:()=>$t.ReflectorForSSRPass}),Et={maxDistance:10,selects:!0},Rt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Ot=function(){"use strict";function n(i,e){L(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.renderer,l=i.finalComposer,s=i.getSize(),d=s.width,x=s.height,y=new xt.SSRPass({renderer:o,scene:r,camera:a,width:d,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=y,l.addPass(y),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Rt,e),a=r.width,o=r.height,l=yt(r,["width","height"]),s=this.composerController,d=s.scene,x=s.getSize(),y=new c.PlaneGeometry(a,o),b=new wt.ReflectorForSSRPass(y,A((0,G.Z)({},l),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,d.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,r),a.resolution.set(e,r))},t.setGui=function(){var e=this,r=new f({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(a){a?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});r.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Mt=function(){"use strict";function n(i){L(this,n),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,a=i.camera,o=this.createRenderTarget(),l=new Oe.EffectComposer(e,o);l.setPixelRatio(e.getPixelRatio()),this.finalComposer=l,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=a}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,a=e.type,o=e.encoding,l=this.getSize(),s={minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,encoding:o,type:a},d;if(+c.REVISION<138&&r>0){var x=new c.WebGLMultisampleRenderTarget(l.width,l.height,s);x.samples=r,d=x}else if(+c.REVISION>=138&&r>0){var y=new c.WebGLRenderTarget(l.width,l.height,A((0,G.Z)({},s),{samples:r}));d=y}else{var b=new c.WebGLRenderTarget(l.width,l.height,s);d=b}return d.texture.name="EffectComposer.rt1",d},t.addRenderPasss=function(){var e=this.options,r=e.scene,a=e.camera,o=new ke.RenderPass(r,a);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new be.ShaderPass(Se.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=new be.ShaderPass(qe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,a)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=this.options.renderer,l=new Qe.SMAAPass(r*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(l),this.smaaPass=l},t.addSSAAPass=function(){var e=this.options,r=e.scene,a=e.camera,o=new $e.SSAARenderPass(r,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new bt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Ot(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new c.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var a,o;this.finalComposer.setSize(e,r),(a=this.bloomController)===null||a===void 0||a.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*o)}},t.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},t.dispose=function(){var e,r,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var l,s,d;(l=o.fsQuad)===null||l===void 0||l.dispose(),(s=o.fsQuad)===null||s===void 0||(d=s.material)===null||d===void 0||d.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Ee=function(){"use strict";function n(i){L(this,n),this.raycaster=new c.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new c.Clock,this.options=(0,re.default)(n.options,i,{isMergeableObject:N.PO});var e=this.options,r=e.container,a=e.stats,o=e.gui,l=e.resizeObserver;if(o){var s=new u.default;s.open(!1),this.gui=s}if(a){var d=new q.default;d.showPanel(0),d.dom.style.position="absolute",r.appendChild(d.dom),this.stats=d}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),l&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var l;(l=e).install.apply(l,[this].concat(k(a))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this.options,r=e.container,a=e.isdev,o=e.axesHelper,l=e.renderer,s=e.scene,d=e.camera,x=this.getSize(),y=x.width,b=x.height,P=new $({isdev:a,width:y,height:b,cameraParams:d});this.gui&&P.setGui(this.gui);var T=P.camera,F=new ne({camera:T,sceneParams:s}),I=F.scene,H=new w({width:y,height:b,scene:I,camera:T,isdev:a,rendererParams:A((0,G.Z)({},l),{outputEncoding:c.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var le=H.renderer;o&&F.addAxesHelper(),this.sceneController=F,this.rendererController=H,this.cameraController=P,r.appendChild(le.domElement)},t.initComposer=function(){var e=this.options,r=e.bloom,a=e.outline,o=e.ssr,l=e.renderer,s=e.bloomParams,d=e.outlineParams,x=e.ssrParams,y=e.multisampling,b=l.antialias;b==="msaa"&&!Me&&(b=!1,console.warn("MSAA is not supported on this browser"));var P=new Mt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?y:0,type:c.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=P,b==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(x),r&&P.addBloomPass(s),a&&P.addOutlinePass(d),l.outputEncoding===c.sRGBEncoding&&P.addGammaCorrectionPass(),b==="fxaa"?P.addFXAAPass():b==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,a=e.css2DRenderer,o=e.css3DRenderer,l=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var d=new Ve(r);a&&d.addRenderer("css2d",l),o&&d.addRenderer("css3d",s),this.cssRendererController=d}},t.initControl=function(){var e=this.options,r=e.control,a=e.mapControl,o=e.controlParams;if(r){var l=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=l}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var a=new ResizeObserver(function(o){var l=!0,s=!1,d=void 0;try{for(var x=o[Symbol.iterator](),y;!(l=(y=x.next()).done);l=!0){var b=y.value,P=b.contentRect;e.handeleResize(P.width,P.height),e.render()}}catch(T){s=!0,d=T}finally{try{!l&&x.return!=null&&x.return()}finally{if(s)throw d}}});a.observe(r),this.resizeObserver=a}},t.handeleResize=function(e,r){var a=this,o=a.rendererController,l=a.cameraController,s=a.composerController,d=a.cssRendererController;l==null||l.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(x,y){var b;(b=y.resize)===null||b===void 0||b.call(y,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,l=o.raycaster,s=o.options,d=s.container,x=new c.Vector2,y=d.getBoundingClientRect();if(x.x=(e.clientX-y.left)/(y.right-y.left)*2-1,x.y=-((e.clientY-y.top)/(y.bottom-y.top))*2+1,this.camera&&this.scene){l.setFromCamera(x,this.camera);var b=l.intersectObjects(r||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,a,o,l=this,s=l.renderer,d=l.scene,x=l.camera,y=l.clock;if(!(!s||!d||!x||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=y.getDelta(),P=y.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(F,I){var H;(H=I.update)===null||H===void 0||H.call(I,b,P)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var T;(T=this.rendererController)===null||T===void 0||T.render()}(a=this.cssRendererController)===null||a===void 0||a.render(d,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:P})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,a,o,l,s,d;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(x,y){var b;(b=y.dispose)===null||b===void 0||b.call(y)}),(r=this.controlController)===null||r===void 0||r.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(l=this.composerController)===null||l===void 0||l.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(d=this.gui)===null||d===void 0||d.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Ee.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:A((0,G.Z)({},S),{antialias:Me?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:K,camera:E,bloom:!1,bloomParams:dt,outline:!1,outlineParams:_t,css2DRenderer:!1,ssr:!1,ssrParams:Et,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Tt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function Pe(n,t,i){return Tt()?Pe=Reflect.construct:Pe=function(r,a,o){var l=[null];l.push.apply(l,a);var s=Function.bind.apply(r,l),d=new s;return o&&Te(d,o.prototype),d},Pe.apply(null,arguments)}function De(n,t,i){return Pe.apply(null,arguments)}var At=V(484);function Lt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),n&&(i.promise=(0,At.Z)(i.promise,t)),i}var jt=n=>{var t={};return V.d(t,n),t},_r=n=>()=>n,Dt=jt({CSS2DObject:()=>Jt.CSS2DObject}),ze=function(n){n&&((0,N.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||ze(t)}))},zt=function(){"use strict";function n(){L(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Lt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Mesh,k(r)),this},t.createGroup=function(){return this.object3d=new c.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(c.Points,k(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Dt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new c.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,k(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,k(r)),this},t.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){ze(this.object3d)},C(n,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),n}()})();var er=_e.L6,tr=_e.sb,rr=_e.z,nr=_e.ZP;export{er as BaseObject,tr as GUIObject,rr as Pencil,nr as default};
@@ -0,0 +1,2 @@
1
+ export declare const ExtrudeGeometry: string;
2
+ export declare const PlaneGeometry: string;
@@ -1,4 +1,4 @@
1
- (function(){var Qe={666:function(C){var T=function(x){"use strict";var P=Object.prototype,S=P.hasOwnProperty,z,O=typeof Symbol=="function"?Symbol:{},D=O.iterator||"@@iterator",W=O.asyncIterator||"@@asyncIterator",E=O.toStringTag||"@@toStringTag";function _(l,u,p){return Object.defineProperty(l,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[u]}try{_({},"")}catch(l){_=function(u,p,A){return u[p]=A}}function F(l,u,p,A){var w=u&&u.prototype instanceof X?u:X,I=Object.create(w.prototype),te=new $(A||[]);return I._invoke=ue(l,p,te),I}x.wrap=F;function Z(l,u,p){try{return{type:"normal",arg:l.call(u,p)}}catch(A){return{type:"throw",arg:A}}}var B="suspendedStart",s="suspendedYield",se="executing",Q="completed",G={};function X(){}function L(){}function R(){}var N={};_(N,D,function(){return this});var ne=Object.getPrototypeOf,J=ne&&ne(ne(me([])));J&&J!==P&&S.call(J,D)&&(N=J);var H=R.prototype=X.prototype=Object.create(N);L.prototype=R,_(H,"constructor",R),_(R,"constructor",L),L.displayName=_(R,E,"GeneratorFunction");function U(l){["next","throw","return"].forEach(function(u){_(l,u,function(p){return this._invoke(u,p)})})}x.isGeneratorFunction=function(l){var u=typeof l=="function"&&l.constructor;return u?u===L||(u.displayName||u.name)==="GeneratorFunction":!1},x.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,R):(l.__proto__=R,_(l,E,"GeneratorFunction")),l.prototype=Object.create(H),l},x.awrap=function(l){return{__await:l}};function ie(l,u){function p(I,te,ae,ce){var oe=Z(l[I],l,te);if(oe.type==="throw")ce(oe.arg);else{var Oe=oe.arg,Pe=Oe.value;return Pe&&typeof Pe=="object"&&S.call(Pe,"__await")?u.resolve(Pe.__await).then(function(re){p("next",re,ae,ce)},function(re){p("throw",re,ae,ce)}):u.resolve(Pe).then(function(re){Oe.value=re,ae(Oe)},function(re){return p("throw",re,ae,ce)})}}var A;function w(I,te){function ae(){return new u(function(ce,oe){p(I,te,ce,oe)})}return A=A?A.then(ae,ae):ae()}this._invoke=w}U(ie.prototype),_(ie.prototype,W,function(){return this}),x.AsyncIterator=ie,x.async=function(l,u,p,A,w){w===void 0&&(w=Promise);var I=new ie(F(l,u,p,A),w);return x.isGeneratorFunction(u)?I:I.next().then(function(te){return te.done?te.value:I.next()})};function ue(l,u,p){var A=B;return function(I,te){if(A===se)throw new Error("Generator is already running");if(A===Q){if(I==="throw")throw te;return ke()}for(p.method=I,p.arg=te;;){var ae=p.delegate;if(ae){var ce=ee(ae,p);if(ce){if(ce===G)continue;return ce}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(A===B)throw A=Q,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);A=se;var oe=Z(l,u,p);if(oe.type==="normal"){if(A=p.done?Q:s,oe.arg===G)continue;return{value:oe.arg,done:p.done}}else oe.type==="throw"&&(A=Q,p.method="throw",p.arg=oe.arg)}}}function ee(l,u){var p=l.iterator[u.method];if(p===z){if(u.delegate=null,u.method==="throw"){if(l.iterator.return&&(u.method="return",u.arg=z,ee(l,u),u.method==="throw"))return G;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return G}var A=Z(p,l.iterator,u.arg);if(A.type==="throw")return u.method="throw",u.arg=A.arg,u.delegate=null,G;var w=A.arg;if(!w)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,G;if(w.done)u[l.resultName]=w.value,u.next=l.nextLoc,u.method!=="return"&&(u.method="next",u.arg=z);else return w;return u.delegate=null,G}U(H),_(H,E,"Generator"),_(H,D,function(){return this}),_(H,"toString",function(){return"[object Generator]"});function ye(l){var u={tryLoc:l[0]};1 in l&&(u.catchLoc=l[1]),2 in l&&(u.finallyLoc=l[2],u.afterLoc=l[3]),this.tryEntries.push(u)}function K(l){var u=l.completion||{};u.type="normal",delete u.arg,l.completion=u}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ye,this),this.reset(!0)}x.keys=function(l){var u=[];for(var p in l)u.push(p);return u.reverse(),function A(){for(;u.length;){var w=u.pop();if(w in l)return A.value=w,A.done=!1,A}return A.done=!0,A}};function me(l){if(l){var u=l[D];if(u)return u.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,A=function w(){for(;++p<l.length;)if(S.call(l,p))return w.value=l[p],w.done=!1,w;return w.value=z,w.done=!0,w};return A.next=A}}return{next:ke}}x.values=me;function ke(){return{value:z,done:!0}}return $.prototype={constructor:$,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=z,this.done=!1,this.delegate=null,this.method="next",this.arg=z,this.tryEntries.forEach(K),!l)for(var u in this)u.charAt(0)==="t"&&S.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=z)},stop:function(){this.done=!0;var l=this.tryEntries[0],u=l.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var u=this;function p(ce,oe){return I.type="throw",I.arg=l,u.next=ce,oe&&(u.method="next",u.arg=z),!!oe}for(var A=this.tryEntries.length-1;A>=0;--A){var w=this.tryEntries[A],I=w.completion;if(w.tryLoc==="root")return p("end");if(w.tryLoc<=this.prev){var te=S.call(w,"catchLoc"),ae=S.call(w,"finallyLoc");if(te&&ae){if(this.prev<w.catchLoc)return p(w.catchLoc,!0);if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else if(te){if(this.prev<w.catchLoc)return p(w.catchLoc,!0)}else if(ae){if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,u){for(var p=this.tryEntries.length-1;p>=0;--p){var A=this.tryEntries[p];if(A.tryLoc<=this.prev&&S.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var w=A;break}}w&&(l==="break"||l==="continue")&&w.tryLoc<=u&&u<=w.finallyLoc&&(w=null);var I=w?w.completion:{};return I.type=l,I.arg=u,w?(this.method="next",this.next=w.finallyLoc,G):this.complete(I)},complete:function(l,u){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&u&&(this.next=u),G},finish:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),K(p),G}},catch:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===l){var A=p.completion;if(A.type==="throw"){var w=A.arg;K(p)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(l,u,p){return this.delegate={iterator:me(l),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=z),G}},x}(C.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(C,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(S){if(S.geometry&&S.geometry.dispose(),S.material){var z=Array.isArray(S.material)?S.material:[S.material];z.forEach(function(O){var D,W,E,_,F,Z,B,s,se,Q,G,X,L;(D=O.map)===null||D===void 0||D.dispose(),(W=O.lightMap)===null||W===void 0||W.dispose(),(E=O.bumpMap)===null||E===void 0||E.dispose(),(_=O.normalMap)===null||_===void 0||_.dispose(),(F=O.specularMap)===null||F===void 0||F.dispose(),(Z=O.envMap)===null||Z===void 0||Z.dispose(),(B=O.alphaMap)===null||B===void 0||B.dispose(),(s=O.aoMap)===null||s===void 0||s.dispose(),(se=O.displacementMap)===null||se===void 0||se.dispose(),(Q=O.emissiveMap)===null||Q===void 0||Q.dispose(),(G=O.gradientMap)===null||G===void 0||G.dispose(),(X=O.metalnessMap)===null||X===void 0||X.dispose(),(L=O.roughnessMap)===null||L===void 0||L.dispose(),O.dispose()})}}},519:function(C,T,x){"use strict";x.d(T,{disposeMesh:function(){return O.Z}});var P=x(666),S=x.n(P),z=null,O=x(695),D=x(644);function W(G){if(G.material){var X=Array.isArray(G.material)?G.material:[G.material];X.forEach(function(L){var R,N;(R=L.color)===null||R===void 0||R.convertSRGBToLinear(),(N=L.emissive)===null||N===void 0||N.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=x(568),_=x(924),F=require("idb-keyval"),Z=x(484),B=null,s=null,se=function(){var G=(0,E.Z)(S().mark(function X(L,R){var N,ne,J,H,U,ie;return S().wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return N=R.version,ee.next=4,(0,F.get)(L);case 4:if(J=ee.sent,!(J&&J[N])){ee.next=9;break}ne=J[N],ee.next=15;break;case 9:return ee.next=11,(0,Z.Z)(fetch(L).then(function(ye){if(ye.ok)return ye.blob();throw new Error}));case 11:H=ee.sent,U=H.res,ie=H.err,ie||(ne=U,(0,F.set)(L,(0,_.Z)({},N,U)));case 15:return ee.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:L});case 16:case"end":return ee.stop()}},X)}));return function(L,R){return G.apply(this,arguments)}}(),Q=x(705)},484:function(C,T,x){"use strict";x.d(T,{Z:function(){return S}});var P=x(42);function S(z){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z.then(function(D){return(0,P.Z)({err:null,res:D},O)}).catch(function(D){return(0,P.Z)({err:D,res:void 0},O)})}},705:function(C,T,x){"use strict";x.d(T,{C:function(){return D},y:function(){return O}});var P=x(644),S=x.n(P),z=new Map,O=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(E,_,F,Z,B){var s=_[F*3],se=_[F*3+1],Q=_[Z*3],G=_[Z*3+1],X=_[B*3],L=_[B*3+1],R;if(z.has(E))R=z.get(E);else{var N=W.box3||new P.Box3;if(!W.box3){var ne=E.parameters.shapes.getPoints();N.setFromArray(ne.map(function(ue){return[ue.x,ue.y,0]}).flat())}var J=N.getSize(new P.Vector3);W.split&&(J.y/=W.split),R={box:N,size:J},z.set(E,R)}var H=R.box,U=R.size,ie=W.split?1-W.split:0;return[new P.Vector2((s-H.min.x)/U.x,(se-H.min.y)/U.y+ie),new P.Vector2((Q-H.min.x)/U.x,(G-H.min.y)/U.y+ie),new P.Vector2((X-H.min.x)/U.x,(L-H.min.y)/U.y+ie)]},generateSideWallUV:function(E,_,F,Z,B,s){var se=_[F*3],Q=_[F*3+1],G=_[F*3+2],X=_[Z*3],L=_[Z*3+1],R=_[Z*3+2],N=_[B*3],ne=_[B*3+1],J=_[B*3+2],H=_[s*3],U=_[s*3+1],ie=_[s*3+2],ue;if(z.has(_))ue=z.get(_);else{var ee=new P.Box3;ee.setFromArray(_);var ye=ee.getSize(new P.Vector3);W.split&&(ye.z/=1-W.split),ue={box:ee,size:ye},z.set(_,ue)}var K=ue.box,$=ue.size;return Math.abs(Q-L)<Math.abs(se-X)?[new P.Vector2((se-K.min.x)/$.x,(G-K.min.z)/$.z),new P.Vector2((X-K.min.x)/$.x,(R-K.min.z)/$.z),new P.Vector2((N-K.min.x)/$.x,(J-K.min.z)/$.z),new P.Vector2((H-K.min.x)/$.x,(ie-K.min.z)/$.z)]:[new P.Vector2((Q-K.min.y)/$.x,(G-K.min.z)/$.z),new P.Vector2((L-K.min.y)/$.x,(R-K.min.z)/$.z),new P.Vector2((ne-K.min.y)/$.x,(J-K.min.z)/$.z),new P.Vector2((U-K.min.y)/$.x,(ie-K.min.z)/$.z)]}}},D=function(){z.clear()}},644:function(C){"use strict";C.exports=require("three")},568:function(C,T,x){"use strict";x.d(T,{Z:function(){return S}});function P(z,O,D,W,E,_,F){try{var Z=z[_](F),B=Z.value}catch(s){D(s);return}Z.done?O(B):Promise.resolve(B).then(W,E)}function S(z){return function(){var O=this,D=arguments;return new Promise(function(W,E){var _=z.apply(O,D);function F(B){P(_,W,E,F,Z,"next",B)}function Z(B){P(_,W,E,F,Z,"throw",B)}F(void 0)})}}},924:function(C,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(S,z,O){return z in S?Object.defineProperty(S,z,{value:O,enumerable:!0,configurable:!0,writable:!0}):S[z]=O,S}},42:function(C,T,x){"use strict";x.d(T,{Z:function(){return S}});var P=x(924);function S(z){for(var O=1;O<arguments.length;O++){var D=arguments[O]!=null?arguments[O]:{},W=Object.keys(D);typeof Object.getOwnPropertySymbols=="function"&&(W=W.concat(Object.getOwnPropertySymbols(D).filter(function(E){return Object.getOwnPropertyDescriptor(D,E).enumerable}))),W.forEach(function(E){(0,P.Z)(z,E,D[E])})}return z}}},De={};function q(C){var T=De[C];if(T!==void 0)return T.exports;var x=De[C]={exports:{}};return Qe[C](x,x.exports,q),x.exports}(function(){q.n=function(C){var T=C&&C.__esModule?function(){return C.default}:function(){return C};return q.d(T,{a:T}),T}})(),function(){q.d=function(C,T){for(var x in T)q.o(T,x)&&!q.o(C,x)&&Object.defineProperty(C,x,{enumerable:!0,get:T[x]})}}(),function(){q.o=function(C,T){return Object.prototype.hasOwnProperty.call(C,T)}}(),function(){q.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})}}();var ze={};(function(){"use strict";q.r(ze),q.d(ze,{ConicPolygon:function(){return _t},ExtrudePolygon:function(){return wt},Image:function(){return A},Line:function(){return rt},MeshLine:function(){return re},MeshLineMaterial:function(){return Re},MeshLineRaycast:function(){return Ue},Node:function(){return oe},Text:function(){return ke},Video:function(){return ae}});function C(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function T(e,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(e,i)}function x(e,i){return T(e,i)}function P(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&x(e,i)}var S=q(42);function z(e,i){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function O(e,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(i,r))}),e}function D(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function W(e){return W=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},W(e)}function E(e){return W(e)}function _(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Z(e,i){return i&&(F(i)==="object"||typeof i=="function")?i:_(e)}function B(e){var i=D();return function(){var n=E(e),a;if(i){var t=E(this).constructor;a=Reflect.construct(n,arguments,t)}else a=n.apply(this,arguments);return Z(this,a)}}var s=q(644);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(e){return!1}}function Q(e,i,r){return se()?Q=Reflect.construct:Q=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&x(v,o.prototype),v},Q.apply(null,arguments)}function G(e,i,r){return Q.apply(null,arguments)}function X(e,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function L(e,i,r){return i&&X(e.prototype,i),r&&X(e,r),e}function R(e,i){(i==null||i>e.length)&&(i=e.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=e[r];return n}function N(e){if(Array.isArray(e))return R(e)}function ne(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function J(){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 H(e,i){if(!!e){if(typeof e=="string")return R(e,i);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(e,i)}}function U(e){return N(e)||ne(e)||H(e)||J()}var ie=q(484);function ue(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),e&&(r.promise=(0,ie.Z)(r.promise,i)),r}var ee=require("three/examples/jsm/renderers/CSS2DRenderer"),ye=require("three/examples/jsm/renderers/CSS3DRenderer"),K=q(519),$=function(e){e&&((0,K.disposeMesh)(e),e.children.forEach(function(i){i.userData.BaseObject_||$(i)}))},me=function(){"use strict";function e(){C(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ue(),this.visible=!1}var i=e.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},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 n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];return this.object3d=G(s.Mesh,U(a)),this},i.createGroup=function(){return this.object3d=new s.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];return this.object3d=G(s.Points,U(a)),this},i.createCSS2DObject=function(n){return this.object3d=new ee.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new ye.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new ye.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new s.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,U(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,U(a)),this},i.getSize=function(){var n=new s.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new s.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){$(this.object3d)},L(e,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),e}(),ke=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,S.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var m=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var g=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,g)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},n.setText=function(t,o){var c=(0,S.Z)(O((0,S.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,g=c.flipX,b=c.scale,y=this.canvas;y.width=v*h.length*2,y.height=v;var M=y.getContext("2d");M.font="".concat(m," ").concat(v,"px/1 ").concat(d);var f=M.measureText(h).width;y.width=f,this.width=f,M=y.getContext("2d"),M.clearRect(0,0,y.width,y.height),g&&M.scale(-1,1),M.font="".concat(m," ").concat(v,"px/1 ").concat(d),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(h,g?f*-1:0,y.height/2),M.restore();var j=new s.Texture(y);j.anisotropy=16,j.needsUpdate=!0;var k=this.object3d;k.material.map&&k.material.map.dispose(),k.material.map=j,k.material.needsUpdate=!0,k.scale.set(j.image.width*b,j.image.height*b,1)},r}(me),l=q(568),u=q(666),p=q.n(u),A=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=a,t}var n=r.prototype;return n.getMaterial=function(){var t=this;return(0,l.Z)(p().mark(function o(){var c,h,v,d,m,g,b,y,M,f;return p().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,g=c.alphaTest,b=c.sprite,y=c.sizeAttenuation,k.next=3,new s.TextureLoader().loadAsync(d);case 3:return M=k.sent,f=b?new s.SpriteMaterial({map:M,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:y!=null?y:!0}):new s.MeshBasicMaterial({map:M,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),k.abrupt("return",f);case 6:case"end":return k.stop()}},o)}))()},n.create=function(){var t=this;return(0,l.Z)(p().mark(function o(){var c,h,v,d,m,g,b,y;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:b=f.sent,m.set(d,b);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:y=f.t0,t.texture=y.map,g?t.createSprite(y):t.createMesh(new s.PlaneBufferGeometry(1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(me);function w(e,i){for(;!Object.prototype.hasOwnProperty.call(e,i)&&(e=E(e),e!==null););return e}function I(e,i,r){return typeof Reflect!="undefined"&&Reflect.get?I=Reflect.get:I=function(a,t,o){var c=w(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},I(e,i,r)}function te(e,i,r){return I(e,i,r)}var ae=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},{autoPlay:!0,loop:!0},a),t}var n=r.prototype;return n.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,g=t.loop,b=t.alphaTest,y=t.sprite,M=ue(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var j=new s.VideoTexture(f);j.format=d!=null?d:s.RGBAFormat,j.needsUpdate=!0;var k=y?new s.SpriteMaterial({map:j,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:j,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});M.resolve(k)},!1),f.src=o,f.muted=!0,f.autoplay=m,f.loop=g,f.preload="auto",M.promise},n.create=function(){var t=this;return(0,l.Z)(p().mark(function o(){var c,h,v,d,m,g,b,y;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:b=f.sent,m.set(d,b);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:y=f.t0,t.video=y.map.image,g?t.createSprite(y):t.createMesh(new s.PlaneBufferGeometry(1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},n.render=function(){var t=this.options.autoPlay;t&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),te(E(r.prototype),"dispose",this).call(this)},r}(me),ce=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(t){return(0,l.Z)(p().mark(function o(){var c,h,v,d;return p().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),d=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",d);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,d=t.position,m=d===void 0?new s.Vector3(0,0,0):d,g=t.cache,b=this;return(0,l.Z)(p().mark(function y(){var M,f,j,k;return p().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(M="node-create-pick-object",!(g&&!g.get(M))){V.next=7;break}return g.init(M),V.next=5,b.getMaterial(c);case 5:f=V.sent,g.set(M,f);case 7:if(!g){V.next=13;break}return V.next=10,g.get(M);case 10:V.t0=V.sent,V.next=16;break;case 13:return V.next=15,b.getMaterial(c);case 15:V.t0=V.sent;case 16:j=V.t0,k=new s.Sprite(j),k.scale.set(j.map.image.width*v.x,j.map.image.height*v.y,1),k.position.copy(m),b.add(k),b.pickObject=k;case 22:case"end":return V.stop()}},y)}))()},n.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),te(E(r.prototype),"dispose",this).call(this)},L(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return U(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(me),oe=ce,Oe=`
1
+ (function(){var Je={666:function(C){var T=function(x){"use strict";var P=Object.prototype,S=P.hasOwnProperty,z,O=typeof Symbol=="function"?Symbol:{},D=O.iterator||"@@iterator",W=O.asyncIterator||"@@asyncIterator",E=O.toStringTag||"@@toStringTag";function _(l,u,p){return Object.defineProperty(l,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[u]}try{_({},"")}catch(l){_=function(u,p,A){return u[p]=A}}function I(l,u,p,A){var w=u&&u.prototype instanceof X?u:X,$=Object.create(w.prototype),ae=new H(A||[]);return $._invoke=ue(l,p,ae),$}x.wrap=I;function F(l,u,p){try{return{type:"normal",arg:l.call(u,p)}}catch(A){return{type:"throw",arg:A}}}var B="suspendedStart",s="suspendedYield",se="executing",Q="completed",G={};function X(){}function L(){}function R(){}var Z={};_(Z,D,function(){return this});var re=Object.getPrototypeOf,J=re&&re(re(de([])));J&&J!==P&&S.call(J,D)&&(Z=J);var N=R.prototype=X.prototype=Object.create(Z);L.prototype=R,_(N,"constructor",R),_(R,"constructor",L),L.displayName=_(R,E,"GeneratorFunction");function U(l){["next","throw","return"].forEach(function(u){_(l,u,function(p){return this._invoke(u,p)})})}x.isGeneratorFunction=function(l){var u=typeof l=="function"&&l.constructor;return u?u===L||(u.displayName||u.name)==="GeneratorFunction":!1},x.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,R):(l.__proto__=R,_(l,E,"GeneratorFunction")),l.prototype=Object.create(N),l},x.awrap=function(l){return{__await:l}};function ie(l,u){function p($,ae,oe,ne){var te=F(l[$],l,ae);if(te.type==="throw")ne(te.arg);else{var je=te.arg,Se=je.value;return Se&&typeof Se=="object"&&S.call(Se,"__await")?u.resolve(Se.__await).then(function(xe){p("next",xe,oe,ne)},function(xe){p("throw",xe,oe,ne)}):u.resolve(Se).then(function(xe){je.value=xe,oe(je)},function(xe){return p("throw",xe,oe,ne)})}}var A;function w($,ae){function oe(){return new u(function(ne,te){p($,ae,ne,te)})}return A=A?A.then(oe,oe):oe()}this._invoke=w}U(ie.prototype),_(ie.prototype,W,function(){return this}),x.AsyncIterator=ie,x.async=function(l,u,p,A,w){w===void 0&&(w=Promise);var $=new ie(I(l,u,p,A),w);return x.isGeneratorFunction(u)?$:$.next().then(function(ae){return ae.done?ae.value:$.next()})};function ue(l,u,p){var A=B;return function($,ae){if(A===se)throw new Error("Generator is already running");if(A===Q){if($==="throw")throw ae;return ze()}for(p.method=$,p.arg=ae;;){var oe=p.delegate;if(oe){var ne=ee(oe,p);if(ne){if(ne===G)continue;return ne}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(A===B)throw A=Q,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);A=se;var te=F(l,u,p);if(te.type==="normal"){if(A=p.done?Q:s,te.arg===G)continue;return{value:te.arg,done:p.done}}else te.type==="throw"&&(A=Q,p.method="throw",p.arg=te.arg)}}}function ee(l,u){var p=l.iterator[u.method];if(p===z){if(u.delegate=null,u.method==="throw"){if(l.iterator.return&&(u.method="return",u.arg=z,ee(l,u),u.method==="throw"))return G;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return G}var A=F(p,l.iterator,u.arg);if(A.type==="throw")return u.method="throw",u.arg=A.arg,u.delegate=null,G;var w=A.arg;if(!w)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,G;if(w.done)u[l.resultName]=w.value,u.next=l.nextLoc,u.method!=="return"&&(u.method="next",u.arg=z);else return w;return u.delegate=null,G}U(N),_(N,E,"Generator"),_(N,D,function(){return this}),_(N,"toString",function(){return"[object Generator]"});function ge(l){var u={tryLoc:l[0]};1 in l&&(u.catchLoc=l[1]),2 in l&&(u.finallyLoc=l[2],u.afterLoc=l[3]),this.tryEntries.push(u)}function K(l){var u=l.completion||{};u.type="normal",delete u.arg,l.completion=u}function H(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ge,this),this.reset(!0)}x.keys=function(l){var u=[];for(var p in l)u.push(p);return u.reverse(),function A(){for(;u.length;){var w=u.pop();if(w in l)return A.value=w,A.done=!1,A}return A.done=!0,A}};function de(l){if(l){var u=l[D];if(u)return u.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,A=function w(){for(;++p<l.length;)if(S.call(l,p))return w.value=l[p],w.done=!1,w;return w.value=z,w.done=!0,w};return A.next=A}}return{next:ze}}x.values=de;function ze(){return{value:z,done:!0}}return H.prototype={constructor:H,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=z,this.done=!1,this.delegate=null,this.method="next",this.arg=z,this.tryEntries.forEach(K),!l)for(var u in this)u.charAt(0)==="t"&&S.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=z)},stop:function(){this.done=!0;var l=this.tryEntries[0],u=l.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var u=this;function p(ne,te){return $.type="throw",$.arg=l,u.next=ne,te&&(u.method="next",u.arg=z),!!te}for(var A=this.tryEntries.length-1;A>=0;--A){var w=this.tryEntries[A],$=w.completion;if(w.tryLoc==="root")return p("end");if(w.tryLoc<=this.prev){var ae=S.call(w,"catchLoc"),oe=S.call(w,"finallyLoc");if(ae&&oe){if(this.prev<w.catchLoc)return p(w.catchLoc,!0);if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else if(ae){if(this.prev<w.catchLoc)return p(w.catchLoc,!0)}else if(oe){if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,u){for(var p=this.tryEntries.length-1;p>=0;--p){var A=this.tryEntries[p];if(A.tryLoc<=this.prev&&S.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var w=A;break}}w&&(l==="break"||l==="continue")&&w.tryLoc<=u&&u<=w.finallyLoc&&(w=null);var $=w?w.completion:{};return $.type=l,$.arg=u,w?(this.method="next",this.next=w.finallyLoc,G):this.complete($)},complete:function(l,u){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&u&&(this.next=u),G},finish:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),K(p),G}},catch:function(l){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===l){var A=p.completion;if(A.type==="throw"){var w=A.arg;K(p)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(l,u,p){return this.delegate={iterator:de(l),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=z),G}},x}(C.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(C,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(S){if(S.geometry&&S.geometry.dispose(),S.material){var z=Array.isArray(S.material)?S.material:[S.material];z.forEach(function(O){var D,W,E,_,I,F,B,s,se,Q,G,X,L;(D=O.map)===null||D===void 0||D.dispose(),(W=O.lightMap)===null||W===void 0||W.dispose(),(E=O.bumpMap)===null||E===void 0||E.dispose(),(_=O.normalMap)===null||_===void 0||_.dispose(),(I=O.specularMap)===null||I===void 0||I.dispose(),(F=O.envMap)===null||F===void 0||F.dispose(),(B=O.alphaMap)===null||B===void 0||B.dispose(),(s=O.aoMap)===null||s===void 0||s.dispose(),(se=O.displacementMap)===null||se===void 0||se.dispose(),(Q=O.emissiveMap)===null||Q===void 0||Q.dispose(),(G=O.gradientMap)===null||G===void 0||G.dispose(),(X=O.metalnessMap)===null||X===void 0||X.dispose(),(L=O.roughnessMap)===null||L===void 0||L.dispose(),O.dispose()})}}},519:function(C,T,x){"use strict";x.d(T,{disposeMesh:function(){return O.Z}});var P=x(666),S=x.n(P),z=null,O=x(695),D=x(644);function W(G){if(G.material){var X=Array.isArray(G.material)?G.material:[G.material];X.forEach(function(L){var R,Z;(R=L.color)===null||R===void 0||R.convertSRGBToLinear(),(Z=L.emissive)===null||Z===void 0||Z.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=x(568),_=x(924),I=require("idb-keyval"),F=x(484),B=null,s=null,se=function(){var G=(0,E.Z)(S().mark(function X(L,R){var Z,re,J,N,U,ie;return S().wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return Z=R.version,ee.next=4,(0,I.get)(L);case 4:if(J=ee.sent,!(J&&J[Z])){ee.next=9;break}re=J[Z],ee.next=15;break;case 9:return ee.next=11,(0,F.Z)(fetch(L).then(function(ge){if(ge.ok)return ge.blob();throw new Error}));case 11:N=ee.sent,U=N.res,ie=N.err,ie||(re=U,(0,I.set)(L,(0,_.Z)({},Z,U)));case 15:return ee.abrupt("return",re?{url:URL.createObjectURL(re)}:{url:L});case 16:case"end":return ee.stop()}},X)}));return function(L,R){return G.apply(this,arguments)}}(),Q=x(705)},484:function(C,T,x){"use strict";x.d(T,{Z:function(){return S}});var P=x(42);function S(z){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z.then(function(D){return(0,P.Z)({err:null,res:D},O)}).catch(function(D){return(0,P.Z)({err:D,res:void 0},O)})}},705:function(C,T,x){"use strict";x.d(T,{C:function(){return D},y:function(){return O}});var P=x(644),S=x.n(P),z=new Map,O=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(E,_,I,F,B){var s=_[I*3],se=_[I*3+1],Q=_[F*3],G=_[F*3+1],X=_[B*3],L=_[B*3+1],R;if(z.has(E))R=z.get(E);else{var Z=W.box3||new P.Box3;if(!W.box3){var re=E.parameters.shapes.getPoints();Z.setFromArray(re.map(function(ue){return[ue.x,ue.y,0]}).flat())}var J=Z.getSize(new P.Vector3);W.split&&(J.y/=W.split),R={box:Z,size:J},z.set(E,R)}var N=R.box,U=R.size,ie=W.split?1-W.split:0;return[new P.Vector2((s-N.min.x)/U.x,(se-N.min.y)/U.y+ie),new P.Vector2((Q-N.min.x)/U.x,(G-N.min.y)/U.y+ie),new P.Vector2((X-N.min.x)/U.x,(L-N.min.y)/U.y+ie)]},generateSideWallUV:function(E,_,I,F,B,s){var se=_[I*3],Q=_[I*3+1],G=_[I*3+2],X=_[F*3],L=_[F*3+1],R=_[F*3+2],Z=_[B*3],re=_[B*3+1],J=_[B*3+2],N=_[s*3],U=_[s*3+1],ie=_[s*3+2],ue;if(z.has(_))ue=z.get(_);else{var ee=new P.Box3;ee.setFromArray(_);var ge=ee.getSize(new P.Vector3);W.split&&(ge.z/=1-W.split),ue={box:ee,size:ge},z.set(_,ue)}var K=ue.box,H=ue.size;return Math.abs(Q-L)<Math.abs(se-X)?[new P.Vector2((se-K.min.x)/H.x,(G-K.min.z)/H.z),new P.Vector2((X-K.min.x)/H.x,(R-K.min.z)/H.z),new P.Vector2((Z-K.min.x)/H.x,(J-K.min.z)/H.z),new P.Vector2((N-K.min.x)/H.x,(ie-K.min.z)/H.z)]:[new P.Vector2((Q-K.min.y)/H.x,(G-K.min.z)/H.z),new P.Vector2((L-K.min.y)/H.x,(R-K.min.z)/H.z),new P.Vector2((re-K.min.y)/H.x,(J-K.min.z)/H.z),new P.Vector2((U-K.min.y)/H.x,(ie-K.min.z)/H.z)]}}},D=function(){z.clear()}},644:function(C){"use strict";C.exports=require("three")},568:function(C,T,x){"use strict";x.d(T,{Z:function(){return S}});function P(z,O,D,W,E,_,I){try{var F=z[_](I),B=F.value}catch(s){D(s);return}F.done?O(B):Promise.resolve(B).then(W,E)}function S(z){return function(){var O=this,D=arguments;return new Promise(function(W,E){var _=z.apply(O,D);function I(B){P(_,W,E,I,F,"next",B)}function F(B){P(_,W,E,I,F,"throw",B)}I(void 0)})}}},924:function(C,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(S,z,O){return z in S?Object.defineProperty(S,z,{value:O,enumerable:!0,configurable:!0,writable:!0}):S[z]=O,S}},42:function(C,T,x){"use strict";x.d(T,{Z:function(){return S}});var P=x(924);function S(z){for(var O=1;O<arguments.length;O++){var D=arguments[O]!=null?arguments[O]:{},W=Object.keys(D);typeof Object.getOwnPropertySymbols=="function"&&(W=W.concat(Object.getOwnPropertySymbols(D).filter(function(E){return Object.getOwnPropertyDescriptor(D,E).enumerable}))),W.forEach(function(E){(0,P.Z)(z,E,D[E])})}return z}}},Ue={};function q(C){var T=Ue[C];if(T!==void 0)return T.exports;var x=Ue[C]={exports:{}};return Je[C](x,x.exports,q),x.exports}(function(){q.n=function(C){var T=C&&C.__esModule?function(){return C.default}:function(){return C};return q.d(T,{a:T}),T}})(),function(){q.d=function(C,T){for(var x in T)q.o(T,x)&&!q.o(C,x)&&Object.defineProperty(C,x,{enumerable:!0,get:T[x]})}}(),function(){q.o=function(C,T){return Object.prototype.hasOwnProperty.call(C,T)}}(),function(){q.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})}}();var Te={};(function(){"use strict";q.r(Te),q.d(Te,{ConicPolygon:function(){return Mt},ExtrudePolygon:function(){return At},Image:function(){return ae},Line:function(){return at},MeshLine:function(){return ye},MeshLineMaterial:function(){return Ee},MeshLineRaycast:function(){return Ie},Node:function(){return xe},Text:function(){return ze},Video:function(){return je}});function C(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function T(e,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(e,i)}function x(e,i){return T(e,i)}function P(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&x(e,i)}var S=q(42);function z(e,i){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function O(e,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(i,r))}),e}function D(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function W(e){return W=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},W(e)}function E(e){return W(e)}function _(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e){return e&&e.constructor===Symbol?"symbol":typeof e}function F(e,i){return i&&(I(i)==="object"||typeof i=="function")?i:_(e)}function B(e){var i=D();return function(){var n=E(e),a;if(i){var t=E(this).constructor;a=Reflect.construct(n,arguments,t)}else a=n.apply(this,arguments);return F(this,a)}}var s=q(644);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(e){return!1}}function Q(e,i,r){return se()?Q=Reflect.construct:Q=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&x(v,o.prototype),v},Q.apply(null,arguments)}function G(e,i,r){return Q.apply(null,arguments)}function X(e,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function L(e,i,r){return i&&X(e.prototype,i),r&&X(e,r),e}function R(e,i){(i==null||i>e.length)&&(i=e.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=e[r];return n}function Z(e){if(Array.isArray(e))return R(e)}function re(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function J(){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 N(e,i){if(!!e){if(typeof e=="string")return R(e,i);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(e,i)}}function U(e){return Z(e)||re(e)||N(e)||J()}var ie=q(484);function ue(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),e&&(r.promise=(0,ie.Z)(r.promise,i)),r}var ee=require("three/examples/jsm/renderers/CSS2DRenderer"),ge=require("three/examples/jsm/renderers/CSS3DRenderer"),K=q(519),H=function(e){e&&((0,K.disposeMesh)(e),e.children.forEach(function(i){i.userData.BaseObject_||H(i)}))},de=function(){"use strict";function e(){C(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ue(),this.visible=!1}var i=e.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},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 n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];return this.object3d=G(s.Mesh,U(a)),this},i.createGroup=function(){return this.object3d=new s.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];return this.object3d=G(s.Points,U(a)),this},i.createCSS2DObject=function(n){return this.object3d=new ee.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new ge.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new ge.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new s.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,U(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),t=0;t<n;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,U(a)),this},i.getSize=function(){var n=new s.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new s.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){H(this.object3d)},L(e,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),e}(),ze=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,S.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.position,c=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var m=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var g=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,g)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},n.setText=function(t,o){var c=(0,S.Z)(O((0,S.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,g=c.flipX,b=c.scale,y=this.canvas;y.width=v*h.length*2,y.height=v;var M=y.getContext("2d");M.font="".concat(m," ").concat(v,"px/1 ").concat(d);var f=M.measureText(h).width;y.width=f,this.width=f,M=y.getContext("2d"),M.clearRect(0,0,y.width,y.height),g&&M.scale(-1,1),M.font="".concat(m," ").concat(v,"px/1 ").concat(d),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(h,g?f*-1:0,y.height/2),M.restore();var j=new s.Texture(y);j.anisotropy=16,j.needsUpdate=!0;var k=this.object3d;k.material.map&&k.material.map.dispose(),k.material.map=j,k.material.needsUpdate=!0,k.scale.set(j.image.width*b,j.image.height*b,1)},r}(de),l=q(568),u=q(666),p=q.n(u),A=+s.REVISION<144,w=A?"ExtrudeBufferGeometry":"ExtrudeGeometry",$=A?"PlaneBufferGeometry":"PlaneGeometry",ae=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=a,t}var n=r.prototype;return n.getMaterial=function(){var t=this;return(0,l.Z)(p().mark(function o(){var c,h,v,d,m,g,b,y,M,f;return p().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,g=c.alphaTest,b=c.sprite,y=c.sizeAttenuation,k.next=3,new s.TextureLoader().loadAsync(d);case 3:return M=k.sent,f=b?new s.SpriteMaterial({map:M,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:y!=null?y:!0}):new s.MeshBasicMaterial({map:M,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),k.abrupt("return",f);case 6:case"end":return k.stop()}},o)}))()},n.create=function(){var t=this;return(0,l.Z)(p().mark(function o(){var c,h,v,d,m,g,b,y;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:b=f.sent,m.set(d,b);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:y=f.t0,t.texture=y.map,g?t.createSprite(y):t.createMesh(new s[$](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(de);function oe(e,i){for(;!Object.prototype.hasOwnProperty.call(e,i)&&(e=E(e),e!==null););return e}function ne(e,i,r){return typeof Reflect!="undefined"&&Reflect.get?ne=Reflect.get:ne=function(a,t,o){var c=oe(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},ne(e,i,r)}function te(e,i,r){return ne(e,i,r)}var je=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},{autoPlay:!0,loop:!0},a),t}var n=r.prototype;return n.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,g=t.loop,b=t.alphaTest,y=t.sprite,M=ue(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var j=new s.VideoTexture(f);j.format=d!=null?d:s.RGBAFormat,j.needsUpdate=!0;var k=y?new s.SpriteMaterial({map:j,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:j,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});M.resolve(k)},!1),f.src=o,f.muted=!0,f.autoplay=m,f.loop=g,f.preload="auto",M.promise},n.create=function(){var t=this;return(0,l.Z)(p().mark(function o(){var c,h,v,d,m,g,b,y;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,g=c.sprite,!(m&&!m.get(d))){f.next=7;break}return m.init(d),f.next=5,t.getMaterial();case 5:b=f.sent,m.set(d,b);case 7:if(!m){f.next=13;break}return f.next=10,m.get(d);case 10:f.t0=f.sent,f.next=16;break;case 13:return f.next=15,t.getMaterial();case 15:f.t0=f.sent;case 16:y=f.t0,t.video=y.map.image,g?t.createSprite(y):t.createMesh(new s[$](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},n.render=function(){var t=this.options.autoPlay;t&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),te(E(r.prototype),"dispose",this).call(this)},r}(de),Se=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.position,c=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(c),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(t){return(0,l.Z)(p().mark(function o(){var c,h,v,d;return p().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return c=document.createElement("canvas"),c.width=256,c.height=256,h=c.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new s.CanvasTexture(c),d=new s.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",d);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(t){var o=t.show,c=o===void 0?!1:o,h=t.scale,v=h===void 0?new s.Vector3(1,1,1):h,d=t.position,m=d===void 0?new s.Vector3(0,0,0):d,g=t.cache,b=this;return(0,l.Z)(p().mark(function y(){var M,f,j,k;return p().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(M="node-create-pick-object",!(g&&!g.get(M))){V.next=7;break}return g.init(M),V.next=5,b.getMaterial(c);case 5:f=V.sent,g.set(M,f);case 7:if(!g){V.next=13;break}return V.next=10,g.get(M);case 10:V.t0=V.sent,V.next=16;break;case 13:return V.next=15,b.getMaterial(c);case 15:V.t0=V.sent;case 16:j=V.t0,k=new s.Sprite(j),k.scale.set(j.map.image.width*v.x,j.map.image.height*v.y,1),k.position.copy(m),b.add(k),b.pickObject=k;case 22:case"end":return V.stop()}},y)}))()},n.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),te(E(r.prototype),"dispose",this).call(this)},L(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return U(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(de),xe=Se,et=`
2
2
  `.concat(s.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(s.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -95,7 +95,7 @@
95
95
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
96
96
  `).concat(s.ShaderChunk.fog_vertex,`
97
97
  }
98
- `),Pe=`
98
+ `),tt=`
99
99
  `.concat(s.ShaderChunk.fog_pars_fragment,`
100
100
  `).concat(s.ShaderChunk.logdepthbuf_pars_fragment,`
101
101
 
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(s.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),re=function(e){"use strict";P(r,e);var i=B(r);function r(){C(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new s.Matrix4,Object.defineProperties(_(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),n}return r}(s.BufferGeometry);re.prototype.setMatrixWorld=function(e){this.matrixWorld=e},re.prototype.setGeometry=function(e,i){this._geometry=e,this.setPoints(e.getAttribute("position").array,i)},re.prototype.setPoints=function(e,i){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=i,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var n=e[r],a=r/e.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ue(e,i){var r=new s.Matrix4,n=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var b=m.array,y=g.position.array,M=g.width.array,f=0,j=b.length-1;f<j;f+=d){var k=b[f],Y=b[f+1];c.fromArray(y,k*3),h.fromArray(y,Y*3);var V=M[Math.floor(f/3)]!==void 0?M[Math.floor(f/3)]:1,fe=e.params.Line.threshold+this.material.lineWidth*V/2,ge=fe*fe,xe=n.distanceSqToSegment(c,h,t,v);if(!(xe>ge)){t.applyMatrix4(this.matrixWorld);var he=e.ray.origin.distanceTo(t);he<e.near||he>e.far||(i.push({distance:he,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=j)}}}}re.prototype.raycast=Ue,re.prototype.compareV3=function(e,i){var r=e*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},re.prototype.copyV3=function(e){var i=e*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},re.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<e;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(e-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(e-1),0),this.uvs.push(n/(e-1),1),n<e-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Te(e,i,r,n,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=i?e.subarray?e.subarray(i,a&&i+a):e.slice(i,a&&i+a):e,r.set)r.set(e,n);else for(t=0;t<e.length;t++)r[t+n]=e[t];return r}re.prototype.advance=function(e){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Te(i,0,r,0,a),Te(i,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,Te(i,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=Oe,s.ShaderChunk.meshline_frag=Pe;var Re=function(e){"use strict";P(r,e);var i=B(r);function r(n){C(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(_(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(s.ShaderMaterial);Re.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function Je(e,i){if(e==null)return{};var r={},n=Object.keys(e),a,t;for(t=0;t<n.length;t++)a=n[t],!(i.indexOf(a)>=0)&&(r[a]=e[a]);return r}function et(e,i){if(e==null)return{};var r=Je(e,i),n,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)n=t[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}var Ie=require("popmotion"),Fe=require("three/examples/jsm//utils/BufferGeometryUtils");function Ze(e){var i=e.setPointWidth,r=e.nodes,n=new s.BufferGeometry,a=new re;return n.setFromPoints(r),a.setGeometry(n,i),a}var tt={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},rt=function(e){"use strict";P(r,e);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},tt,a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,b=o.nodesArr,y=o.coordinatesArr,M=o.projection,f=o.workerController,j=o.useGroups,k=et(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),Y=this.pencil.getSize(),V=Y.width,fe=Y.height,ge=new Re(O((0,S.Z)({},k),{resolution:new s.Vector2(V,fe)}));if(this.material=ge,g)this.createMesh(Ze({nodes:g,setPointWidth:d}),ge);else if(b){var xe=Fe.mergeBufferGeometries(b.map(function(he){return Ze({nodes:he,setPointWidth:d})}),j!=null?j:!1);this.createMesh(xe,ge)}else if(y&&f)return new Promise(function(he){f.postMessage({coordinatesArr:y,projection:M,useGroups:j},function(le){var _e=new s.BufferGeometry;Object.keys(le).forEach(function(pe){pe==="index"?_e.setIndex(new s.BufferAttribute(le[pe].array,le[pe].itemSize)):_e.setAttribute(pe,new s.BufferAttribute(le[pe].array,le[pe].itemSize))}),t.createMesh(_e,ge),he("")})})},n.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},n.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,Ie.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ie.linear,onUpdate:function(g){v.value.x=g.x}});this.tween=m},n.dispose=function(){var t;te(E(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(me);function nt(e){if(Array.isArray(e))return e}function it(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function be(e,i){return nt(e)||ne(e,i)||H(e,i)||it()}var Se=require("d3-array"),at=require("earcut"),Ee=q.n(at),ot=require("@turf/boolean-clockwise"),st=q.n(ot);function ut(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var ct=require("delaunator"),lt=q.n(ct),ft=require("@turf/boolean-point-in-polygon"),ht=q.n(ft),je=require("d3-geo"),pt=require("d3-geo-voronoi"),Ne=require("d3-scale");function vt(e,i){return e.map(function(r){var n=[],a;return r.forEach(function(t){if(a){var o=(0,je.geoDistance)(t,a)*180/Math.PI;if(o>i)for(var c=(0,je.geoInterpolate)(a,t),h=1/Math.ceil(o/i),v=h;v<1;)n.push(c(v)),v+=h}n.push(a=t)}),n})}function dt(e){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,t=i.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(f){return f/c*360%360-180},v=function(f){return Math.acos(2*f/o-1)/Math.PI*180-90},d=function(f){return o*(Math.cos((f+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(f){return f<=n}:n===void 0?function(f){return f>=r}:n>=r?function(f){return f>=r&&f<=n}:function(f){return f>=r||f<=n},b=[],y=m[0];y<=m[1];y++){var M=h(y);g(M)&&b.push([M,v(y)])}return b}function Be(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,je.geoContains)(i,e):ht()(e,i)}function mt(e,i){var r={type:"Polygon",coordinates:e},n=be((0,je.geoBounds)(r),2),a=be(n[0],2),t=a[0],o=a[1],c=be(n[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<i)return[];var d=t>h||v>=89||o<=-89;return dt(i,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return Be(m,r,d)})}function gt(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=vt(e,n),t=(0,Se.merge)(a),o=mt(e,n),c=U(t).concat(U(o)),h={type:"Polygon",coordinates:e},v=be((0,je.geoBounds)(h),2),d=be(v[0],2),m=d[0],g=d[1],b=be(v[1],2),y=b[0],M=b[1],f=m>y||M>=89||g<=-89,j=[];if(f){var k=(0,pt.geoVoronoi)(c).triangles(),Y=new Map(c.map(function(ve,Ae){var Me=be(ve,2),de=Me[0],Ce=Me[1];return["".concat(de,"-").concat(Ce),Ae]}));k.features.forEach(function(ve){var Ae,Me=ve.geometry.coordinates[0].slice(0,3).reverse(),de=[];if(Me.forEach(function(Le){var we=be(Le,2),We=we[0],Pt=we[1],Ye="".concat(We,"-").concat(Pt);Y.has(Ye)&&de.push(Y.get(Ye))}),de.length===3){if(de.some(function(Le){return Le<t.length})){var Ce=ve.properties.circumcenter;if(!Be(Ce,h,f))return}(Ae=j).push.apply(Ae,U(de))}})}else if(o.length)for(var he=function(ve,Ae){var Me,de=[2,1,0].map(function(we){return le.triangles[ve+we]}),Ce=de.map(function(we){return c[we]});if(de.some(function(we){return we<t.length})){var Le=[0,1].map(function(we){return(0,Se.mean)(Ce,function(We){return We[we]})});if(!Be(Le,h,f))return"continue"}(Me=j).push.apply(Me,U(de))},le=lt().from(c),_e=0,pe=le.triangles.length;_e<pe;_e+=3)he(_e,pe);else{var V=Ee().flatten(a),fe=V.vertices,ge=V.holes,xe=ge===void 0?[]:ge;j=Ee()(fe,xe,2)}var Ve=(0,Ne.scaleLinear)((0,Se.extent)(c,function(ve){return ve[0]}),[0,1]),xt=(0,Ne.scaleLinear)((0,Se.extent)(c,function(ve){return ve[1]}),[0,1]),Mt=c.map(function(ve){var Ae=be(ve,2),Me=Ae[0],de=Ae[1];return[Ve(Me),xt(de)]}),At={points:c,indices:j,uvs:Mt};return{contour:a,triangles:At}}var yt=gt,He=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ge(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.map(function(a){return a.map(function(t){var o=be(t,2),c=o[0],h=o[1];return r?ut(c,h,i):[c,h,i]})});return Ee().flatten(n)}function $e(e,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ge(e,i,n),t=a.vertices,o=a.holes,c=Ge(e,r,n),h=c.vertices,v=(0,Se.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),g=0,b=[],y=0;y<d;y++){var M=y+1;if(M===d)M=g;else if(m.has(M)){var f=M;M=g,g=f}b.push(y,y+d,M+d),b.push(M+d,M,y)}for(var j=[],k=1;k>=0;k--)for(var Y=0;Y<d;Y+=1)j.push(Y/(d-1),k);return{indices:b,vertices:v,uvs:j,topVerts:h}}function qe(e,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?e.indices:e.indices.slice().reverse(),vertices:Ge([e.points],i,a).vertices,uvs:r}}var bt=function(e){"use strict";P(r,e);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,r);var t;t=i.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,S.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;st()(n[0])||n[0].reverse();var M=yt(n,{resolution:g}),f=M.contour,j=M.triangles,k=(0,Se.merge)(j.uvs),Y=[],V=[],fe=[],ge=0,xe=function(le){var _e=Math.round(Y.length/3),pe=fe.length;Y=Y.concat(le.vertices),V=V.concat(le.uvs),fe=fe.concat(_e?le.indices.map(function(Ve){return Ve+_e}):le.indices),t.addGroup(pe,fe.length-pe,ge++)};if(m){var he=$e(f,c,h,b);xe(he),t.userData.rso=y?$e(f,c,h+y,b):he}return v&&xe(qe(j,c,k,!1,b)),d&&xe(qe(j,h,k,!0,b)),t.setIndex(fe),t[He]("position",new s.Float32BufferAttribute(Y,3)),t[He]("uv",new s.Float32BufferAttribute(V,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),_t=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,g=t.cartesian,b=new bt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(me),Ke=q(705);function Xe(e){var i=e.split,r=e.depth,n=e.points,a=new s.ExtrudeGeometry(new s.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Ke.y)({split:i})});return(0,Ke.C)(),a}var wt=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.coordinatesArr,d=o.material,m=o.useGroups,g=o.depth,b=o.split,y=o.workerController,M=o.projection;if(c)this.createMesh(Xe({points:c,depth:g,split:b}),d);else if(h){var f=Fe.mergeBufferGeometries(h.map(function(j){return Xe({points:j,depth:g,split:b})}),m!=null?m:!1);this.createMesh(f,d)}else if(v&&y)return new Promise(function(j){y.postMessage({coordinatesArr:v,depth:g,split:b,useGroups:m,projection:M},function(k){var Y=new s.BufferGeometry;Object.keys(k).forEach(function(V){Y.setAttribute(V,new s.BufferAttribute(k[V].array,k[V].itemSize))}),t.createMesh(Y,d),j("")})})},r}(me)})(),module.exports=ze})();
132
+ `),ye=function(e){"use strict";P(r,e);var i=B(r);function r(){C(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new s.Matrix4,Object.defineProperties(_(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),n}return r}(s.BufferGeometry);ye.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ye.prototype.setGeometry=function(e,i){this._geometry=e,this.setPoints(e.getAttribute("position").array,i)},ye.prototype.setPoints=function(e,i){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=i,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var n=e[r],a=r/e.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ie(e,i){var r=new s.Matrix4,n=new s.Ray,a=new s.Sphere,t=new s.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,h=new s.Vector3,v=new s.Vector3,d=this instanceof s.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var b=m.array,y=g.position.array,M=g.width.array,f=0,j=b.length-1;f<j;f+=d){var k=b[f],Y=b[f+1];c.fromArray(y,k*3),h.fromArray(y,Y*3);var V=M[Math.floor(f/3)]!==void 0?M[Math.floor(f/3)]:1,le=e.params.Line.threshold+this.material.lineWidth*V/2,me=le*le,Me=n.distanceSqToSegment(c,h,t,v);if(!(Me>me)){t.applyMatrix4(this.matrixWorld);var fe=e.ray.origin.distanceTo(t);fe<e.near||fe>e.far||(i.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=j)}}}}ye.prototype.raycast=Ie,ye.prototype.compareV3=function(e,i){var r=e*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ye.prototype.copyV3=function(e){var i=e*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},ye.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<e;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(e-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(e-1),0),this.uvs.push(n/(e-1),1),n<e-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Re(e,i,r,n,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=i?e.subarray?e.subarray(i,a&&i+a):e.slice(i,a&&i+a):e,r.set)r.set(e,n);else for(t=0;t<e.length;t++)r[t+n]=e[t];return r}ye.prototype.advance=function(e){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Re(i,0,r,0,a),Re(i,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,Re(i,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=et,s.ShaderChunk.meshline_frag=tt;var Ee=function(e){"use strict";P(r,e);var i=B(r);function r(n){C(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(_(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(s.ShaderMaterial);Ee.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function rt(e,i){if(e==null)return{};var r={},n=Object.keys(e),a,t;for(t=0;t<n.length;t++)a=n[t],!(i.indexOf(a)>=0)&&(r[a]=e[a]);return r}function nt(e,i){if(e==null)return{};var r=rt(e,i),n,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)n=t[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}var Fe=require("popmotion"),Ze=require("three/examples/jsm//utils/BufferGeometryUtils");function Ne(e){var i=e.setPointWidth,r=e.nodes,n=new s.BufferGeometry,a=new ye;return n.setFromPoints(r),a.setGeometry(n,i),a}var it={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},at=function(e){"use strict";P(r,e);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},it,a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,b=o.nodesArr,y=o.coordinatesArr,M=o.projection,f=o.workerController,j=o.useGroups,k=nt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),Y=this.pencil.getSize(),V=Y.width,le=Y.height,me=new Ee(O((0,S.Z)({},k),{resolution:new s.Vector2(V,le)}));if(this.material=me,g)this.createMesh(Ne({nodes:g,setPointWidth:d}),me);else if(b){var Me=Ze.mergeBufferGeometries(b.map(function(fe){return Ne({nodes:fe,setPointWidth:d})}),j!=null?j:!1);this.createMesh(Me,me)}else if(y&&f)return new Promise(function(fe){f.postMessage({coordinatesArr:y,projection:M,useGroups:j},function(ce){var _e=new s.BufferGeometry;Object.keys(ce).forEach(function(he){he==="index"?_e.setIndex(new s.BufferAttribute(ce[he].array,ce[he].itemSize)):_e.setAttribute(he,new s.BufferAttribute(ce[he].array,ce[he].itemSize))}),t.createMesh(_e,me),fe("")})})},n.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},n.animate=function(){var t=this.options,o=t.duration,c=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=c!=null?c:0,m=(0,Fe.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Fe.linear,onUpdate:function(g){v.value.x=g.x}});this.tween=m},n.dispose=function(){var t;te(E(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(de);function ot(e){if(Array.isArray(e))return e}function st(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function be(e,i){return ot(e)||re(e,i)||N(e,i)||st()}var Oe=require("d3-array"),ut=require("earcut"),Be=q.n(ut),ct=require("@turf/boolean-clockwise"),lt=q.n(ct);function ft(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var ht=require("delaunator"),pt=q.n(ht),vt=require("@turf/boolean-point-in-polygon"),dt=q.n(vt),Ce=require("d3-geo"),mt=require("d3-geo-voronoi"),He=require("d3-scale");function gt(e,i){return e.map(function(r){var n=[],a;return r.forEach(function(t){if(a){var o=(0,Ce.geoDistance)(t,a)*180/Math.PI;if(o>i)for(var c=(0,Ce.geoInterpolate)(a,t),h=1/Math.ceil(o/i),v=h;v<1;)n.push(c(v)),v+=h}n.push(a=t)}),n})}function yt(e){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,t=i.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(f){return f/c*360%360-180},v=function(f){return Math.acos(2*f/o-1)/Math.PI*180-90},d=function(f){return o*(Math.cos((f+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(f){return f<=n}:n===void 0?function(f){return f>=r}:n>=r?function(f){return f>=r&&f<=n}:function(f){return f>=r||f<=n},b=[],y=m[0];y<=m[1];y++){var M=h(y);g(M)&&b.push([M,v(y)])}return b}function Ge(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ce.geoContains)(i,e):dt()(e,i)}function bt(e,i){var r={type:"Polygon",coordinates:e},n=be((0,Ce.geoBounds)(r),2),a=be(n[0],2),t=a[0],o=a[1],c=be(n[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<i)return[];var d=t>h||v>=89||o<=-89;return yt(i,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return Ge(m,r,d)})}function _t(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=gt(e,n),t=(0,Oe.merge)(a),o=bt(e,n),c=U(t).concat(U(o)),h={type:"Polygon",coordinates:e},v=be((0,Ce.geoBounds)(h),2),d=be(v[0],2),m=d[0],g=d[1],b=be(v[1],2),y=b[0],M=b[1],f=m>y||M>=89||g<=-89,j=[];if(f){var k=(0,mt.geoVoronoi)(c).triangles(),Y=new Map(c.map(function(pe,Pe){var Ae=be(pe,2),ve=Ae[0],Le=Ae[1];return["".concat(ve,"-").concat(Le),Pe]}));k.features.forEach(function(pe){var Pe,Ae=pe.geometry.coordinates[0].slice(0,3).reverse(),ve=[];if(Ae.forEach(function(ke){var we=be(ke,2),De=we[0],jt=we[1],Qe="".concat(De,"-").concat(jt);Y.has(Qe)&&ve.push(Y.get(Qe))}),ve.length===3){if(ve.some(function(ke){return ke<t.length})){var Le=pe.properties.circumcenter;if(!Ge(Le,h,f))return}(Pe=j).push.apply(Pe,U(ve))}})}else if(o.length)for(var fe=function(pe,Pe){var Ae,ve=[2,1,0].map(function(we){return ce.triangles[pe+we]}),Le=ve.map(function(we){return c[we]});if(ve.some(function(we){return we<t.length})){var ke=[0,1].map(function(we){return(0,Oe.mean)(Le,function(De){return De[we]})});if(!Ge(ke,h,f))return"continue"}(Ae=j).push.apply(Ae,U(ve))},ce=pt().from(c),_e=0,he=ce.triangles.length;_e<he;_e+=3)fe(_e,he);else{var V=Be().flatten(a),le=V.vertices,me=V.holes,Me=me===void 0?[]:me;j=Be()(le,Me,2)}var We=(0,He.scaleLinear)((0,Oe.extent)(c,function(pe){return pe[0]}),[0,1]),Pt=(0,He.scaleLinear)((0,Oe.extent)(c,function(pe){return pe[1]}),[0,1]),St=c.map(function(pe){var Pe=be(pe,2),Ae=Pe[0],ve=Pe[1];return[We(Ae),Pt(ve)]}),Ot={points:c,indices:j,uvs:St};return{contour:a,triangles:Ot}}var wt=_t,$e=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ve(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.map(function(a){return a.map(function(t){var o=be(t,2),c=o[0],h=o[1];return r?ft(c,h,i):[c,h,i]})});return Be().flatten(n)}function qe(e,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ve(e,i,n),t=a.vertices,o=a.holes,c=Ve(e,r,n),h=c.vertices,v=(0,Oe.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),g=0,b=[],y=0;y<d;y++){var M=y+1;if(M===d)M=g;else if(m.has(M)){var f=M;M=g,g=f}b.push(y,y+d,M+d),b.push(M+d,M,y)}for(var j=[],k=1;k>=0;k--)for(var Y=0;Y<d;Y+=1)j.push(Y/(d-1),k);return{indices:b,vertices:v,uvs:j,topVerts:h}}function Ke(e,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?e.indices:e.indices.slice().reverse(),vertices:Ve([e.points],i,a).vertices,uvs:r}}var xt=function(e){"use strict";P(r,e);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,r);var t;t=i.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,S.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,c=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;lt()(n[0])||n[0].reverse();var M=wt(n,{resolution:g}),f=M.contour,j=M.triangles,k=(0,Oe.merge)(j.uvs),Y=[],V=[],le=[],me=0,Me=function(ce){var _e=Math.round(Y.length/3),he=le.length;Y=Y.concat(ce.vertices),V=V.concat(ce.uvs),le=le.concat(_e?ce.indices.map(function(We){return We+_e}):ce.indices),t.addGroup(he,le.length-he,me++)};if(m){var fe=qe(f,c,h,b);Me(fe),t.userData.rso=y?qe(f,c,h+y,b):fe}return v&&Me(Ke(j,c,k,!1,b)),d&&Me(Ke(j,h,k,!0,b)),t.setIndex(le),t[$e]("position",new s.Float32BufferAttribute(Y,3)),t[$e]("uv",new s.Float32BufferAttribute(V,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Mt=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var n=r.prototype;return n.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,g=t.cartesian,b=new xt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(de),Xe=q(705);function Ye(e){var i=e.split,r=e.depth,n=e.points,a=new s[w](new s.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Xe.y)({split:i})});return(0,Xe.C)(),a}var At=function(e){"use strict";P(r,e);var i=B(r);function r(a){C(this,r);var t;return t=i.call(this),t.options=(0,S.Z)({},a),t}var n=r.prototype;return n.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.coordinatesArr,d=o.material,m=o.useGroups,g=o.depth,b=o.split,y=o.workerController,M=o.projection;if(c)this.createMesh(Ye({points:c,depth:g,split:b}),d);else if(h){var f=Ze.mergeBufferGeometries(h.map(function(j){return Ye({points:j,depth:g,split:b})}),m!=null?m:!1);this.createMesh(f,d)}else if(v&&y)return new Promise(function(j){y.postMessage({coordinatesArr:v,depth:g,split:b,useGroups:m,projection:M},function(k){var Y=new s.BufferGeometry;Object.keys(k).forEach(function(V){Y.setAttribute(V,new s.BufferAttribute(k[V].array,k[V].itemSize))}),t.createMesh(Y,d),j("")})})},r}(de)})(),module.exports=Te})();