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