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