gl-draw 0.3.12 → 0.4.0
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 +1 -1
- package/dist/index.module.js +1 -1
- package/dist/objects/extrudePolygon/index.d.ts +10 -2
- package/dist/objects/index.js +11 -11
- package/dist/objects/index.module.js +11 -11
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.module.js +1 -1
- package/dist/workers/extrudePolygon.js +1 -1
- package/package.json +1 -1
package/dist/objects/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
`.concat(
|
|
3
|
-
`).concat(
|
|
1
|
+
(function(){var tt={666:function(L){var T=function(x){"use strict";var P=Object.prototype,O=P.hasOwnProperty,R,C=typeof Symbol=="function"?Symbol:{},U=C.iterator||"@@iterator",D=C.asyncIterator||"@@asyncIterator",G=C.toStringTag||"@@toStringTag";function w(f,l,p){return Object.defineProperty(f,l,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{w({},"")}catch(f){w=function(l,p,A){return l[p]=A}}function F(f,l,p,A){var M=l&&l.prototype instanceof Q?l:Q,q=Object.create(M.prototype),ue=new $(A||[]);return q._invoke=pe(f,p,ue),q}x.wrap=F;function Z(f,l,p){try{return{type:"normal",arg:f.call(l,p)}}catch(A){return{type:"throw",arg:A}}}var V="suspendedStart",u="suspendedYield",he="executing",J="completed",W={};function Q(){}function k(){}function E(){}var N={};w(N,U,function(){return this});var ie=Object.getPrototypeOf,ee=ie&&ie(ie(ye([])));ee&&ee!==P&&O.call(ee,U)&&(N=ee);var H=E.prototype=Q.prototype=Object.create(N);k.prototype=E,w(H,"constructor",E),w(E,"constructor",k),k.displayName=w(E,G,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(l){w(f,l,function(p){return this._invoke(l,p)})})}x.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===k||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,E):(f.__proto__=E,w(f,G,"GeneratorFunction")),f.prototype=Object.create(H),f},x.awrap=function(f){return{__await:f}};function se(f,l){function p(q,ue,ce,ae){var re=Z(f[q],f,ue);if(re.type==="throw")ae(re.arg);else{var je=re.arg,Se=je.value;return Se&&typeof Se=="object"&&O.call(Se,"__await")?l.resolve(Se.__await).then(function(xe){p("next",xe,ce,ae)},function(xe){p("throw",xe,ce,ae)}):l.resolve(Se).then(function(xe){je.value=xe,ce(je)},function(xe){return p("throw",xe,ce,ae)})}}var A;function M(q,ue){function ce(){return new l(function(ae,re){p(q,ue,ae,re)})}return A=A?A.then(ce,ce):ce()}this._invoke=M}I(se.prototype),w(se.prototype,D,function(){return this}),x.AsyncIterator=se,x.async=function(f,l,p,A,M){M===void 0&&(M=Promise);var q=new se(F(f,l,p,A),M);return x.isGeneratorFunction(l)?q:q.next().then(function(ue){return ue.done?ue.value:q.next()})};function pe(f,l,p){var A=V;return function(q,ue){if(A===he)throw new Error("Generator is already running");if(A===J){if(q==="throw")throw ue;return ze()}for(p.method=q,p.arg=ue;;){var ce=p.delegate;if(ce){var ae=te(ce,p);if(ae){if(ae===W)continue;return ae}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(A===V)throw A=J,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);A=he;var re=Z(f,l,p);if(re.type==="normal"){if(A=p.done?J:u,re.arg===W)continue;return{value:re.arg,done:p.done}}else re.type==="throw"&&(A=J,p.method="throw",p.arg=re.arg)}}}function te(f,l){var p=f.iterator[l.method];if(p===R){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=R,te(f,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var A=Z(p,f.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,W;var M=A.arg;if(!M)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(M.done)l[f.resultName]=M.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=R);else return M;return l.delegate=null,W}I(H),w(H,G,"Generator"),w(H,U,function(){return this}),w(H,"toString",function(){return"[object Generator]"});function be(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function X(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function $(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(be,this),this.reset(!0)}x.keys=function(f){var l=[];for(var p in f)l.push(p);return l.reverse(),function A(){for(;l.length;){var M=l.pop();if(M in f)return A.value=M,A.done=!1,A}return A.done=!0,A}};function ye(f){if(f){var l=f[U];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,A=function M(){for(;++p<f.length;)if(O.call(f,p))return M.value=f[p],M.done=!1,M;return M.value=R,M.done=!0,M};return A.next=A}}return{next:ze}}x.values=ye;function ze(){return{value:R,done:!0}}return $.prototype={constructor:$,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(X),!f)for(var l in this)l.charAt(0)==="t"&&O.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=R)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function p(ae,re){return q.type="throw",q.arg=f,l.next=ae,re&&(l.method="next",l.arg=R),!!re}for(var A=this.tryEntries.length-1;A>=0;--A){var M=this.tryEntries[A],q=M.completion;if(M.tryLoc==="root")return p("end");if(M.tryLoc<=this.prev){var ue=O.call(M,"catchLoc"),ce=O.call(M,"finallyLoc");if(ue&&ce){if(this.prev<M.catchLoc)return p(M.catchLoc,!0);if(this.prev<M.finallyLoc)return p(M.finallyLoc)}else if(ue){if(this.prev<M.catchLoc)return p(M.catchLoc,!0)}else if(ce){if(this.prev<M.finallyLoc)return p(M.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var p=this.tryEntries.length-1;p>=0;--p){var A=this.tryEntries[p];if(A.tryLoc<=this.prev&&O.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var M=A;break}}M&&(f==="break"||f==="continue")&&M.tryLoc<=l&&l<=M.finallyLoc&&(M=null);var q=M?M.completion:{};return q.type=f,q.arg=l,M?(this.method="next",this.next=M.finallyLoc,W):this.complete(q)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),W},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),X(p),W}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.tryLoc===f){var A=p.completion;if(A.type==="throw"){var M=A.arg;X(p)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,p){return this.delegate={iterator:ye(f),resultName:l,nextLoc:p},this.method==="next"&&(this.arg=R),W}},x}(L.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(L,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(O){if(O.geometry&&O.geometry.dispose(),O.material){var R=Array.isArray(O.material)?O.material:[O.material];R.forEach(function(C){var U,D,G,w,F,Z,V,u,he,J,W,Q,k;(U=C.map)===null||U===void 0||U.dispose(),(D=C.lightMap)===null||D===void 0||D.dispose(),(G=C.bumpMap)===null||G===void 0||G.dispose(),(w=C.normalMap)===null||w===void 0||w.dispose(),(F=C.specularMap)===null||F===void 0||F.dispose(),(Z=C.envMap)===null||Z===void 0||Z.dispose(),(V=C.alphaMap)===null||V===void 0||V.dispose(),(u=C.aoMap)===null||u===void 0||u.dispose(),(he=C.displacementMap)===null||he===void 0||he.dispose(),(J=C.emissiveMap)===null||J===void 0||J.dispose(),(W=C.gradientMap)===null||W===void 0||W.dispose(),(Q=C.metalnessMap)===null||Q===void 0||Q.dispose(),(k=C.roughnessMap)===null||k===void 0||k.dispose(),C.dispose()})}}},519:function(L,T,x){"use strict";x.d(T,{disposeMesh:function(){return C.Z}});var P=x(666),O=x.n(P),R=null,C=x(695),U=x(644);function D(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(k){var E,N;(E=k.color)===null||E===void 0||E.convertSRGBToLinear(),(N=k.emissive)===null||N===void 0||N.convertSRGBToLinear(),k.map&&(k.map.encoding=THREE.sRGBEncoding),k.emissiveMap&&(k.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=x(568),w=x(924),F=require("idb-keyval"),Z=x(484),V=null,u=null,he=function(){var W=(0,G.Z)(O().mark(function Q(k,E){var N,ie,ee,H,I,se;return O().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return N=E.version,te.next=4,(0,F.get)(k);case 4:if(ee=te.sent,!(ee&&ee[N])){te.next=9;break}ie=ee[N],te.next=15;break;case 9:return te.next=11,(0,Z.Z)(fetch(k).then(function(be){if(be.ok)return be.blob();throw new Error}));case 11:H=te.sent,I=H.res,se=H.err,se||(ie=I,(0,F.set)(k,(0,w.Z)({},N,I)));case 15:return te.abrupt("return",ie?{url:URL.createObjectURL(ie)}:{url:k});case 16:case"end":return te.stop()}},Q)}));return function(k,E){return W.apply(this,arguments)}}(),J=x(705)},484:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});var P=x(42);function O(R){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(U){return(0,P.Z)({err:null,res:U},C)}).catch(function(U){return(0,P.Z)({err:U,res:void 0},C)})}},705:function(L,T,x){"use strict";x.d(T,{C:function(){return U},y:function(){return C}});var P=x(644),O=x.n(P),R=new Map,C=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,w,F,Z,V){var u=w[F*3],he=w[F*3+1],J=w[Z*3],W=w[Z*3+1],Q=w[V*3],k=w[V*3+1],E;if(R.has(G))E=R.get(G);else{var N=D.box3||new P.Box3;if(!D.box3){var ie=G.parameters.shapes.getPoints();N.setFromArray(ie.map(function(pe){return[pe.x,pe.y,0]}).flat())}var ee=N.getSize(new P.Vector3);D.split&&(ee.y/=D.split),E={box:N,size:ee},R.set(G,E)}var H=E.box,I=E.size,se=D.split?1-D.split:0;return[new P.Vector2((u-H.min.x)/I.x,(he-H.min.y)/I.y+se),new P.Vector2((J-H.min.x)/I.x,(W-H.min.y)/I.y+se),new P.Vector2((Q-H.min.x)/I.x,(k-H.min.y)/I.y+se)]},generateSideWallUV:function(G,w,F,Z,V,u){var he=w[F*3],J=w[F*3+1],W=w[F*3+2],Q=w[Z*3],k=w[Z*3+1],E=w[Z*3+2],N=w[V*3],ie=w[V*3+1],ee=w[V*3+2],H=w[u*3],I=w[u*3+1],se=w[u*3+2],pe;if(R.has(w))pe=R.get(w);else{var te=new P.Box3;te.setFromArray(w);var be=te.getSize(new P.Vector3);D.split&&(be.z/=1-D.split),pe={box:te,size:be},R.set(w,pe)}var X=pe.box,$=pe.size;return Math.abs(J-k)<Math.abs(he-Q)?[new P.Vector2((he-X.min.x)/$.x,(W-X.min.z)/$.z),new P.Vector2((Q-X.min.x)/$.x,(E-X.min.z)/$.z),new P.Vector2((N-X.min.x)/$.x,(ee-X.min.z)/$.z),new P.Vector2((H-X.min.x)/$.x,(se-X.min.z)/$.z)]:[new P.Vector2((J-X.min.y)/$.y,(W-X.min.z)/$.z),new P.Vector2((k-X.min.y)/$.y,(E-X.min.z)/$.z),new P.Vector2((ie-X.min.y)/$.y,(ee-X.min.z)/$.z),new P.Vector2((I-X.min.y)/$.y,(se-X.min.z)/$.z)]}}},U=function(){R.clear()}},644:function(L){"use strict";L.exports=require("three")},568:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});function P(R,C,U,D,G,w,F){try{var Z=R[w](F),V=Z.value}catch(u){U(u);return}Z.done?C(V):Promise.resolve(V).then(D,G)}function O(R){return function(){var C=this,U=arguments;return new Promise(function(D,G){var w=R.apply(C,U);function F(V){P(w,D,G,F,Z,"next",V)}function Z(V){P(w,D,G,F,Z,"throw",V)}F(void 0)})}}},924:function(L,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(O,R,C){return R in O?Object.defineProperty(O,R,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[R]=C,O}},42:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});var P=x(924);function O(R){for(var C=1;C<arguments.length;C++){var U=arguments[C]!=null?arguments[C]:{},D=Object.keys(U);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(U).filter(function(G){return Object.getOwnPropertyDescriptor(U,G).enumerable}))),D.forEach(function(G){(0,P.Z)(R,G,U[G])})}return R}}},Fe={};function K(L){var T=Fe[L];if(T!==void 0)return T.exports;var x=Fe[L]={exports:{}};return tt[L](x,x.exports,K),x.exports}(function(){K.n=function(L){var T=L&&L.__esModule?function(){return L.default}:function(){return L};return K.d(T,{a:T}),T}})(),function(){K.d=function(L,T){for(var x in T)K.o(T,x)&&!K.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:T[x]})}}(),function(){K.o=function(L,T){return Object.prototype.hasOwnProperty.call(L,T)}}(),function(){K.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";K.r(Be),K.d(Be,{ConicPolygon:function(){return Pt},ExtrudePolygon:function(){return St},Image:function(){return ue},Line:function(){return st},MeshLine:function(){return _e},MeshLineMaterial:function(){return Ve},MeshLineRaycast:function(){return Ze},Node:function(){return xe},Text:function(){return ze},Video:function(){return je}});function L(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function T(t,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(t,i)}function x(t,i){return T(t,i)}function P(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}var O=K(42);function R(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function C(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function U(){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(t){return!1}}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function G(t){return D(t)}function w(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function Z(t,i){return i&&(F(i)==="object"||typeof i=="function")?i:w(t)}function V(t){var i=U();return function(){var n=G(t),a;if(i){var e=G(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return Z(this,a)}}var u=K(644);function he(){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(t){return!1}}function J(t,i,r){return he()?J=Reflect.construct:J=function(a,e,o){var s=[null];s.push.apply(s,e);var h=Function.bind.apply(a,s),v=new h;return o&&x(v,o.prototype),v},J.apply(null,arguments)}function W(t,i,r){return J.apply(null,arguments)}function Q(t,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(t,n.key,n)}}function k(t,i,r){return i&&Q(t.prototype,i),r&&Q(t,r),t}function E(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function N(t){if(Array.isArray(t))return E(t)}function ie(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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(t,i){if(!!t){if(typeof t=="string")return E(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E(t,i)}}function I(t){return N(t)||ie(t)||H(t)||ee()}var se=K(484);function pe(){var t=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}),t&&(r.promise=(0,se.Z)(r.promise,i)),r}var te=require("three/examples/jsm/renderers/CSS2DRenderer"),be=require("three/examples/jsm/renderers/CSS3DRenderer"),X=K(519),$=function(t){t&&((0,X.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||$(i)}))},ye=function(){"use strict";function t(){L(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=pe(),this.visible=!1}var i=t.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),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(u.Mesh,I(a)),this},i.createGroup=function(){return this.object3d=new u.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(u.Points,I(a)),this},i.createCSS2DObject=function(n){return this.object3d=new te.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new be.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new be.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new u.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,I(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,I(a)),this},i.getSize=function(){var n=new u.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new u.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){$(this.object3d)},k(t,[{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})}}]),t}(),ze=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,O.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.lookAt,h=e.sprite,v=e.text,d=e.sizeAttenuation;if(h){var g=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=g}else{var y=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),b=new u.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(v)},n.setText=function(e,o){var s=(0,O.Z)(C((0,O.Z)({},this.options),{text:e}),o||{}),h=s.text,v=s.fontSize,d=s.fontFamily,g=s.fontWeight,y=s.flipX,b=s.scale,m=this.canvas;m.width=v*h.length*2,m.height=v;var _=m.getContext("2d");_.font="".concat(g," ").concat(v,"px/1 ").concat(d);var c=_.measureText(h).width;m.width=c,this.width=c,_=m.getContext("2d"),_.clearRect(0,0,m.width,m.height),y&&_.scale(-1,1),_.font="".concat(g," ").concat(v,"px/1 ").concat(d),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(h,y?c*-1:0,m.height/2),_.restore();var S=new u.Texture(m);S.anisotropy=16,S.needsUpdate=!0;var j=this.object3d;j.material.map&&j.material.map.dispose(),j.material.map=S,j.material.needsUpdate=!0,j.scale.set(S.image.width*b,S.image.height*b,1)},r}(ye),f=K(568),l=K(666),p=K.n(l),A=+u.REVISION<144,M=A?"ExtrudeBufferGeometry":"ExtrudeGeometry",q=A?"PlaneBufferGeometry":"PlaneGeometry",ue=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m,_,c;return p().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return s=e.options,h=s.transparent,v=s.blending,d=s.src,g=s.depthWrite,y=s.alphaTest,b=s.sprite,m=s.sizeAttenuation,j.next=3,new u.TextureLoader().loadAsync(d);case 3:return _=j.sent,c=b?new u.SpriteMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0,sizeAttenuation:m!=null?m:!0}):new u.MeshBasicMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0}),j.abrupt("return",c);case 6:case"end":return j.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m;return p().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=e.options,h=s.scale,v=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,e.getMaterial();case 5:b=c.sent,g.set(d,b);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,e.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,e.texture=m.map,y?e.createSprite(m):e.createMesh(new u[q](1,1),m),h&&e.setScale(h),v&&e.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ye);function ce(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=G(t),t!==null););return t}function ae(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ae=Reflect.get:ae=function(a,e,o){var s=ce(a,e);if(!!s){var h=Object.getOwnPropertyDescriptor(s,e);return h.get?h.get.call(o||a):h.value}},ae(t,i,r)}function re(t,i,r){return ae(t,i,r)}var je=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,h=e.blending,v=e.depthWrite,d=e.format,g=e.autoPlay,y=e.loop,b=e.alphaTest,m=e.sprite,_=pe(),c=document.createElement("video");return c.addEventListener("loadedmetadata",function(){var S=new u.VideoTexture(c);S.format=d!=null?d:u.RGBAFormat,S.needsUpdate=!0;var j=m?new u.SpriteMaterial({map:S,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new u.MeshBasicMaterial({map:S,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});_.resolve(j)},!1),c.src=o,c.muted=!0,c.autoplay=g,c.loop=y,c.preload="auto",_.promise},n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m;return p().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=e.options,h=s.scale,v=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,e.getMaterial();case 5:b=c.sent,g.set(d,b);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,e.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,e.video=m.map.image,y?e.createSprite(m):e.createMesh(new u[q](1,1),m),h&&e.setScale(h),v&&e.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),re(G(r.prototype),"dispose",this).call(this)},r}(ye),Se=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,h=e.onClick,v=e.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(g){g.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,f.Z)(p().mark(function o(){var s,h,v,d;return p().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new u.CanvasTexture(s),d=new u.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,h=e.scale,v=h===void 0?new u.Vector3(1,1,1):h,d=e.position,g=d===void 0?new u.Vector3(0,0,0):d,y=e.cache,b=this;return(0,f.Z)(p().mark(function m(){var _,c,S,j;return p().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(_="node-create-pick-object",!(y&&!y.get(_))){z.next=7;break}return y.init(_),z.next=5,b.getMaterial(s);case 5:c=z.sent,y.set(_,c);case 7:if(!y){z.next=13;break}return z.next=10,y.get(_);case 10:z.t0=z.sent,z.next=16;break;case 13:return z.next=15,b.getMaterial(s);case 15:z.t0=z.sent;case 16:S=z.t0,j=new u.Sprite(S),j.scale.set(S.map.image.width*v.x,S.map.image.height*v.y,1),j.position.copy(g),b.add(j),b.pickObject=j;case 22:case"end":return z.stop()}},m)}))()},n.dispose=function(){var e=this.options.onClick;e&&this.clickTarge.forEach(function(o){o.removeEventListener("click",e)}),re(G(r.prototype),"dispose",this).call(this)},k(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return I(e.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(ye),xe=Se,rt=`
|
|
2
|
+
`.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(u.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(u.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(u.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),nt=`
|
|
99
|
+
`.concat(u.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(u.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(u.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(u.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
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})();
|
|
132
|
+
`),_e=function(t){"use strict";P(r,t);var i=V(r);function r(){L(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 u.Matrix4,Object.defineProperties(w(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(u.BufferGeometry);_e.prototype.setMatrixWorld=function(t){this.matrixWorld=t},_e.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},_e.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof u.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.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<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ze(t,i){var r=new u.Matrix4,n=new u.Ray,a=new u.Sphere,e=new u.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new u.Vector3,h=new u.Vector3,v=new u.Vector3,d=this instanceof u.LineSegments?2:1,g=o.index,y=o.attributes;if(g!==null)for(var b=g.array,m=y.position.array,_=y.width.array,c=0,S=b.length-1;c<S;c+=d){var j=b[c],Y=b[c+1];s.fromArray(m,j*3),h.fromArray(m,Y*3);var z=_[Math.floor(c/3)]!==void 0?_[Math.floor(c/3)]:1,ne=t.params.Line.threshold+this.material.lineWidth*z/2,oe=ne*ne,de=n.distanceSqToSegment(s,h,e,v);if(!(de>oe)){e.applyMatrix4(this.matrixWorld);var fe=t.ray.origin.distanceTo(e);fe<t.near||fe>t.far||(i.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}),c=S)}}}}_e.prototype.raycast=Ze,_e.prototype.compareV3=function(t,i){var r=t*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]},_e.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},_e.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-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<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-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(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-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 u.BufferAttribute(new Float32Array(this.positions),3),previous:new u.BufferAttribute(new Float32Array(this.previous),3),next:new u.BufferAttribute(new Float32Array(this.next),3),side:new u.BufferAttribute(new Float32Array(this.side),1),width:new u.BufferAttribute(new Float32Array(this.width),1),uv:new u.BufferAttribute(new Float32Array(this.uvs),2),index:new u.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new u.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 Ge(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}_e.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ge(i,0,r,0,a),Ge(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Ge(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},u.ShaderChunk.meshline_vert=rt,u.ShaderChunk.meshline_frag=nt;var Ve=function(t){"use strict";P(r,t);var i=V(r);function r(n){L(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},u.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.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 u.Vector2(1,1)},offset:{value:new u.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:u.ShaderChunk.meshline_vert,fragmentShader:u.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(w(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}(u.ShaderMaterial);Ve.prototype.copy=function(t){return u.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function it(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function at(t,i){if(t==null)return{};var r=it(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ne=require("popmotion"),He=require("three/examples/jsm//utils/BufferGeometryUtils");function $e(t){var i=t.setPointWidth,r=t.nodes,n=new u.BufferGeometry,a=new _e;return n.setFromPoints(r),a.setGeometry(n,i),a}var ot={color:new u.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},st=function(t){"use strict";P(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},ot,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,g=o.key,y=o.nodes,b=o.nodesArr,m=o.coordinatesArr,_=o.projection,c=o.workerController,S=o.useGroups,j=at(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),Y=this.pencil.getSize(),z=Y.width,ne=Y.height,oe=new Ve(C((0,O.Z)({},j),{resolution:new u.Vector2(z,ne)}));if(this.material=oe,y)this.createMesh($e({nodes:y,setPointWidth:d}),oe);else if(b){var de=He.mergeBufferGeometries(b.map(function(fe){return $e({nodes:fe,setPointWidth:d})}),S!=null?S:!1);this.createMesh(de,oe)}else if(m&&c)return new Promise(function(fe){c.postMessage({coordinatesArr:m,projection:_,useGroups:S},function(ve){var B=new u.BufferGeometry;Object.keys(ve).forEach(function(le){le==="index"?B.setIndex(new u.BufferAttribute(ve[le].array,ve[le].itemSize)):B.setAttribute(le,new u.BufferAttribute(ve[le].array,ve[le].itemSize))}),e.createMesh(B,oe),fe("")})})},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,h=e.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,g=(0,Ne.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ne.linear,onUpdate:function(y){v.value.x=y.x}});this.tween=g},n.dispose=function(){var e;re(G(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ye);function ut(t){if(Array.isArray(t))return t}function ct(){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 we(t,i){return ut(t)||ie(t,i)||H(t,i)||ct()}var Ce=require("d3-array"),lt=require("earcut"),We=K.n(lt),ft=require("@turf/boolean-clockwise"),ht=K.n(ft);function pt(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var vt=require("delaunator"),dt=K.n(vt),mt=require("@turf/boolean-point-in-polygon"),gt=K.n(mt),Le=require("d3-geo"),yt=require("d3-geo-voronoi"),qe=require("d3-scale");function bt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Le.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Le.geoInterpolate)(a,e),h=1/Math.ceil(o/i),v=h;v<1;)n.push(s(v)),v+=h}n.push(a=e)}),n})}function _t(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(c){return c/s*360%360-180},v=function(c){return Math.acos(2*c/o-1)/Math.PI*180-90},d=function(c){return o*(Math.cos((c+90)*Math.PI/180)+1)/2},g=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(c){return c<=n}:n===void 0?function(c){return c>=r}:n>=r?function(c){return c>=r&&c<=n}:function(c){return c>=r||c<=n},b=[],m=g[0];m<=g[1];m++){var _=h(m);y(_)&&b.push([_,v(m)])}return b}function De(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,t):gt()(t,i)}function wt(t,i){var r={type:"Polygon",coordinates:t},n=we((0,Le.geoBounds)(r),2),a=we(n[0],2),e=a[0],o=a[1],s=we(n[1],2),h=s[0],v=s[1];if(Math.min(Math.abs(h-e),Math.abs(v-o))<i)return[];var d=e>h||v>=89||o<=-89;return _t(i,{minLng:e,maxLng:h,minLat:o,maxLat:v}).filter(function(g){return De(g,r,d)})}function Mt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=bt(t,n),e=(0,Ce.merge)(a),o=wt(t,n),s=I(e).concat(I(o)),h={type:"Polygon",coordinates:t},v=we((0,Le.geoBounds)(h),2),d=we(v[0],2),g=d[0],y=d[1],b=we(v[1],2),m=b[0],_=b[1],c=g>m||_>=89||y<=-89,S=[];if(c){var j=(0,yt.geoVoronoi)(s).triangles(),Y=new Map(s.map(function(me,Pe){var Ae=we(me,2),ge=Ae[0],Re=Ae[1];return["".concat(ge,"-").concat(Re),Pe]}));j.features.forEach(function(me){var Pe,Ae=me.geometry.coordinates[0].slice(0,3).reverse(),ge=[];if(Ae.forEach(function(Te){var Me=we(Te,2),Ie=Me[0],Ct=Me[1],et="".concat(Ie,"-").concat(Ct);Y.has(et)&&ge.push(Y.get(et))}),ge.length===3){if(ge.some(function(Te){return Te<e.length})){var Re=me.properties.circumcenter;if(!De(Re,h,c))return}(Pe=S).push.apply(Pe,I(ge))}})}else if(o.length)for(var fe=function(me,Pe){var Ae,ge=[2,1,0].map(function(Me){return ve.triangles[me+Me]}),Re=ge.map(function(Me){return s[Me]});if(ge.some(function(Me){return Me<e.length})){var Te=[0,1].map(function(Me){return(0,Ce.mean)(Re,function(Ie){return Ie[Me]})});if(!De(Te,h,c))return"continue"}(Ae=S).push.apply(Ae,I(ge))},ve=dt().from(s),B=0,le=ve.triangles.length;B<le;B+=3)fe(B,le);else{var z=We().flatten(a),ne=z.vertices,oe=z.holes,de=oe===void 0?[]:oe;S=We()(ne,de,2)}var Oe=(0,qe.scaleLinear)((0,Ce.extent)(s,function(me){return me[0]}),[0,1]),Ee=(0,qe.scaleLinear)((0,Ce.extent)(s,function(me){return me[1]}),[0,1]),ke=s.map(function(me){var Pe=we(me,2),Ae=Pe[0],ge=Pe[1];return[Oe(Ae),Ee(ge)]}),Ot={points:s,indices:S,uvs:ke};return{contour:a,triangles:Ot}}var xt=Mt,Ke=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=we(e,2),s=o[0],h=o[1];return r?pt(s,h,i):[s,h,i]})});return We().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ue(t,i,n),e=a.vertices,o=a.holes,s=Ue(t,r,n),h=s.vertices,v=(0,Ce.merge)([h,e]),d=Math.round(h.length/3),g=new Set(o),y=0,b=[],m=0;m<d;m++){var _=m+1;if(_===d)_=y;else if(g.has(_)){var c=_;_=y,y=c}b.push(m,m+d,_+d),b.push(_+d,_,m)}for(var S=[],j=1;j>=0;j--)for(var Y=0;Y<d;Y+=1)S.push(Y/(d-1),j);return{indices:b,vertices:v,uvs:S,topVerts:h}}function Ye(t,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?t.indices:t.indices.slice().reverse(),vertices:Ue([t.points],i,a).vertices,uvs:r}}var At=function(t){"use strict";P(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,O.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,g=o.includeSides,y=o.curvatureResolution,b=o.cartesian,m=o.userDataRsoOffset;ht()(n[0])||n[0].reverse();var _=xt(n,{resolution:y}),c=_.contour,S=_.triangles,j=(0,Ce.merge)(S.uvs),Y=[],z=[],ne=[],oe=0,de=function(ve){var B=Math.round(Y.length/3),le=ne.length;Y=Y.concat(ve.vertices),z=z.concat(ve.uvs),ne=ne.concat(B?ve.indices.map(function(Oe){return Oe+B}):ve.indices),e.addGroup(le,ne.length-le,oe++)};if(g){var fe=Xe(c,s,h,b);de(fe),e.userData.rso=m?Xe(c,s,h+m,b):fe}return v&&de(Ye(S,s,j,!1,b)),d&&de(Ye(S,h,j,!0,b)),e.setIndex(ne),e[Ke]("position",new u.Float32BufferAttribute(Y,3)),e[Ke]("uv",new u.Float32BufferAttribute(z,2)),e.computeVertexNormals(),e}return r}(u.BufferGeometry),Pt=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,h=e.closedBottom,v=e.closedTop,d=e.curvatureResolution,g=e.userDataRsoOffset,y=e.cartesian,b=new At(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:y,userDataRsoOffset:g});this.createMesh(b,this.options.material)},r}(ye),Qe=K(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=new u[M](new u.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i})});return(0,Qe.C)(),a}var St=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=C((0,O.Z)({},a),{split:.1}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m,_,c,S,j,Y,z,ne,oe,de,fe;return p().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(s=e.options,h=s.points,v=s.pointsArr,d=s.coordinatesArr,g=s.useGroups,y=s.depth,b=s.material,m=s.workerController,_=s.projection,c=s.cache,S=s.sideMap,j=s.topColor,Y=s.split,z=0,ne=b,!(S&&j)){B.next=22;break}if(z=Y,oe=S+j,!(c&&!c.get(oe))){B.next=12;break}return c.init(oe),B.next=10,e.getMaterial();case 10:de=B.sent,c.set(oe,de);case 12:if(!c){B.next=18;break}return B.next=15,c.get(oe);case 15:B.t0=B.sent,B.next=21;break;case 18:return B.next=20,e.getMaterial();case 20:B.t0=B.sent;case 21:ne=B.t0;case 22:if(!h){B.next=26;break}e.createMesh(Je({points:h,depth:y,split:z}),b),B.next=32;break;case 26:if(!v){B.next=30;break}fe=He.mergeBufferGeometries(v.map(function(le){return Je({points:le,depth:y,split:z})}),g!=null?g:!1),e.createMesh(fe,b),B.next=32;break;case 30:if(!(d&&m)){B.next=32;break}return B.abrupt("return",new Promise(function(le){m.postMessage({coordinatesArr:d,depth:y,split:z,useGroups:g,projection:_},function(Oe){var Ee=new u.BufferGeometry;Object.keys(Oe).forEach(function(ke){Ee.setAttribute(ke,new u.BufferAttribute(Oe[ke].array,Oe[ke].itemSize))}),e.createMesh(Ee,ne),le("")})}));case 32:case"end":return B.stop()}},o)}))()},n.getMaterial=function(){var e=this,o=this.options,s=o.topColor,h=o.sideMap,v=o.materialType,d=o.materialOptions,g=o.createCanvasObjectURL,y=o.split;return new Promise(function(b){var m=document.createElement("img");m.src=h,m.onload=function(){var _=y,c=document.createElement("canvas"),S=c.getContext("2d");c.height=m.height/(1-_),c.width=m.width,_&&(S.fillStyle=s,S.fillRect(0,0,m.width,c.height*_)),S.drawImage(m,0,c.height*_,m.width,m.height),g&&c.toBlob(function(ne){console.log(URL.createObjectURL(ne))});var j=new u.CanvasTexture(c),Y=e.pencil.renderer.capabilities.getMaxAnisotropy();j.anisotropy=Y;var z=new u[v||"MeshBasicMaterial"]((0,O.Z)({map:j},d||{}));b(z)}})},r}(ye)})(),module.exports=Be})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import*as tt from"idb-keyval";import*as It from"three";import*as Ft from"three/examples/jsm/renderers/CSS2DRenderer";import*as rt from"three/examples/jsm/renderers/CSS3DRenderer";import*as nt from"popmotion";import*as Zt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ie from"d3-array";import*as Xt from"earcut";import*as Ht from"@turf/boolean-clockwise";import*as Kt from"delaunator";import*as $t from"@turf/boolean-point-in-polygon";import*as Te from"d3-geo";import*as Yt from"d3-geo-voronoi";import*as Jt from"d3-scale";var Qt={666:function(L){var j=function(w){"use strict";var P=Object.prototype,x=P.hasOwnProperty,W,O=typeof Symbol=="function"?Symbol:{},R=O.iterator||"@@iterator",F=O.asyncIterator||"@@asyncIterator",A=O.toStringTag||"@@toStringTag";function k(f,u,p){return Object.defineProperty(f,u,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{k({},"")}catch(f){k=function(u,p,S){return u[p]=S}}function $(f,u,p,S){var g=u&&u.prototype instanceof ie?u:ie,J=Object.create(g.prototype),H=new Me(S||[]);return J._invoke=se(f,p,H),J}w.wrap=$;function Y(f,u,p){try{return{type:"normal",arg:f.call(u,p)}}catch(S){return{type:"throw",arg:S}}}var T="suspendedStart",s="suspendedYield",ae="executing",te="completed",K={};function ie(){}function z(){}function N(){}var D={};k(D,R,function(){return this});var Z=Object.getPrototypeOf,U=Z&&Z(Z(Re([])));U&&U!==P&&x.call(U,R)&&(D=U);var X=N.prototype=ie.prototype=Object.create(D);z.prototype=N,k(X,"constructor",N),k(N,"constructor",z),z.displayName=k(N,A,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(u){k(f,u,function(p){return this._invoke(u,p)})})}w.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===z||(u.displayName||u.name)==="GeneratorFunction":!1},w.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,N):(f.__proto__=N,k(f,A,"GeneratorFunction")),f.prototype=Object.create(X),f},w.awrap=function(f){return{__await:f}};function Q(f,u){function p(J,H,re,oe){var ne=Y(f[J],f,H);if(ne.type==="throw")oe(ne.arg);else{var Ee=ne.arg,Se=Ee.value;return Se&&typeof Se=="object"&&x.call(Se,"__await")?u.resolve(Se.__await).then(function(ce){p("next",ce,re,oe)},function(ce){p("throw",ce,re,oe)}):u.resolve(Se).then(function(ce){Ee.value=ce,re(Ee)},function(ce){return p("throw",ce,re,oe)})}}var S;function g(J,H){function re(){return new u(function(oe,ne){p(J,H,oe,ne)})}return S=S?S.then(re,re):re()}this._invoke=g}I(Q.prototype),k(Q.prototype,F,function(){return this}),w.AsyncIterator=Q,w.async=function(f,u,p,S,g){g===void 0&&(g=Promise);var J=new Q($(f,u,p,S),g);return w.isGeneratorFunction(u)?J:J.next().then(function(H){return H.done?H.value:J.next()})};function se(f,u,p){var S=T;return function(J,H){if(S===ae)throw new Error("Generator is already running");if(S===te){if(J==="throw")throw H;return Ce()}for(p.method=J,p.arg=H;;){var re=p.delegate;if(re){var oe=_e(re,p);if(oe){if(oe===K)continue;return oe}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(S===T)throw S=te,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);S=ae;var ne=Y(f,u,p);if(ne.type==="normal"){if(S=p.done?te:s,ne.arg===K)continue;return{value:ne.arg,done:p.done}}else ne.type==="throw"&&(S=te,p.method="throw",p.arg=ne.arg)}}}function _e(f,u){var p=f.iterator[u.method];if(p===W){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=W,_e(f,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var S=Y(p,f.iterator,u.arg);if(S.type==="throw")return u.method="throw",u.arg=S.arg,u.delegate=null,K;var g=S.arg;if(!g)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(g.done)u[f.resultName]=g.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=W);else return g;return u.delegate=null,K}I(X),k(X,A,"Generator"),k(X,R,function(){return this}),k(X,"toString",function(){return"[object Generator]"});function q(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function B(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function Me(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(q,this),this.reset(!0)}w.keys=function(f){var u=[];for(var p in f)u.push(p);return u.reverse(),function S(){for(;u.length;){var g=u.pop();if(g in f)return S.value=g,S.done=!1,S}return S.done=!0,S}};function Re(f){if(f){var u=f[R];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,S=function g(){for(;++p<f.length;)if(x.call(f,p))return g.value=f[p],g.done=!1,g;return g.value=W,g.done=!0,g};return S.next=S}}return{next:Ce}}w.values=Re;function Ce(){return{value:W,done:!0}}return Me.prototype={constructor:Me,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=W,this.done=!1,this.delegate=null,this.method="next",this.arg=W,this.tryEntries.forEach(B),!f)for(var u in this)u.charAt(0)==="t"&&x.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=W)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function p(oe,ne){return J.type="throw",J.arg=f,u.next=oe,ne&&(u.method="next",u.arg=W),!!ne}for(var S=this.tryEntries.length-1;S>=0;--S){var g=this.tryEntries[S],J=g.completion;if(g.tryLoc==="root")return p("end");if(g.tryLoc<=this.prev){var H=x.call(g,"catchLoc"),re=x.call(g,"finallyLoc");if(H&&re){if(this.prev<g.catchLoc)return p(g.catchLoc,!0);if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else if(H){if(this.prev<g.catchLoc)return p(g.catchLoc,!0)}else if(re){if(this.prev<g.finallyLoc)return p(g.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var p=this.tryEntries.length-1;p>=0;--p){var S=this.tryEntries[p];if(S.tryLoc<=this.prev&&x.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var g=S;break}}g&&(f==="break"||f==="continue")&&g.tryLoc<=u&&u<=g.finallyLoc&&(g=null);var J=g?g.completion:{};return J.type=f,J.arg=u,g?(this.method="next",this.next=g.finallyLoc,K):this.complete(J)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),K},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),B(p),K}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var p=this.tryEntries[u];if(p.tryLoc===f){var S=p.completion;if(S.type==="throw"){var g=S.arg;B(p)}return g}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,p){return this.delegate={iterator:Re(f),resultName:u,nextLoc:p},this.method==="next"&&(this.arg=W),K}},w}(L.exports);try{regeneratorRuntime=j}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(L,j,w){w.d(j,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var W=Array.isArray(x.material)?x.material:[x.material];W.forEach(function(O){var R,F,A,k,$,Y,T,s,ae,te,K,ie,z;(R=O.map)===null||R===void 0||R.dispose(),(F=O.lightMap)===null||F===void 0||F.dispose(),(A=O.bumpMap)===null||A===void 0||A.dispose(),(k=O.normalMap)===null||k===void 0||k.dispose(),($=O.specularMap)===null||$===void 0||$.dispose(),(Y=O.envMap)===null||Y===void 0||Y.dispose(),(T=O.alphaMap)===null||T===void 0||T.dispose(),(s=O.aoMap)===null||s===void 0||s.dispose(),(ae=O.displacementMap)===null||ae===void 0||ae.dispose(),(te=O.emissiveMap)===null||te===void 0||te.dispose(),(K=O.gradientMap)===null||K===void 0||K.dispose(),(ie=O.metalnessMap)===null||ie===void 0||ie.dispose(),(z=O.roughnessMap)===null||z===void 0||z.dispose(),O.dispose()})}}},521:function(L,j,w){w.d(j,{wf:function(){return O.Z}});var P=w(666),x=w.n(P),W=null,O=w(695),R=w(949);function F(z){if(z.material){var N=Array.isArray(z.material)?z.material:[z.material];N.forEach(function(D){var Z,U;(Z=D.color)===null||Z===void 0||Z.convertSRGBToLinear(),(U=D.emissive)===null||U===void 0||U.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var A=w(568),k=w(924),$=z=>{var N={};return w.d(N,z),N},Y=z=>()=>z,T=$({get:()=>tt.get,set:()=>tt.set}),s=w(484),ae=null,te=null,K=function(){var z=(0,A.Z)(x().mark(function N(D,Z){var U,X,I,Q,se,_e;return x().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return U=Z.version,B.next=4,(0,T.get)(D);case 4:if(I=B.sent,!(I&&I[U])){B.next=9;break}X=I[U],B.next=15;break;case 9:return B.next=11,(0,s.Z)(fetch(D).then(function(Me){if(Me.ok)return Me.blob();throw new Error}));case 11:Q=B.sent,se=Q.res,_e=Q.err,_e||(X=se,(0,T.set)(D,(0,k.Z)({},U,se)));case 15:return B.abrupt("return",X?{url:URL.createObjectURL(X)}:{url:D});case 16:case"end":return B.stop()}},N)}));return function(D,Z){return z.apply(this,arguments)}}(),ie=w(705)},484:function(L,j,w){w.d(j,{Z:function(){return x}});var P=w(42);function x(W){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return W.then(function(R){return(0,P.Z)({err:null,res:R},O)}).catch(function(R){return(0,P.Z)({err:R,res:void 0},O)})}},705:function(L,j,w){w.d(j,{C:function(){return O},y:function(){return W}});var P=w(949),x=new Map,W=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,A,k,$,Y){var T=A[k*3],s=A[k*3+1],ae=A[$*3],te=A[$*3+1],K=A[Y*3],ie=A[Y*3+1],z;if(x.has(F))z=x.get(F);else{var N=R.box3||new P.Box3;if(!R.box3){var D=F.parameters.shapes.getPoints();N.setFromArray(D.map(function(Q){return[Q.x,Q.y,0]}).flat())}var Z=N.getSize(new P.Vector3);R.split&&(Z.y/=R.split),z={box:N,size:Z},x.set(F,z)}var U=z.box,X=z.size,I=R.split?1-R.split:0;return[new P.Vector2((T-U.min.x)/X.x,(s-U.min.y)/X.y+I),new P.Vector2((ae-U.min.x)/X.x,(te-U.min.y)/X.y+I),new P.Vector2((K-U.min.x)/X.x,(ie-U.min.y)/X.y+I)]},generateSideWallUV:function(F,A,k,$,Y,T){var s=A[k*3],ae=A[k*3+1],te=A[k*3+2],K=A[$*3],ie=A[$*3+1],z=A[$*3+2],N=A[Y*3],D=A[Y*3+1],Z=A[Y*3+2],U=A[T*3],X=A[T*3+1],I=A[T*3+2],Q;if(x.has(A))Q=x.get(A);else{var se=new P.Box3;se.setFromArray(A);var _e=se.getSize(new P.Vector3);R.split&&(_e.z/=1-R.split),Q={box:se,size:_e},x.set(A,Q)}var q=Q.box,B=Q.size;return Math.abs(ae-ie)<Math.abs(s-K)?[new P.Vector2((s-q.min.x)/B.x,(te-q.min.z)/B.z),new P.Vector2((K-q.min.x)/B.x,(z-q.min.z)/B.z),new P.Vector2((N-q.min.x)/B.x,(Z-q.min.z)/B.z),new P.Vector2((U-q.min.x)/B.x,(I-q.min.z)/B.z)]:[new P.Vector2((ae-q.min.y)/B.x,(te-q.min.z)/B.z),new P.Vector2((ie-q.min.y)/B.x,(z-q.min.z)/B.z),new P.Vector2((D-q.min.y)/B.x,(Z-q.min.z)/B.z),new P.Vector2((X-q.min.y)/B.x,(I-q.min.z)/B.z)]}}},O=function(){x.clear()}},949:function(L){var j=P=>{var x={};return V.d(x,P),x},w=P=>()=>P;L.exports=It},568:function(L,j,w){w.d(j,{Z:function(){return x}});function P(W,O,R,F,A,k,$){try{var Y=W[k]($),T=Y.value}catch(s){R(s);return}Y.done?O(T):Promise.resolve(T).then(F,A)}function x(W){return function(){var O=this,R=arguments;return new Promise(function(F,A){var k=W.apply(O,R);function $(T){P(k,F,A,$,Y,"next",T)}function Y(T){P(k,F,A,$,Y,"throw",T)}$(void 0)})}}},924:function(L,j,w){w.d(j,{Z:function(){return P}});function P(x,W,O){return W in x?Object.defineProperty(x,W,{value:O,enumerable:!0,configurable:!0,writable:!0}):x[W]=O,x}},42:function(L,j,w){w.d(j,{Z:function(){return x}});var P=w(924);function x(W){for(var O=1;O<arguments.length;O++){var R=arguments[O]!=null?arguments[O]:{},F=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(R).filter(function(A){return Object.getOwnPropertyDescriptor(R,A).enumerable}))),F.forEach(function(A){(0,P.Z)(W,A,R[A])})}return W}}},it={};function V(L){var j=it[L];if(j!==void 0)return j.exports;var w=it[L]={exports:{}};return Qt[L](w,w.exports,V),w.exports}(function(){V.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(j,{a:j}),j}})(),function(){V.d=function(L,j){for(var w in j)V.o(j,w)&&!V.o(L,w)&&Object.defineProperty(L,w,{enumerable:!0,get:j[w]})}}(),function(){V.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var me={};(function(){V.d(me,{Ei:function(){return Dt},Yo:function(){return Wt},Ee:function(){return Ee},x1:function(){return dt},VJ:function(){return ge},r7:function(){return De},XA:function(){return Fe},NB:function(){return st},xv:function(){return S},nk:function(){return at}});function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function w(e,n){return j(e,n)}function P(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&w(e,n)}var x=V(42);function W(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function O(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function R(){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 F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function A(e){return F(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Y(e,n){return n&&($(n)==="object"||typeof n=="function")?n:k(e)}function T(e){var n=R();return function(){var i=A(e),a;if(n){var t=A(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return Y(this,a)}}var s=V(949);function ae(){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 te(e,n,r){return ae()?te=Reflect.construct:te=function(a,t,o){var c=[null];c.push.apply(c,t);var h=Function.bind.apply(a,c),v=new h;return o&&w(v,o.prototype),v},te.apply(null,arguments)}function K(e,n,r){return te.apply(null,arguments)}function ie(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function z(e,n,r){return n&&ie(e.prototype,n),r&&ie(e,r),e}function N(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function D(e){if(Array.isArray(e))return N(e)}function Z(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function U(){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 X(e,n){if(!!e){if(typeof e=="string")return N(e,n);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 N(e,n)}}function I(e){return D(e)||Z(e)||X(e)||U()}var Q=V(484);function se(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,Q.Z)(r.promise,n)),r}var _e=e=>{var n={};return V.d(n,e),n},q=e=>()=>e,B=_e({CSS2DObject:()=>Ft.CSS2DObject}),Me=e=>{var n={};return V.d(n,e),n},Re=e=>()=>e,Ce=Me({CSS3DObject:()=>rt.CSS3DObject,CSS3DSprite:()=>rt.CSS3DSprite}),f=V(521),u=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||u(n)}))},p=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=se(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Mesh,I(a)),this},n.createGroup=function(){return this.object3d=new s.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=K(s.Points,I(a)),this},n.createCSS2DObject=function(i){return this.object3d=new B.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Ce.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Ce.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new s.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,I(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,I(a)),this},n.getSize=function(){var i=new s.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new s.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){u(this.object3d)},z(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),S=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.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 _=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,_)}this.object3d.position.copy(o),c&&this.object3d.lookAt(c),this.setText(v)},i.setText=function(t,o){var c=(0,x.Z)(O((0,x.Z)({},this.options),{text:t}),o||{}),h=c.text,v=c.fontSize,d=c.fontFamily,m=c.fontWeight,_=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 l=M.measureText(h).width;y.width=l,this.width=l,M=y.getContext("2d"),M.clearRect(0,0,y.width,y.height),_&&M.scale(-1,1),M.font="".concat(m," ").concat(v,"px/1 ").concat(d),M.textBaseline="middle",M.fillStyle="#ffffff",M.fillText(h,_?l*-1:0,y.height/2),M.restore();var C=new s.Texture(y);C.anisotropy=16,C.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=C,E.material.needsUpdate=!0,E.scale.set(C.image.width*b,C.image.height*b,1)},r}(p),g=V(568),J=V(666),H=V.n(J),re=+s.REVISION<144,oe=re?"ExtrudeBufferGeometry":"ExtrudeGeometry",ne=re?"PlaneBufferGeometry":"PlaneGeometry",Ee=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,g.Z)(H().mark(function o(){var c,h,v,d,m,_,b,y,M,l;return H().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return c=t.options,h=c.transparent,v=c.blending,d=c.src,m=c.depthWrite,_=c.alphaTest,b=c.sprite,y=c.sizeAttenuation,E.next=3,new s.TextureLoader().loadAsync(d);case 3:return M=E.sent,l=b?new s.SpriteMaterial({map:M,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:_!=null?_: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:_!=null?_:0}),E.abrupt("return",l);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,g.Z)(H().mark(function o(){var c,h,v,d,m,_,b,y;return H().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.texture=y.map,_?t.createSprite(y):t.createMesh(new s[ne](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function Se(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=A(e),e!==null););return e}function ce(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ce=Reflect.get:ce=function(a,t,o){var c=Se(a,t);if(!!c){var h=Object.getOwnPropertyDescriptor(c,t);return h.get?h.get.call(o||a):h.value}},ce(e,n,r)}function Be(e,n,r){return ce(e,n,r)}var at=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,c=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,_=t.loop,b=t.alphaTest,y=t.sprite,M=se(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var C=new s.VideoTexture(l);C.format=d!=null?d:s.RGBAFormat,C.needsUpdate=!0;var E=y?new s.SpriteMaterial({map:C,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:C,transparent:c!=null?c:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});M.resolve(E)},!1),l.src=o,l.muted=!0,l.autoplay=m,l.loop=_,l.preload="auto",M.promise},i.create=function(){var t=this;return(0,g.Z)(H().mark(function o(){var c,h,v,d,m,_,b,y;return H().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(c=t.options,h=c.scale,v=c.position,d=c.src,m=c.cache,_=c.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.video=y.map.image,_?t.createSprite(y):t.createMesh(new s[ne](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Be(A(r.prototype),"dispose",this).call(this)},r}(p),ot=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.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)},i.getMaterial=function(t){return(0,g.Z)(H().mark(function o(){var c,h,v,d;return H().wrap(function(_){for(;;)switch(_.prev=_.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}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.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,_=t.cache,b=this;return(0,g.Z)(H().mark(function y(){var M,l,C,E;return H().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(M="node-create-pick-object",!(_&&!_.get(M))){G.next=7;break}return _.init(M),G.next=5,b.getMaterial(c);case 5:l=G.sent,_.set(M,l);case 7:if(!_){G.next=13;break}return G.next=10,_.get(M);case 10:G.t0=G.sent,G.next=16;break;case 13:return G.next=15,b.getMaterial(c);case 15:G.t0=G.sent;case 16:C=G.t0,E=new s.Sprite(C),E.scale.set(C.map.image.width*v.x,C.map.image.height*v.y,1),E.position.copy(m),b.add(E),b.pickObject=E;case 22:case"end":return G.stop()}},y)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),Be(A(r.prototype),"dispose",this).call(this)},z(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var c=o.map(function(h){return I(t.element.querySelectorAll(h))}).flat();return c}return[this.element]}}]),r}(p),st=ot,ut=`
|
|
2
|
-
`.concat(
|
|
3
|
-
`).concat(
|
|
1
|
+
import*as nt from"idb-keyval";import*as It from"three";import*as Ft from"three/examples/jsm/renderers/CSS2DRenderer";import*as it from"three/examples/jsm/renderers/CSS3DRenderer";import*as at from"popmotion";import*as Zt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ze from"d3-array";import*as Xt from"earcut";import*as Ht from"@turf/boolean-clockwise";import*as Kt from"delaunator";import*as $t from"@turf/boolean-point-in-polygon";import*as De from"d3-geo";import*as Yt from"d3-geo-voronoi";import*as Jt from"d3-scale";var Qt={666:function(L){var j=function(A){"use strict";var P=Object.prototype,x=P.hasOwnProperty,V,C=typeof Symbol=="function"?Symbol:{},T=C.iterator||"@@iterator",X=C.asyncIterator||"@@asyncIterator",M=C.toStringTag||"@@toStringTag";function k(f,l,p){return Object.defineProperty(f,l,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{k({},"")}catch(f){k=function(l,p,S){return l[p]=S}}function Y(f,l,p,S){var b=l&&l.prototype instanceof se?l:se,Q=Object.create(b.prototype),I=new Me(S||[]);return Q._invoke=pe(f,p,I),Q}A.wrap=Y;function J(f,l,p){try{return{type:"normal",arg:f.call(l,p)}}catch(S){return{type:"throw",arg:S}}}var B="suspendedStart",u="suspendedYield",le="executing",re="completed",$={};function se(){}function W(){}function F(){}var G={};k(G,T,function(){return this});var H=Object.getPrototypeOf,N=H&&H(H(Be([])));N&&N!==P&&x.call(N,T)&&(G=N);var K=F.prototype=se.prototype=Object.create(G);W.prototype=F,k(K,"constructor",F),k(F,"constructor",W),W.displayName=k(F,M,"GeneratorFunction");function Z(f){["next","throw","return"].forEach(function(l){k(f,l,function(p){return this._invoke(l,p)})})}A.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===W||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,F):(f.__proto__=F,k(f,M,"GeneratorFunction")),f.prototype=Object.create(K),f},A.awrap=function(f){return{__await:f}};function ee(f,l){function p(Q,I,ie,fe){var ae=J(f[Q],f,I);if(ae.type==="throw")fe(ae.arg);else{var Le=ae.arg,Se=Le.value;return Se&&typeof Se=="object"&&x.call(Se,"__await")?l.resolve(Se.__await).then(function(ve){p("next",ve,ie,fe)},function(ve){p("throw",ve,ie,fe)}):l.resolve(Se).then(function(ve){Le.value=ve,ie(Le)},function(ve){return p("throw",ve,ie,fe)})}}var S;function b(Q,I){function ie(){return new l(function(fe,ae){p(Q,I,fe,ae)})}return S=S?S.then(ie,ie):ie()}this._invoke=b}Z(ee.prototype),k(ee.prototype,X,function(){return this}),A.AsyncIterator=ee,A.async=function(f,l,p,S,b){b===void 0&&(b=Promise);var Q=new ee(Y(f,l,p,S),b);return A.isGeneratorFunction(l)?Q:Q.next().then(function(I){return I.done?I.value:Q.next()})};function pe(f,l,p){var S=B;return function(Q,I){if(S===le)throw new Error("Generator is already running");if(S===re){if(Q==="throw")throw I;return Ee()}for(p.method=Q,p.arg=I;;){var ie=p.delegate;if(ie){var fe=ye(ie,p);if(fe){if(fe===$)continue;return fe}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(S===B)throw S=re,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);S=le;var ae=J(f,l,p);if(ae.type==="normal"){if(S=p.done?re:u,ae.arg===$)continue;return{value:ae.arg,done:p.done}}else ae.type==="throw"&&(S=re,p.method="throw",p.arg=ae.arg)}}}function ye(f,l){var p=f.iterator[l.method];if(p===V){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=V,ye(f,l),l.method==="throw"))return $;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var S=J(p,f.iterator,l.arg);if(S.type==="throw")return l.method="throw",l.arg=S.arg,l.delegate=null,$;var b=S.arg;if(!b)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,$;if(b.done)l[f.resultName]=b.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=V);else return b;return l.delegate=null,$}Z(K),k(K,M,"Generator"),k(K,T,function(){return this}),k(K,"toString",function(){return"[object Generator]"});function te(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function z(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function Me(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(te,this),this.reset(!0)}A.keys=function(f){var l=[];for(var p in f)l.push(p);return l.reverse(),function S(){for(;l.length;){var b=l.pop();if(b in f)return S.value=b,S.done=!1,S}return S.done=!0,S}};function Be(f){if(f){var l=f[T];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,S=function b(){for(;++p<f.length;)if(x.call(f,p))return b.value=f[p],b.done=!1,b;return b.value=V,b.done=!0,b};return S.next=S}}return{next:Ee}}A.values=Be;function Ee(){return{value:V,done:!0}}return Me.prototype={constructor:Me,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=V,this.done=!1,this.delegate=null,this.method="next",this.arg=V,this.tryEntries.forEach(z),!f)for(var l in this)l.charAt(0)==="t"&&x.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=V)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function p(fe,ae){return Q.type="throw",Q.arg=f,l.next=fe,ae&&(l.method="next",l.arg=V),!!ae}for(var S=this.tryEntries.length-1;S>=0;--S){var b=this.tryEntries[S],Q=b.completion;if(b.tryLoc==="root")return p("end");if(b.tryLoc<=this.prev){var I=x.call(b,"catchLoc"),ie=x.call(b,"finallyLoc");if(I&&ie){if(this.prev<b.catchLoc)return p(b.catchLoc,!0);if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else if(I){if(this.prev<b.catchLoc)return p(b.catchLoc,!0)}else if(ie){if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var p=this.tryEntries.length-1;p>=0;--p){var S=this.tryEntries[p];if(S.tryLoc<=this.prev&&x.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var b=S;break}}b&&(f==="break"||f==="continue")&&b.tryLoc<=l&&l<=b.finallyLoc&&(b=null);var Q=b?b.completion:{};return Q.type=f,Q.arg=l,b?(this.method="next",this.next=b.finallyLoc,$):this.complete(Q)},complete:function(f,l){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&l&&(this.next=l),$},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),z(p),$}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.tryLoc===f){var S=p.completion;if(S.type==="throw"){var b=S.arg;z(p)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,p){return this.delegate={iterator:Be(f),resultName:l,nextLoc:p},this.method==="next"&&(this.arg=V),$}},A}(L.exports);try{regeneratorRuntime=j}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(L,j,A){A.d(j,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var V=Array.isArray(x.material)?x.material:[x.material];V.forEach(function(C){var T,X,M,k,Y,J,B,u,le,re,$,se,W;(T=C.map)===null||T===void 0||T.dispose(),(X=C.lightMap)===null||X===void 0||X.dispose(),(M=C.bumpMap)===null||M===void 0||M.dispose(),(k=C.normalMap)===null||k===void 0||k.dispose(),(Y=C.specularMap)===null||Y===void 0||Y.dispose(),(J=C.envMap)===null||J===void 0||J.dispose(),(B=C.alphaMap)===null||B===void 0||B.dispose(),(u=C.aoMap)===null||u===void 0||u.dispose(),(le=C.displacementMap)===null||le===void 0||le.dispose(),(re=C.emissiveMap)===null||re===void 0||re.dispose(),($=C.gradientMap)===null||$===void 0||$.dispose(),(se=C.metalnessMap)===null||se===void 0||se.dispose(),(W=C.roughnessMap)===null||W===void 0||W.dispose(),C.dispose()})}}},521:function(L,j,A){A.d(j,{wf:function(){return C.Z}});var P=A(666),x=A.n(P),V=null,C=A(695),T=A(949);function X(W){if(W.material){var F=Array.isArray(W.material)?W.material:[W.material];F.forEach(function(G){var H,N;(H=G.color)===null||H===void 0||H.convertSRGBToLinear(),(N=G.emissive)===null||N===void 0||N.convertSRGBToLinear(),G.map&&(G.map.encoding=THREE.sRGBEncoding),G.emissiveMap&&(G.emissiveMap.encoding=THREE.sRGBEncoding)})}}var M=A(568),k=A(924),Y=W=>{var F={};return A.d(F,W),F},J=W=>()=>W,B=Y({get:()=>nt.get,set:()=>nt.set}),u=A(484),le=null,re=null,$=function(){var W=(0,M.Z)(x().mark(function F(G,H){var N,K,Z,ee,pe,ye;return x().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return N=H.version,z.next=4,(0,B.get)(G);case 4:if(Z=z.sent,!(Z&&Z[N])){z.next=9;break}K=Z[N],z.next=15;break;case 9:return z.next=11,(0,u.Z)(fetch(G).then(function(Me){if(Me.ok)return Me.blob();throw new Error}));case 11:ee=z.sent,pe=ee.res,ye=ee.err,ye||(K=pe,(0,B.set)(G,(0,k.Z)({},N,pe)));case 15:return z.abrupt("return",K?{url:URL.createObjectURL(K)}:{url:G});case 16:case"end":return z.stop()}},F)}));return function(G,H){return W.apply(this,arguments)}}(),se=A(705)},484:function(L,j,A){A.d(j,{Z:function(){return x}});var P=A(42);function x(V){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return V.then(function(T){return(0,P.Z)({err:null,res:T},C)}).catch(function(T){return(0,P.Z)({err:T,res:void 0},C)})}},705:function(L,j,A){A.d(j,{C:function(){return C},y:function(){return V}});var P=A(949),x=new Map,V=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,M,k,Y,J){var B=M[k*3],u=M[k*3+1],le=M[Y*3],re=M[Y*3+1],$=M[J*3],se=M[J*3+1],W;if(x.has(X))W=x.get(X);else{var F=T.box3||new P.Box3;if(!T.box3){var G=X.parameters.shapes.getPoints();F.setFromArray(G.map(function(ee){return[ee.x,ee.y,0]}).flat())}var H=F.getSize(new P.Vector3);T.split&&(H.y/=T.split),W={box:F,size:H},x.set(X,W)}var N=W.box,K=W.size,Z=T.split?1-T.split:0;return[new P.Vector2((B-N.min.x)/K.x,(u-N.min.y)/K.y+Z),new P.Vector2((le-N.min.x)/K.x,(re-N.min.y)/K.y+Z),new P.Vector2(($-N.min.x)/K.x,(se-N.min.y)/K.y+Z)]},generateSideWallUV:function(X,M,k,Y,J,B){var u=M[k*3],le=M[k*3+1],re=M[k*3+2],$=M[Y*3],se=M[Y*3+1],W=M[Y*3+2],F=M[J*3],G=M[J*3+1],H=M[J*3+2],N=M[B*3],K=M[B*3+1],Z=M[B*3+2],ee;if(x.has(M))ee=x.get(M);else{var pe=new P.Box3;pe.setFromArray(M);var ye=pe.getSize(new P.Vector3);T.split&&(ye.z/=1-T.split),ee={box:pe,size:ye},x.set(M,ee)}var te=ee.box,z=ee.size;return Math.abs(le-se)<Math.abs(u-$)?[new P.Vector2((u-te.min.x)/z.x,(re-te.min.z)/z.z),new P.Vector2(($-te.min.x)/z.x,(W-te.min.z)/z.z),new P.Vector2((F-te.min.x)/z.x,(H-te.min.z)/z.z),new P.Vector2((N-te.min.x)/z.x,(Z-te.min.z)/z.z)]:[new P.Vector2((le-te.min.y)/z.y,(re-te.min.z)/z.z),new P.Vector2((se-te.min.y)/z.y,(W-te.min.z)/z.z),new P.Vector2((G-te.min.y)/z.y,(H-te.min.z)/z.z),new P.Vector2((K-te.min.y)/z.y,(Z-te.min.z)/z.z)]}}},C=function(){x.clear()}},949:function(L){var j=P=>{var x={};return U.d(x,P),x},A=P=>()=>P;L.exports=It},568:function(L,j,A){A.d(j,{Z:function(){return x}});function P(V,C,T,X,M,k,Y){try{var J=V[k](Y),B=J.value}catch(u){T(u);return}J.done?C(B):Promise.resolve(B).then(X,M)}function x(V){return function(){var C=this,T=arguments;return new Promise(function(X,M){var k=V.apply(C,T);function Y(B){P(k,X,M,Y,J,"next",B)}function J(B){P(k,X,M,Y,J,"throw",B)}Y(void 0)})}}},924:function(L,j,A){A.d(j,{Z:function(){return P}});function P(x,V,C){return V in x?Object.defineProperty(x,V,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[V]=C,x}},42:function(L,j,A){A.d(j,{Z:function(){return x}});var P=A(924);function x(V){for(var C=1;C<arguments.length;C++){var T=arguments[C]!=null?arguments[C]:{},X=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(T).filter(function(M){return Object.getOwnPropertyDescriptor(T,M).enumerable}))),X.forEach(function(M){(0,P.Z)(V,M,T[M])})}return V}}},ot={};function U(L){var j=ot[L];if(j!==void 0)return j.exports;var A=ot[L]={exports:{}};return Qt[L](A,A.exports,U),A.exports}(function(){U.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return U.d(j,{a:j}),j}})(),function(){U.d=function(L,j){for(var A in j)U.o(j,A)&&!U.o(L,A)&&Object.defineProperty(L,A,{enumerable:!0,get:j[A]})}}(),function(){U.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var _e={};(function(){U.d(_e,{Ei:function(){return Gt},Yo:function(){return Vt},Ee:function(){return Le},x1:function(){return gt},VJ:function(){return be},r7:function(){return Ve},XA:function(){return Xe},NB:function(){return ct},xv:function(){return S},nk:function(){return st}});function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function A(e,n){return j(e,n)}function P(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&A(e,n)}var x=U(42);function V(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function C(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function T(){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 X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},X(e)}function M(e){return X(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return e&&e.constructor===Symbol?"symbol":typeof e}function J(e,n){return n&&(Y(n)==="object"||typeof n=="function")?n:k(e)}function B(e){var n=T();return function(){var i=M(e),a;if(n){var t=M(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return J(this,a)}}var u=U(949);function le(){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 re(e,n,r){return le()?re=Reflect.construct:re=function(a,t,o){var s=[null];s.push.apply(s,t);var h=Function.bind.apply(a,s),v=new h;return o&&A(v,o.prototype),v},re.apply(null,arguments)}function $(e,n,r){return re.apply(null,arguments)}function se(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function W(e,n,r){return n&&se(e.prototype,n),r&&se(e,r),e}function F(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function G(e){if(Array.isArray(e))return F(e)}function H(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N(){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 K(e,n){if(!!e){if(typeof e=="string")return F(e,n);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 F(e,n)}}function Z(e){return G(e)||H(e)||K(e)||N()}var ee=U(484);function pe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,ee.Z)(r.promise,n)),r}var ye=e=>{var n={};return U.d(n,e),n},te=e=>()=>e,z=ye({CSS2DObject:()=>Ft.CSS2DObject}),Me=e=>{var n={};return U.d(n,e),n},Be=e=>()=>e,Ee=Me({CSS3DObject:()=>it.CSS3DObject,CSS3DSprite:()=>it.CSS3DSprite}),f=U(521),l=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||l(n)}))},p=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=pe(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(u.Mesh,Z(a)),this},n.createGroup=function(){return this.object3d=new u.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(u.Points,Z(a)),this},n.createCSS2DObject=function(i){return this.object3d=new z.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Ee.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Ee.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new u.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,Z(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,Z(a)),this},n.getSize=function(){var i=new u.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new u.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){l(this.object3d)},W(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),S=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var g=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=g}else{var _=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),y=new u.PlaneGeometry(1,1,1,1);this.createMesh(y,_)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(v)},i.setText=function(t,o){var s=(0,x.Z)(C((0,x.Z)({},this.options),{text:t}),o||{}),h=s.text,v=s.fontSize,d=s.fontFamily,g=s.fontWeight,_=s.flipX,y=s.scale,m=this.canvas;m.width=v*h.length*2,m.height=v;var w=m.getContext("2d");w.font="".concat(g," ").concat(v,"px/1 ").concat(d);var c=w.measureText(h).width;m.width=c,this.width=c,w=m.getContext("2d"),w.clearRect(0,0,m.width,m.height),_&&w.scale(-1,1),w.font="".concat(g," ").concat(v,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,_?c*-1:0,m.height/2),w.restore();var O=new u.Texture(m);O.anisotropy=16,O.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=O,E.material.needsUpdate=!0,E.scale.set(O.image.width*y,O.image.height*y,1)},r}(p),b=U(568),Q=U(666),I=U.n(Q),ie=+u.REVISION<144,fe=ie?"ExtrudeBufferGeometry":"ExtrudeGeometry",ae=ie?"PlaneBufferGeometry":"PlaneGeometry",Le=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m,w,c;return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return s=t.options,h=s.transparent,v=s.blending,d=s.src,g=s.depthWrite,_=s.alphaTest,y=s.sprite,m=s.sizeAttenuation,E.next=3,new u.TextureLoader().loadAsync(d);case 3:return w=E.sent,c=y?new u.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:_!=null?_:0,sizeAttenuation:m!=null?m:!0}):new u.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:_!=null?_:0}),E.abrupt("return",c);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m;return I().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=t.options,h=s.scale,v=s.position,d=s.src,g=s.cache,_=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,t.getMaterial();case 5:y=c.sent,g.set(d,y);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,t.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,t.texture=m.map,_?t.createSprite(m):t.createMesh(new u[ae](1,1),m),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function Se(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=M(e),e!==null););return e}function ve(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ve=Reflect.get:ve=function(a,t,o){var s=Se(a,t);if(!!s){var h=Object.getOwnPropertyDescriptor(s,t);return h.get?h.get.call(o||a):h.value}},ve(e,n,r)}function We(e,n,r){return ve(e,n,r)}var st=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,g=t.autoPlay,_=t.loop,y=t.alphaTest,m=t.sprite,w=pe(),c=document.createElement("video");return c.addEventListener("loadedmetadata",function(){var O=new u.VideoTexture(c);O.format=d!=null?d:u.RGBAFormat,O.needsUpdate=!0;var E=m?new u.SpriteMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:y!=null?y:0}):new u.MeshBasicMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:y!=null?y:0});w.resolve(E)},!1),c.src=o,c.muted=!0,c.autoplay=g,c.loop=_,c.preload="auto",w.promise},i.create=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m;return I().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=t.options,h=s.scale,v=s.position,d=s.src,g=s.cache,_=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,t.getMaterial();case 5:y=c.sent,g.set(d,y);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,t.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,t.video=m.map.image,_?t.createSprite(m):t.createMesh(new u[ae](1,1),m),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),We(M(r.prototype),"dispose",this).call(this)},r}(p),ut=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(g){g.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,b.Z)(I().mark(function o(){var s,h,v,d;return I().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new u.CanvasTexture(s),d=new u.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,h=t.scale,v=h===void 0?new u.Vector3(1,1,1):h,d=t.position,g=d===void 0?new u.Vector3(0,0,0):d,_=t.cache,y=this;return(0,b.Z)(I().mark(function m(){var w,c,O,E;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(w="node-create-pick-object",!(_&&!_.get(w))){R.next=7;break}return _.init(w),R.next=5,y.getMaterial(s);case 5:c=R.sent,_.set(w,c);case 7:if(!_){R.next=13;break}return R.next=10,_.get(w);case 10:R.t0=R.sent,R.next=16;break;case 13:return R.next=15,y.getMaterial(s);case 15:R.t0=R.sent;case 16:O=R.t0,E=new u.Sprite(O),E.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),E.position.copy(g),y.add(E),y.pickObject=E;case 22:case"end":return R.stop()}},m)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),We(M(r.prototype),"dispose",this).call(this)},W(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return Z(t.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(p),ct=ut,lt=`
|
|
2
|
+
`.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(u.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@ import*as tt from"idb-keyval";import*as It from"three";import*as Ft from"three/e
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(u.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(u.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),ft=`
|
|
99
|
+
`.concat(u.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(u.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(u.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(u.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),ge=function(e){"use strict";P(r,e);var n=T(r);function r(){L(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new s.Matrix4,Object.defineProperties(k(i),{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)}}}),i}return r}(s.BufferGeometry);ge.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ge.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},ge.prototype.setPoints=function(e,n){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=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof s.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.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 Fe(e,n){var r=new s.Matrix4,i=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(),i.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,_=o.attributes;if(m!==null)for(var b=m.array,y=_.position.array,M=_.width.array,l=0,C=b.length-1;l<C;l+=d){var E=b[l],ee=b[l+1];c.fromArray(y,E*3),h.fromArray(y,ee*3);var G=M[Math.floor(l/3)]!==void 0?M[Math.floor(l/3)]:1,le=e.params.Line.threshold+this.material.lineWidth*G/2,de=le*le,xe=i.distanceSqToSegment(c,h,t,v);if(!(xe>de)){t.applyMatrix4(this.matrixWorld);var fe=e.ray.origin.distanceTo(t);fe<e.near||fe>e.far||(n.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=C)}}}}ge.prototype.raycast=Fe,ge.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},ge.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},ge.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,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 i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),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 ze(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}ge.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;ze(n,0,r,0,a),ze(n,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,ze(n,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,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=ut,s.ShaderChunk.meshline_frag=ct;var De=function(e){"use strict";P(r,e);var n=T(r);function r(i){L(this,r);var a;return a=n.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(k(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(i),a}return r}(s.ShaderMaterial);De.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 lt(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ft(e,n){if(e==null)return{};var r=lt(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var ht=e=>{var n={};return V.d(n,e),n},cr=e=>()=>e,Ze=ht({animate:()=>nt.animate,linear:()=>nt.linear}),pt=e=>{var n={};return V.d(n,e),n},lr=e=>()=>e,Xe=pt({mergeBufferGeometries:()=>Zt.mergeBufferGeometries});function He(e){var n=e.setPointWidth,r=e.nodes,i=new s.BufferGeometry,a=new ge;return i.setFromPoints(r),a.setGeometry(i,n),a}var vt={color:new s.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},dt=function(e){"use strict";P(r,e);var n=T(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},vt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,_=o.nodes,b=o.nodesArr,y=o.coordinatesArr,M=o.projection,l=o.workerController,C=o.useGroups,E=ft(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),ee=this.pencil.getSize(),G=ee.width,le=ee.height,de=new De(O((0,x.Z)({},E),{resolution:new s.Vector2(G,le)}));if(this.material=de,_)this.createMesh(He({nodes:_,setPointWidth:d}),de);else if(b){var xe=Xe.mergeBufferGeometries(b.map(function(fe){return He({nodes:fe,setPointWidth:d})}),C!=null?C:!1);this.createMesh(xe,de)}else if(y&&l)return new Promise(function(fe){l.postMessage({coordinatesArr:y,projection:M,useGroups:C},function(ue){var be=new s.BufferGeometry;Object.keys(ue).forEach(function(he){he==="index"?be.setIndex(new s.BufferAttribute(ue[he].array,ue[he].itemSize)):be.setAttribute(he,new s.BufferAttribute(ue[he].array,ue[he].itemSize))}),t.createMesh(be,de),fe("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.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,Ze.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ze.linear,onUpdate:function(_){v.value.x=_.x}});this.tween=m},i.dispose=function(){var t;Be(A(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function mt(e){if(Array.isArray(e))return e}function _t(){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 ye(e,n){return mt(e)||Z(e,n)||X(e,n)||_t()}var gt=e=>{var n={};return V.d(n,e),n},fr=e=>()=>e,Oe=gt({extent:()=>Ie.extent,mean:()=>Ie.mean,merge:()=>Ie.merge}),yt=e=>{var n={};return V.d(n,e),n},hr=e=>()=>e,We=yt({default:()=>Xt.default}),bt=e=>{var n={};return V.d(n,e),n},pr=e=>()=>e,wt=bt({default:()=>Ht.default});function xt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var At=e=>{var n={};return V.d(n,e),n},vr=e=>()=>e,Mt=At({default:()=>Kt.default}),Pt=e=>{var n={};return V.d(n,e),n},dr=e=>()=>e,St=Pt({default:()=>$t.default}),Ot=e=>{var n={};return V.d(n,e),n},mr=e=>()=>e,Le=Ot({geoBounds:()=>Te.geoBounds,geoContains:()=>Te.geoContains,geoDistance:()=>Te.geoDistance,geoInterpolate:()=>Te.geoInterpolate}),Ct=e=>{var n={};return V.d(n,e),n},_r=e=>()=>e,Et=Ct({geoVoronoi:()=>Yt.geoVoronoi}),Lt=e=>{var n={};return V.d(n,e),n},gr=e=>()=>e,Ke=Lt({scaleLinear:()=>Jt.scaleLinear});function jt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Le.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var c=(0,Le.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(c(v)),v+=h}i.push(a=t)}),i})}function kt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),c=(1+Math.sqrt(5))/2,h=function(l){return l/c*360%360-180},v=function(l){return Math.acos(2*l/o-1)/Math.PI*180-90},d=function(l){return o*(Math.cos((l+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},b=[],y=m[0];y<=m[1];y++){var M=h(y);_(M)&&b.push([M,v(y)])}return b}function Ge(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(n,e):(0,St.default)(e,n)}function Rt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,Le.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],c=ye(i[1],2),h=c[0],v=c[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return kt(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return Ge(m,r,d)})}function Tt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=jt(e,i),t=(0,Oe.merge)(a),o=Rt(e,i),c=I(t).concat(I(o)),h={type:"Polygon",coordinates:e},v=ye((0,Le.geoBounds)(h),2),d=ye(v[0],2),m=d[0],_=d[1],b=ye(v[1],2),y=b[0],M=b[1],l=m>y||M>=89||_<=-89,C=[];if(l){var E=(0,Et.geoVoronoi)(c).triangles(),ee=new Map(c.map(function(pe,Pe){var Ae=ye(pe,2),ve=Ae[0],je=Ae[1];return["".concat(ve,"-").concat(je),Pe]}));E.features.forEach(function(pe){var Pe,Ae=pe.geometry.coordinates[0].slice(0,3).reverse(),ve=[];if(Ae.forEach(function(ke){var we=ye(ke,2),Ne=we[0],Nt=we[1],et="".concat(Ne,"-").concat(Nt);ee.has(et)&&ve.push(ee.get(et))}),ve.length===3){if(ve.some(function(ke){return ke<t.length})){var je=pe.properties.circumcenter;if(!Ge(je,h,l))return}(Pe=C).push.apply(Pe,I(ve))}})}else if(o.length)for(var fe=function(pe,Pe){var Ae,ve=[2,1,0].map(function(we){return ue.triangles[pe+we]}),je=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)(je,function(Ne){return Ne[we]})});if(!Ge(ke,h,l))return"continue"}(Ae=C).push.apply(Ae,I(ve))},ue=Mt.default.from(c),be=0,he=ue.triangles.length;be<he;be+=3)fe(be,he);else{var G=We.default.flatten(a),le=G.vertices,de=G.holes,xe=de===void 0?[]:de;C=(0,We.default)(le,xe,2)}var Ue=(0,Ke.scaleLinear)((0,Oe.extent)(c,function(pe){return pe[0]}),[0,1]),Gt=(0,Ke.scaleLinear)((0,Oe.extent)(c,function(pe){return pe[1]}),[0,1]),Vt=c.map(function(pe){var Pe=ye(pe,2),Ae=Pe[0],ve=Pe[1];return[Ue(Ae),Gt(ve)]}),Ut={points:c,indices:C,uvs:Vt};return{contour:a,triangles:Ut}}var Bt=Tt,$e=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ve(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=ye(t,2),c=o[0],h=o[1];return r?xt(c,h,n):[c,h,n]})});return We.default.flatten(i)}function Ye(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ve(e,n,i),t=a.vertices,o=a.holes,c=Ve(e,r,i),h=c.vertices,v=(0,Oe.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),_=0,b=[],y=0;y<d;y++){var M=y+1;if(M===d)M=_;else if(m.has(M)){var l=M;M=_,_=l}b.push(y,y+d,M+d),b.push(M+d,M,y)}for(var C=[],E=1;E>=0;E--)for(var ee=0;ee<d;ee+=1)C.push(ee/(d-1),E);return{indices:b,vertices:v,uvs:C,topVerts:h}}function Je(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ve([e.points],n,a).vertices,uvs:r}}var zt=function(e){"use strict";P(r,e);var n=T(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.Z)({},{polygonGeoJson:i,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,_=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;(0,wt.default)(i[0])||i[0].reverse();var M=Bt(i,{resolution:_}),l=M.contour,C=M.triangles,E=(0,Oe.merge)(C.uvs),ee=[],G=[],le=[],de=0,xe=function(ue){var be=Math.round(ee.length/3),he=le.length;ee=ee.concat(ue.vertices),G=G.concat(ue.uvs),le=le.concat(be?ue.indices.map(function(Ue){return Ue+be}):ue.indices),t.addGroup(he,le.length-he,de++)};if(m){var fe=Ye(l,c,h,b);xe(fe),t.userData.rso=y?Ye(l,c,h+y,b):fe}return v&&xe(Je(C,c,E,!1,b)),d&&xe(Je(C,h,E,!0,b)),t.setIndex(le),t[$e]("position",new s.Float32BufferAttribute(ee,3)),t[$e]("uv",new s.Float32BufferAttribute(G,2)),t.computeVertexNormals(),t}return r}(s.BufferGeometry),Dt=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,c=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,_=t.cartesian,b=new zt(this.options.geojson,{startHeight:o,endHeight:o+c,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:_,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(p),Qe=V(705);function qe(e){var n=e.split,r=e.depth,i=e.points,a=new s[oe](new s.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:n})});return(0,Qe.C)(),a}var Wt=function(e){"use strict";P(r,e);var n=T(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,c=o.points,h=o.pointsArr,v=o.coordinatesArr,d=o.material,m=o.useGroups,_=o.depth,b=o.split,y=o.workerController,M=o.projection;if(c)this.createMesh(qe({points:c,depth:_,split:b}),d);else if(h){var l=Xe.mergeBufferGeometries(h.map(function(C){return qe({points:C,depth:_,split:b})}),m!=null?m:!1);this.createMesh(l,d)}else if(v&&y)return new Promise(function(C){y.postMessage({coordinatesArr:v,depth:_,split:b,useGroups:m,projection:M},function(E){var ee=new s.BufferGeometry;Object.keys(E).forEach(function(G){ee.setAttribute(G,new s.BufferAttribute(E[G].array,E[G].itemSize))}),t.createMesh(ee,d),C("")})})},r}(p)})();var qt=me.Ei,er=me.Yo,tr=me.Ee,rr=me.x1,nr=me.VJ,ir=me.r7,ar=me.XA,or=me.NB,sr=me.xv,ur=me.nk;export{qt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
|
|
132
|
+
`),be=function(e){"use strict";P(r,e);var n=B(r);function r(){L(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new u.Matrix4,Object.defineProperties(k(i),{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)}}}),i}return r}(u.BufferGeometry);be.prototype.setMatrixWorld=function(e){this.matrixWorld=e},be.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},be.prototype.setPoints=function(e,n){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=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof u.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.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 Xe(e,n){var r=new u.Matrix4,i=new u.Ray,a=new u.Sphere,t=new u.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(),i.copy(e.ray).applyMatrix4(r);var s=new u.Vector3,h=new u.Vector3,v=new u.Vector3,d=this instanceof u.LineSegments?2:1,g=o.index,_=o.attributes;if(g!==null)for(var y=g.array,m=_.position.array,w=_.width.array,c=0,O=y.length-1;c<O;c+=d){var E=y[c],q=y[c+1];s.fromArray(m,E*3),h.fromArray(m,q*3);var R=w[Math.floor(c/3)]!==void 0?w[Math.floor(c/3)]:1,ne=e.params.Line.threshold+this.material.lineWidth*R/2,oe=ne*ne,de=i.distanceSqToSegment(s,h,t,v);if(!(de>oe)){t.applyMatrix4(this.matrixWorld);var ce=e.ray.origin.distanceTo(t);ce<e.near||ce>e.far||(n.push({distance:ce,point:v.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}),c=O)}}}}be.prototype.raycast=Xe,be.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},be.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},be.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,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 i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),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 u.BufferAttribute(new Float32Array(this.positions),3),previous:new u.BufferAttribute(new Float32Array(this.previous),3),next:new u.BufferAttribute(new Float32Array(this.next),3),side:new u.BufferAttribute(new Float32Array(this.side),1),width:new u.BufferAttribute(new Float32Array(this.width),1),uv:new u.BufferAttribute(new Float32Array(this.uvs),2),index:new u.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new u.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 Ge(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}be.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ge(n,0,r,0,a),Ge(n,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,Ge(n,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,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},u.ShaderChunk.meshline_vert=lt,u.ShaderChunk.meshline_frag=ft;var Ve=function(e){"use strict";P(r,e);var n=B(r);function r(i){L(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},u.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.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 u.Vector2(1,1)},offset:{value:new u.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:u.ShaderChunk.meshline_vert,fragmentShader:u.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(k(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(i),a}return r}(u.ShaderMaterial);Ve.prototype.copy=function(e){return u.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 ht(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function pt(e,n){if(e==null)return{};var r=ht(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var vt=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,He=vt({animate:()=>at.animate,linear:()=>at.linear}),dt=e=>{var n={};return U.d(n,e),n},lr=e=>()=>e,Ke=dt({mergeBufferGeometries:()=>Zt.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new u.BufferGeometry,a=new be;return i.setFromPoints(r),a.setGeometry(i,n),a}var mt={color:new u.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},gt=function(e){"use strict";P(r,e);var n=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},mt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,g=o.key,_=o.nodes,y=o.nodesArr,m=o.coordinatesArr,w=o.projection,c=o.workerController,O=o.useGroups,E=pt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),q=this.pencil.getSize(),R=q.width,ne=q.height,oe=new Ve(C((0,x.Z)({},E),{resolution:new u.Vector2(R,ne)}));if(this.material=oe,_)this.createMesh($e({nodes:_,setPointWidth:d}),oe);else if(y){var de=Ke.mergeBufferGeometries(y.map(function(ce){return $e({nodes:ce,setPointWidth:d})}),O!=null?O:!1);this.createMesh(de,oe)}else if(m&&c)return new Promise(function(ce){c.postMessage({coordinatesArr:m,projection:w,useGroups:O},function(he){var D=new u.BufferGeometry;Object.keys(he).forEach(function(ue){ue==="index"?D.setIndex(new u.BufferAttribute(he[ue].array,he[ue].itemSize)):D.setAttribute(ue,new u.BufferAttribute(he[ue].array,he[ue].itemSize))}),t.createMesh(D,oe),ce("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,g=(0,He.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:He.linear,onUpdate:function(_){v.value.x=_.x}});this.tween=g},i.dispose=function(){var t;We(M(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function _t(e){if(Array.isArray(e))return e}function yt(){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 we(e,n){return _t(e)||H(e,n)||K(e,n)||yt()}var bt=e=>{var n={};return U.d(n,e),n},fr=e=>()=>e,Ce=bt({extent:()=>Ze.extent,mean:()=>Ze.mean,merge:()=>Ze.merge}),wt=e=>{var n={};return U.d(n,e),n},hr=e=>()=>e,Ue=wt({default:()=>Xt.default}),xt=e=>{var n={};return U.d(n,e),n},pr=e=>()=>e,At=xt({default:()=>Ht.default});function Mt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var Pt=e=>{var n={};return U.d(n,e),n},vr=e=>()=>e,St=Pt({default:()=>Kt.default}),Ot=e=>{var n={};return U.d(n,e),n},dr=e=>()=>e,Ct=Ot({default:()=>$t.default}),Et=e=>{var n={};return U.d(n,e),n},mr=e=>()=>e,je=Et({geoBounds:()=>De.geoBounds,geoContains:()=>De.geoContains,geoDistance:()=>De.geoDistance,geoInterpolate:()=>De.geoInterpolate}),Lt=e=>{var n={};return U.d(n,e),n},gr=e=>()=>e,jt=Lt({geoVoronoi:()=>Yt.geoVoronoi}),kt=e=>{var n={};return U.d(n,e),n},_r=e=>()=>e,Ye=kt({scaleLinear:()=>Jt.scaleLinear});function Rt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,je.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,je.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(s(v)),v+=h}i.push(a=t)}),i})}function Tt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(c){return c/s*360%360-180},v=function(c){return Math.acos(2*c/o-1)/Math.PI*180-90},d=function(c){return o*(Math.cos((c+90)*Math.PI/180)+1)/2},g=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(c){return c<=i}:i===void 0?function(c){return c>=r}:i>=r?function(c){return c>=r&&c<=i}:function(c){return c>=r||c<=i},y=[],m=g[0];m<=g[1];m++){var w=h(m);_(w)&&y.push([w,v(m)])}return y}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,je.geoContains)(n,e):(0,Ct.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=we((0,je.geoBounds)(r),2),a=we(i[0],2),t=a[0],o=a[1],s=we(i[1],2),h=s[0],v=s[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return Tt(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(g){return Ne(g,r,d)})}function zt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Rt(e,i),t=(0,Ce.merge)(a),o=Bt(e,i),s=Z(t).concat(Z(o)),h={type:"Polygon",coordinates:e},v=we((0,je.geoBounds)(h),2),d=we(v[0],2),g=d[0],_=d[1],y=we(v[1],2),m=y[0],w=y[1],c=g>m||w>=89||_<=-89,O=[];if(c){var E=(0,jt.geoVoronoi)(s).triangles(),q=new Map(s.map(function(me,Pe){var Ae=we(me,2),ge=Ae[0],Re=Ae[1];return["".concat(ge,"-").concat(Re),Pe]}));E.features.forEach(function(me){var Pe,Ae=me.geometry.coordinates[0].slice(0,3).reverse(),ge=[];if(Ae.forEach(function(Te){var xe=we(Te,2),Fe=xe[0],Nt=xe[1],rt="".concat(Fe,"-").concat(Nt);q.has(rt)&&ge.push(q.get(rt))}),ge.length===3){if(ge.some(function(Te){return Te<t.length})){var Re=me.properties.circumcenter;if(!Ne(Re,h,c))return}(Pe=O).push.apply(Pe,Z(ge))}})}else if(o.length)for(var ce=function(me,Pe){var Ae,ge=[2,1,0].map(function(xe){return he.triangles[me+xe]}),Re=ge.map(function(xe){return s[xe]});if(ge.some(function(xe){return xe<t.length})){var Te=[0,1].map(function(xe){return(0,Ce.mean)(Re,function(Fe){return Fe[xe]})});if(!Ne(Te,h,c))return"continue"}(Ae=O).push.apply(Ae,Z(ge))},he=St.default.from(s),D=0,ue=he.triangles.length;D<ue;D+=3)ce(D,ue);else{var R=Ue.default.flatten(a),ne=R.vertices,oe=R.holes,de=oe===void 0?[]:oe;O=(0,Ue.default)(ne,de,2)}var Oe=(0,Ye.scaleLinear)((0,Ce.extent)(s,function(me){return me[0]}),[0,1]),ze=(0,Ye.scaleLinear)((0,Ce.extent)(s,function(me){return me[1]}),[0,1]),ke=s.map(function(me){var Pe=we(me,2),Ae=Pe[0],ge=Pe[1];return[Oe(Ae),ze(ge)]}),Ut={points:s,indices:O,uvs:ke};return{contour:a,triangles:Ut}}var Dt=zt,Je=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=we(t,2),s=o[0],h=o[1];return r?Mt(s,h,n):[s,h,n]})});return Ue.default.flatten(i)}function Qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,s=Ie(e,r,i),h=s.vertices,v=(0,Ce.merge)([h,t]),d=Math.round(h.length/3),g=new Set(o),_=0,y=[],m=0;m<d;m++){var w=m+1;if(w===d)w=_;else if(g.has(w)){var c=w;w=_,_=c}y.push(m,m+d,w+d),y.push(w+d,w,m)}for(var O=[],E=1;E>=0;E--)for(var q=0;q<d;q+=1)O.push(q/(d-1),E);return{indices:y,vertices:v,uvs:O,topVerts:h}}function qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Wt=function(e){"use strict";P(r,e);var n=B(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,s=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,g=o.includeSides,_=o.curvatureResolution,y=o.cartesian,m=o.userDataRsoOffset;(0,At.default)(i[0])||i[0].reverse();var w=Dt(i,{resolution:_}),c=w.contour,O=w.triangles,E=(0,Ce.merge)(O.uvs),q=[],R=[],ne=[],oe=0,de=function(he){var D=Math.round(q.length/3),ue=ne.length;q=q.concat(he.vertices),R=R.concat(he.uvs),ne=ne.concat(D?he.indices.map(function(Oe){return Oe+D}):he.indices),t.addGroup(ue,ne.length-ue,oe++)};if(g){var ce=Qe(c,s,h,y);de(ce),t.userData.rso=m?Qe(c,s,h+m,y):ce}return v&&de(qe(O,s,E,!1,y)),d&&de(qe(O,h,E,!0,y)),t.setIndex(ne),t[Je]("position",new u.Float32BufferAttribute(q,3)),t[Je]("uv",new u.Float32BufferAttribute(R,2)),t.computeVertexNormals(),t}return r}(u.BufferGeometry),Gt=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,s=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,g=t.userDataRsoOffset,_=t.cartesian,y=new Wt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:_,userDataRsoOffset:g});this.createMesh(y,this.options.material)},r}(p),et=U(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=new u[fe](new u.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n})});return(0,et.C)(),a}var Vt=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=C((0,x.Z)({},a),{split:.1}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m,w,c,O,E,q,R,ne,oe,de,ce;return I().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(s=t.options,h=s.points,v=s.pointsArr,d=s.coordinatesArr,g=s.useGroups,_=s.depth,y=s.material,m=s.workerController,w=s.projection,c=s.cache,O=s.sideMap,E=s.topColor,q=s.split,R=0,ne=y,!(O&&E)){D.next=22;break}if(R=q,oe=O+E,!(c&&!c.get(oe))){D.next=12;break}return c.init(oe),D.next=10,t.getMaterial();case 10:de=D.sent,c.set(oe,de);case 12:if(!c){D.next=18;break}return D.next=15,c.get(oe);case 15:D.t0=D.sent,D.next=21;break;case 18:return D.next=20,t.getMaterial();case 20:D.t0=D.sent;case 21:ne=D.t0;case 22:if(!h){D.next=26;break}t.createMesh(tt({points:h,depth:_,split:R}),y),D.next=32;break;case 26:if(!v){D.next=30;break}ce=Ke.mergeBufferGeometries(v.map(function(ue){return tt({points:ue,depth:_,split:R})}),g!=null?g:!1),t.createMesh(ce,y),D.next=32;break;case 30:if(!(d&&m)){D.next=32;break}return D.abrupt("return",new Promise(function(ue){m.postMessage({coordinatesArr:d,depth:_,split:R,useGroups:g,projection:w},function(Oe){var ze=new u.BufferGeometry;Object.keys(Oe).forEach(function(ke){ze.setAttribute(ke,new u.BufferAttribute(Oe[ke].array,Oe[ke].itemSize))}),t.createMesh(ze,ne),ue("")})}));case 32:case"end":return D.stop()}},o)}))()},i.getMaterial=function(){var t=this,o=this.options,s=o.topColor,h=o.sideMap,v=o.materialType,d=o.materialOptions,g=o.createCanvasObjectURL,_=o.split;return new Promise(function(y){var m=document.createElement("img");m.src=h,m.onload=function(){var w=_,c=document.createElement("canvas"),O=c.getContext("2d");c.height=m.height/(1-w),c.width=m.width,w&&(O.fillStyle=s,O.fillRect(0,0,m.width,c.height*w)),O.drawImage(m,0,c.height*w,m.width,m.height),g&&c.toBlob(function(ne){console.log(URL.createObjectURL(ne))});var E=new u.CanvasTexture(c),q=t.pencil.renderer.capabilities.getMaxAnisotropy();E.anisotropy=q;var R=new u[v||"MeshBasicMaterial"]((0,x.Z)({map:E},d||{}));y(R)}})},r}(p)})();var qt=_e.Ei,er=_e.Yo,tr=_e.Ee,rr=_e.x1,nr=_e.VJ,ir=_e.r7,ar=_e.XA,or=_e.NB,sr=_e.xv,ur=_e.nk;export{qt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
|